:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #ecfdf5;
  --primary-ring: rgba(16, 185, 129, 0.35);
  --secondary: #0f172a;
  --background: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #94a3b8;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --error: #dc2626;
  --error-light: #fef2f2;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { letter-spacing: -0.02em; color: var(--text); }

/* Icones (Material Symbols Outlined, plus fines que les Material Icons pleins) */
.material-icons {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 22;
}

#app { display: flex; min-height: 100vh; --admin-sidebar-w: 260px; }
#app.sidebar-collapsed { --admin-sidebar-w: 72px; }
#main-content { flex: 1; padding: 36px 40px; overflow-y: auto; }
#main-content.main-content-admin { margin-left: var(--admin-sidebar-w); transition: margin-left 0.18s var(--ease); }
#main-content.main-content-admin.with-sidebar { margin-left: calc(var(--admin-sidebar-w) + 260px); }

/* Sidebar admin (persistante, largeur reductible via --admin-sidebar-w) +
   sous-navigation projet - meme habillage visuel, deux rails fixes cote a
   cote quand un projet est ouvert. */
#sidebar-admin, #sidebar {
  position: fixed; top: 0; bottom: 0; width: 260px;
  background: var(--secondary); color: white; z-index: 100;
  display: flex; flex-direction: column;
}
#sidebar-admin { left: 0; z-index: 101; width: var(--admin-sidebar-w); transition: width 0.18s var(--ease); overflow: hidden; }
#sidebar { left: var(--admin-sidebar-w); border-left: 1px solid rgba(255,255,255,0.08); transition: left 0.18s var(--ease); }
#sidebar-admin.hidden, #sidebar.hidden { display: none; }

.sidebar-header {
  padding: 24px 22px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header .logo { width: 32px; height: 32px; flex-shrink: 0; cursor: pointer; }
.sidebar-header .brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }

.nav-menu { list-style: none; padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; }
.nav-item {
  padding: 11px 14px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; border-radius: var(--radius-sm); color: rgba(255,255,255,0.65);
  font-size: 13.5px; font-weight: 500; transition: background 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.95); }
.nav-item.active { background: rgba(16, 185, 129, 0.16); color: #ffffff; }
.nav-item .material-icons { font-size: 19px; opacity: 0.85; flex-shrink: 0; }
.nav-item.active .material-icons { opacity: 1; color: var(--primary); }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.sidebar-footer .btn { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.16); white-space: nowrap; }
.sidebar-footer .btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); color: white; }

/* Etat reduit : icones seules, centrees, textes masques (cliquer sur le
   logo en haut de la sidebar admin bascule cet etat, voir
   toggleSidebarAdminCollapse dans app.js). */
#app.sidebar-collapsed #sidebar-admin .brand,
#app.sidebar-collapsed #sidebar-admin .nav-label,
#app.sidebar-collapsed #sidebar-admin .sidebar-user {
  display: none;
}
#app.sidebar-collapsed #sidebar-admin .sidebar-header { justify-content: center; padding: 24px 0; }
#app.sidebar-collapsed #sidebar-admin .nav-item { justify-content: center; padding: 11px 0; }
#app.sidebar-collapsed #sidebar-admin .sidebar-footer .btn { justify-content: center; padding: 9px 0; }
.sidebar-user {
  font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.75);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn .material-icons { font-size: 18px; }

.btn-primary { background: var(--primary); color: #ffffff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #1e293b; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface); border-color: var(--border-strong); }

/* Fil d'ariane du devis mise en page : etape deja validee (vert clair,
   cliquable) vs etape jamais atteinte (grisee, non cliquable). */
.btn-step-visited { background: var(--primary-light); border-color: var(--primary-light); color: var(--primary); }
.btn-step-visited:hover { filter: brightness(0.97); }
.btn-step-disabled { opacity: 0.5; pointer-events: none; }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; }
.btn-icon { padding: 8px; border-radius: 50%; }

/* Cards */
.card {
  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); padding: 24px; transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 17px; font-weight: 650; }

