/* ==========================================================================
   LBM3 — Le Bulletin Municipal
   Direction : Civic Modern — Swiss precision meets French editorial elegance
   Palette : Teal #38A3A5 / Navy #002A43
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
    /* Color — Navy scale */
    --navy-900: #001A2C;
    --navy-800: #002A43;
    --navy-700: #003459;
    --navy-600: #004270;
    --navy-500: #0C5276;
    --navy-100: #D0E8F2;
    --navy-50: #E8F4FA;

    /* Color — Teal scale */
    --teal-600: #2B8E90;
    --teal-500: #38A3A5;
    --teal-400: #57C4C6;
    --teal-300: #7DD8DA;
    --teal-200: #A8E6E8;
    --teal-100: #D4F3F4;
    --teal-50: #EEFBFB;

    /* Color — Semantic */
    --success-600: #15803D;
    --success-500: #22C55E;
    --success-100: #DCFCE7;
    --success-50: #F0FDF4;
    --warning-600: #D97706;
    --warning-500: #F59E0B;
    --warning-100: #FEF3C7;
    --warning-50: #FFFBEB;
    --danger-600: #DC2626;
    --danger-500: #EF4444;
    --danger-100: #FEE2E2;
    --danger-50: #FEF2F2;
    --info-600: #2563EB;
    --info-100: #DBEAFE;
    --info-50: #EFF6FF;

    /* Neutrals */
    --neutral-900: #0F172A;
    --neutral-700: #334155;
    --neutral-500: #64748B;
    --neutral-400: #94A3B8;
    --neutral-300: #CBD5E1;
    --neutral-200: #E2E8F0;
    --neutral-100: #F1F5F9;
    --neutral-50: #F8FAFC;
    --white: #FFFFFF;

    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 42, 67, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 42, 67, 0.06), 0 1px 2px rgba(0, 42, 67, 0.04);
    --shadow-soft: 0 4px 20px -2px rgba(0, 42, 67, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 42, 67, 0.07), 0 2px 4px -1px rgba(0, 42, 67, 0.04);
    --shadow-float: 0 10px 30px -5px rgba(0, 42, 67, 0.08);
    --shadow-lg: 0 10px 25px -3px rgba(0, 42, 67, 0.08), 0 4px 6px -2px rgba(0, 42, 67, 0.03);
    --shadow-xl: 0 20px 50px -5px rgba(0, 42, 67, 0.12), 0 8px 16px rgba(0, 42, 67, 0.04);
    --shadow-glow: 0 0 0 3px rgba(56, 163, 165, 0.18);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 150ms;
    --dur-normal: 250ms;
    --dur-slow: 400ms;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--neutral-700);
    background-color: var(--neutral-50);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--teal-600); text-decoration: none; transition: color var(--dur-fast) ease; }
a:hover { color: var(--teal-500); }

h1, h2, h3, h4, h5, h6 { color: var(--navy-800); line-height: 1.2; }
h1, h2 { font-family: var(--font-display); font-weight: 400; }
h3, h4, h5, h6 { font-family: var(--font-body); font-weight: 600; }
h1 { font-size: 2rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.125rem; }

::selection { background: var(--teal-200); color: var(--navy-800); }

/* Turbo transitions */
.turbo-progress-bar { background: linear-gradient(90deg, var(--teal-500), var(--teal-300)); height: 3px; }

/* ========================================================================
   LAYOUT — Admin (AIDesigner style)
   ======================================================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar — Dark navy, Phosphor Icons --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--navy-900);
    color: var(--white);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--white);
}

.sidebar-logo-mark {
    width: 32px;
    height: 32px;
    background: var(--teal-500);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--white);
    box-shadow: 0 0 15px rgba(56, 163, 165, 0.4);
}

.sidebar-logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    color: var(--white);
}

.sidebar-nav-section {
    padding: var(--space-6) var(--space-4) 0;
}

.sidebar-section-title {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.3);
    padding: 0 var(--space-3);
    margin-bottom: var(--space-3);
}

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--dur-fast) ease;
    position: relative;
    margin-bottom: 2px;
    text-decoration: none;
}

.sidebar-nav li a i {
    font-size: 1.125rem;
    transition: color var(--dur-fast) ease;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.sidebar-nav li a:hover i {
    color: var(--white);
}

.sidebar-nav li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-weight: 600;
}

.sidebar-nav li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--teal-500);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.sidebar-nav li a.active i {
    color: var(--teal-500);
}

/* Favorite star toggle */
.fav-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: var(--neutral-400);
    font-size: 1rem;
    line-height: 1;
    transition: color var(--dur-fast) ease;
    flex-shrink: 0;
}
.fav-star:hover { color: var(--amber-400, #fbbf24); }
.fav-star--active { color: var(--amber-400, #fbbf24); }

/* Sidebar favorites empty state */
.sidebar-fav-empty-text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.25);
    font-style: italic;
}

/* Sidebar bottom */
.sidebar-bottom {
    margin-top: auto;
    padding: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Credits IA gauge */

a.sidebar-credits,
.sidebar-credits {
    display: block;
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, rgba(56, 163, 165, 0.08), rgba(56, 163, 165, 0.03));
    border: 1px solid rgba(56, 163, 165, 0.15);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

a.sidebar-credits:hover {
    background: linear-gradient(135deg, rgba(56, 163, 165, 0.14), rgba(56, 163, 165, 0.07));
    border-color: rgba(56, 163, 165, 0.3);
}

.sidebar-credits-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 6px;
}

.sidebar-credits-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-credits-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teal-400);
    font-variant-numeric: tabular-nums;
}

.sidebar-credits-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.sidebar-credits-fill {
    height: 100%;
    background: var(--teal-400);
    border-radius: 2px;
    transition: width 0.4s ease-out;
}

.sidebar-credits-fill--low {
    background: var(--warning-400);
}

.sidebar-credits-fill--empty {
    background: var(--danger-400);
}

