/* ========================================
   ZCMS 2.5 Admin - Template Responsive
   Optimisé pour performance et ergonomie
   Mobile-first, PC et smartphone
   
   Univers graphique inspiré de l'Agence Ouverture
   - Palette neutre : blanc, gris
   - Accents : bleu foncé professionnel (#1e3a5f)
   - Design épuré et moderne
   - Typographie sans empattement
   ======================================== */

/* === VARIABLES CSS - INSPIRÉ AGENCE OUVERTURE === */
:root {
    font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
    
    /* Thème sombre inspiré Agence Ouverture - Neutres + Bleu foncé */
    --bg: #0f1419;
    --bg-panel: rgba(20, 25, 32, 0.95);
    --bg-panel-strong: rgba(24, 30, 38, 1);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-active: rgba(30, 58, 85, 0.25);
    --fg: #e8ecf1;
    --fg-muted: #9ca3af;
    --fg-disabled: #6b7280;
    /* Bleu foncé professionnel (inspiré Agence Ouverture) */
    --accent: #1e3a5f;
    --accent-strong: #2d4a6b;
    --accent-hover: #254061;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #059669;
    --success-hover: #047857;
    --warning: #d97706;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.15s ease;
}

/* === THÈME CLAIR - INSPIRÉ AGENCE OUVERTURE === */
[data-theme="light"] {
    color-scheme: light;
    /* Thème clair inspiré Agence Ouverture - Blanc/Gris + Bleu foncé */
    --bg: #f8f9fa;
    --bg-panel: rgba(255, 255, 255, 0.98);
    --bg-panel-strong: #ffffff;
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-active: rgba(30, 58, 85, 0.1);
    --fg: #1a1f28;
    --fg-muted: #4b5563;
    --fg-disabled: #9ca3af;
    /* Bleu foncé professionnel (inspiré Agence Ouverture) */
    --accent: #1e3a5f;
    --accent-strong: #2d4a6b;
    --accent-hover: #254061;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #059669;
    --success-hover: #047857;
    --warning: #d97706;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* === RESET & BASE === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === MOBILE FIRST - TOUCH OPTIMIZATIONS === */
body {
    touch-action: pan-y pinch-zoom;
}

button,
.ghost-button,
a.button,
input[type="submit"],
input[type="button"],
input[type="file"]::-webkit-file-upload-button,
a.nav-link,
.keyword-tag,
.keyword-remove {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

input,
textarea,
select {
    font-size: 16px; /* Empêche le zoom iOS */
    min-height: 44px;
}

/* === ADMIN SHELL LAYOUT === */
.admin-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Overlay pour mobile quand sidebar ouverte */
.admin-shell.sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

@media screen and (max-width: 960px) {
    .admin-shell.sidebar-open::before {
        display: block;
    }
}

/* === SIDEBAR - MOBILE FIRST === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.sidebar-visible {
    transform: translateX(0);
}

.sidebar-hidden-mobile {
    transform: translateX(-100%);
}

@media (min-width: 961px) {
    .sidebar {
        position: fixed;
        transform: translateX(0);
    }
    
    .sidebar-hidden-mobile {
        transform: translateX(0);
    }
    
    .admin-shell.sidebar-open::before {
        display: none !important;
    }
}

/* === MENU BURGER === */
.mobile-burger {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    padding: 0;
}

.mobile-burger:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.mobile-burger:active {
    opacity: 0.8;
}

.mobile-burger span {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--fg);
    border-radius: 2px;
}

.mobile-burger span::before,
.mobile-burger span::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--fg);
    left: 0;
    border-radius: 2px;
    transition: transform 0.15s ease, top 0.15s ease, bottom 0.15s ease;
}

.mobile-burger span::before {
    top: -8px;
}

.mobile-burger span::after {
    bottom: -8px;
}

/* Burger → X (simplifié) */
.admin-shell.sidebar-open .mobile-burger span {
    background: transparent;
}

.admin-shell.sidebar-open .mobile-burger span::before {
    top: 0;
    transform: rotate(45deg);
}

.admin-shell.sidebar-open .mobile-burger span::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Afficher le burger sur mobile */
@media screen and (max-width: 960px) {
    .mobile-burger {
        display: flex !important;
    }
}

/* Cacher le burger sur desktop */
@media (min-width: 961px) {
    .mobile-burger {
        display: none !important;
    }
}