.project-card { cursor: pointer; position: relative; }
.project-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.project-title { font-size: 15.5px; font-weight: 650; margin-bottom: 6px; color: var(--text); }
.project-artist { color: var(--text-light); font-size: 13.5px; margin-bottom: 16px; }
.project-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.project-meta span { display: flex; align-items: center; gap: 4px; }
.project-meta .material-icons { font-size: 15px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-light); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--background); transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-checkbox input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* Tables */
.table-container { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; text-align: center; border-bottom: 1px solid var(--border); }
.table th { background: transparent; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 1px solid var(--border-strong); }
.table tbody tr { transition: background 0.1s var(--ease); }
.table tbody tr:hover { background: var(--surface); }
.table .number { text-align: center; font-variant-numeric: tabular-nums; }
.table .total-row { font-weight: 600; background: var(--primary-light); }
.table .highlight { background: var(--primary-light); }
.table input {
  padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; font-size: 13px;
  width: 100%; background: transparent; transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.table input:hover { border-color: var(--border); }
.table input:focus { outline: none; border-color: var(--primary); background: var(--background); box-shadow: 0 0 0 3px var(--primary-ring); }
.table input[type="number"] { text-align: center; font-variant-numeric: tabular-nums; }

/* Modal */
.modal-container {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-container.hidden { display: none; }
.modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); }
.modal-content {
  position: relative; background: var(--background); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.18s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 17px; font-weight: 650; }
.modal-close { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-muted); border-radius: 6px; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.modal-close:hover { background: var(--surface); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* Home */
.home-header { text-align: center; margin-bottom: 36px; }
.home-header h1 { font-size: 30px; font-weight: 750; margin-bottom: 6px; }
.home-header p { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.home-actions { display: flex; justify-content: center; gap: 12px; margin-bottom: 36px; flex-wrap: wrap; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-state .material-icons { font-size: 56px; opacity: 0.4; margin-bottom: 18px; }
.empty-state h3 { color: var(--text); margin-bottom: 6px; font-weight: 650; }

/* Section pages */
.section-header { margin-bottom: 28px; }
.section-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.section-header p { color: var(--text-muted); font-size: 13.5px; font-weight: 500; }
.section-block { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); margin-bottom: 18px; overflow: hidden; }
.section-block-header {
  padding: 14px 20px; background: var(--surface); color: var(--text); font-weight: 650; font-size: 13.5px;
  border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}
.section-block-body { padding: 20px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-xs); }
.stat-card .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 10px; }
.stat-card .stat-value { font-size: 25px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat-card .stat-value.positive { color: var(--success); }
.stat-card .stat-value.negative { color: var(--error); }
.stat-card.highlight { background: var(--primary-light); border-color: rgba(16, 185, 129, 0.25); }
.stat-card.highlight .stat-label { color: var(--primary-dark); }
.stat-card.highlight .stat-value { color: var(--primary-dark); }

/* Toast */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px;
  min-width: 280px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 550;
  animation: slideIn 0.25s var(--ease);
}
.toast.success { background: var(--secondary); color: white; }
.toast.success .material-icons { color: #4ade80; }
.toast.error { background: var(--secondary); color: white; }
.toast.error .material-icons { color: #f87171; }
.toast.info { background: var(--secondary); color: white; }
.toast.info .material-icons { color: #60a5fa; }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading */
#loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 3000;
  gap: 14px;
}
#loading-overlay.hidden { display: none; }
#loading-overlay p { color: var(--text-muted); font-size: 13.5px; font-weight: 500; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Indicateur d'enregistrement automatique (remplace les boutons "Enregistrer") */
.save-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 500; color: var(--text-muted); min-width: 110px;
}
.save-status .material-icons { font-size: 16px; }
.save-status.saving { color: var(--text-light); }
.save-status.saved { color: var(--success); }
.save-status.error { color: var(--error); }
.save-status .material-icons.spin { animation: spin 0.8s linear infinite; }

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }

/* Bouton menu burger + fond d'assombrissement - bases masquees par defaut
   (desktop), rendues visibles par les media queries ci-dessous. Definies
   AVANT les media queries : a specificite egale, une regle plus tardive
   dans le fichier l'emporterait sinon meme a l'interieur d'une media query
   qui matche, et masquerait le bouton en permanence. */
.mobile-nav-toggle {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 200;
  width: 44px; height: 44px; align-items: center; justify-content: center;
  background: var(--secondary); color: white; border: none; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); cursor: pointer;
}
#mobile-nav-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 99;
}