.sidebar-bottom-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-bottom-text {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.sidebar-gear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.sidebar-gear:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-gear i {
    font-size: 16px;
}

.sidebar-plan-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-2);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--teal-500), #60a5fa);
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--white);
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white);
}

.sidebar-user-email {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.4);
}

/* --- Main Workspace --- */
.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    background: var(--neutral-50);
}

/* --- Workspace Header — Glass panel --- */
.workspace-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--neutral-200);
    box-shadow: 0 1px 3px rgba(0, 42, 67, 0.04);
    padding: 0 var(--space-8);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.workspace-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.workspace-header-title {
    font-weight: 600;
    color: var(--navy-800);
}

.workspace-header-badge {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--neutral-500);
    margin-left: var(--space-2);
}

.workspace-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.workspace-header-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--neutral-700);
    background: var(--white);
    text-decoration: none;
    transition: all var(--dur-fast) ease;
}

.workspace-header-btn:hover {
    border-color: var(--teal-500);
    color: var(--teal-600);
}

.workspace-header-btn i {
    font-size: 1rem;
}

/* --- Workspace Content --- */
.workspace-content {
    flex: 1;
    padding: var(--space-8);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* --- Workspace Footer --- */
.workspace-footer {
    border-top: 1px solid var(--neutral-200);
    padding: var(--space-4) var(--space-8);
    text-align: center;
    font-size: 0.75rem;
    color: var(--neutral-400);
    letter-spacing: 0.02em;
    background: var(--white);
}

/* Legacy aliases for pages still using old class names */
.main-content {
    padding: var(--space-8) var(--space-10);
    overflow-y: auto;
    position: relative;
}

.main-content > * { position: relative; z-index: 1; }

/* ========================================================================
   LAYOUT — Redaction (public, sans sidebar)
   ======================================================================== */

.redaction-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--neutral-50) 0%, var(--white) 100%);
}

.redaction-header {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
    color: var(--white);
    padding: 0 var(--space-8);
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--teal-500);
}

.redaction-main {
    flex: 1;
    max-width: 780px;
    margin: var(--space-10) auto;
    padding: 0 var(--space-6);
    width: 100%;
}

.redaction-footer {
    background: var(--white);
    border-top: 1px solid var(--neutral-200);
    padding: var(--space-4) var(--space-6);
    text-align: center;
    font-size: 0.75rem;
    color: var(--neutral-400);
}

/* ========================================================================
   PAGE HEADER
   ======================================================================== */

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header h1 { margin: 0; font-size: 2rem; }

.page-subtitle {
    font-family: var(--font-body);
    color: var(--neutral-500);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-header-actions { display: flex; gap: var(--space-3); }

/* ========================================================================
   CARDS
   ======================================================================== */

.card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-200);
    padding: var(--space-6);
    transition: box-shadow var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-out);
}

.card--hoverable:hover {
    box-shadow: var(--shadow-float);
    transform: translateY(-2px);
}

/* --- Widget (bento-style card) --- */
.ds-widget {
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    padding: var(--space-6);
    transition: all 0.3s var(--ease-out);
}

.ds-widget:hover {
    box-shadow: var(--shadow-float);
    transform: translateY(-2px);
}

.ds-widget--dark {
    background: var(--navy-900);
    color: var(--white);
    border-color: var(--navy-900);
}

.ds-widget--dark:hover {
    transform: none;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--neutral-100);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--navy-800);
}

/* ========================================================================
   STAT CARDS
   ======================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--neutral-200);
    padding: var(--space-5) var(--space-6);
    position: relative;
    overflow: hidden;
    transition: all var(--dur-normal) var(--ease-out);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--neutral-300);
    transition: background var(--dur-fast) ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
    background: var(--neutral-100);
}

.stat-card-icon svg { width: 20px; height: 20px; }

.stat-card-value {
    font-family: var(--font-body);
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy-800);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    margin-top: var(--space-1);
    font-weight: 500;
}

.stat-card--teal::before { background: linear-gradient(90deg, var(--teal-500), var(--teal-300)); }
.stat-card--teal .stat-card-icon { background: var(--teal-50); color: var(--teal-600); }
.stat-card--teal .stat-card-value { color: var(--teal-600); }

.stat-card--success::before { background: linear-gradient(90deg, var(--success-600), var(--success-500)); }
.stat-card--success .stat-card-icon { background: var(--success-50); color: var(--success-600); }
.stat-card--success .stat-card-value { color: var(--success-600); }

.stat-card--warning::before { background: linear-gradient(90deg, var(--warning-600), var(--warning-500)); }
.stat-card--warning .stat-card-icon { background: var(--warning-50); color: var(--warning-600); }
.stat-card--warning .stat-card-value { color: var(--warning-600); }

.stat-card--danger::before { background: linear-gradient(90deg, var(--danger-600), var(--danger-500)); }
.stat-card--danger .stat-card-icon { background: var(--danger-50); color: var(--danger-600); }
.stat-card--danger .stat-card-value { color: var(--danger-600); }

/* ========================================================================
   TABLE
   ======================================================================== */

.table-wrapper { overflow-x: auto; margin: 0 calc(-1 * var(--space-6)); padding: 0 var(--space-6); }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

thead th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    color: var(--neutral-500);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid var(--neutral-200);
    white-space: nowrap;
    font-family: var(--font-body);
}

tbody td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--neutral-100);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--dur-fast) ease;
}

tbody tr:hover { background: var(--teal-50); }
tbody tr:last-child td { border-bottom: none; }

.td-title {
    font-weight: 600;
    color: var(--navy-800);
}

.td-email {
    color: var(--neutral-500);
    font-size: 0.8125rem;
}

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

/* ========================================================================
   BADGES
   ======================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge svg { width: 12px; height: 12px; }

.badge--brouillon {
    background: var(--warning-100);
    color: #92400E;
}

.badge--soumis {
    background: var(--info-100);
    color: #1E40AF;
}

.badge--valide {
    background: var(--success-100);
    color: #166534;
}

.badge--retard {
    background: var(--danger-100);
    color: #991B1B;
    animation: pulse-badge 2s ease infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--dur-fast) ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    letter-spacing: 0.01em;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}

.btn:active { transform: scale(0.97); }

/* Primary — teal gradient */
.btn--primary {
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: var(--white);
    box-shadow: 0 1px 3px rgba(56, 163, 165, 0.3);
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--teal-400), var(--teal-500));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(56, 163, 165, 0.35);
    transform: translateY(-1px);
}

