/* =========================================================
   CHANGEFLOW — DESIGN SYSTEM
   ========================================================= */
   @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

   /* --- SHARED (non-color) TOKENS --- */
   :root {
     --accent:        #6366f1;
     --accent-dim:    #4f46e5;
     --accent-glow:   rgba(99,102,241,0.25);
     --accent-soft:   rgba(99,102,241,0.12);

     --sidebar-w: 260px;
     --topbar-h: 64px;
     --ticker-text: var(--accent);

     --radius-sm: 6px;
     --radius-md: 10px;
     --radius-lg: 16px;
     --radius-xl: 20px;

     --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
   }

   /* --- DARK THEME (default) --- */
   [data-theme="dark"] {
     --ticker-text: #ffffff;
     --bg-base:       #0a0d14;
     --bg-elevated:   #111622;
     --bg-surface:    #161d2e;
     --bg-hover:      #1c2540;
     --border:        #1e2a42;
     --border-light:  #263252;

     --text-primary:  #f0f4ff;
     --text-secondary:#b0b8d1;
     --text-muted:    #718096;

     --shadow-card: 0 4px 24px rgba(0,0,0,0.35);
     --shadow-modal: 0 24px 80px rgba(0,0,0,0.6);

     --status-nouvelle-bg:   rgba(59,130,246,0.15);
     --status-nouvelle-text: #60a5fa;
     --status-acceptee-bg:   rgba(168,85,247,0.15);
     --status-acceptee-text: #c084fc;
     --status-encours-bg:    rgba(245,158,11,0.15);
     --status-encours-text:  #fbbf24;
     --status-traitee-bg:    rgba(16,185,129,0.15);
     --status-traitee-text:  #34d399;
     --status-rejetee-bg:    rgba(239,68,68,0.15);
     --status-rejetee-text:  #f87171;
   }

   /* --- LIGHT THEME --- */
   [data-theme="light"] {
     --bg-base:       #f3f4f6;
     --bg-elevated:   #ffffff;
     --bg-surface:    #e5e7eb;
     --bg-hover:      #d1d5db;
     --border:        #e5e7eb;
     --border-light:  #d1d5db;

     --text-primary:  #111827;
     --text-secondary:#4b5563;
     --text-muted:    #9ca3af;

     --shadow-card: 0 4px 12px rgba(0,0,0,0.08);
     --shadow-modal: 0 12px 40px rgba(0,0,0,0.15);

     --status-nouvelle-bg:   rgba(37,99,235,0.1);
     --status-nouvelle-text: #1d4ed8;
     --status-acceptee-bg:   rgba(147,51,234,0.1);
     --status-acceptee-text: #7e22ce;
     --status-encours-bg:    rgba(217,119,6,0.1);
     --status-encours-text:  #b45309;
     --status-traitee-bg:    rgba(5,150,105,0.1);
     --status-traitee-text:  #047857;
     --status-rejetee-bg:    rgba(220,38,38,0.1);
     --status-rejetee-text:  #b91c1c;
   }
      .sidebar-footer { 
      margin-top: auto; padding: 20px 24px; font-size: 0.7rem; color: var(--text-muted); 
      text-align: center; border-top: 1px solid var(--border-light); 
    }
    
    /* Content Area */