@media (max-width: 768px) {
  #main-content { padding: 20px 14px; padding-top: 76px; }
  .home-actions { flex-direction: column; align-items: stretch; }
  .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  /* Champs en pleine largeur, y compris ceux avec une largeur fixe posee
     en style inline depuis le JS (filtres Annee/Statut/recherche, etc.) -
     !important necessaire pour passer devant l'inline style, cible
     uniquement le mobile donc aucun effet desktop. */
  /* .form-input-compact = champs volontairement etroits (associes a un
     suffixe/unite, ou a une autre valeur sur la meme ligne) ou les forcer
     en pleine largeur casserait la mise en page plutot que de l'ameliorer. */
  .form-input:not(.form-input-compact),
  .form-select:not(.form-input-compact),
  .form-textarea { width: 100% !important; max-width: 100%; }

  /* Boutons/zones tactiles >= ~44px, entetes qui ne debordent plus. */
  .btn { min-height: 44px; padding: 11px 16px; }
  .btn-sm { min-height: 40px; padding: 9px 14px; }
  .btn-icon { min-width: 44px; min-height: 44px; }
  .modal-close { padding: 10px; }
  .section-header.flex-between,
  .section-block-header,
  .flex-between,
  #param-tabs-nav { flex-wrap: wrap; gap: 10px; }

  /* Toasts pleine largeur (evite tout debordement sur un ecran <=360px). */
  #toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }

  /* KPIs/Dashboard : une seule colonne des que la largeur d'ecran ne
     permet plus d'accueillir meme une seule carte a sa largeur minimale. */
  .dashboard-grid, .stats-grid { grid-template-columns: 1fr; }
  .dashboard-donut-wrap { flex-direction: column; align-items: flex-start; }
}

/* Tablette + mobile : les sidebars (admin, sous-nav projet, artiste)
   deviennent des tiroirs ouverts via le bouton hamburger plutot que des
   rails fixes qui mangeraient une trop grande partie d'un ecran de 768 a
   1024px - le rendu desktop (>1024px) reste strictement identique a
   l'existant, aucune regle ici ne s'applique au-dessus de ce seuil. */