/* Secondary — navy */
.btn--secondary {
    background: var(--navy-800);
    color: var(--white);
}

.btn--secondary:hover {
    background: var(--navy-700);
    color: var(--white);
    transform: translateY(-1px);
}

/* Outline */
.btn--outline {
    background: var(--white);
    color: var(--neutral-700);
    border-color: var(--neutral-300);
}

.btn--outline:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-400);
    color: var(--neutral-900);
}

/* Success */
.btn--success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: var(--white);
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.3);
}

.btn--success:hover {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    color: var(--white);
    transform: translateY(-1px);
}

/* Danger */
.btn--danger {
    background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
    color: var(--white);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.btn--danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    color: var(--white);
    transform: translateY(-1px);
}

/* Warning */
.btn--warning {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
    color: var(--white);
}

.btn--warning:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    color: var(--white);
    transform: translateY(-1px);
}

/* Ghost — minimal */
.btn--ghost {
    background: transparent;
    color: var(--neutral-500);
    padding: var(--space-2);
}

.btn--ghost:hover {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

/* Sizes */
.btn--sm { padding: 6px 12px; font-size: 0.75rem; }
.btn--lg { padding: 14px 28px; font-size: 0.9375rem; }

.btn-group { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ========================================================================
   FORMS
   ======================================================================== */

.form-group { margin-bottom: var(--space-5); }

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--navy-800);
    margin-bottom: var(--space-2);
    letter-spacing: 0.01em;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--neutral-900);
    background: var(--white);
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: var(--shadow-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--neutral-400);
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.7;
}

/* Champ mot de passe avec bouton afficher/masquer (controleur Stimulus password-toggle) */
.password-field {
    position: relative;
    display: block;
}

.password-field .form-input {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--neutral-400);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color var(--dur-fast) ease;
}

.password-toggle:hover {
    color: var(--teal-600);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--teal-500);
    outline-offset: -2px;
    border-radius: var(--radius-md);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--neutral-400);
    margin-top: var(--space-1);
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger-600);
    margin-top: var(--space-1);
}

/* Editor-style textarea for redaction */
.form-textarea--editor {
    font-family: 'Georgia', serif;
    font-size: 1.0625rem;
    line-height: 1.8;
    padding: var(--space-6);
    min-height: 400px;
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    background: var(--white);
}

.form-textarea--editor:focus {
    border-color: var(--teal-400);
    box-shadow: 0 0 0 4px rgba(56, 163, 165, 0.1);
}

/* Word counter */
.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3);
    padding: 0 var(--space-1);
}

.word-count {
    font-size: 0.75rem;
    color: var(--neutral-400);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ========================================================================
   PROGRESS BAR
   ======================================================================== */

.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--neutral-500);
    font-weight: 500;
}

.progress-label-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--navy-800);
}

.progress {
    width: 100%;
    height: 8px;
    background: var(--neutral-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--teal-500), var(--teal-300));
    transition: width 600ms var(--ease-out);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25));
    border-radius: inherit;
}

.progress-bar--success {
    background: linear-gradient(90deg, var(--success-600), var(--success-500));
}

.progress-bar--warning {
    background: linear-gradient(90deg, var(--warning-600), var(--warning-500));
}

.progress-bar--danger {
    background: linear-gradient(90deg, var(--danger-600), var(--danger-500));
}

/* ========================================================================
   FLASH MESSAGES
   ======================================================================== */

.flash-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-4));
    right: var(--space-6);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 420px;
    width: 100%;
}

.flash {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    box-shadow: var(--shadow-lg);
    animation: flash-in 400ms var(--ease-out);
    position: relative;
    overflow: hidden;
}

.flash::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.flash-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.flash-content { flex: 1; }

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--dur-fast) ease;
}

.flash-close:hover { opacity: 1; }
.flash-close svg { width: 16px; height: 16px; }

/* Auto-close progress */
.flash-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.25;
    animation: flash-timer 5s linear forwards;
}

@keyframes flash-timer { from { width: 100%; } to { width: 0; } }

.flash--success {
    background: var(--success-50);
    color: #166534;
    border: 1px solid rgba(22, 101, 52, 0.12);
}
.flash--success::before { background: var(--success-600); }

.flash--error {
    background: var(--danger-50);
    color: #991B1B;
    border: 1px solid rgba(153, 27, 27, 0.12);
}
.flash--error::before { background: var(--danger-600); }

.flash--warning {
    background: var(--warning-50);
    color: #92400E;
    border: 1px solid rgba(146, 64, 14, 0.12);
}
.flash--warning::before { background: var(--warning-600); }

.flash--info {
    background: var(--info-50);
    color: #1E40AF;
    border: 1px solid rgba(30, 64, 175, 0.12);
}
.flash--info::before { background: var(--info-600); }