/* === SIDEBAR BRAND === */
.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel-strong);
}

.sidebar-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.02em;
}

.sidebar-brand .logo strong {
    color: var(--accent);
    font-weight: 700;
}

.sidebar-brand .subtitle {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--fg-muted);
    text-decoration: none;
}

.sidebar-brand .subtitle:hover {
    color: var(--accent);
}

/* === SIDEBAR NAVIGATION === */
.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    margin-bottom: 0.25rem;
    color: var(--fg-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--fg);
}

.nav-link.active {
    background: var(--bg-active);
    color: var(--accent);
    font-weight: 600;
}

.nav-link-primary {
    background: linear-gradient(135deg, rgba(30, 58, 85, 0.2), rgba(45, 74, 107, 0.15));
    color: var(--accent-strong);
    font-weight: 600;
    border: 1px solid rgba(30, 58, 85, 0.3);
}

.nav-link-primary:hover {
    background: linear-gradient(135deg, rgba(30, 58, 85, 0.25), rgba(45, 74, 107, 0.2));
    color: var(--accent-strong);
}

.nav-link.fast-backup {
    background: linear-gradient(135deg, rgba(129, 201, 149, 0.15), rgba(102, 187, 106, 0.1));
    color: var(--success);
    border: 1px solid rgba(129, 201, 149, 0.2);
}

.nav-link.fast-backup:hover {
    background: linear-gradient(135deg, rgba(129, 201, 149, 0.2), rgba(102, 187, 106, 0.15));
}

/* === SIDEBAR FOOTER === */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-panel-strong);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-footer .theme-toggle {
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--fg);
    min-height: 44px;
}

.sidebar-footer .theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--fg-muted);
}

.user-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.logout-link {
    display: block;
    margin-top: 0.75rem;
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

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

/* === TOGGLE THÈME === */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    width: 48px;
    height: 48px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    font-size: 1.25rem;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.theme-toggle:active {
    opacity: 0.8;
}

/* === WORKSPACE === */
.workspace {
    flex: 1;
    margin-left: 0;
    padding: 1rem;
}

@media (min-width: 961px) {
    .workspace {
        margin-left: 280px;
        padding: 2rem;
    }
}

/* === WORKSPACE HEADER === */
.workspace-header {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.workspace-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--fg);
    margin: 0 0 0.5rem 0;
}

.workspace-header .lead {
    font-size: 0.9375rem;
    color: var(--fg-muted);
    margin: 0;
    line-height: 1.6;
}

.workspace-header-content {
    flex: 1;
    min-width: 0;
}

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

@media (max-width: 960px) {
    .workspace-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .workspace-header-actions {
        margin-top: 1rem;
        width: 100%;
    }
    
    .workspace-header-actions > * {
        flex: 1;
        min-width: 0;
    }
}

/* Sur mobile, padding pour le burger */
@media screen and (max-width: 960px) {
    .workspace {
        padding-top: 4rem;
    }
    
    .workspace-header {
        position: relative;
    }
}

@media (min-width: 961px) {
    .workspace-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1.5rem;
    }
}

/* === STATUS CARD === */
.status-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

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

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

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

.status-card .value.warning {
    color: var(--warning);
}

.status-card .value.error {
    color: var(--danger);
}

/* === TILES === */
.tile {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.tile h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg);
    margin: 0 0 0.75rem 0;
}

.tile .lead {
    font-size: 0.9375rem;
    color: var(--fg-muted);
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

/* === FORMS === */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
    }
    
    .form-row > * {
        flex: 1;
    }
}

label {
    display: block;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 0.9375rem;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30, 58, 85, 0.15);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* === BUTTONS === */
button,
.ghost-button,
a.button,
input[type="submit"],
input[type="button"] {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

button:hover,
.ghost-button:hover,
a.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

button:active,
.ghost-button:active,
a.button:active,
input[type="submit"]:active,
input[type="button"]:active {
    opacity: 0.9;
}

button:disabled,
.ghost-button:disabled,
a.button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ghost-button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
}

.ghost-button:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.primary-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.primary-link:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