@media (max-width: 1024px) {
  .mobile-nav-toggle { display: flex; }
  #mobile-nav-backdrop { display: none; }
  #app.mobile-nav-open #mobile-nav-backdrop { display: block; }

  /* Le mode "reduit" (icones seules) n'a de sens que pour gagner de la
     place sur un rail desktop toujours visible - sur un tiroir mobile qui
     ne s'affiche que ponctuellement, on garde toujours les libelles. */
  #app.sidebar-collapsed { --admin-sidebar-w: 260px; }

  #sidebar-admin, #sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  #sidebar { z-index: 102; }

  /* #sidebar-artiste n'a pas de position fixe sur desktop (simple element
     flex a cote de #main-content) - uniquement a cette largeur on le fait
     sortir du flux pour le transformer en tiroir, sans toucher a son
     comportement desktop existant. */
  #sidebar-artiste {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  #app.mobile-nav-open #sidebar-admin,
  #app.mobile-nav-open #sidebar,
  #app.mobile-nav-open #sidebar-artiste {
    transform: translateX(0);
  }

  #main-content.main-content-admin,
  #main-content.main-content-admin.with-sidebar {
    margin-left: 0;
  }

  /* Tableaux : la grande majorite des tableaux de l'app sont places
     directement dans .section-block-body (ou .modal-body) sans wrapper
     dedie - plutot que d'ajouter .table-container partout cote JS, on
     rend ces conteneurs eux-memes defilants horizontalement, ce qui
     couvre tous les tableaux (avec ou sans wrapper) sans aucune modif JS. */
  .table-container,
  .section-block-body,
  .modal-body {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .table { min-width: max-content; }

  #planning-scroll-container, #dashboard-planning-scroll {
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile : les modales occupent tout l'ecran plutot qu'un encart centre -
   plus de place pour les formulaires, rien a faire cote JS. */
@media (max-width: 768px) {
  .modal-container { align-items: stretch; justify-content: stretch; }
  .modal-content {
    max-width: 100%; width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; display: flex; flex-direction: column; animation: none;
  }
  .modal-header, .modal-footer { flex-shrink: 0; }
  .modal-body { flex: 1; overflow-y: auto; }
  .modal-footer { flex-wrap: wrap; }
}

/* Section filtre */
.filter-section {
  background: var(--background);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: 28px;
}

/* Valeurs positives/négatives */
.stat-value.positive {
  color: var(--success);
}

.stat-value.negative {
  color: var(--error);
}

/* Cartes projets améliorées */
.project-card {
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

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

/* ========================================
   ECRAN DE CONNEXION (nouveau - remplace
   l'authentification implicite Google)
   ======================================== */
#login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.10), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.08), transparent 40%),
    var(--surface);
  padding: 20px;
}
#login-screen.hidden { display: none; }
.login-card {
  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px; width: 100%; max-width: 380px;
}
.login-logo { display: block; width: 64px; height: 64px; margin: 0 auto 16px; }
.login-card h1 { font-size: 21px; font-weight: 700; margin-bottom: 4px; text-align: center; }
.login-card p.login-subtitle { color: var(--text-muted); text-align: center; margin-bottom: 28px; font-size: 13.5px; font-weight: 500; }
.login-error {
  background: var(--error-light); color: var(--error); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px; font-weight: 500;
}
.login-error.hidden { display: none; }
#app.hidden { display: none; }

/* ========================================
   PLANNING GANTT (retroplanning fabrication)
   ======================================== */
#planning-scroll-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
}
.planning-grid { position: relative; min-width: max-content; }
.planning-header-row {
  display: flex; position: sticky; top: 0; z-index: 3; background: var(--background);
  border-bottom: 2px solid var(--text); height: 40px;
}
.planning-col-projet-header, .planning-col-projet {
  width: 220px; flex-shrink: 0; position: sticky; left: 0; z-index: 2;
  background: var(--background); border-right: 1px solid var(--border-strong);
  padding: 8px 12px; box-sizing: border-box;
}
.planning-col-projet-header { display: flex; align-items: flex-end; font-weight: 700; font-size: 13px; z-index: 4; }
.planning-mois-label {
  flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center;
  font-weight: 700; font-size: 12px; color: var(--text); padding-bottom: 6px;
  border-left: 1px solid var(--border);
}
.planning-row {
  display: flex; height: 78px; border-bottom: 1px solid var(--border);
}
.planning-col-projet { display: flex; flex-direction: column; justify-content: center; }
.planning-projet-titre {
  font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer;
}
.planning-projet-titre:hover { color: var(--primary); text-decoration: underline; }
.planning-projet-responsable { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.planning-col-grille { position: relative; flex-shrink: 0; }
.planning-weekend-col { position: absolute; top: 0; bottom: 0; background: var(--surface); }
.planning-barre {
  position: absolute; top: 14px; height: 24px; border-radius: 5px;
  box-shadow: var(--shadow-xs); cursor: pointer;
}
.planning-barre-label {
  position: absolute; bottom: 27px; left: 0; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; color: var(--text);
}
.planning-sortie-marqueur {
  position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--error); z-index: 1;
}
.planning-sortie-label {
  position: absolute; top: -2px; font-size: 9.5px; font-weight: 700; color: var(--error);
  white-space: nowrap; transform: translateX(-100%); padding-right: 4px;
}
.planning-filtre-liste { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.planning-filtre-liste label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.planning-responsable-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 8px 5px 14px; margin: 0 8px 8px 0; font-size: 13px;
}
.planning-responsable-chip button {
  background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; padding: 2px;
}
.planning-responsable-chip button:hover { color: var(--error); }

/* ========================================
   DASHBOARD ADMIN (page d'accueil)
   ======================================== */
.dashboard-greeting { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px; align-items: start; margin-bottom: 20px;
}
.dashboard-grid.dashboard-grid-full { grid-template-columns: 1fr; }

.dashboard-alert {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-radius: var(--radius-md); background: #fffbeb; border: 1px solid #fde68a;
  color: #92400e; margin-bottom: 20px;
}
.dashboard-alert .material-icons { font-size: 22px; color: #d97706; }
.dashboard-alert strong { font-weight: 700; }

.dashboard-quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

.dashboard-task-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.dashboard-task-item:last-child { border-bottom: none; }
.dashboard-task-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dashboard-task-titre { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-task-meta { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }

.dashboard-activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.dashboard-activity-item:last-child { border-bottom: none; }
.dashboard-activity-item .material-icons { font-size: 18px; color: var(--primary); margin-top: 1px; }
.dashboard-activity-texte { font-size: 13px; flex: 1; }
.dashboard-activity-date { font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }

.dashboard-donut-wrap { display: flex; align-items: center; gap: 24px; }
.dashboard-donut {
  width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
}
.dashboard-donut-legende { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.dashboard-donut-legende .legende-item { display: flex; align-items: center; gap: 8px; }
.dashboard-donut-legende .legende-dot { width: 12px; height: 12px; border-radius: 3px; }

.dashboard-empty { color: var(--text-muted); font-size: 13px; padding: 12px 0; }