@keyframes flash-in {
    from { opacity: 0; transform: translateX(30px) scale(0.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.flash--hiding {
    animation: flash-out 250ms var(--ease-out) forwards;
}

@keyframes flash-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(30px) scale(0.96); }
}

/* ========================================================================
   MODAL
   ======================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 26, 44, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    animation: modal-bg-in 250ms var(--ease-out);
}

.modal {
    background: var(--white);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 26, 44, 0.15);
    width: 100%;
    max-width: 672px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modal-in 350ms var(--ease-spring);
    overflow: hidden;
}

.modal--lg {
    max-width: 900px;
}

.modal--lg .modal-body {
    max-height: none;
}

.modal--preview {
    max-width: 360px;
    max-height: 240px;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal--preview .modal-body {
    max-height: none;
    overflow: hidden;
}

.modal-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.modal-images img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200);
    object-fit: cover;
    aspect-ratio: 4/3;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-5) var(--space-8);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--navy-800);
}

.modal-header p {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    margin-top: var(--space-1);
}

.modal-close {
    background: var(--white);
    border: 1px solid var(--neutral-200);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-500);
    transition: all var(--dur-fast) ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--neutral-50);
    color: var(--navy-800);
}

.modal-close i { font-size: 16px; line-height: 1; }

.modal-body {
    padding: var(--space-8);
    overflow-y: auto;
    flex: 1;
}

.modal-context {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: var(--neutral-50);
    border-radius: var(--radius-sm);
}

.modal-context strong { color: var(--navy-800); }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    border-top: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    flex-shrink: 0;
}

.modal-footer .btn {
    border-radius: var(--radius-full);
}

.zone-image-link {
    position: relative;
    display: inline-block;
    cursor: zoom-in;
}

.zone-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 26, 44, 0.4);
    border-radius: var(--radius-md);
    opacity: 0;
    transition: opacity var(--dur-fast) ease;
    color: var(--white);
}

.zone-image-link:hover .zone-image-overlay {
    opacity: 1;
}

@keyframes modal-bg-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========================================================================
   ANNOTATIONS BANNER
   ======================================================================== */

.annotations-banner {
    background: linear-gradient(135deg, var(--warning-50), #FFF8E1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-left: 4px solid var(--warning-500);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-6);
}

.annotations-banner-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.annotations-banner-title {
    font-weight: 700;
    color: #92400E;
    font-size: 0.875rem;
    font-family: var(--font-body);
}

.annotations-banner ul {
    list-style: none;
    padding: 0;
    color: #78350F;
    font-size: 0.8125rem;
}

.annotations-banner li {
    padding: var(--space-2) 0;
    border-bottom: 1px solid rgba(245, 158, 11, 0.12);
    padding-left: var(--space-5);
    position: relative;
}

.annotations-banner li:last-child { border-bottom: none; }

.annotations-banner li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    background: var(--warning-500);
    border-radius: 50%;
    transform: translateY(-50%);
}

/* ========================================================================
   ALERTS
   ======================================================================== */

.alert {
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: var(--space-6);
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    border-left: 4px solid transparent;
}

.alert-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

.alert-content { flex: 1; }

.alert-title {
    font-weight: 700;
    margin-bottom: var(--space-1);
    font-family: var(--font-body);
}

.alert--warning {
    background: var(--warning-50);
    border-left-color: var(--warning-500);
    color: #92400E;
}

.alert--success {
    background: var(--success-50);
    border-left-color: var(--success-600);
    color: #166534;
}

.alert--error {
    background: var(--danger-50);
    border-left-color: var(--danger-600);
    color: #991B1B;
}

.alert--info {
    background: var(--info-50);
    border-left-color: var(--info-600);
    color: #1E40AF;
}

/* ========================================================================
   SUCCESS PAGE
   ======================================================================== */

.success-page {
    text-align: center;
    padding: var(--space-16) var(--space-4);
}

.success-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    position: relative;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: check-draw 600ms var(--ease-out) 300ms forwards;
}

.success-icon::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid var(--success-100);
    animation: ring-expand 600ms var(--ease-out) forwards;
}

.success-icon--check {
    background: var(--success-50);
    color: var(--success-600);
    animation: icon-pop 500ms var(--ease-spring) forwards;
}

@keyframes check-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes ring-expand {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes icon-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-page h1 {
    margin-bottom: var(--space-3);
    color: var(--navy-800);
    animation: fade-up 500ms var(--ease-out) 400ms both;
}

.success-page p {
    color: var(--neutral-500);
    max-width: 400px;
    margin: 0 auto;
    font-size: 0.9375rem;
    line-height: 1.7;
    animation: fade-up 500ms var(--ease-out) 500ms both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================================
   PROJECTS LIST
   ======================================================================== */

/* --- Featured Project Card --- */
/* Dashboard projects layout */
.dashboard-projects-layout {
    display: flex;
    gap: var(--space-6);
    align-items: stretch;
}
.dashboard-projects-featured { flex: 2; min-width: 0; }
.dashboard-projects-list { flex: 3; min-width: 0; }

@media (max-width: 900px) {
    .dashboard-projects-layout { flex-direction: column; }
}

.featured-project {
    position: relative;
    background: var(--navy-900);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all var(--dur-normal) var(--ease-out);
    min-height: 240px;
    display: flex;
    align-items: stretch;
}

.featured-project--vertical {
    min-height: auto;
    height: 100%;
}

.featured-project:hover {
    box-shadow: var(--shadow-float);
    transform: translateY(-2px);
    color: inherit;
}

.featured-project-cover {
    position: absolute;
    inset: 0;
}

.featured-project--vertical .featured-project-cover {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    filter: blur(1px);
}

.featured-project-cover img,
.featured-project-cover-img {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    object-fit: cover;
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.7) 50%, black 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.7) 50%, black 100%);
}


.featured-project-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
}

.featured-project-body {
    position: relative;
    z-index: 1;
    padding: var(--space-8) var(--space-10);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 55%;
}

.featured-project--vertical .featured-project-body {
    max-width: 100%;
    padding: var(--space-5) var(--space-6);
}

.featured-project-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: var(--space-3);
}

.featured-project-meta {
    display: flex;
    gap: var(--space-4);
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.featured-project--vertical .featured-project-meta {
    flex-direction: column;
    gap: var(--space-1);
}

.featured-project-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

@media (max-width: 768px) {
    .featured-project-body {
        max-width: 100%;
        padding: var(--space-6);
    }
}

.projects-list { display: grid; gap: var(--space-3); }

.project-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--neutral-200);
    padding: var(--space-5) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    transition: all var(--dur-normal) var(--ease-out);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--teal-500);
    transition: width var(--dur-normal) var(--ease-out);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}

.project-card:hover::before { width: 4px; }

.project-card-info {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.project-card-title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    color: var(--navy-800);
    margin-bottom: var(--space-1);
}

.project-card-meta {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
}