.reports-container {
  background: var(--bg-elevated);
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-top: 20px;
}
.report-settings {
  max-width: 800px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.report-settings .form-group {
  margin-bottom: 0;
}
.report-settings .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}
.report-settings .form-group select {
  width: 100%;
}
#monthSelectGroup, #quarterSelectGroup, #semesterSelectGroup {
  display: none; /* Controlled by JS via 'flex' or 'none' */
  flex-direction: column;
}
.report-preview {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- TOAST --- */
   /* --- RESET & BASE --- */
   *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
   html { font-size: 15px; scroll-behavior: smooth; }
   body {
     font-family: 'Inter', sans-serif;
     background: var(--bg-base);
     color: var(--text-primary);
     min-height: 100vh;
     display: flex;
     overflow-x: hidden;
   }
   
   /* =========================================================
      LOGIN OVERLAY
      ========================================================= */
   #loginOverlay {
     position: fixed;
     inset: 0;
     background: var(--bg-base);
     z-index: 9999;
     display: flex;
     align-items: center;
     justify-content: center;
     flex-direction: column;
   }
   .login-container {
     background: var(--bg-elevated);
     padding: 40px;
     border-radius: var(--radius-lg);
     border: 1px solid var(--border);
     width: 100%;
     max-width: 400px;
     box-shadow: var(--shadow-modal);
   }
    .login-logo {
      text-align: center;
      margin-bottom: 30px;
      font-size: 1.5rem;
      font-weight: 800;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
    }
    .logo-img {
      width: 42px;
      height: 42px;
      object-fit: contain;
      border-radius: var(--radius-sm);
    }
   .login-options { margin-top: 20px; font-size: 0.8rem; text-align: center; }
   .login-options a { color: var(--accent); cursor: pointer; text-decoration: none; }
   .login-options a:hover { text-decoration: underline; }

   /* =========================================================
      SERVICE TABS
      ========================================================= */
   .service-tabs {
     display: flex;
     gap: 10px;
     margin-bottom: 20px;
     border-bottom: 1px solid var(--border);
     padding-bottom: 10px;
     overflow-x: auto;
   }
   .service-tab {
     padding: 8px 16px;
     background: var(--bg-surface);
     border: 1px solid var(--border);
     border-radius: var(--radius-sm);
     color: var(--text-secondary);
     cursor: pointer;
     font-weight: 500;
     font-size: 0.85rem;
     white-space: nowrap;
     transition: all var(--transition);
   }
   .service-tab:hover {
     background: var(--bg-hover);
     color: var(--text-primary);
   }
   .service-tab.active {
     background: var(--accent-soft);
     color: var(--accent);
     border-color: var(--accent);
   }

   /* =========================================================
      SIDEBAR
      ========================================================= */
   .sidebar {
     width: var(--sidebar-w);
     background: var(--bg-elevated);
     border-right: 1px solid var(--border);
     display: flex;
     flex-direction: column;
     position: fixed;
     top: 0; left: 0; bottom: 0;
     z-index: 100;
     transition: transform var(--transition);
     overflow-y: auto;
     overflow-x: hidden;
   }
   .sidebar-logo {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 22px 20px 18px;
     border-bottom: 1px solid var(--border);
   }
    .logo-icon {
      width: 36px; height: 36px;
      background: #fff;
      border-radius: var(--radius-sm);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 0 15px rgba(0,0,0,0.1);
      overflow: hidden;
    }
    .logo-icon .logo-img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
   .logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
   
   .sidebar-nav {
     flex: 1;
     padding: 12px 10px;
     display: flex;
     flex-direction: column;
     gap: 2px;
   }
   .nav-section-label {
     font-size: 0.7rem;
     font-weight: 600;
     text-transform: uppercase;
     letter-spacing: 0.08em;
     color: var(--text-muted);
     padding: 16px 10px 6px;
   }
   .nav-item {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 9px 12px;
     border-radius: var(--radius-sm);
     border: none;
     background: transparent;
     color: var(--text-secondary);
     font-size: 0.875rem;
     font-weight: 500;
     cursor: pointer;
     transition: all var(--transition);
     width: 100%;
     text-align: left;
     font-family: inherit;
   }
   .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
   .nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
   .nav-item.active { background: var(--accent-soft); color: var(--accent); }
   
   .sidebar-footer {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 16px 18px;
     border-top: 1px solid var(--border);
   }
   .user-profile {
     display: flex;
     align-items: center;
     gap: 10px;
     cursor: pointer;
     padding: 4px;
     border-radius: var(--radius-sm);
     transition: background var(--transition);
     flex: 1;
   }
   .user-profile:hover {
     background: var(--bg-hover);
   }
   .user-avatar {
     width: 34px; height: 34px;
     border-radius: 50%;
     background: linear-gradient(135deg, var(--accent), #818cf8);
     display: flex; align-items: center; justify-content: center;
     font-size: 0.75rem; font-weight: 700; color: #fff;
     flex-shrink: 0;
   }
   .user-info { display: flex; flex-direction: column; }
   .user-name { font-size: 0.8rem; font-weight: 600; }
   .user-role { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
   .logout-btn {
     background: none; border: none; color: var(--text-muted); cursor: pointer;
     transition: color var(--transition);
   }
   .logout-btn:hover { color: #f87171; }
   
   /* =========================================================
      MAIN CONTENT
      ========================================================= */
   .app-container {
     display: flex;
     width: 100%;
   }
   .main-content {
     margin-left: var(--sidebar-w);
     flex: 1;
     min-height: 100vh;
     display: flex;
     flex-direction: column;
   }
   
   /* TOPBAR */
   .topbar {
     height: var(--topbar-h);
     background: var(--bg-elevated);
     border-bottom: 1px solid var(--border);
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 0 28px;
     position: sticky;
     top: 0;
     z-index: 50;
     gap: 16px;
   }
   .topbar-left { display: flex; align-items: center; gap: 16px; }
   .menu-toggle {
     display: none;
     flex-direction: column;
     gap: 5px;
     background: none;
     border: none;
     cursor: pointer;
     padding: 4px;
   }
   .menu-toggle span {
     display: block;
     width: 22px; height: 2px;
     background: var(--text-secondary);
     border-radius: 2px;
     transition: var(--transition);
   }
    .breadcrumb { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }
    
    .topbar-center {
      flex: 1;
      display: flex;
      justify-content: center;
      overflow: hidden;
      max-width: 400px;
      margin: 0 auto;
    }
    .ticker-wrap {
      width: 100%;
      background: var(--accent-soft);
      border: 1px solid var(--accent-border);
      border-radius: 20px;
      padding: 4px 15px;
      overflow: hidden;
      white-space: nowrap;
      position: relative;
    }
    .ticker-content {
      display: inline-block;
      padding-left: 100%;
      animation: ticker-scroll 15s linear infinite;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--ticker-text);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    @keyframes ticker-scroll {
      0% { transform: translateX(0); }
      100% { transform: translateX(-100%); }
    }
   .topbar-right { display: flex; align-items: center; gap: 12px; }
   .search-box {
     display: flex;
     align-items: center;
     gap: 8px;
     background: var(--bg-surface);
     border: 1px solid var(--border);
     border-radius: var(--radius-sm);
     padding: 7px 12px;
     transition: var(--transition);
   }
   .search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
   .search-box svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
   .search-box input {
     background: none; border: none; outline: none;
     color: var(--text-primary); font-size: 0.875rem; width: 200px; font-family: inherit;
   }
   .search-box input::placeholder { color: var(--text-muted); }
   
   .notif-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition); background: var(--bg-surface); border: 1px solid var(--border); }
   .notif-btn:hover { background: var(--bg-hover); transform: translateY(-1px); }
   .notif-btn svg { width: 18px; height: 18px; color: var(--text-secondary); }
   .notif-badge { 
     position: absolute; top: -4px; right: -4px; 
     background: #f87171; color: white; 
     font-size: 0.65rem; font-weight: 700; 
     min-width: 16px; height: 16px; border-radius: 10px; 
     display: flex; align-items: center; justify-content: center; 
     padding: 0 4px; border: 2px solid var(--bg-body);
     z-index: 10;
   }

   /* Notif Dropdown */
   .notif-dropdown {
     position: absolute; top: calc(100% + 12px); right: 0;
     width: 340px; background: var(--bg-elevated); border: 1px solid var(--border);
     border-radius: var(--radius-xl); box-shadow: var(--shadow-2xl); z-index: 1000;
     display: none; flex-direction: column; animation: slideDown 0.3s ease;
   }
   .notif-dropdown.open { display: flex; }

   /* GENERIC CLOSE BUBBLE FOR ALL MODALS / POPUPS */
   .close-bubble {
     position: absolute; top: -12px; left: -12px;
     width: 28px; height: 28px;
     background: var(--accent); border: 2px solid white; color: white; cursor: pointer;
     display: flex; align-items: center; justify-content: center;
     border-radius: 50%; transition: all var(--transition); z-index: 1010;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
   }
   .close-bubble:hover { background: #ef4444; border-color: #ef4444; transform: scale(1.15); }
   .close-bubble svg { width: 14px; height: 14px; stroke-width: 3.5; }

   .notif-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
   .notif-header span { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
   .notif-clear { background: none; border: none; color: var(--accent); font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: color var(--transition); }
   .notif-clear:hover { color: var(--accent-light); }
   
   .notif-list { max-height: 360px; overflow-y: auto; }
   .notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
   .notif-item:hover { background: var(--bg-hover); }
   .notif-item:last-child { border-bottom: none; }
   .notif-item-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; color: var(--text-primary); }
   .notif-item-desc { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; }
   .notif-item-time { font-size: 0.65rem; color: var(--text-muted); margin-top: 4px; }
   .notif-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 0.8rem; }
   
   @keyframes slideDown {
     from { opacity: 0; transform: translateY(-10px); }
     to { opacity: 1; transform: translateY(0); }
   }
   
   /* =========================================================
      BUTTONS
      ========================================================= */
   .btn-primary {
     display: inline-flex; align-items: center; gap: 6px;
     padding: 9px 18px; background: linear-gradient(135deg, var(--accent), #818cf8);
     border: none; border-radius: var(--radius-sm); color: #fff;
     font-size: 0.875rem; font-weight: 600; cursor: pointer;
     transition: all var(--transition); font-family: inherit; white-space: nowrap;
   }
   .btn-primary svg { width: 16px; height: 16px; }
   .btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
   
   .btn-secondary {
     background: var(--bg-surface); color: var(--text-primary);
     border: 1px solid var(--border);
   }
   .btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }
   
   .btn-ghost {
     display: inline-flex; align-items: center; gap: 6px;
     padding: 8px 14px; background: transparent; border: 1px solid var(--border-light);
     border-radius: var(--radius-sm); color: var(--text-secondary);
     font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all var(--transition); font-family: inherit;
   }
   .btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
   .btn-ghost.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
   
   .btn-link { background: none; border: none; color: var(--accent); font-size: 0.875rem; font-weight: 500; cursor: pointer; font-family: inherit; transition: opacity var(--transition); }
   .btn-link:hover { opacity: 0.8; }
   
   .btn-danger {
     background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3);
     border-radius: var(--radius-sm); padding: 6px 12px; font-size: 0.8rem;
     cursor: pointer; font-family: inherit; transition: all var(--transition);
   }
   .btn-danger:hover { background: rgba(239,68,68,0.25); }
   
   /* =========================================================
      VIEWS & KPI
      ========================================================= */
   .view-container { flex: 1; }
   .view { display: none; padding: 32px 32px 60px; animation: fadeIn 0.3s ease; }
   .view.active { display: block; }
   @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
   
   .view-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }
   .view-header-left h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
   .view-header-left p { color: var(--text-secondary); font-size: 0.9rem; }
   
   .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
   .kpi-card {
     background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
     padding: 20px 22px; display: flex; align-items: center; gap: 16px; transition: all var(--transition); position: relative; overflow: hidden;
   }
   .kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
   .kpi-icon { width: 46px; height: 46px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
   .kpi-icon svg { width: 22px; height: 22px; }
   
   .kpi-total .kpi-icon { background: var(--accent-soft); color: var(--accent); }
   .kpi-open .kpi-icon { background: rgba(251,191,36,0.12); color: #fbbf24; }
   .kpi-done .kpi-icon { background: rgba(16,185,129,0.12); color: #10b981; }
   .kpi-rate .kpi-icon { background: rgba(168,85,247,0.12); color: #c084fc; }
   
   .kpi-content { flex: 1; }
   .kpi-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 2px; }
   .kpi-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
   
   .charts-row { display: flex; gap: 16px; margin-bottom: 32px; align-items: stretch; }
   .chart-card { flex: 1; min-width: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; display: flex; flex-direction: column; }
   .chart-card.list-card { flex: 1.5; padding: 22px 18px; }
   .action-required-list { flex: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 220px; padding-right: 4px; }
   .action-required-list::-webkit-scrollbar { width: 4px; }
   .action-required-list::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
   .ar-item { background: var(--bg-surface); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; transition: all var(--transition); }
   .ar-item:hover { border-color: var(--accent); transform: translateY(-1px); }
   .ar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.75rem; color: var(--text-muted); }
   .ar-title { font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; line-height: 1.3; color: var(--text-primary); }
   .ar-foot { font-size: 0.7rem; color: var(--text-secondary); text-align: right; }
   .ar-empty { text-align: center; padding: 30px; font-size: 0.85rem; color: var(--text-muted); }
   .chart-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 20px; color: var(--text-primary); }
   .donut-chart { display: flex; flex-direction: column; align-items: center; gap: 16px; }
   .donut-chart svg { width: 150px; height: 150px; }
   .donut-legend { display: flex; flex-direction: column; gap: 8px; width: 100%; }
   .legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
   .legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
   .legend-label { color: var(--text-secondary); flex: 1; }
   .legend-val { font-weight: 600; color: var(--text-primary); }
   .bar-chart { height: 160px; }
   .bar-chart svg { width: 100%; height: 100%; }
   
   .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
   .section-header h2 { font-size: 1rem; font-weight: 700; }
   
   /* USER SUMMARY SPECIFIC */
   .user-summary-content { flex: 1; display: flex; flex-direction: column; }
   .progress-bar-container { height: 12px; background: var(--border-light); border-radius: 6px; overflow: hidden; display: flex; }
   .progress-segment { height: 100%; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
   .summary-pills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: auto; }
   .summary-pill { 
     background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); 
     padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-secondary);
   }
   .summary-pill strong { color: var(--text-primary); font-size: 0.95rem; }
   .summary-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
   
   /* TAXONOMY EDITOR */
   .taxonomy-editor { display: flex; flex-direction: column; gap: 24px; padding-bottom: 40px; }
   .tax-service-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
   .tax-service-header { 
     background: var(--bg-surface); padding: 18px 24px; display: flex; justify-content: space-between; align-items: center;
     border-bottom: 1px solid var(--border);
   }
   .tax-service-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 10px; }
   .tax-service-body { padding: 18px 24px; }
   
   .tax-domaine-row { margin-bottom: 24px; border-left: 2px solid var(--border-light); padding-left: 20px; }
   .tax-domaine-row:last-child { margin-bottom: 0; }
   .tax-domaine-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
   .tax-domaine-header h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
   
   .tax-sd-list { display: flex; flex-wrap: wrap; gap: 8px; }
   .tax-sd-tag { 
     background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px; 
     padding: 6px 14px; font-size: 0.8rem; display: flex; align-items: center; gap: 8px;
   }
   .tax-sd-tag button { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; }
   .tax-sd-tag button:hover { color: #ef4444; }
   
   .action-btns-small { display: flex; gap: 8px; }
   .action-btns-small button { 
     background: none; border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px;
     font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
   }
   .action-btns-small button:hover { background: var(--bg-surface); color: var(--accent); border-color: var(--accent); }

    .btn-move { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; padding: 2px; }
    .btn-move:hover { color: var(--accent); }
    .btn-move:disabled { opacity: 0.2; cursor: default; }
    .action-group-small { display: flex; align-items: center; gap: 4px; }

   .btn-add-inline { 
     background: none; border: 1px dashed var(--accent); color: var(--accent); 
     border-radius: 20px; padding: 6px 14px; font-size: 0.8rem; cursor: pointer;
   }
   .btn-add-inline:hover { background: rgba(59,130,246,0.05); }

   /* =========================================================
      GUIDE UTILISATEUR
      ========================================================= */
   .guide-content { max-width: 800px; color: var(--text-primary); font-size: 0.9rem; line-height: 1.6; }
   .guide-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
   .guide-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
   .guide-h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
   .guide-p { margin-bottom: 12px; color: var(--text-secondary); }
   .guide-ul { padding-left: 20px; list-style-type: disc; color: var(--text-secondary); }
   .guide-ul li { margin-bottom: 8px; }
   .guide-ul li strong { color: var(--text-primary); font-weight: 600; }

   /* =========================================================
      TABLE & BADGES
      ========================================================= */
   .requests-table-wrap { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
   .requests-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
   .requests-table thead tr { background: var(--bg-surface); border-bottom: 1px solid var(--border); }
   .requests-table th { padding: 12px 16px; text-align: left; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); white-space: nowrap; }
   .requests-table th.sortable { cursor: pointer; }
   .requests-table th.sortable:hover { color: var(--text-secondary); }
   .requests-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
   .requests-table tbody tr:last-child td { border-bottom: none; }
   .requests-table tbody tr:hover { background: var(--bg-hover); }
   
   .req-id { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
   .req-title { font-weight: 500; color: var(--text-primary); cursor: pointer; }
   .req-title:hover { color: var(--accent); }
   .req-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
   
   .row-actions { display: flex; gap: 6px; opacity: 0; transition: opacity var(--transition); }
   tr:hover .row-actions { opacity: 1; }
   .action-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: none; cursor: pointer; background: transparent; color: var(--text-muted); transition: all var(--transition); }
   .action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
   .action-btn.danger:hover { background: rgba(239,68,68,0.15); color: #f87171; }
   
   .badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
   .badge-status-Nouvelle { background: var(--status-nouvelle-bg); color: var(--status-nouvelle-text); }
   .badge-status-Acceptée { background: var(--status-acceptee-bg); color: var(--status-acceptee-text); }
   .badge-status-En\ cours{ background: var(--status-encours-bg); color: var(--status-encours-text); }
   .badge-status-Traitée  { background: var(--status-traitee-bg); color: var(--status-traitee-text); }
   .badge-status-Rejetée  { background: var(--status-rejetee-bg); color: var(--status-rejetee-text); }
   
   .badge-service { font-size: 0.72rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; background: rgba(129,140,248,0.12); color: #818cf8; }

   /* Priority indicators */
   .priority-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 500; }
   .priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
   .priority-Critique { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.4); }
   .priority-Haute { background: #fb923c; }
   .priority-Moyenne { background: #fbbf24; }
   .priority-Basse { background: #94a3b8; }
   .priority-text { color: var(--text-secondary); }
   
   .filters-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
   .filter-group { display: flex; flex-direction: column; gap: 5px; }
   .filter-group label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
   .filter-group select {
     background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
     color: var(--text-primary); font-size: 0.85rem; padding: 7px 12px; cursor: pointer; outline: none;
     appearance: none; background-image: url("data:image/svg+xml,..."); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
   }
   
   .pagination { display: flex; justify-content: center; gap: 6px; padding: 20px 0; }
   .page-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); cursor: pointer; }
   .page-btn:hover, .page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
   
   /* =========================================================
      MODAL / FORMS
      ========================================================= */
   .modal-overlay {
     position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200;
     display: flex; align-items: center; justify-content: center; padding: 20px;
     opacity: 0; pointer-events: none; transition: opacity 0.25s ease; backdrop-filter: blur(4px);
   }
   .modal-overlay.open { opacity: 1; pointer-events: all; }
   .modal {
     background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: var(--radius-xl);
     width: 100%; max-width: 680px; max-height: 92vh; display: flex; flex-direction: column; overflow: visible; position: relative;
     box-shadow: var(--shadow-modal); transform: scale(0.95) translateY(20px); transition: transform 0.25s;
   }
   .modal-overlay.open .modal { transform: scale(1) translateY(0); }
   .modal-header { display: flex; justify-content: space-between; padding: 24px 28px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-elevated); z-index: 2; }
   .modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; }
   .modal-close:hover { color: var(--text-primary); }
   .modal-form { padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; flex: 1; }
   .modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 28px 24px; border-top: 1px solid var(--border); }
   
   .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
   .form-group { display: flex; flex-direction: column; gap: 6px; }
   .form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
   .required { color: var(--accent); }
   .form-group input, .form-group select, .form-group textarea {
     background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
     color: var(--text-primary); font-size: 0.875rem; padding: 9px 13px; outline: none; font-family: inherit;
   }
   .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
   .form-group input[readonly] { opacity: 0.7; cursor: not-allowed; }

   /* =========================================================
      DETAIL PANEL
      ========================================================= */
    .detail-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; display: flex; justify-content: flex-end; padding: 40px 0; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
    .detail-overlay.open { opacity: 1; pointer-events: all; }
    .detail-panel { 
      width: 850px; max-width: 95vw; background: var(--bg-elevated); border: 1px solid var(--border); 
      height: calc(100% - 80px); position: relative; overflow: visible; transform: translateX(100%); 
      transition: transform 0.3s; display: flex; flex-direction: column; border-top-left-radius: var(--radius-xl); border-bottom-left-radius: var(--radius-xl); 
    }
   .detail-overlay.open .detail-panel { transform: translateX(0); }
   .detail-header { display: flex; padding: 20px; border-bottom: 1px solid var(--border); justify-content: space-between; z-index: 10; background: var(--bg-elevated); }
   .detail-body { padding: 22px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
   .detail-title { font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
   .detail-badges { display: flex; gap: 8px; flex-wrap: wrap; }
   .detail-section-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
   .detail-section-value { font-size: 0.875rem; color: var(--text-secondary); }
   .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
   .detail-field label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; display: block; margin-bottom: 4px; }
   .detail-field span { font-size: 0.875rem; font-weight: 500; }
   .detail-divider { height: 1px; background: var(--border); }
   
   /* =========================================================
      TOAST
      ========================================================= */
   .toast { position: fixed; bottom: 28px; right: 28px; z-index: 40000; background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 13px 20px; font-size: 0.875rem; font-weight: 500; transform: translateY(20px); opacity: 0; transition: all 0.3s; pointer-events: none; display: flex; align-items: center; gap: 10px; }
   .toast.show { transform: translateY(0); opacity: 1; }
   .toast.success { border-left: 3px solid #10b981; }
   .toast.error   { border-left: 3px solid #ef4444; }
   .toast.info    { border-left: 3px solid var(--accent); }
   
   /* =========================================================
      CUSTOM PRODUCT SEARCHABLE SELECT
      ========================================================= */
   .product-select { position: relative; }
   .product-select-trigger {
     display: flex; align-items: center; justify-content: space-between;
     background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
     color: var(--text-primary); font-size: 0.875rem; padding: 9px 13px;
     cursor: pointer; transition: border-color var(--transition); user-select: none;
   }
   .product-select-trigger:hover, .product-select-trigger:focus { border-color: var(--accent); outline: none; }
   .product-select-trigger svg { flex-shrink: 0; color: var(--text-muted); transition: transform var(--transition); }
   .product-select.open .product-select-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
   .product-select.open .product-select-trigger svg { transform: rotate(180deg); }

   .product-select-dropdown {
     display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 300;
     background: var(--bg-elevated); border: 1px solid var(--border-light);
     border-radius: var(--radius-md); box-shadow: var(--shadow-modal);
     overflow: hidden;
   }
   .product-select.open .product-select-dropdown { display: block; }

   .product-search-wrap {
     display: flex; align-items: center; gap: 8px;
     padding: 10px 12px; border-bottom: 1px solid var(--border);
     background: var(--bg-surface);
   }
   .product-search-wrap svg { flex-shrink: 0; color: var(--text-muted); }
   .product-search-wrap input {
     flex: 1; background: none; border: none; outline: none;
     color: var(--text-primary); font-size: 0.875rem; font-family: inherit;
   }
   .product-search-wrap input::placeholder { color: var(--text-muted); }

   .product-select-list {
     list-style: none; max-height: 240px; overflow-y: auto;
     padding: 6px 0;
   }
   .product-select-list::-webkit-scrollbar { width: 6px; }
   .product-select-list::-webkit-scrollbar-track { background: transparent; }
   .product-select-list::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
   .product-select-list li {
     padding: 9px 14px; font-size: 0.85rem; cursor: pointer;
     color: var(--text-primary); transition: background var(--transition);
     white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
   }
   .product-select-list li:hover { background: var(--bg-hover); }
   .product-select-list li.selected { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
   .product-select-list li.active-kb { background: var(--bg-hover); outline: 1px solid var(--accent); }
   .product-select-list li.no-result { color: var(--text-muted); font-style: italic; cursor: default; }
   .product-select-list li.no-result:hover { background: none; }

   /* =========================================================
      FILE ATTACHMENTS
      ========================================================= */
   .drop-zone {
     border: 2px dashed var(--border-light); border-radius: var(--radius-md);
     padding: 22px 16px; display: flex; flex-direction: column; align-items: center;
     gap: 6px; color: var(--text-muted); font-size: 0.85rem; cursor: pointer;
     transition: all var(--transition); text-align: center;
   }
   .drop-zone:hover, .drop-zone.drag-over {
     border-color: var(--accent); background: var(--accent-soft); color: var(--text-secondary);
   }
   .drop-zone svg { color: var(--text-muted); transition: color var(--transition); }
   .drop-zone:hover svg, .drop-zone.drag-over svg { color: var(--accent); }
   .drop-zone small { font-size: 0.72rem; color: var(--text-muted); }
   .drop-zone-link { color: var(--accent); cursor: pointer; text-decoration: underline; }

   .attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
   .attachment-chip {
     display: inline-flex; align-items: center; gap: 6px;
     background: var(--bg-surface); border: 1px solid var(--border);
     border-radius: 20px; padding: 4px 10px 4px 8px;
     font-size: 0.75rem; max-width: 200px;
   }
   .attachment-chip-icon { font-size: 1rem; flex-shrink: 0; }
   .attachment-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
   .attachment-chip-size { color: var(--text-muted); flex-shrink: 0; }
   .attachment-chip-del {
     background: none; border: none; color: var(--text-muted); cursor: pointer;
     font-size: 1rem; line-height: 1; padding: 0; flex-shrink: 0; transition: color var(--transition);
   }
   .attachment-chip-del:hover { color: #f87171; }

   .attachment-chip.with-preview { padding-left: 4px; }
   .chip-preview { width: 32px; height: 32px; border-radius: 4px; overflow: hidden; cursor: pointer; flex-shrink: 0; border: 1px solid var(--border); position: relative; z-index: 10; pointer-events: auto; display: block; }
   .chip-preview img { width: 100%; height: 100%; object-fit: cover; }
   .attachment-chip-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color var(--transition); text-decoration: none; }
   .attachment-chip-btn:hover { color: var(--accent); }

   /* Detail panel attachments */
   .detail-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
   .detail-attach-item {
     display: inline-flex; align-items: center; gap: 6px;
     background: var(--bg-surface); border: 1px solid var(--border);
     border-radius: var(--radius-sm); padding: 6px 12px;
     font-size: 0.78rem; cursor: pointer; text-decoration: none; color: var(--text-secondary);
     transition: all var(--transition); max-width: 220px;
   }
   .detail-attach-item:hover { border-color: var(--accent); color: var(--accent); }
   .detail-attach-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

   /* COMMENTS SECTION */
   .comments-section { margin-top: 20px; }
   .comments-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
   .comment-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-surface); border: 1px solid var(--border); width: 100%; box-sizing: border-box; }
   .comment-item.own { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); }
   .comment-header { display: flex; justify-content: space-between; font-size: 0.72rem; }
   .comment-user { font-weight: 700; color: var(--text-primary); }
   .comment-at { color: var(--text-muted); }
   .comment-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; }
   
   .comment-input-wrap { display: flex; gap: 8px; margin-top: 12px; }
   .comment-input { flex: 1; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 0.85rem; color: var(--text-primary); resize: none; transition: border-color var(--transition); }
   .comment-input:focus { border-color: var(--accent); outline: none; }
   .comment-send { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: none; background: var(--accent); color: white; cursor: pointer; transition: transform 0.2s ease; }
   .comment-send:hover { transform: scale(1.05); }

   /* IMAGE PREVIEWS */
   .image-preview-card {
     width: 100px; height: 100px;
     border-radius: var(--radius-sm); border: 1px solid var(--border);
     overflow: hidden; cursor: pointer; position: relative;
     background: var(--bg-surface);
   }
   .image-preview-card img { width: 100%; height: 100%; object-fit: cover; }
   .image-preview-overlay {
     position: absolute; inset: 0; background: rgba(0,0,0,0.4);
     display: flex; align-items: center; justify-content: center;
     opacity: 0; transition: opacity var(--transition); color: white;
   }
   .image-preview-card:hover .image-preview-overlay { opacity: 1; }

   /* LIGHTBOX (PhotoSnap) */
   .lightbox-overlay {
     position: fixed; inset: 0; background: rgba(0,0,0,0.92);
     z-index: 10000; display: none; align-items: center; justify-content: center;
     padding: 40px; backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.3s ease;
   }
   .lightbox-overlay.open { display: flex; opacity: 1; pointer-events: all; }
   .lightbox-content { position: relative; max-width: 90%; max-height: 90%; display: flex; flex-direction: column; align-items: center;}
   .lightbox-content img { max-width: 100%; max-height: 85vh; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1); object-fit: contain; }
   .lightbox-close { position: absolute; top: -40px; right: 0px; color: white; background: none; border: none; cursor: pointer; display: flex; padding: 4px; border-radius: 50%; transition: background 0.2s;}
   .lightbox-close:hover { background: rgba(255,255,255,0.1); }

   @media (max-width: 768px) {
     .sidebar { transform: translateX(-100%); }
     .sidebar.open { transform: translateX(0); }
     .main-content { margin-left: 0; }
     .menu-toggle { display: flex; }
     .kpi-grid { grid-template-columns: 1fr 1fr; }
   }
   
   /* =========================================================
      USER MANAGEMENT BADGES & STATUS
      ========================================================= */
    .role-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; }
    .role-admin { background: rgba(239,68,68,0.15); color: #f87171; }
    .role-manager { background: rgba(245,158,11,0.15); color: #fbbf24; }
    .role-user { background: rgba(59,130,246,0.15); color: #60a5fa; }
    
   /* =========================================================
      PROFILE MODAL
      ========================================================= */
   .avatar-preview {
     width: 80px; height: 80px; border-radius: 50%;
     background: var(--bg-hover); display: flex; align-items: center; justify-content: center;
     overflow: hidden; margin-bottom: 10px; border: 2px solid var(--border);
   }
   .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
   .avatar-preview span { font-size: 1.5rem; font-weight: 700; color: var(--text-secondary); }

    /* =========================================================
       MSGBOX OVERRIDES (MUST BE LAST)
       ========================================================= */
    .msgbox-overlay { 
      z-index: 30000 !important; 
      background: rgba(0,0,0,0.8) !important; 
      backdrop-filter: blur(8px) !important; 
    }
    .msgbox-modal { 
       overflow: visible !important; 
      max-width: 400px; 
      border-radius: var(--radius-xl); 
      transform: translateY(-30px) scale(0.95); 
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 
      text-align: center;
    }
    .msgbox-overlay.open .msgbox-modal { transform: translateY(0) scale(1); }
    .msgbox-modal .modal-header { padding: 25px 20px 10px; border-bottom: none; }
    .msgbox-modal .modal-header h3 { font-size: 1.25rem; color: var(--text-primary); width: 100%; }
    .msgbox-modal .modal-form { padding: 20px; }
    .msgbox-modal .modal-footer { padding: 15px 20px 25px; border-top: none; display: flex; justify-content: center; gap: 12px; }
    .msgbox-modal .btn-cancel { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 6px 14px; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
    .msgbox-modal .btn-cancel:hover { background: var(--bg-surface); }

/* ============================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ============================================================ */

/* TABLETS & MOBILES (< 1024px) */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .charts-row {
        flex-direction: column;
    }
}

/* SMARTPHONES (< 768px) */
@media (max-width: 768px) {
    /* Layout Adjustments */
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -260px; /* Hide by default */
        top: 0;
        bottom: 0;
        z-index: 2000;
        transition: all 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        left: 0;
    }

    /* Sidebar toggle button (Burger) visibility */
    .menu-toggle {
        display: flex !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 10px;
    }

    .topbar {
        padding: 0 15px;
        height: 60px;
    }
    
    .topbar-right .btn-primary span { display: none; } /* Hide text on small buttons */
    .breadcrumb { display: none; } /* Breadcrumb occupies too much space */

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* TABLE TO CARDS (MAGIC TRICK) */
    .requests-table thead {
        display: none; /* Hide real headers */
    }

    .requests-table, .requests-table tbody, .requests-table tr, .requests-table td {
        display: block;
        width: 100%;
    }

    .requests-table tr {
        margin-bottom: 15px;
        border-radius: var(--radius-md);
        background: var(--bg-surface);
        border: 1px solid var(--border);
        padding: 10px;
        position: relative;
    }

    .requests-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none !important;
        margin-bottom: 5px;
        font-size: 0.85rem;
    }

    /* Add labels before values */
    .requests-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.7rem;
    }

    /* Detail / Modal adjustments */
    .modal {
        width: 95% !important;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Ticker adjustments */
    .ticker-wrap {
        font-size: 0.75rem;
    }
}

/* VERY SMALL PHONES (< 480px) */
@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .topbar-right .search-box {
        display: none; /* Search via topbar occupies too much space */
    }
}