/* === ALERTS === */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-icon {
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.alert.success {
    background: rgba(129, 201, 149, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert.error {
    background: rgba(229, 115, 115, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert.warning {
    background: rgba(255, 183, 77, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--fg-muted);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* === RESPONSIVE UTILITIES === */
@media screen and (max-width: 960px) {
    .workspace-actions {
        flex-direction: column;
    }
    
    .workspace-actions .ghost-button {
        width: 100%;
    }
}

/* === ARTICLE CARDS === */
.article-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.article-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.article-card.unpublished {
    opacity: 0.6;
}

.article-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.article-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.article-header-content {
    flex: 1;
    min-width: 0;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--fg);
    text-decoration: none;
    display: inline-block;
}

.article-title:hover {
    color: var(--accent);
    text-decoration: underline;
}

.article-snippet {
    color: var(--fg-muted);
    margin: 0.5rem 0 1rem 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.article-slug-container {
    margin: 0.5rem 0 1rem 0;
    position: relative;
}

.article-slug {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--fg);
    word-break: break-all;
}

.article-slug:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30, 58, 85, 0.15);
}

.article-slug.state-saving {
    border-color: var(--warning);
    background: rgba(255, 183, 77, 0.1);
}

.article-slug.state-saved {
    border-color: var(--success);
    background: rgba(129, 201, 149, 0.1);
}

.article-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--fg-muted);
}

.article-type-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    background: var(--bg-panel-strong);
    color: var(--fg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 120px;
    box-shadow: var(--shadow-sm);
}

.article-type-select:hover {
    border-color: var(--accent-strong);
    box-shadow: var(--shadow-md);
}

.article-featured-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--warning);
    color: #000;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* === FEATURED ARTICLES === */
.featured-articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-article-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: move;
}

.featured-article-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.featured-article-item.dragging {
    opacity: 0.5;
}

.featured-article-grip {
    cursor: grab;
    padding: 0.5rem;
    color: var(--fg-muted);
    user-select: none;
}

.featured-article-grip:active {
    cursor: grabbing;
}

.featured-article-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.featured-article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-article-content {
    flex: 1;
    min-width: 0;
}

.featured-article-title {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.featured-article-title a {
    color: var(--fg);
    text-decoration: none;
}

.featured-article-title a:hover {
    color: var(--accent);
}

.featured-article-snippet {
    margin: 0;
    font-size: 0.875rem;
    color: var(--fg-muted);
}

.order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

/* === KEYWORDS / TAGS === */
.keyword-tag,
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--fg);
    margin: 0.25rem;
}

.keyword-remove,
.tag-remove {
    cursor: pointer;
    color: var(--fg-muted);
    padding: 0;
    min-width: 20px;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.keyword-remove:hover,
.tag-remove:hover {
    color: var(--danger);
}

.keyword-suggestions,
.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 0.25rem;
    box-shadow: var(--shadow-lg);
}

.keyword-suggestion-item,
.tag-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.keyword-suggestion-item:last-child,
.tag-suggestion-item:last-child {
    border-bottom: none;
}

.keyword-suggestion-item:hover,
.tag-suggestion-item:hover {
    background: var(--bg-hover);
}

/* === COVER IMAGE SELECTOR === */
.cover-image-selector {
    position: relative;
}

.cover-image-trigger {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cover-image-trigger:hover {
    border-color: var(--accent);
}

.cover-image-trigger-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.cover-image-thumbnail-small {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.cover-image-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 0.25rem;
    box-shadow: var(--shadow-lg);
}

.cover-image-option {
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.cover-image-option:last-child {
    border-bottom: none;
}

.cover-image-option:hover {
    background: var(--bg-hover);
}

.cover-image-option.selected {
    background: var(--bg-active);
}

.cover-image-option-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.cover-image-option-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === MEDIA ITEMS === */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

.media-item {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.media-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.media-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* === FORM ROWS === */
.form-row-theme-cover {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row-theme-cover {
        grid-template-columns: 1fr;
    }
}

/* === WORKSPACE ACTIONS === */
.workspace-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* === GENERATE HTML BUTTON === */
.btn-generate-html {
    position: relative;
}

.btn-generate-html.state-gray {
    background: var(--fg-muted);
}

.btn-generate-html.state-red {
    background: var(--danger);
}

.btn-generate-html.state-orange {
    background: var(--warning);
    color: #000;
}

/* === UTILITY CLASSES === */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* === FIX MOBILE SCROLL === */
@media screen and (max-width: 960px) {
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .admin-shell {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
}