.project-card-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.project-card-meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.project-card-progress {
    min-width: 200px;
    flex-shrink: 0;
}

.project-card--retard {
    border-color: rgba(220, 38, 38, 0.2);
}

.project-card--retard::before {
    width: 4px;
    background: var(--danger-500);
}

/* ========================================================================
   EXPORT PAGE
   ======================================================================== */

.export-summary { margin-bottom: var(--space-6); }

.export-section-title {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--neutral-500);
    margin-bottom: var(--space-3);
}

.export-articles-list { list-style: none; }

.export-articles-list li {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--neutral-100);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.export-articles-list li:last-child { border-bottom: none; }

/* ========================================================================
   EMPTY STATE
   ======================================================================== */

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--neutral-400);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    opacity: 0.4;
}

.empty-state p {
    margin-bottom: var(--space-4);
    font-size: 0.9375rem;
}

/* ========================================================================
   REDACTION — Editor specific
   ======================================================================== */

.editor-header {
    margin-bottom: var(--space-8);
}

.editor-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-2);
}

.editor-header p {
    color: var(--neutral-500);
    font-size: 0.875rem;
}

.editor-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    padding-top: var(--space-4);
    margin-top: var(--space-2);
}

/* ========================================================================
   TURBO & LOADING
   ======================================================================== */

turbo-frame[busy] {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity var(--dur-fast) ease;
}

/* Page transition */
[data-turbo-preview] { opacity: 0.7; }

/* ========================================================================
   STAGGER ANIMATIONS
   ======================================================================== */

.stagger-in > * {
    animation: stagger-fade 400ms var(--ease-out) both;
}

.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 60ms; }
.stagger-in > *:nth-child(3) { animation-delay: 120ms; }
.stagger-in > *:nth-child(4) { animation-delay: 180ms; }
.stagger-in > *:nth-child(5) { animation-delay: 240ms; }
.stagger-in > *:nth-child(6) { animation-delay: 300ms; }

@keyframes stagger-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================================
   LOGO PREVIEW — Parametres page
   ======================================================================== */

.logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    min-height: 160px;
}

.logo-preview-image {
    max-width: 200px;
    max-height: 120px;
    object-fit: contain;
}

.logo-preview-empty {
    text-align: center;
    color: var(--neutral-400);
}

.logo-preview-empty p {
    margin-top: var(--space-2);
    font-size: 0.875rem;
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

/* ========================================================================
   HEADER — Logo image
   ======================================================================== */

.header-logo-image {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(56, 163, 165, 0.3);
}

.header-logo-custom {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--white);
    padding: 3px 6px;
}

/* ========================================================================
   FORM — Label row (label + action inline)
   ======================================================================== */

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.form-label-row .form-label {
    margin-bottom: 0;
}

/* ========================================================================
   BUTTON — AI (gradient sparkle)
   ======================================================================== */

.btn--ai {
    background: linear-gradient(135deg, #8B5CF6, #6366F1, var(--teal-500));
    color: var(--white);
    border: none;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.btn--ai::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
    animation: ai-shimmer 3s ease infinite;
}

@keyframes ai-shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.btn--ai:hover {
    background: linear-gradient(135deg, #7C3AED, #4F46E5, var(--teal-600));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

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

/* ========================================================================
   DROPZONE — Image upload area
   ======================================================================== */

.dropzone {
    border: 2px dashed var(--neutral-300);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    transition: all var(--dur-fast) ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.dropzone--compact {
    padding: var(--space-4) var(--space-6);
    flex-direction: row;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.dropzone--compact .dropzone-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
}

.dropzone--compact .dropzone-hint {
    display: none;
}

.dropzone:hover {
    border-color: var(--teal-400);
    background: var(--teal-50);
}

.dropzone--dragover {
    border-color: var(--teal-500);
    background: var(--teal-50);
    box-shadow: 0 0 0 4px rgba(56, 163, 165, 0.1);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--neutral-400);
}

.dropzone p {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin: 0;
}

.dropzone-browse {
    color: var(--teal-600);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.dropzone-browse:hover {
    color: var(--teal-500);
}

.dropzone-hint {
    font-size: 0.75rem;
    color: var(--neutral-400);
}

/* ========================================================================
   IMAGE GALLERY — Grid of uploaded images
   ======================================================================== */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.image-gallery:empty {
    display: none;
}

.image-gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--neutral-200);
    background: var(--neutral-50);
    transition: all var(--dur-fast) ease;
    cursor: grab;
}

.image-gallery-item:active {
    cursor: grabbing;
}

.image-gallery-item:hover {
    border-color: var(--teal-400);
    box-shadow: var(--shadow-md);
}

.image-gallery-item--dragging {
    opacity: 0.2;
    border-color: var(--neutral-300);
    border-style: dashed;
}

.image-gallery-placeholder {
    border: 2px dashed var(--teal-500);
    border-radius: var(--radius-md);
    background: var(--teal-50);
    aspect-ratio: 1;
}

.image-gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.image-gallery-actions {
    position: absolute;
    top: var(--space-1);
    right: var(--space-1);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--dur-fast) ease;
}

.image-gallery-item:hover .image-gallery-actions {
    opacity: 1;
}

.image-gallery-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur-fast) ease;
    backdrop-filter: blur(8px);
}

.image-gallery-btn--delete {
    background: rgba(220, 38, 38, 0.85);
    color: var(--white);
}

.image-gallery-btn--delete:hover {
    background: var(--danger-600);
}

.image-gallery-btn--analyse {
    background: rgba(99, 102, 241, 0.85);
    color: var(--white);
}

.image-gallery-btn--analyse:hover {
    background: #4F46E5;
}

.image-gallery-uploading {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: var(--neutral-100);
}

