  :root {
    --cvl-navy: #0E1727;
    --cvl-navy-2: #1a2638;
    --cvl-orange: #EF7E4B;
    --cvl-orange-dark: #d96a3a;
    --cvl-orange-light: rgba(239, 126, 75, 0.12);
    --cvl-blue: #7196CE;
    --cvl-blue-light: rgba(113, 150, 206, 0.15);
    --bg-page: #f5f6f8;
    --bg-card: #ffffff;
    --bg-secondary: #f1f3f6;
    --text-primary: #0E1727;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f0f1f3;
    --green: #10b981;
    --green-bg: #d1fae5;
    --green-text: #065f46;
    --amber: #f59e0b;
    --amber-bg: #fef3c7;
    --amber-text: #92400e;
    --red: #ef4444;
    --red-bg: #fee2e2;
    --red-text: #991b1b;
    --gray-bg: #f3f4f6;
    --gray-text: #4b5563;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
  }

  /* ============ LOGIN SCREEN ============ */
  .login-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--cvl-navy) 0%, var(--cvl-navy-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  }
  .login-logo {
    text-align: center;
    margin-bottom: 28px;
  }
  .login-logo .brand {
    font-size: 26px;
    font-weight: 700;
    color: var(--cvl-navy);
    font-style: italic;
    letter-spacing: -0.5px;
  }
  .login-logo .brand .accent { color: var(--cvl-orange); font-weight: 400; }
  .login-logo .tagline {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
  }
  .form-group { margin-bottom: 16px; }
  .form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
  }
  .form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
  }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--cvl-orange);
    box-shadow: 0 0 0 3px var(--cvl-orange-light);
  }
  .btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .btn-primary { background: var(--cvl-orange); color: white; }
  .btn-primary:hover { background: var(--cvl-orange-dark); }
  .btn-secondary { background: white; color: var(--text-primary); border: 1px solid var(--border); }
  .btn-secondary:hover { background: var(--bg-secondary); }
  .btn-block { width: 100%; justify-content: center; }
  .btn-lg { padding: 12px 20px; font-size: 14px; }

  /* ============ APP LAYOUT ============ */
  /* Django : .app est toujours affiché (pas de SPA toggle comme dans le prototype) */
  .app { display: flex; min-height: 100vh; }
  /* Vision DG UX : sidebar fixe qui scrolle independamment du contenu */
  .app > .sidebar { flex-shrink: 0; }
  .app > .main-content, .app > .main { margin-left: 240px; flex: 1; min-width: 0; }
  .app.active { display: flex; }

  .sidebar {
    width: 240px;
    background: var(--cvl-navy);
    color: white;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    height: 100vh;
    position: fixed;      /* fixe la sidebar au viewport, scroll independant */
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    scrollbar-width: thin;
  }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
  /* Vision DG UX : sections nav collapsibles avec chevron +/- */
  .nav-section {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 6px;
    transition: background 0.15s;
    border-radius: 4px;
  }
  .nav-section:hover { background: rgba(255,255,255,0.05); }
  .nav-section::after {
    content: '▼';
    font-size: 8px;
    opacity: 0.5;
    margin-left: 6px;
    transition: transform 0.2s;
  }
  .nav-section.collapsed::after { transform: rotate(-90deg); }
  /* v22.464 : hide-collapsed sur tout element (nav-item + div wrappers type 'Administration RH') */
  .nav-item.hidden-collapsed,
  .sidebar .hidden-collapsed { display: none !important; }
  /* v22.148 : sidebar-brand STICKY - reste visible en haut au scroll de la sidebar */
  .sidebar-brand {
    position: sticky;
    top: -18px;
    z-index: 6;
    background: var(--cvl-navy);
    padding: 24px 10px 14px 10px;
    margin: -18px -12px 0 -12px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sidebar-brand .logo-mark {
    width: 32px; height: 32px;
    background: var(--cvl-orange);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
  }
  /* v22.138 : logo image uploade - affiche sans fond ni bordure ni padding */
  .sidebar-brand .logo-img {
    max-width: 44px;
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    display: block;
    flex-shrink: 0;
  }
  .sidebar-brand .name {
    font-size: 14px; font-weight: 600; line-height: 1.2;
    font-style: italic;
  }
  .sidebar-brand .name .accent { color: var(--cvl-orange); font-weight: 400; }
  .sidebar-brand .tagline { font-size: 9px; color: rgba(255,255,255,0.5); margin-top: 2px; font-style: italic; }

  /* v22.148 : recherche sidebar STICKY (colle sous le brand) */
  .sidebar-search-sticky {
    position: sticky;
    top: 52px; /* colle juste sous le brand collé (approximatif hauteur du brand) */
    z-index: 5;
    background: var(--cvl-navy);
    margin: 0 -12px 6px -12px;
    padding: 10px 18px !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    padding: 14px 12px 6px;
  }
  .nav-item {
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
  }
  .nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
  .nav-item.active { background: var(--cvl-orange-light); color: var(--cvl-orange); font-weight: 500; }
  .nav-item.sub { padding-left: 36px; font-size: 12px; }
  .nav-item .badge {
    margin-left: auto;
    font-size: 10px;
    background: rgba(239,126,75,0.2);
    color: var(--cvl-orange);
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 500;
  }
  .nav-item .badge.muted { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }
  .nav-item svg { flex-shrink: 0; }

  .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .topbar-left h1 { font-size: 18px; font-weight: 600; }
  .topbar-left .breadcrumb { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .topbar-right { display: flex; align-items: center; gap: 12px; }
  .search-box {
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    width: 240px;
    color: var(--text-primary);
  }
  .search-box:focus { outline: none; border-color: var(--cvl-orange); background: white; }
  .avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--cvl-blue);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
  }
  .icon-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    border: none;
  }
  .icon-btn:hover { background: var(--border); color: var(--text-primary); }

  .content { padding: 24px; flex: 1; }

  /* ============ PAGE SECTIONS ============ */
  .page { display: none; }
  .page.active { display: block; }

  /* ============ KPI ============ */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
  }
  .kpi-card {
    background: white;
    border-radius: 10px;
    padding: 16px 18px;
    border-left: 3px solid var(--cvl-orange);
    border-top: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
  }
  .kpi-card.blue { border-left-color: var(--cvl-blue); }
  .kpi-card.green { border-left-color: var(--green); }
  .kpi-card.navy { border-left-color: var(--cvl-navy); }
  .kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 500;
  }
  .kpi-value {
    font-size: 28px;
    font-weight: 600;
    margin-top: 6px;
    color: var(--text-primary);
  }
  .kpi-trend {
    font-size: 11px;
    margin-top: 4px;
    color: var(--text-secondary);
  }
  .kpi-trend.up { color: var(--green-text); }
  .kpi-trend.warn { color: var(--amber-text); }

  /* ============ CARDS ============ */
  .card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
  }
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
  }
  .card-title { font-size: 15px; font-weight: 600; }
  .card-subtitle { font-size: 12px; color: var(--text-secondary); }

  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }

  /* ============ TRANSPORT CARDS ============ */
  .transport-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .transport-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .transport-card:hover { border-color: var(--cvl-orange); transform: translateY(-1px); }
  .transport-card.selected { border: 2px solid var(--cvl-orange); background: var(--cvl-orange-light); padding: 15px; }
  .transport-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .transport-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
  }
  .transport-card.selected .transport-icon { background: var(--cvl-orange); color: white; }
  .transport-card.selected .transport-icon svg { fill: white; }

  /* ============ PROGRESS BARS ============ */
  .progress-row { margin-bottom: 12px; }
  .progress-row:last-child { margin-bottom: 0; }
  .progress-label {
    display: flex; justify-content: space-between;
    font-size: 12px; margin-bottom: 4px;
  }
  .progress-label .obj { color: var(--text-tertiary); font-weight: 400; }
  .progress-label .value { font-weight: 600; }
  .progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
  }
  .progress-fill { height: 100%; border-radius: 4px; transition: width 0.4s; }
  .progress-fill.green { background: var(--green); }
  .progress-fill.orange { background: var(--cvl-orange); }
  .progress-fill.red { background: var(--red); }

  /* ============ TABLES ============ */
  .table-wrapper { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  thead th {
    background: var(--bg-secondary);
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  thead th:first-child { border-radius: 6px 0 0 6px; }
  thead th:last-child { border-radius: 0 6px 6px 0; }
  tbody td { padding: 12px; border-bottom: 1px solid var(--border-light); }
  tbody tr { cursor: pointer; transition: background 0.1s; }
  tbody tr:hover { background: var(--bg-secondary); }
  tbody tr:last-child td { border-bottom: none; }

  /* ============ BADGES & PILLS ============ */
  .pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
  }
  .pill.green { background: var(--green-bg); color: var(--green-text); }
  .pill.amber { background: var(--amber-bg); color: var(--amber-text); }
  .pill.red { background: var(--red-bg); color: var(--red-text); }
  .pill.gray { background: var(--gray-bg); color: var(--gray-text); }
  .pill.orange { background: var(--cvl-orange-light); color: var(--cvl-orange-dark); }
  .pill.blue { background: var(--cvl-blue-light); color: #2B5A95; }
  .pill.navy { background: rgba(15,23,39,0.08); color: var(--cvl-navy); }

  .avatar-sm {
    width: 28px; height: 28px;
    border-radius: 50%;
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    margin-right: 8px;
  }

  /* ============ FILTERS ============ */
  .filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
  .filter-pill {
    padding: 7px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
  }
  .filter-pill:hover { border-color: var(--cvl-orange); }
  .filter-pill.active { background: var(--cvl-orange); color: white; border-color: var(--cvl-orange); }

  /* ============ STEPS ============ */
  .steps { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
  .step {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
  }
  .step.active { background: var(--cvl-orange); color: white; font-weight: 500; }
  .step.done { background: var(--green-bg); color: var(--green-text); }

  /* ============ INFO BOX ============ */
  .info-box {
    padding: 12px 14px;
    background: var(--cvl-blue-light);
    border-left: 3px solid var(--cvl-blue);
    border-radius: 4px;
    font-size: 12px;
    margin-top: 14px;
  }
  .info-box strong { color: #185FA5; }

  /* ============ DONUT CHART ============ */
  .legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; }
  .legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

  /* ============ PERMISSION MATRIX ============ */
  .perm-table th, .perm-table td { text-align: center; }
  .perm-table th:first-child, .perm-table td:first-child { text-align: left; }
  .perm-cell {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .perm-cell.allowed { background: var(--green-bg); color: var(--green-text); }
  .perm-cell.denied { background: var(--gray-bg); color: var(--text-tertiary); }

  /* ============ MODAL ============ */
  /* v22.593 : fallback top/left/right/bottom pour compatibilite WebView desktop */
  .modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
  }
  .modal-overlay.active { display: flex !important; }
  .modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
  }
  .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
  }
  .modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-secondary); }

  /* ============ ALERTS ============ */
  .alert-item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--bg-secondary);
    margin-bottom: 8px;
    font-size: 12px;
  }
  .alert-item.urgent { background: var(--red-bg); }
  .alert-item.warning { background: var(--amber-bg); }
  .alert-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: white;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }

  .text-orange { color: var(--cvl-orange); }
  .text-green { color: var(--green-text); }
  .text-red { color: var(--red); }
  .text-secondary { color: var(--text-secondary); }
  .text-xs { font-size: 11px; }
  .text-sm { font-size: 12px; }
  .mb-0 { margin-bottom: 0; }
  .mt-2 { margin-top: 8px; }
  .mt-4 { margin-top: 16px; }
  .flex { display: flex; }
  .flex-1 { flex: 1; }
  .gap-2 { gap: 8px; }
  .items-center { align-items: center; }
  .justify-end { justify-content: flex-end; }
  .text-right { text-align: right; }
  .font-medium { font-weight: 500; }
  .font-semibold { font-weight: 600; }

  /* Dark mode */
  body.dark-mode {
    --bg-page: #0a0f1c;
    --bg-card: #141d2e;
    --bg-secondary: #1c2740;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --border: #2a3548;
    --border-light: #1f2940;
    --green-bg: rgba(16, 185, 129, 0.15);
    --amber-bg: rgba(245, 158, 11, 0.15);
    --red-bg: rgba(239, 68, 68, 0.15);
    --gray-bg: rgba(156, 163, 175, 0.12);
  }
  body.dark-mode .login-card { background: #141d2e; color: #e5e7eb; }
  body.dark-mode .login-logo .brand,
  body.dark-mode .login-logo .brand span { color: #e5e7eb; }
  body.dark-mode .login-logo .brand .accent { color: var(--cvl-orange); }
  body.dark-mode .form-group input,
  body.dark-mode .form-group select,
  body.dark-mode .form-group textarea,
  body.dark-mode .search-box,
  body.dark-mode input,
  body.dark-mode select,
  body.dark-mode textarea { background: #1c2740; color: #e5e7eb; border-color: #2a3548; }
  body.dark-mode .filter-pill { background: #1c2740; color: #e5e7eb; border-color: #2a3548; }
  body.dark-mode .filter-pill:hover { border-color: var(--cvl-orange); }
  body.dark-mode .filter-pill.active { background: var(--cvl-orange); color: white; }
  body.dark-mode .btn-secondary { background: #1c2740; color: #e5e7eb; border-color: #2a3548; }
  body.dark-mode .btn-secondary:hover { background: #243349; }
  body.dark-mode thead th { background: #1c2740; color: #9ca3af; }
  body.dark-mode tbody tr:hover { background: #1c2740; }
  body.dark-mode .icon-btn { background: #1c2740; color: #9ca3af; }
  body.dark-mode .icon-btn:hover { background: #2a3548; color: #e5e7eb; }
  body.dark-mode .modal { background: #141d2e; color: #e5e7eb; }
  body.dark-mode .topbar { background: #141d2e; border-bottom-color: #2a3548; }
  body.dark-mode .info-box { background: rgba(113, 150, 206, 0.12); }
  body.dark-mode .pill.green { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
  body.dark-mode .pill.amber { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
  body.dark-mode .pill.red { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
  body.dark-mode .pill.gray { background: rgba(156, 163, 175, 0.18); color: #d1d5db; }

  /* v22.199 : Avatar & Cloche dropdowns - style pro CVL */
  .avatar-wrapper { position: relative; }
  .avatar-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    background: #ffffff; border: 1px solid rgba(13,59,102,.08);
    border-radius: 12px; box-shadow: 0 12px 40px rgba(13,59,102,.15), 0 4px 12px rgba(13,59,102,.08);
    width: 300px; z-index: 200; display: none; overflow: hidden;
    animation: cvlDropIn .15s ease-out;
  }
  @keyframes cvlDropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
  .avatar-dropdown.open, .avatar-dropdown.show { display: block; }
  .avatar-dropdown::before {
    content:''; position:absolute; top:-6px; right:14px;
    width:12px; height:12px; background:#fff; transform:rotate(45deg);
    border-left:1px solid rgba(13,59,102,.08); border-top:1px solid rgba(13,59,102,.08);
  }
  .avatar-dropdown-header {
    padding: 14px 16px; background: linear-gradient(135deg,#0d3b66,#12507f);
    color: #fff; border-bottom: 3px solid #f0804c;
    display: flex; gap: 10px; align-items: center;
    position: relative;
  }
  .avatar-dropdown-header strong { color: #fff; font-weight: 700; letter-spacing: .3px; }
  .avatar-dropdown-header .sub { font-size: 11px; color: #cbd5e1; margin-top: 2px; }
  .avatar-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; font-size: 13px; cursor: pointer;
    transition: background .12s, color .12s, padding-left .12s;
    border: none; background: none; width: 100%; text-align: left;
    color: #334155; text-decoration: none;
  }
  .avatar-dropdown-item:hover { background: #f7f8fa; color: #0d3b66; padding-left: 20px; }
  .avatar-dropdown-item:hover .cloche-badge { transform: scale(1.05); }
  .avatar-dropdown-item.danger { color: #dc2626; }
  .avatar-dropdown-item.danger:hover { background: #fef2f2; color: #991b1b; padding-left: 20px; }
  .avatar-dropdown-divider { height: 1px; background: #e2e8f0; margin: 6px 12px; }
  .cloche-badge {
    transition: transform .12s, background .12s;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    min-width: 20px; text-align: center; display: inline-block;
  }
  body.dark-mode .avatar-dropdown { background: #15213a; border-color: #2a3548; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
  body.dark-mode .avatar-dropdown::before { background: #15213a; border-color: #2a3548; }
  body.dark-mode .avatar-dropdown-item { color: #cbd5e1; }
  body.dark-mode .avatar-dropdown-item:hover { background: #1c2740; color: #f0804c; }
  body.dark-mode .avatar-dropdown-divider { background: #2a3548; }
  .theme-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; font-size: 13px;
  }
  .switch { position: relative; width: 36px; height: 20px; }
  .switch input { display: none; }
  .switch .slider {
    position: absolute; inset: 0; background: var(--border);
    border-radius: 10px; cursor: pointer; transition: 0.2s;
  }
  .switch .slider::before {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; background: white;
    border-radius: 50%; transition: 0.2s;
  }
  .switch input:checked + .slider { background: var(--cvl-orange); }
  .switch input:checked + .slider::before { transform: translateX(16px); }

  /* Multi-step form */
  .step { cursor: pointer; transition: all 0.15s; }
  .step:hover { background: var(--cvl-orange-light); color: var(--cvl-orange-dark); }
  .step.done { background: var(--green-bg); color: var(--green-text); }
  .step.done::before { content: "✓ "; }
  .form-step { animation: fadeIn 0.3s; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

  /* Toast notification */
  .toast {
    position: fixed; top: 80px; right: 24px;
    background: var(--cvl-navy); color: white;
    padding: 12px 18px; border-radius: 8px;
    font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 200; opacity: 0; transform: translateY(-10px);
    transition: all 0.25s; pointer-events: none;
  }
  .toast.show { opacity: 1; transform: translateY(0); }
  .toast.success { background: var(--green); }
  .toast.error { background: var(--red); }

  /* Utility for spinners on bars */
  .bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
  .bar-row:last-child { border-bottom: none; }
  .bar-row .name { width: 130px; flex-shrink: 0; }
  .bar-row .bar-track { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
  .bar-row .bar-track .fill { height: 100%; }
  .bar-row .count { width: 36px; text-align: right; font-weight: 600; }


/* ============ DJANGO ADDITIONS — utilities used by existing templates ============ */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-1 { gap: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-orange { color: var(--cvl-orange); }
.text-green { color: var(--green-text); }
.text-red { color: var(--red-text); }
.text-secondary { color: var(--text-secondary); }
.text-xs { font-size: 11px; }
.pill.gray { background: var(--gray-bg); color: var(--gray-text); }

/* alerts (used by nouveau.html) */
.alert { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }
.alert-danger { background: var(--red-bg); color: var(--red-text); }
.alert-warning { background: var(--amber-bg); color: var(--amber-text); }
.alert-info { background: var(--cvl-blue-light); color: #2B5A95; }
.alert-success { background: var(--green-bg); color: var(--green-text); }

/* Forms additions */
.form-group textarea { resize: vertical; min-height: 60px; }

/* v22.184 : tableaux corporate - police pro + entetes navy + hover + zebra + tabular-nums */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'kern' 1;
  color: var(--text-primary);
}
table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #0d3b66;
  border-bottom: 2px solid #ff6f00;
  white-space: nowrap;
  vertical-align: middle;
}
table th:first-child { border-top-left-radius: 6px; }
table th:last-child { border-top-right-radius: 6px; }
table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
  line-height: 1.4;
  vertical-align: middle;
}
table tbody tr:nth-child(even) td { background: #fafbfc; }
table tbody tr:hover td { background: #eef4ff !important; }
table tr.clickable { cursor: pointer; transition: background .12s ease; }
table tr.clickable:hover td { background: #eef4ff !important; }
table td.text-right, table th.text-right { text-align: right; }
table td.text-center, table th.text-center { text-align: center; }
table td .pill { font-weight: 600; }

/* Filtres inline dans thead (v22.180) : fond clair + inputs discrets */
table thead tr:nth-child(2) th {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #cbd5e1;
  padding: 5px 8px;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
table thead tr:nth-child(2) input,
table thead tr:nth-child(2) select {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: var(--text-primary);
}
table thead tr:nth-child(2) input:focus,
table thead tr:nth-child(2) select:focus {
  outline: none;
  border-color: #0d3b66;
  box-shadow: 0 0 0 2px rgba(13,59,102,.15);
}

/* Wrapper table (scroll horizontal si necessaire, ombre douce) */
.table-wrapper {
  overflow-x: auto;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
  border: 1px solid #e2e8f0;
  background: #fff;
}
.table-wrapper table { min-width: 100%; }

/* Sidebar additions for new sub-items */
.nav-item.sub { padding-left: 28px; font-size: 12px; color: var(--text-secondary); }
.nav-item.sub:hover { color: var(--cvl-orange); }

/* Dark mode utilities */
body.dark-mode table th { background: #0d3b66; color: #cbd5e1; border-color: #ff6f00; }
body.dark-mode table td { border-color: #2a3548; }
body.dark-mode table tbody tr:nth-child(even) td { background: #15213a; }
body.dark-mode table tbody tr:hover td { background: #1e2f4f !important; }
body.dark-mode table tr.clickable:hover td { background: #1e2f4f !important; }
body.dark-mode .table-wrapper { background: #0f172a; border-color: #2a3548; }
body.dark-mode table thead tr:nth-child(2) th { background: #1c2740 !important; color: #cbd5e1; }
body.dark-mode .alert-danger { background: rgba(239,68,68,0.18); color: #fca5a5; }
body.dark-mode .alert-warning { background: rgba(245,158,11,0.18); color: #fcd34d; }
body.dark-mode .alert-info { background: rgba(113,150,206,0.2); color: #93c5fd; }
body.dark-mode .alert-success { background: rgba(16,185,129,0.2); color: #6ee7b7; }

/* ============ ÉTIQUETTES / LABELS — module impression QR ============ */
.label-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  max-height: 600px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}
.cvl-label {
  width: 240px;
  height: 480px;
  background: white;
  border: 2px solid var(--cvl-navy);
  border-radius: 4px;
  padding: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--cvl-navy);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.cvl-label .lbl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1.5px solid var(--cvl-navy);
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.cvl-label .lbl-brand { font-size: 11px; font-weight: 700; color: var(--cvl-navy); font-style: italic; }
.cvl-label .lbl-brand .accent { color: var(--cvl-orange); font-weight: 400; }
.cvl-label .lbl-tagline { font-size: 7px; color: var(--text-secondary); }
.cvl-label .lbl-colis {
  background: var(--cvl-orange);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.cvl-label .lbl-mode {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--cvl-navy);
  color: white;
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.cvl-label .lbl-row {
  display: flex;
  gap: 4px;
  padding: 2px 0;
  border-bottom: 1px dotted #e5e7eb;
  align-items: baseline;
}
.cvl-label .lbl-label {
  font-size: 7px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 56px;
  font-weight: 600;
}
.cvl-label .lbl-value { font-size: 10px; font-weight: 600; flex: 1; word-break: break-word; }
.cvl-label .lbl-strong { font-size: 12px; font-weight: 700; }
.cvl-label .lbl-qr-zone {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1.5px dashed var(--border);
  align-items: center;
  justify-content: center;
}
.cvl-label .lbl-qr-main, .cvl-label .lbl-qr-secondary { text-align: center; }
.cvl-label .lbl-qr-main canvas, .cvl-label .lbl-qr-main img,
.cvl-label .lbl-qr-secondary canvas, .cvl-label .lbl-qr-secondary img {
  display: block;
  margin: 0 auto;
}
.cvl-label .lbl-qr-caption { font-size: 8px; color: var(--text-secondary); text-align: center; margin-top: 3px; font-weight: 600; }
.cvl-label .lbl-footer {
  font-size: 7px;
  color: var(--text-secondary);
  text-align: center;
  padding-top: 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border-light);
}

/* ==========================================
   IMPRESSION
   ========================================== */

/* Mode 1 : Etiquettes 100x200mm (Zebra/Brother) - active via body.print-labels-mode */
@media print {
  body.print-labels-mode * { visibility: hidden; }
  body.print-labels-mode #print-area,
  body.print-labels-mode #print-area * { visibility: visible; }
  body.print-labels-mode #print-area {
    position: absolute; left: 0; top: 0; width: 100mm; background: white;
  }
  body.print-labels-mode #print-area .cvl-label {
    width: 100mm; height: 200mm; box-sizing: border-box;
    padding: 5mm; border: 0; page-break-after: always; font-size: 11pt;
  }
  body.print-labels-mode #print-area .cvl-label:last-child { page-break-after: auto; }
  body.print-labels-mode .lbl-brand { font-size: 15pt; }
  body.print-labels-mode .lbl-colis { font-size: 22pt; padding: 8px 14px; }
  body.print-labels-mode .lbl-value { font-size: 12pt; }
  body.print-labels-mode .lbl-strong { font-size: 14pt; }
  body.print-labels-mode .lbl-label { font-size: 9pt; }
}

/* Mode 2 : Documents A4 (chemise fiche, BL/HBL, AWB/HAWB, manifest, devis, facture...) */
@media print {
  /* Cacher chrome de l'app — selecteurs absolus car le DOM est .app > .main > .topbar */
  body:not(.print-labels-mode) .sidebar,
  body:not(.print-labels-mode) .topbar,
  body:not(.print-labels-mode) .breadcrumb,
  body:not(.print-labels-mode) .toast,
  body:not(.print-labels-mode) .alert,
  body:not(.print-labels-mode) .nav-section,
  body:not(.print-labels-mode) .no-print { display: none !important; }
  body:not(.print-labels-mode) { background: white !important; margin: 0 !important; }
  body:not(.print-labels-mode) .app,
  body:not(.print-labels-mode) .main,
  body:not(.print-labels-mode) .content,
  body:not(.print-labels-mode) .main-content {
    display: block !important; margin: 0 !important; padding: 0 !important;
    width: 100% !important; max-width: 100% !important;
  }
  /* v22.490/v22.495 : impression modale isolée - version compacte pour tenir sur 1 page A4 */
  body:not(.print-labels-mode).cvl-printing * { visibility: hidden; }
  body:not(.print-labels-mode).cvl-printing .modal-overlay.print-target,
  body:not(.print-labels-mode).cvl-printing .modal-overlay.print-target * { visibility: visible; }
  body:not(.print-labels-mode).cvl-printing .modal-overlay.print-target {
    position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important; height: auto !important; min-height: 0 !important; max-height: none !important;
    background: white !important; padding: 0 !important; margin: 0 !important;
    display: block !important; overflow: hidden !important; z-index: 999999 !important;
    align-items: flex-start !important; justify-content: flex-start !important;
    page-break-inside: avoid !important; page-break-after: avoid !important;
  }
  body:not(.print-labels-mode).cvl-printing .modal-overlay.print-target .modal {
    padding: 0 !important; margin: 0 !important;
    max-height: none !important; height: auto !important; min-height: 0 !important;
    overflow: visible !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
    max-width: 100% !important; width: 100% !important;
    page-break-inside: avoid !important; page-break-after: avoid !important;
  }
  /* Neutralise la seconde page vide potentielle */
  body:not(.print-labels-mode).cvl-printing { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  html { height: auto !important; }
  /* Modale en mode print (fallback si pas de classe cvl-printing) */
  body:not(.print-labels-mode) .modal-overlay:not(.print-target) { display: none !important; }
  body:not(.print-labels-mode) .modal-overlay.print-target {
    position: static !important; background: white !important; padding: 0 !important;
    display: block !important; overflow: visible !important;
  }
  body:not(.print-labels-mode) .modal-overlay.print-target .modal {
    box-shadow: none !important; max-width: 100% !important; width: 100% !important;
    max-height: none !important; overflow: visible !important; border: 0 !important;
  }
  body:not(.print-labels-mode) .modal-overlay.print-target .modal-header,
  body:not(.print-labels-mode) .modal-overlay.print-target .modal-close,
  body:not(.print-labels-mode) .modal-overlay.print-target .modal-footer { display: none !important; }
  /* Eviter coupure des lignes/cellules au milieu */
  tr, td, th { page-break-inside: avoid; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  /* v22.483 : masque tout ce qui n a rien a faire dans une impression pro */
  body:not(.print-labels-mode) button,
  body:not(.print-labels-mode) .btn,
  body:not(.print-labels-mode) .btn-primary,
  body:not(.print-labels-mode) .btn-secondary,
  body:not(.print-labels-mode) input[type="button"],
  body:not(.print-labels-mode) input[type="submit"],
  body:not(.print-labels-mode) .filters,
  body:not(.print-labels-mode) .pagination,
  body:not(.print-labels-mode) .filter-pill,
  body:not(.print-labels-mode) .search-box,
  body:not(.print-labels-mode) #rh-badger,
  body:not(.print-labels-mode) #rh-badger-restore,
  body:not(.print-labels-mode) #cvl-btn-retour,
  body:not(.print-labels-mode) [id^="cvl-install"],
  body:not(.print-labels-mode) .actions,
  body:not(.print-labels-mode) .card-actions,
  body:not(.print-labels-mode) .cvl-install-btn,
  body:not(.print-labels-mode) form.filter-form,
  body:not(.print-labels-mode) .messages { display: none !important; }
  /* Liens en noir + underline pour lisibilite papier */
  body:not(.print-labels-mode) a { color: #000 !important; text-decoration: none !important; }
  /* Fond blanc pour cards (economie encre + lisibilite) */
  body:not(.print-labels-mode) .card,
  body:not(.print-labels-mode) .card-header {
    background: #fff !important; box-shadow: none !important; border: 1px solid #999 !important;
  }
  /* Affiche seulement les elements marques print-only */
  body:not(.print-labels-mode) .print-only { display: block !important; }
  body:not(.print-labels-mode) .print-only-inline { display: inline !important; }
  /* Titre de page : force couleurs sobres */
  body:not(.print-labels-mode) h1, body:not(.print-labels-mode) h2, body:not(.print-labels-mode) h3 { color: #000 !important; }
}

/* v22.483 : print-only cache par defaut (visible seulement a l impression) */
.print-only, .print-only-inline { display: none; }

@page { size: A4; margin: 12mm; }

/* ============================================================
   v22.521 : Responsive mobile - tablette & smartphone
   ============================================================ */
#cvl-mobile-menu-btn {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  background: #0d3b66;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
#cvl-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
}

@media (max-width: 900px) {
  #cvl-mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .app > .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1000;
    box-shadow: 2px 0 12px rgba(0,0,0,.2);
  }
  .app.sidebar-open > .sidebar { transform: translateX(0); }
  body.sidebar-open #cvl-mobile-overlay { display: block; }
  .app > .main-content, .app > .main { margin-left: 0 !important; }

  .topbar { padding-left: 60px !important; }  /* laisse la place au bouton hamburger */
  .topbar-left h1 { font-size: 15px !important; }
  .content { padding: 12px !important; }

  /* Grids en 1 colonne */
  .grid-2, .grid-3, .grid-2-1,
  [class*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* Tables scrollables horizontalement */
  .table-responsive, table { max-width: 100%; }
  .main-content table, .content table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Cards & padding */
  .card { padding: 12px !important; }
  .form-group { margin-bottom: 10px; }

  /* Font sizes */
  body { font-size: 13px; }
  h1 { font-size: 18px; }
  h2 { font-size: 16px; }
  h3 { font-size: 14px; }

  /* Boutons plus touch-friendly */
  .btn { padding: 8px 14px; font-size: 13px; min-height: 36px; }

  /* KPI cards en 2 colonnes au lieu de 4 */
  .stats { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr !important; }
  .topbar-right .user-avatar + div { display: none; }  /* cache nom user en topbar */
}

/* =========================================================================
   v24.6 — POLISH GLOBAL UX (ajuste l'affichage sur toutes les tailles d'ecran
   sans toucher aux templates individuels)
   ========================================================================= */

/* --- Breakpoints laptop/mobile — passage en 1 col uniquement si vraiment serre --- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
}
/* grid-2 et grid-2-1 restent en 2 col jusqu'a 900px (geres plus bas par le bloc mobile) */

/* --- Grids : permet aux colonnes de retrecir sans deborder --- */
.grid-2 > *, .grid-3 > *, .grid-2-1 > * { min-width: 0; }
/* --- grid-2-1 : équilibré 50/50 pour que les 2 colonnes aient la même largeur --- */
.grid-2-1 { grid-template-columns: 1fr 1fr !important; }

/* --- Content : interdit tout scroll horizontal au niveau page --- */
.main-content, .content { overflow-x: hidden; max-width: 100%; }

/* --- Widgets internes KPI/stats : auto-fit pour ne jamais depasser --- */
.content .stats,
.content [class*="grid-template-columns"]:not([style*="minmax"]) {
  min-width: 0;
}
.content .card .stats {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
  gap: 8px !important;
}

/* --- Boutons / pastilles dans en-tetes de widget : wrap propre --- */
.content .card-header { flex-wrap: wrap; gap: 8px; }
.content .card-header > * { min-width: 0; }

/* --- Textes longs dans les boutons : evite "Ouvrir le w..." tronque --- */
.content .btn { white-space: nowrap; }

/* --- Les colonnes de widgets internes doivent s'empiler si trop etroites --- */
@media (max-width: 1300px) {
  .content .card .grid-2 { grid-template-columns: 1fr !important; }
}

/* --- Cartes : coherence spacing + radius + ombre discrete --- */
.content .card {
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 39, .04);
  border: 1px solid var(--border-light, #E1E4EC);
  background: var(--bg-primary, #fff);
}
.content .card-header {
  padding: 2px 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light, #E1E4EC);
}
.content .card-header .card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--cvl-navy, #0F1D41);
  letter-spacing: .2px;
}
.content .card-header .card-subtitle {
  font-size: 11px;
  color: var(--text-secondary, #8A90A6);
  margin-top: 2px;
}

/* --- Textes longs : evite les debordements horizontaux --- */
.content .card strong,
.content .card .font-medium,
.content .card .font-semibold {
  overflow-wrap: break-word;
  word-break: normal;
}
.content td, .content th {
  overflow-wrap: break-word;
  max-width: 420px;
}

/* --- Pills uniformes --- */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}

/* --- Boutons : hauteur / alignement coherents --- */
.btn {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(.95); }
.btn:active { transform: translateY(1px); }
.btn.text-xs { min-height: 28px; padding: 4px 10px; font-size: 11.5px; }

/* --- Inputs/select/textarea : harmonie + focus accessible --- */
.content input[type="text"],
.content input[type="number"],
.content input[type="date"],
.content input[type="datetime-local"],
.content input[type="email"],
.content input[type="tel"],
.content input[type="search"],
.content select,
.content textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-light, #CBD5E1);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.content input:focus,
.content select:focus,
.content textarea:focus {
  outline: none;
  border-color: var(--cvl-orange, #F0804C);
  box-shadow: 0 0 0 3px rgba(240, 128, 76, .15);
}
.content label {
  display: block;
  font-size: 11.5px;
  color: var(--text-secondary, #64748b);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: none;
}

/* --- Tables : respiration + lignes alternees --- */
.content table th {
  background: var(--bg-secondary, #F8FAFC);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-secondary, #64748b);
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light, #E1E4EC);
}
.content table td {
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.content table tbody tr:hover { background: #F8FAFC; }
.content table tr.clickable { cursor: pointer; }
.content table tr.clickable:hover { background: #FFF7ED; }

/* --- Longs numeros / noms : evite le debordement de dossier/numero --- */
.content h1, .content h2, .content h3 {
  overflow-wrap: break-word;
  word-break: normal;
}

/* --- Topbar polish pro v24.7 --- */
.topbar {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%) !important;
  border-bottom: 1px solid #E1E4EC;
  box-shadow: 0 1px 3px rgba(15,29,65,.04);
  padding: 10px 20px !important;
}
.topbar .topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}
/* v24.7c : breadcrumb INLINE a cote du titre (meme ligne) sans separateur vertical */
.topbar .topbar-left #page-breadcrumb,
.topbar .topbar-left .breadcrumb {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .topbar-left #page-title,
.topbar .topbar-left h1 {
  flex: 0 0 auto;
}
.topbar .topbar-left #page-title,
.topbar .topbar-left h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100vw - 440px);
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0F1D41 !important;
  letter-spacing: -0.2px !important;
  margin: 0 !important;
  line-height: 1.2;
}
.topbar .topbar-left .breadcrumb,
.topbar .topbar-left #page-breadcrumb {
  display: block;
  width: 100%;
  font-size: 12px;
  color: #8A90A6;
  margin-top: 1px;
  font-weight: 500;
  letter-spacing: .1px;
  line-height: 1.3;
}
/* bouton retour pro : orange CVL au hover */
.topbar #cvl-btn-retour {
  background: #fff !important;
  color: #0F1D41 !important;
  border: 1px solid #E1E4EC !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  transition: all .15s !important;
  margin-right: 10px !important;
}
.topbar #cvl-btn-retour:hover {
  background: #F0804C !important;
  color: #fff !important;
  border-color: #F0804C !important;
  transform: translateX(-2px);
}
@media (max-width: 900px) {
  .topbar .topbar-left #page-title,
  .topbar .topbar-left h1 { max-width: calc(100vw - 200px); font-size: 15px !important; }
  .topbar .topbar-left .breadcrumb { font-size: 11px; }
}

/* --- Modal : largeur max + padding --- */
.modal-overlay .modal {
  border-radius: 10px;
  padding: 20px 22px;
  max-width: 92vw;
}
.modal-overlay .modal-header {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light, #E1E4EC);
}

/* --- Filtres pastilles (listes) : wrap sur petits ecrans --- */
.filters { flex-wrap: wrap; gap: 6px; }
.filter-pill {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light, #E1E4EC);
  background: #fff;
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-pill:hover { background: #F8FAFC; color: var(--cvl-navy, #0F1D41); }
.filter-pill.active {
  background: var(--cvl-navy, #0F1D41);
  color: #fff;
  border-color: var(--cvl-navy, #0F1D41);
}

/* --- Content zone : max-width pour ne pas s'etirer sur ecrans ultra-wide --- */
@media (min-width: 1800px) {
  .content, .main-content > .container, .main > .container {
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* --- Scrollbars sur Chrome/Edge : plus fines et discretes --- */
.content ::-webkit-scrollbar { width: 8px; height: 8px; }
.content ::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
.content ::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
.content ::-webkit-scrollbar-track { background: #F8FAFC; }

/* --- Empty states : plus propre --- */
.content .empty-state,
.content td.text-secondary[colspan] {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary, #8A90A6);
  font-style: italic;
  font-size: 13px;
}

/* --- Flex utilities : wrap par defaut pour eviter overflow --- */
.flex { flex-wrap: wrap; }
.flex.no-wrap { flex-wrap: nowrap; }

/* --- Textes secondaires : lisibilite --- */
.text-secondary { color: var(--text-secondary, #64748b); line-height: 1.5; }
.text-xs { font-size: 11.5px; line-height: 1.4; }

/* --- Dark mode : adaptations POLISH --- */
body.dark-mode .content .card { background: #1E2437; border-color: #2A3148; }
body.dark-mode .content table th { background: #272E44; color: #94A3B8; border-color: #2A3148; }
body.dark-mode .content table td { border-color: #272E44; }
body.dark-mode .content table tbody tr:hover { background: #272E44; }
body.dark-mode .content input,
body.dark-mode .content select,
body.dark-mode .content textarea { background: #272E44; color: #E5E7EB; border-color: #3A4260; }

/* --- Impression : nettoyage ambient --- */
@media print {
  .content .card { box-shadow: none !important; border: 1px solid #ddd !important; margin-bottom: 10px !important; }
}
