:root {
    font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
    --bg: #090c10;
    --bg-panel: rgba(20, 24, 29, 0.88);
    --bg-panel-strong: rgba(24, 28, 34, 0.95);
    --bg-gradient: linear-gradient(135deg, rgba(39, 47, 58, 0.65), rgba(20, 24, 29, 0.95));
    --fg: #f2f5f8;
    --muted: #a4aebb;
    --accent: #98b4c9;
    --accent-strong: #c2d7eb;
    --border: rgba(255, 255, 255, 0.06);
    --danger: #e57373;
    --success: #89d7a9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(56, 67, 78, 0.35), transparent 45%), var(--bg);
    color: var(--fg);
}

.auth-layout {
    display: grid;
    place-items: center;
    padding: 5vh clamp(1.5rem, 6vw, 3.5rem);
}

.auth-panel {
    width: min(480px, 100%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-card {
    background: var(--bg-panel);
    padding: clamp(1.75rem, 5vw, 2.5rem);
    border-radius: 26px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
}

.auth-header .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(152, 180, 201, 0.12);
    color: var(--accent);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.auth-header h1 {
    margin: 1.2rem 0 0.5rem;
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 600;
}

.auth-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    margin-top: 1.8rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.input-group label {
    font-size: 0.95rem;
    color: var(--accent-strong);
    letter-spacing: 0.03em;
}

.input-group input {
    border: none;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
    font-size: 1rem;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.35);
}

.input-group textarea {
    border: none;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.35);
}

.input-group select {
    border: none;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.input-group select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.35);
}

.input-group .input-hint {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: -0.25rem;
}

.input-group .input-hint a {
    color: var(--accent);
    text-decoration: none;
}

.input-group .input-hint a:hover {
    text-decoration: underline;
}

.input-group .input-error {
    font-size: 0.85rem;
    color: var(--danger);
    margin-top: -0.25rem;
}

.input-group label .required {
    color: var(--danger);
    margin-left: 0.25rem;
}

.primary-action {
    border: none;
    border-radius: 16px;
    padding: 0.95rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(152, 180, 201, 0.85), rgba(102, 124, 140, 0.85));
    color: #081018;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-action:hover,
.primary-action:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(152, 180, 201, 0.25);
}

.primary-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 14px;
    background: rgba(152, 180, 201, 0.18);
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.primary-link:hover,
.primary-link:focus-visible {
    background: rgba(152, 180, 201, 0.26);
    transform: translateY(-1px);
}