.image-counter {
    font-size: 0.75rem;
    color: var(--neutral-400);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ========================================================================
   QUALITY SCORE BADGE
   ======================================================================== */

.quality-score {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    padding: 4px 10px;
    border: 1px solid;
    border-top: none;
    border-radius: 0 0 var(--radius-md, 6px) var(--radius-md, 6px);
    font-size: 0.8125rem;
    font-weight: 600;
}

.quality-score__label {
    font-weight: 500;
}

.quality-score__value {
    font-weight: 700;
}

.quality-score__info {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: none;
    font-size: 0.625rem;
    font-weight: 700;
    font-style: italic;
    font-family: serif;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ========================================================================
   QUALITY MODAL
   ======================================================================== */

.quality-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.quality-modal {
    background: #fff;
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.quality-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}

.quality-modal__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.quality-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--neutral-400);
    padding: 0;
    line-height: 1;
}

.quality-modal__overall {
    margin: 16px 20px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid;
    text-align: center;
}

.quality-modal__grade {
    font-size: 1.125rem;
    font-weight: 700;
}

.quality-modal__criteria {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quality-modal__criterion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    margin-bottom: 6px;
}

.quality-modal__bar-track {
    height: 6px;
    background: var(--neutral-100, #f3f4f6);
    border-radius: 3px;
    overflow: hidden;
}

.quality-modal__bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quality-modal__advice {
    margin: 8px 0 0;
    font-size: 0.8125rem;
    color: var(--neutral-600, #4B5563);
    line-height: 1.4;
}

.quality-modal__loading {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.quality-modal__loading p {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.quality-modal__loading-sub {
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    color: var(--neutral-500) !important;
}

.quality-modal__enhance {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--neutral-100, #f3f4f6);
    text-align: center;
}

.quality-modal__enhance-note {
    margin: 8px 0 0;
    font-size: 0.75rem;
    color: var(--neutral-500);
    line-height: 1.4;
}

/* ========================================================================
   QUALITY SCORE — ENHANCE BUTTON
   ======================================================================== */

.quality-score__enhance {
    margin-left: auto;
    padding: 2px 8px;
    border: 1px solid currentColor;
    border-radius: 12px;
    background: none;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.quality-score__enhance:hover:not(:disabled) {
    background: var(--primary-600, #4F46E5);
    color: #fff;
    border-color: var(--primary-600, #4F46E5);
}

.quality-score__enhance:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ========================================================================
   ENHANCE OVERLAY
   ======================================================================== */

.enhance-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ========================================================================
   ZONE IMAGE THUMBNAIL WITH HOVER OVERLAY
   ======================================================================== */

.zone-image-thumb {
    position: relative;
    display: inline-block;
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
}

.zone-image-thumb__img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.zone-image-thumb__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.zone-image-thumb:hover .zone-image-thumb__overlay,
.zone-image-thumb--loading .zone-image-thumb__overlay {
    opacity: 1;
}

.zone-image-thumb__score {
    font-size: 0.875rem;
    font-weight: 700;
}

.zone-image-thumb__hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

/* ========================================================================
   IMAGE PREVIEW MODAL
   ======================================================================== */

.preview-modal {
    background: #fff;
    border-radius: 12px;
    width: 900px;
    max-width: 95vw;
    height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.preview-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--neutral-100, #f3f4f6);
}

.preview-modal__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.preview-modal__body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.preview-modal__image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 16px;
    background: var(--neutral-900, #111);
}

.preview-modal__img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.preview-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: #fff;
}

.preview-modal__loading p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.preview-modal__loading-sub {
    font-weight: 400 !important;
    font-size: 0.8125rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

.preview-modal__sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 20px;
    border-left: 1px solid var(--neutral-100, #f3f4f6);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-modal__score {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-md, 6px);
    border: 1px solid;
}

.preview-modal__grade {
    font-size: 0.875rem;
    font-weight: 700;
}

.preview-modal__criteria {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-modal__criterion {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-modal__criterion-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.preview-modal__enhance {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-100, #f3f4f6);
}

.preview-modal__enhance .btn {
    width: 100%;
}

.preview-modal__enhance-note {
    font-size: 0.75rem;
    color: var(--neutral-500);
    text-align: center;
}

/* ========================================================================
   CROP MODAL
   ======================================================================== */

.crop-modal {
    background: #fff;
    border-radius: 12px;
    width: 900px;
    max-width: 95vw;
    height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.crop-modal__header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--neutral-100);
}

.crop-modal__header h3 {
    margin: 0 0 var(--space-1);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neutral-900);
}

.crop-modal__subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--neutral-500);
    line-height: 1.4;
}

.crop-modal__body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.crop-modal__cropper {
    flex: 1;
    position: relative;
    background: var(--neutral-900);
}

.crop-modal__sidebar {
    width: 240px;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    border-left: 1px solid var(--neutral-100);
}

.crop-modal__score {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.crop-modal__grade {
    font-size: 0.9375rem;
    font-weight: 700;
}

.crop-modal__dims {
    font-size: 0.75rem;
    color: var(--neutral-600);
    font-weight: 600;
}

.crop-modal__expected {
    font-size: 0.6875rem;
    color: var(--neutral-400);
}

.crop-modal__zoom {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.crop-modal__zoom label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-600);
}

.crop-modal__zoom input[type="range"] {
    width: 100%;
    accent-color: var(--primary-500);
}

.crop-modal__confirm {
    width: 100%;
    margin-top: auto;
}

.crop-modal__skip {
    background: none;
    border: none;
    color: var(--neutral-400);
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    padding: var(--space-1) 0;
}

.crop-modal__skip:hover {
    color: var(--neutral-600);
    text-decoration: underline;
}

/* ========================================================================
   IMAGE COMPARE MODAL
   ======================================================================== */

.compare-modal {
    background: #fff;
    border-radius: 12px;
    width: 700px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.compare-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--neutral-100, #f3f4f6);
}

.compare-modal__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.compare-modal__labels {
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compare-modal__labels > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compare-modal__dim {
    font-size: 0.6875rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--neutral-400);
}

.compare-modal__container {
    position: relative;
    cursor: ew-resize;
    overflow: hidden;
    flex: 1;
    min-height: 300px;
}

.compare-modal__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.compare-modal__clip {
    position: absolute;
    inset: 0;
}

.compare-modal__clip .compare-modal__img {
    position: absolute;
    inset: 0;
}

.compare-modal__slider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #fff;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 2;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.compare-modal__slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--neutral-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-modal__slider-handle::before {
    content: "\2194";
    font-size: 14px;
    color: var(--neutral-500);
}

.compare-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 16px 20px;
    border-top: 1px solid var(--neutral-100, #f3f4f6);
}

/* ========================================================================
   LIGHTBOX
   ======================================================================== */

.lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    transition: background 0.25s ease, backdrop-filter 0.25s ease;
    cursor: zoom-out;
}

.lightbox-backdrop--visible {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    cursor: default;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.lightbox-backdrop--visible .lightbox-image {
    transform: scale(1);
    opacity: 1;
}

.image-gallery-thumb {
    cursor: zoom-in;
}

/* ========================================================================
   MODAL — Split (reformulation)
   ======================================================================== */

.modal-split {
    width: 90vw;
    max-width: none;
}

.modal-split-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    height: 60vh;
    overflow: hidden;
    padding: 0;
}

.modal-split-column {
    padding: var(--space-5) var(--space-6);
    overflow-y: auto;
    min-height: 0; /* Required for grid children to respect overflow */
}

.modal-split-divider {
    width: 1px;
    background: var(--neutral-200);
}

.modal-split-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neutral-400);
    margin-bottom: var(--space-3);
}

.modal-split-label--ai {
    color: #6366F1;
}

.modal-split-content {
    font-family: 'Georgia', serif;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--neutral-700);
}

.modal-split-content p {
    margin-bottom: var(--space-4);
}

.modal-split-content p:last-child {
    margin-bottom: 0;
}

/* ========================================================================
   ANALYSIS PANEL — Image AI analysis results
   ======================================================================== */

.analysis-panel {
    background: var(--white);
    border-top: 1px solid var(--neutral-200);
    padding: var(--space-3);
    font-size: 0.8125rem;
}

.analysis-panel-description {
    color: var(--neutral-700);
    line-height: 1.6;
    margin-bottom: var(--space-2);
}

.analysis-panel-type {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--info-100);
    color: #1E40AF;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.analysis-panel-suggestions {
    list-style: none;
    padding: 0;
    margin: var(--space-2) 0 0;
}

.analysis-panel-suggestions li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--neutral-100);
    font-size: 0.8125rem;
    color: var(--neutral-600);
}

.analysis-panel-suggestions li:last-child {
    border-bottom: none;
}

.analysis-panel-insert {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--teal-400);
    color: var(--teal-600);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--dur-fast) ease;
}

.analysis-panel-insert:hover {
    background: var(--teal-50);
    border-color: var(--teal-500);
}

/* ========================================================================
   LOADER — Spinner for async operations
   ======================================================================== */

.loader-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--neutral-200);
    border-top-color: var(--teal-500);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}

.loader-spinner--ai {
    border-top-color: var(--teal-500);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

/* ========================================================================
   DIFF — Reformulation IA
   ======================================================================== */

.modal-split-column ins {
    background-color: #d1fae5;
    color: #065f46;
    text-decoration: none;
    padding: 1px 2px;
    border-radius: 2px;
}

.modal-split-column del {
    background-color: #fee2e2;
    color: #991b1b;
    text-decoration: line-through;
    padding: 1px 2px;
    border-radius: 2px;
    opacity: 0.8;
}

/* ========================================================================
   ARTICLE ACCORDION LIST
   ======================================================================== */

.article-list {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
}

.article-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.article-list-header p {
    color: var(--neutral-500);
    font-size: 0.875rem;
    max-width: 500px;
    line-height: 1.6;
}

.article-list-pills {
    display: flex;
    gap: var(--space-2);
}

.article-list-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--neutral-500);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.article-list-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.article-list-pill .dot--amber { background: #F59E0B; }
.article-list-pill .dot--teal { background: var(--teal-500); }
.article-list-pill .dot--success { background: var(--success-500); }

.article-row {
    border-top: 1px solid var(--neutral-200);
}

.article-row:first-child {
    border-top: none;
}

.article-row > summary {
    list-style: none;
    padding: var(--space-5) var(--space-8);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-6);
    transition: background var(--dur-fast) ease;
}

.article-row > summary::-webkit-details-marker { display: none; }

.article-row > summary:hover {
    background: var(--neutral-50);
}

.article-row-grip {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--neutral-300);
    flex-shrink: 0;
}

.article-row-grip .grip-icon {
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity var(--dur-fast) ease;
    cursor: grab;
}

.article-row > summary:hover .grip-icon {
    opacity: 1;
}

.article-row-grip .row-number {
    font-size: 0.875rem;
    font-weight: 600;
    width: 16px;
    text-align: center;
    color: var(--neutral-400);
}

.article-row-info {
    flex: 1;
    min-width: 0;
}

.article-row-title-line {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.article-row-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--navy-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.article-row-title-pen {
    width: 20px;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--neutral-400);
    opacity: 0;
    transition: opacity 0.15s;
}

.article-row-title-line:hover .article-row-title-pen--active {
    opacity: 1;
    cursor: pointer;
}

.inline-edit-input {
    font: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--navy-900);
    background: var(--neutral-50);
    border: 1px solid var(--teal-400);
    border-radius: var(--radius-sm, 4px);
    padding: 2px 6px;
    outline: none;
    width: 100%;
    min-width: 120px;
}

.inline-edit-input:focus {
    border-color: var(--teal-500);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.inline-edit-input--saving {
    opacity: 0.6;
    cursor: wait;
}

.article-row-assignee {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: 4px;
}

.article-row-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
}

.article-row-avatar--empty {
    border: 1px dashed var(--neutral-300);
    background: var(--neutral-50);
    color: var(--neutral-400);
}

.article-row-avatar--filled {
    background: var(--navy-800);
    color: var(--white);
}

.article-row-assignee span {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.article-row-assignee span.assigned {
    color: var(--navy-800);
    font-weight: 500;
}

.article-row-right {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex-shrink: 0;
}

.progress-ring {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--neutral-200);
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--teal-500);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 88;
    transition: stroke-dashoffset 0.6s ease-out;
}