.mini-info {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

.mini-info code {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.alert.error {
    background: rgba(229, 115, 115, 0.12);
    border: 1px solid rgba(229, 115, 115, 0.35);
    color: var(--danger);
}

.alert.success {
    background: rgba(137, 215, 169, 0.12);
    border: 1px solid rgba(137, 215, 169, 0.35);
    color: var(--success);
}

.auth-footer {
    text-align: center;
    color: var(--muted);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ====== Layout Admin ====== */

.admin-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    overflow: hidden;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: clamp(220px, 280px, 280px);
    min-width: 220px;
    max-width: 280px;
    background: var(--bg-panel-strong);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: clamp(1.5rem, 4vw, 2.2rem) clamp(1.2rem, 4vw, 1.8rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-brand .logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sidebar-brand .subtitle {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    text-decoration: none;
    color: var(--fg);
    background: transparent;
    transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(152, 180, 201, 0.18);
}

.nav-link.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.nav-link[href*="index.php"] {
    color: rgba(152, 180, 201, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.nav-link[href*="index.php"]:hover {
    color: var(--accent-strong);
    background: rgba(152, 180, 201, 0.1);
}

.nav-link.fast-backup {
    background: rgba(137, 215, 169, 0.12);
    color: var(--success);
    font-weight: 600;
}

.nav-link.fast-backup:hover {
    background: rgba(137, 215, 169, 0.22);
}

.badge {
    border-radius: 999px;
    background: rgba(152, 180, 201, 0.14);
    color: var(--accent-strong);
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.user-pill .dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #68d391;
    box-shadow: 0 0 10px rgba(104, 211, 145, 0.6);
}

.logout-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.logout-link:hover {
    color: var(--accent);
}

.workspace {
    flex: 1;
    margin-left: 280px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(1.5rem, 4vw, 2.8rem);
    gap: 2rem;
    background: radial-gradient(circle at top left, rgba(69, 80, 93, 0.25), transparent 40%), var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
}

.workspace-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: var(--bg-panel);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: clamp(1.5rem, 4vw, 2.3rem);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.workspace-header > div:first-child {
    flex: 1;
    min-width: 0;
}

.workspace-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.workspace-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.lead {
    margin: 0;
    color: var(--muted);
    max-width: 620px;
    line-height: 1.6;
}

.status-card {
    align-self: flex-start;
    padding: 0.6rem 1.1rem;
    border-radius: 14px;
    background: rgba(152, 180, 201, 0.1);
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid rgba(152, 180, 201, 0.25);
}

.status-card .label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.status-card .value.ok {
    color: var(--success);
    font-weight: 600;
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.tile {
    background: var(--bg-panel);
    border-radius: 24px;
    padding: clamp(1.5rem, 3vw, 2.2rem);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tile h2 {
    margin: 0;
    font-size: 1.2rem;
}

.tile p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.tile code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.tile-link {
    margin-top: auto;
    align-self: flex-start;
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tile-link span {
    font-size: 0.8rem;
    color: var(--muted);
}

.tile-link.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.tile-subsection {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.tile-subsection:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.tile-subsection h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
}

.tile-subsection p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.9rem;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
}

.tile-clickable {
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: row;
}

.tile-draggable {
    cursor: grab;
}

.tile-draggable:active {
    cursor: grabbing;
}

.tile-draggable.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.tile-clickable::before {
    content: '→';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0;
    transition: all 0.25s ease;
    font-weight: 300;
}

.tile-clickable:hover:not(.disabled) {
    transform: translateX(6px);
    border-color: var(--accent);
    background: var(--bg-panel-strong);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tile-clickable:hover:not(.disabled)::before {
    opacity: 1;
    right: 1.2rem;
}

.tile-clickable.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tile-clickable.disabled::before {
    display: none;
}

.tile-clickable.disabled:hover {
    transform: none;
    border-color: var(--border);
    background: var(--bg-panel);
    box-shadow: none;
}

.tile-link-wrapper {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
    padding-right: 2.5rem;
}

.tile-draggable .drag-handle {
    font-size: 1.2rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    min-width: 1.8rem;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    transition: color 0.2s ease;
    padding: 0.25rem;
    border-radius: 4px;
    order: -1;
}

.tile-draggable:hover .drag-handle {
    color: var(--accent);
    background: rgba(152, 180, 201, 0.1);
}

.tile-draggable .drag-handle:active {
    cursor: grabbing;
}

.tile-draggable.dragging .drag-handle {
    cursor: grabbing;
}

.tile-link-wrapper h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--accent-strong);
    transition: color 0.25s ease;
    font-weight: 600;
}

.tile-clickable:hover:not(.disabled) .tile-link-wrapper h2 {
    color: var(--accent);
}

.tile-link-wrapper p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.coming-soon {
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
    opacity: 0.8;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form-row label {
    font-size: 0.95rem;
    color: var(--accent-strong);
    letter-spacing: 0.05em;
}

.form-row input,
.form-row textarea {
    border: none;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.07);
    color: var(--fg);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.form-row textarea {
    resize: vertical;
    min-height: 240px;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.25);
}

.form-error {
    font-size: 0.85rem;
    color: var(--danger);
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    padding: 0.7rem 1.2rem;
    background: transparent;
    color: var(--fg);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.settings-tile {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section {
    background: var(--bg-panel);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: clamp(1.5rem, 4vw, 2.3rem);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section h2 {
    margin: 0 0 0.5rem 0;
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    font-weight: 600;
    color: var(--accent-strong);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.media-selector {
    width: 100%;
}

.media-preview {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.media-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Sélecteur de média visuel */
.media-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.media-selector-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    overflow: hidden;
}

.media-selector-item:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.media-selector-item.selected {
    border-color: var(--accent);
    background: rgba(152, 180, 201, 0.15);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.3);
}

.media-selector-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-selector-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-selector-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.media-selector-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #081018;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.media-selector-check svg {
    width: 16px;
    height: 16px;
}

.media-selector-label {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    color: var(--fg);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
}

.media-selector-empty {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px dashed var(--border);
    margin-top: 0.75rem;
}

.media-selector-empty a {
    color: var(--accent);
    text-decoration: none;
}

.media-selector-empty a:hover {
    text-decoration: underline;
}

/* Sélecteur de fichier */
.file-upload-section {
    margin-bottom: 1rem;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.file-upload-label:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.file-upload-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(152, 180, 201, 0.2);
    color: var(--accent-strong);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.file-upload-label:hover .file-upload-button {
    background: rgba(152, 180, 201, 0.3);
    transform: translateY(-1px);
}

.file-upload-name {
    color: var(--muted);
    font-size: 0.9rem;
    display: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-file-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.current-file-label {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

.current-file-image {
    display: block;
    max-width: 200px;
    max-height: 100px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.current-file-image.favicon-preview {
    max-width: 64px;
    max-height: 64px;
}

.current-file-path {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
    font-family: monospace;
    word-break: break-all;
}

.backup-list {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.backup-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 1.5rem clamp(1.3rem, 3vw, 1.8rem);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.backup-item h3 {
    margin: 0;
    font-size: 1.15rem;
}

.backup-item .meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.description-block,
.category-block {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.description-block label,
.category-block label {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.description-fieldset,
.category-fieldset {
    display: flex;
    align-items: stretch;
    gap: 0.6rem;
}

.description-field {
    flex: 1;
    border: none;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.07);
    color: var(--fg);
    resize: vertical;
    min-height: 70px;
}

.description-field:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.3);
}

.save-button {
    border: none;
    border-radius: 16px;
    padding: 0.65rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    color: var(--fg);
}

.save-button .label {
    pointer-events: none;
}

.save-button:disabled {
    cursor: default;
}

.save-button.state-idle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.save-button.state-idle:hover,
.save-button.state-idle:focus-visible {
    transform: none;
}

.save-button.state-dirty {
    background: rgba(249, 179, 96, 0.85);
    color: #201107;
    box-shadow: 0 12px 24px rgba(249, 179, 96, 0.3);
}

.save-button.state-dirty:hover,
.save-button.state-dirty:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(249, 179, 96, 0.35);
}

.save-button.state-saving {
    background: rgba(152, 180, 201, 0.65);
    color: #10161d;
    box-shadow: 0 12px 24px rgba(152, 180, 201, 0.25);
    cursor: progress;
}

.save-button.state-success {
    background: rgba(137, 215, 169, 0.9);
    color: #0d1c13;
    box-shadow: 0 12px 24px rgba(137, 215, 169, 0.35);
}

.save-button.state-error {
    background: rgba(229, 115, 115, 0.88);
    color: #270d0d;
    box-shadow: 0 12px 24px rgba(229, 115, 115, 0.35);
}

.save-feedback {
    font-size: 0.85rem;
    color: var(--muted);
    min-height: 1.2em;
    transition: color 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    opacity: 0;
}

.save-feedback.active {
    opacity: 1;
}

.save-feedback.error {
    color: var(--danger);
}

.save-feedback.success {
    color: var(--success);
}

.save-feedback.pending {
    color: var(--accent-strong);
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    font-weight: 600;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.admin-table .meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.article-table-tile {
    gap: 1.5rem;
}

.article-table-tile h2 {
    margin: 0;
}

.table-actions {
    white-space: nowrap;
}

.table-action {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 12px;
    background: rgba(152, 180, 201, 0.18);
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.table-action:hover,
.table-action:focus-visible {
    background: rgba(152, 180, 201, 0.28);
    transform: translateY(-1px);
}

.reorder-tile {
    gap: 1.4rem;
}

.drag-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.drag-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    cursor: grab;
}

.drag-item.dragging {
    opacity: 0.6;
}

.drag-handle {
    font-size: 1.3rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    cursor: grab;
}

.drag-label {
    flex: 1;
    font-weight: 600;
}

.drag-slug {
    color: var(--muted);
    font-size: 0.9rem;
}

.summary-row {
    gap: 0.8rem;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.prompt-json {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.prompt-json summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-strong);
}

.form-tile {
    gap: 1.6rem;
}

.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-pill {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(152, 180, 201, 0.18);
    color: var(--accent-strong);
    font-size: 0.85rem;
}

.tag-editor {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tag-editor-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.tag-editor-row input {
    flex: 1;
}

.tag-remove {
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    background: rgba(229, 115, 115, 0.25);
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tag-remove:hover,
.tag-remove:focus-visible {
    background: rgba(229, 115, 115, 0.4);
    transform: translateY(-1px);
}

.tag-editor-actions {
    margin-top: 0.4rem;
}

.inline-form {
    display: inline;
}

/* Media library styles */
.media-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.media-upload-tile.full-width,
.media-list-tile.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.media-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    align-items: flex-start;
}

.media-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
}

.media-preview {
    position: relative;
    width: 220px;
    min-width: 220px;
    height: 165px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 10px;
}

.media-preview-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-item:hover .media-preview img,
.media-preview-link:hover img {
    transform: scale(1.05);
}

.media-info {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.media-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.media-id {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    background: rgba(152, 180, 201, 0.15);
    border-radius: 6px;
}

.media-id-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.media-id-link:hover,
.media-id-link:focus-visible {
    color: var(--accent-strong);
    text-decoration: underline;
}

.media-info .description-block,
.media-info .category-block {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.media-info .description-block label,
.media-info .category-block label {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.media-info .description-fieldset,
.media-info .category-fieldset {
    display: flex;
    align-items: stretch;
    gap: 0.6rem;
}

.media-description {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
    min-height: 70px;
    max-height: 150px;
    width: 100%;
}

.media-description:focus {
    outline: none;
    border-color: rgba(152, 180, 201, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.15);
}

.media-category {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
    width: 100%;
}

.media-category:focus {
    outline: none;
    border-color: rgba(152, 180, 201, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.15);
}

.media-info .save-button {
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    white-space: nowrap;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.media-info .save-button .label {
    pointer-events: none;
}

.media-info .save-button:disabled {
    cursor: default;
}

.media-info .save-button.state-idle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.media-info .save-button.state-idle:hover,
.media-info .save-button.state-idle:focus-visible {
    transform: none;
}

.media-info .save-button.state-dirty {
    background: rgba(249, 179, 96, 0.85);
    color: #201107;
    box-shadow: 0 8px 16px rgba(249, 179, 96, 0.3);
}

.media-info .save-button.state-dirty:hover,
.media-info .save-button.state-dirty:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(249, 179, 96, 0.35);
}

.media-info .save-button.state-saving {
    background: rgba(152, 180, 201, 0.65);
    color: #10161d;
    box-shadow: 0 8px 16px rgba(152, 180, 201, 0.25);
    cursor: progress;
}

.media-info .save-button.state-success {
    background: rgba(137, 215, 169, 0.9);
    color: #0d1c13;
    box-shadow: 0 8px 16px rgba(137, 215, 169, 0.35);
}

.media-info .save-button.state-error {
    background: rgba(229, 115, 115, 0.88);
    color: #270d0d;
    box-shadow: 0 8px 16px rgba(229, 115, 115, 0.35);
}

.media-info .save-feedback {
    font-size: 0.85rem;
    color: var(--muted);
    min-height: 1.2em;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.media-info .save-feedback.pending {
    color: var(--accent);
}

.media-info .save-feedback.success {
    color: var(--success);
}

.media-info .save-feedback.error {
    color: var(--danger);
}

.media-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

.media-meta span {
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-weight: 500;
}

.media-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    align-items: center;
    flex-wrap: wrap;
}

.media-detail-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    background: rgba(152, 180, 201, 0.25);
    color: var(--accent-strong);
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.media-detail-btn:hover,
.media-detail-btn:focus-visible {
    background: rgba(152, 180, 201, 0.35);
    transform: translateY(-1px);
    color: var(--accent-strong);
}

.media-delete-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    background: rgba(229, 115, 115, 0.25);
    color: var(--danger);
    white-space: nowrap;
}

.media-delete-btn:hover,
.media-delete-btn:focus-visible {
    background: rgba(229, 115, 115, 0.35);
    transform: translateY(-1px);
}

.media-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.media-generate-seo-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(152, 180, 201, 0.2);
    color: var(--accent);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.media-generate-seo-btn:hover:not(:disabled):not(.disabled),
.media-generate-seo-btn:focus-visible:not(:disabled):not(.disabled) {
    background: rgba(152, 180, 201, 0.35);
    transform: translateY(-1px);
    color: var(--accent-strong);
}

.media-generate-seo-btn:disabled,
.media-generate-seo-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
}

.media-generate-seo-btn.state-saving {
    background: rgba(152, 180, 201, 0.15);
    color: var(--accent);
    cursor: wait;
    opacity: 0.7;
}

.media-generate-seo-btn.state-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.media-generate-seo-btn.state-error {
    background: rgba(229, 115, 115, 0.2);
    color: var(--danger);
}

.media-render-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.media-render-btn:hover:not(:disabled):not(.disabled),
.media-render-btn:focus-visible:not(:disabled):not(.disabled) {
    background: rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
    color: #a78bfa;
}

.media-render-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
}

.media-render-btn.state-saving {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    cursor: wait;
    opacity: 0.7;
}

.media-render-btn.state-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.media-render-btn.state-error {
    background: rgba(229, 115, 115, 0.2);
    color: var(--danger);
}

.media-favorite-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.media-favorite-btn:hover:not(:disabled):not(.disabled),
.media-favorite-btn:focus-visible:not(:disabled):not(.disabled) {
    background: rgba(255, 193, 7, 0.25);
    transform: translateY(-1px);
    color: #ffca28;
}

.media-favorite-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
}

.media-favorite-btn.active {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
    font-weight: 700;
}

.media-favorite-btn.state-saving {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    cursor: wait;
    opacity: 0.7;
}

.media-favorite-btn.state-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.media-favorite-btn.state-error {
    background: rgba(229, 115, 115, 0.2);
    color: var(--danger);
}

.favorite-star {
    margin-right: 0.4rem;
    font-size: 1.1rem;
    vertical-align: middle;
}

.upload-feedback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-feedback.pending {
    background: rgba(152, 180, 201, 0.15);
    color: var(--accent);
}

.upload-feedback.success {
    background: rgba(137, 215, 169, 0.15);
    color: var(--success);
}

.upload-feedback.error {
    background: rgba(229, 115, 115, 0.15);
    color: var(--danger);
}

/* Media detail page styles */
.media-detail-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.media-detail-preview {
    max-width: 400px;
}

.media-large-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-large-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.02);
}

.media-technical-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.info-value {
    font-size: 0.9rem;
    color: var(--fg);
    font-weight: 600;
    text-align: right;
}

.media-detail-form {
    flex: 1;
}

.media-detail-form .admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.keywords-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2.5rem;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(152, 180, 201, 0.2);
    color: var(--accent-strong);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.keyword-remove {
    border: none;
    background: transparent;
    color: var(--accent-strong);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.keyword-remove:hover,
.keyword-remove:focus-visible {
    background: rgba(229, 115, 115, 0.3);
    color: var(--danger);
}

.keywords-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.keyword-input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
    font-size: 0.9rem;
    font-family: inherit;
}

.keyword-input:focus {
    outline: none;
    border-color: rgba(152, 180, 201, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(152, 180, 201, 0.15);
}

.add-keyword-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(152, 180, 201, 0.25);
    color: var(--accent-strong);
    transition: background 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.add-keyword-btn:hover,
.add-keyword-btn:focus-visible {
    background: rgba(152, 180, 201, 0.35);
    transform: translateY(-1px);
}

.save-feedback-global {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 1.2em;
}

.save-feedback-global.pending {
    background: rgba(152, 180, 201, 0.15);
    color: var(--accent);
}

.save-feedback-global.success {
    background: rgba(137, 215, 169, 0.15);
    color: var(--success);
}

.save-feedback-global.error {
    background: rgba(229, 115, 115, 0.15);
    color: var(--danger);
}

#save-all-btn.state-idle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    cursor: default;
}

#save-all-btn.state-idle:hover,
#save-all-btn.state-idle:focus-visible {
    transform: none;
}

#save-all-btn.state-dirty {
    background: rgba(249, 179, 96, 0.85);
    color: #201107;
    box-shadow: 0 8px 16px rgba(249, 179, 96, 0.3);
}

#save-all-btn.state-dirty:hover,
#save-all-btn.state-dirty:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(249, 179, 96, 0.35);
}

#save-all-btn.state-success {
    background: rgba(137, 215, 169, 0.9);
    color: #0d1c13;
    box-shadow: 0 8px 16px rgba(137, 215, 169, 0.35);
}

#save-all-btn.state-error {
    background: rgba(229, 115, 115, 0.88);
    color: #270d0d;
    box-shadow: 0 8px 16px rgba(229, 115, 115, 0.35);
}

@media (min-width: 1200px) {
    .media-detail-section {
        flex-direction: row;
        align-items: flex-start;
    }

    .media-detail-preview {
        position: sticky;
        top: 2rem;
    }
}

@media (max-width: 960px) {
    .admin-shell {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: center;
    }

    .workspace {
        margin-left: 0;
        height: auto;
        min-height: 100vh;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-footer {
        flex-direction: row;
        align-items: center;
    }

    .media-item {
        padding: 0.85rem;
        gap: 1rem;
    }

    .media-preview {
        width: 180px;
        min-width: 180px;
        height: 135px;
    }

    .media-info {
        gap: 0.85rem;
    }

    .media-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 640px) {
    .auth-card {
        border-radius: 22px;
    }

    .admin-shell {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 1.2rem;
    }

    .workspace {
        margin-left: 0;
        height: auto;
        min-height: 100vh;
        padding: 1.2rem;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .media-item {
        flex-direction: column;
        border-radius: 10px;
        padding: 0.85rem;
        gap: 1rem;
    }

    .media-preview {
        width: 100%;
        min-width: 100%;
        height: 200px;
        border-radius: 8px;
    }

    .media-info {
        gap: 0.85rem;
        padding: 0;
    }

    .media-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .description-fieldset,
    .category-fieldset {
        flex-direction: column;
        gap: 0.5rem;
    }

    .media-info .save-button {
        width: 100%;
    }

    .media-actions {
        margin-top: 0.5rem;
        flex-direction: column;
    }

    .media-detail-btn,
    .media-generate-seo-btn,
    .media-render-btn,
    .media-favorite-btn,
    .media-delete-btn {
        width: 100%;
    }

    .media-detail-section {
        flex-direction: column;
    }

    .media-detail-preview {
        max-width: 100%;
    }

    .media-large-preview {
        aspect-ratio: 4 / 3;
    }
}