.progress-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--navy-800);
}

.article-row-expand {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-500);
    transition: all 0.3s ease;
}

.article-row > summary:hover .article-row-expand {
    border-color: rgba(56, 163, 165, 0.5);
    color: var(--teal-500);
    box-shadow: 0 2px 8px rgba(56, 163, 165, 0.15);
}

.article-row[open] .article-row-expand {
    background: var(--teal-500);
    color: var(--white);
    border-color: var(--teal-500);
}

.article-row-expand i {
    font-size: 1.125rem;
    transition: transform 0.3s ease;
}

.article-row[open] .article-row-expand i {
    transform: rotate(90deg);
}

.article-row-panel-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.article-row[open]:not(.closing) > .article-row-panel-wrapper {
    grid-template-rows: 1fr;
}

.article-row-panel {
    overflow: hidden;
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-200);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    position: relative;
}

.article-row-panel-inner {
    padding: var(--space-6) var(--space-8);
    padding-left: 72px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s;
}

.article-row[open]:not(.closing) .article-row-panel-inner {
    opacity: 1;
    transform: translateY(0);
}

.article-row-panel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.article-row-panel--complete::before { background: var(--teal-500); }
.article-row-panel--partial::before { background: #F59E0B; }
.article-row-panel--empty::before { background: var(--neutral-300); }

.article-row-panel-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.zone-badges-title {
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--neutral-500);
    letter-spacing: 0.1em;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.zone-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.zone-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.zone-badge--filled {
    background: var(--white);
    border: 1px solid var(--neutral-200);
    color: var(--neutral-700);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.zone-badge--filled .zone-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success-500);
}

.zone-badge--empty {
    background: transparent;
    border: 1px dashed var(--neutral-300);
    color: var(--neutral-500);
    font-weight: 500;
}

.zone-badge i { color: var(--teal-500); }
.zone-badge--empty i { color: var(--neutral-400); }

.article-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.status-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.status-badge--brouillon {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.status-badge--soumis {
    background: var(--teal-50, #E6F7F7);
    color: var(--teal-700, #0F766E);
    border: 1px solid var(--teal-200, #99D8D9);
}

.status-badge--valide {
    background: var(--success-50, #ECFDF5);
    color: var(--success-700, #15803D);
    border: 1px solid var(--success-200, #A7F3D0);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { display: none; }
    .main-workspace { min-height: 100vh; }
    .workspace-content { padding: var(--space-4); }
    .workspace-header { padding: 0 var(--space-4); height: 60px; }
    .main-content { padding: var(--space-4); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; align-items: flex-start; }
    .project-card { flex-direction: column; align-items: flex-start; }
    .project-card-progress { width: 100%; }
    .header { padding: 0 var(--space-4); }
    .header-collectivite { display: none; }
    .redaction-main { padding: 0 var(--space-4); margin: var(--space-6) auto; }
    .editor-actions { flex-direction: column; }
    .editor-actions .btn { width: 100%; }

    .modal-split { max-width: 100%; margin: var(--space-2); }
    .modal-split-body { grid-template-columns: 1fr; max-height: 70vh; }
    .modal-split-divider { width: 100%; height: 1px; }
    .image-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .form-label-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
}

/* Sortable drag & drop */
tr.is-dragging {
    opacity: 0.4;
    background: var(--primary-50);
}
tr[data-article-id] {
    transition: transform 0.15s ease;
}
.sortable-handle:hover {
    color: var(--neutral-600);
}
.sortable-handle:hover svg {
    opacity: 1 !important;
}

/* --- Zone Constraints --- */
.zone-counter {
    font-size: 0.75rem;
    color: var(--neutral-400);
    transition: color 0.2s ease, font-weight 0.2s ease;
    white-space: nowrap;
}
.zone-counter--warning {
    color: var(--warning-600);
    font-weight: 500;
}
.zone-counter--danger {
    color: var(--danger-600);
    font-weight: 600;
}

/* ==================== SETTINGS ROWS ==================== */

.settings-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: var(--white);
    border-bottom: 1px solid var(--neutral-100);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.settings-row:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.settings-row:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-bottom: none;
}

.settings-row:only-child {
    border-radius: var(--radius-lg);
}

.settings-row:hover {
    background: var(--neutral-50);
}

.settings-row-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.settings-row-icon--teal {
    background: var(--teal-50);
    color: var(--teal-600);
}

.settings-row-icon--navy {
    background: rgba(0, 26, 44, 0.06);
    color: var(--navy-800);
}

.settings-row-icon--amber {
    background: #FEF3C7;
    color: #D97706;
}

.settings-row-info {
    flex: 1;
    min-width: 0;
}

.settings-row-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: 2px;
}

.settings-row-desc {
    font-size: 0.8125rem;
    color: var(--neutral-500);
}

.settings-row-chevron {
    flex-shrink: 0;
    color: var(--neutral-300);
    font-size: 14px;
    transition: transform 0.2s;
}

.settings-row:hover .settings-row-chevron {
    color: var(--neutral-500);
    transform: translateX(2px);
}

/* ── Filtre de recherche des articles (page projet) ── */
.article-filter-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: var(--space-4);
}

.article-filter-icon {
    position: absolute;
    left: 14px;
    color: var(--neutral-400);
    font-size: 1rem;
    pointer-events: none;
}

.article-filter-input {
    width: 100%;
    padding: 10px 40px;
    border: 1.5px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--neutral-900);
    background: var(--white);
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.article-filter-input:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: var(--shadow-glow);
}

.article-filter-input::placeholder {
    color: var(--neutral-400);
}

.article-filter-clear {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--neutral-400);
    cursor: pointer;
    transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.article-filter-clear:hover {
    color: var(--neutral-900);
    background: var(--neutral-100);
}

.article-filter-empty {
    padding: var(--space-6);
    text-align: center;
    color: var(--neutral-400);
    font-size: 0.875rem;
}
