/* ============================================================
   Campus 26 — Design System
   Police : Syne (titres) + DM Sans (corps)
   Thème : Bleu nuit professionnel avec accents ardoise
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:          #0f1117;
  --bg-2:        #161b27;
  --bg-3:        #1e2535;
  --border:      #2a3347;
  --border-light:#313d55;

  --text:        #e8ecf4;
  --text-2:      #8b96ad;
  --text-3:      #5a6480;

  --blue:        #3b82f6;
  --blue-dark:   #1d4ed8;
  --blue-light:  #93c5fd;
  --blue-glow:   rgba(59,130,246,0.15);

  --green:       #22c55e;
  --green-bg:    rgba(34,197,94,0.12);
  --red:         #ef4444;
  --red-bg:      rgba(239,68,68,0.12);
  --orange:      #f97316;
  --orange-bg:   rgba(249,115,22,0.12);
  --yellow:      #eab308;
  --yellow-bg:   rgba(234,179,8,0.12);

  --sidebar-w:   260px;
  --topbar-h:    60px;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   16px;

  --shadow:      0 4px 24px rgba(0,0,0,0.35);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.25);

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --transition:  0.18s ease;
}

[data-theme="light"] {
  --bg:          #f0f2f7;
  --bg-2:        #ffffff;
  --bg-3:        #e8ecf4;
  --border:      #d8dee9;
  --border-light:#c5cdd9;

  --text:        #111827;
  --text-2:      #4b5563;
  --text-3:      #9ca3af;

  --blue-glow:   rgba(59,130,246,0.1);
  --green-bg:    rgba(34,197,94,0.1);
  --red-bg:      rgba(239,68,68,0.1);
  --orange-bg:   rgba(249,115,22,0.1);
  --yellow-bg:   rgba(234,179,8,0.1);

  --shadow:      0 4px 24px rgba(0,0,0,0.08);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.06);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-light); }

/* ── Layout ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(2px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 24px;
  background: var(--blue-glow);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  display: grid; place-items: center;
}

.logo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.logo-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 1px;
}

.sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  font-size: 1.1rem; padding: 4px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  margin: 12px;
  border-radius: var(--radius);
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px 6px;
}

.nav-section + .nav-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.nav-section + .nav-section .nav-section-label {
  padding-top: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

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

.nav-link.active {
  background: var(--blue-glow);
  color: var(--blue-light);
  border: 1px solid rgba(59,130,246,0.3);
}

.nav-icon {
  font-size: 0.55rem;
  opacity: 0.5;
}

.nav-link.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.nav-logout { color: var(--text-3); }
.nav-logout:hover { background: var(--red-bg); color: var(--red); }

/* ── Main Wrapper ──────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.topbar-burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: var(--transition);
}

.topbar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.notif-btn {
  position: relative;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-2);
  transition: var(--transition);
}

.notif-btn:hover { border-color: var(--blue); color: var(--blue-light); }

.notif-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: grid; place-items: center;
  padding: 0 4px;
}

.notif-badge[hidden] {
  display: none !important;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 28px 28px 40px;
  max-width: 1200px;
  width: 100%;
}

/* ── Flash Messages ────────────────────────────────────────── */
.flash-container { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

.flash-success { background: var(--green-bg); border: 1px solid var(--green); color: #86efac; }
.flash-danger  { background: var(--red-bg);   border: 1px solid var(--red);   color: #fca5a5; }
.flash-warning { background: var(--yellow-bg); border: 1px solid var(--yellow); color: #fde68a; }
.flash-info    { background: var(--blue-glow); border: 1px solid var(--blue);   color: var(--blue-light); }

[data-theme="light"] .flash-success { color: #15803d; }
[data-theme="light"] .flash-danger  { color: #b91c1c; }
[data-theme="light"] .flash-warning { color: #a16207; }
[data-theme="light"] .flash-info    { color: #1d4ed8; }
[data-theme="light"] .catchup-ok      { color: #15803d; }
[data-theme="light"] .catchup-partial { color: #b45309; }

.flash-close {
  background: none; border: none;
  color: inherit; cursor: pointer;
  opacity: 0.6; font-size: 0.8rem;
}
.flash-close:hover { opacity: 1; }

.flash-toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: calc(var(--sidebar-w) + 28px);
  right: 28px;
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.flash-toast-container .flash {
  pointer-events: auto;
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  .flash-toast-container {
    left: 16px;
    right: 16px;
  }
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-urgent {
  border-color: rgba(249,115,22,0.4);
  box-shadow: 0 0 0 1px rgba(249,115,22,0.1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── KPI Grid ──────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}

.kpi-card:hover { border-color: var(--border-light); }

.kpi-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.kpi-value {
  font-family: var(--font-body);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kpi-unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 4px;
}

.kpi-gain   { color: var(--green); }
.kpi-recup  { color: var(--blue-light); }

.kpi-positive { border-color: rgba(34,197,94,0.3); }
.kpi-positive .kpi-value { color: var(--green); }
.kpi-negative { border-color: rgba(239,68,68,0.3); }
.kpi-negative .kpi-value { color: var(--red); }
.kpi-zero     { border-color: var(--border); }
.kpi-warning  { border-color: rgba(249,115,22,0.4); }

.kpi-bar {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
}

.kpi-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 2px;
  transition: width 0.6s ease;
}

.kpi-icon-bg {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  opacity: 0.06;
  font-family: var(--font-display);
  font-weight: 800;
  pointer-events: none;
}

/* ── Alert Expiration ─────────────────────────────────────── */
.alert-expiration {
  background: var(--orange-bg);
  border: 1px solid rgba(249,115,22,0.4);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease;
}

.alert-expiration-icon { font-size: 1.4rem; flex-shrink: 0; }

.alert-expiration strong { color: var(--orange); font-weight: 600; }
.alert-expiration p { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }

.expiry-chip {
  background: rgba(249,115,22,0.2);
  border: 1px solid rgba(249,115,22,0.4);
  color: #fdba74;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Section layout ────────────────────────────────────────── */
.section-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .section-row { grid-template-columns: 1fr; }
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

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

.table thead {
  background: var(--bg-3);
}

.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover td { background: var(--bg-3); }

.row-pending td { background: rgba(234,179,8,0.03); }
.row-refused td { background: rgba(239,68,68,0.03); }
.row-comment td { background: var(--bg-3); border-bottom: 1px solid var(--border); }

.comment-cell {
  font-size: 0.82rem;
  color: var(--text-3);
  padding: 8px 16px !important;
}

/* ── Badges ──────────────────────────────────────────────────  */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success  { background: var(--green-bg); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.badge-danger   { background: var(--red-bg);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-warning  { background: var(--yellow-bg); color: #fde68a; border: 1px solid rgba(234,179,8,0.3); }
.badge-info     { background: var(--blue-glow); color: var(--blue-light); border: 1px solid rgba(59,130,246,0.3); }
.badge-primary  { background: var(--blue-glow); color: var(--blue-light); border: 1px solid rgba(59,130,246,0.3); }
.badge-gain     { background: var(--green-bg); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.badge-recup    { background: var(--blue-glow); color: var(--blue-light); border: 1px solid rgba(59,130,246,0.3); }

[data-theme="light"] .badge-success,
[data-theme="light"] .badge-gain     { color: #15803d; border-color: rgba(21,128,61,0.35); }
[data-theme="light"] .badge-danger   { color: #b91c1c; border-color: rgba(185,28,28,0.35); }
[data-theme="light"] .badge-warning  { color: #a16207; border-color: rgba(161,98,7,0.35); }
[data-theme="light"] .badge-info,
[data-theme="light"] .badge-primary,
[data-theme="light"] .badge-recup    { color: #1d4ed8; border-color: rgba(29,78,216,0.35); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: white;
}

.btn-success {
  background: var(--green-bg);
  color: #86efac;
  border-color: rgba(34,197,94,0.4);
}
.btn-success:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.btn-danger {
  background: var(--red-bg);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.4);
}
.btn-danger:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--border-light); }

.btn-danger-ghost {
  color: #fca5a5;
  border-color: rgba(239,68,68,0.3);
}
.btn-danger-ghost:hover { background: var(--red); color: white; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; justify-content: center; }

.inline-form { display: inline; }
.action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.action-buttons .btn {
  margin-top: 0;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-page-wrapper {
  max-width: 680px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.card-body {
  padding: 22px 24px 24px;
}

.card-form .card-header {
  gap: 16px;
}

.card-form .card-body form {
  margin: 0;
}

.appearance-card .card-body {
  padding-top: 0;
}

.form-hint-spaced {
  margin-bottom: 12px;
}

.section-title,
.form-section-title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin: 0 0 16px;
  padding: 0;
  border: none;
  overflow: visible;
}

.section-title::after,
.form-section-title::after {
  content: '';
  display: block;
  margin-top: 10px;
  border-bottom: 1px solid var(--border);
}

.section-title-spaced {
  margin-top: 24px;
}

.settings-form,
.profile-form {
  padding: 0;
}

.card-body .empty-state {
  padding: 48px 24px;
}

.card-body form > div {
  margin-bottom: 18px;
}

.card-body form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 7px;
}

.card-body form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.card-body form select,
.card-body form textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.card-body form input:focus,
.card-body form select:focus,
.card-body form textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list dt {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-3);
}

.detail-list dd {
  margin: 0;
  color: var(--text);
}

.catchup-panel {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: var(--radius);
  background: rgba(249, 115, 22, 0.08);
}

.catchup-panel h3 {
  margin: 0;
}

.user-cell-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.text-success { color: #86efac; }
.text-danger { color: #fca5a5; }

.smtp-test-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input::placeholder { color: var(--text-3); }

.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.form-input-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea.form-input { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-hint {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 6px;
}

.form-hint-danger { color: #fca5a5; }
.form-hint-inline { font-weight: 300; color: var(--text-3); }

.required { color: var(--red); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-actions.form-actions-equal .btn {
  min-width: 12rem;
  height: 2.5rem;
  margin: 0;
  padding: 0 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  box-sizing: border-box;
  vertical-align: middle;
}

.form-actions.form-actions-equal button.btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix .form-input {
  padding-right: 36px;
}

.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 0.85rem;
  pointer-events: none;
}

.input-password-wrapper {
  position: relative;
}

.input-password-wrapper .form-input {
  padding-right: 44px;
}

.btn-show-pw {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; padding: 4px;
  color: var(--text-3);
  font-size: 1rem;
}

/* Type selector cards */
.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.type-selector-3 {
  grid-template-columns: repeat(3, 1fr);
}

a.type-option {
  text-decoration: none;
  color: inherit;
}

.type-option {
  cursor: pointer;
  display: flex;
}

.type-option input[type="radio"] {
  display: none;
}

.type-card {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  transition: all var(--transition);
}

.type-card:hover {
  border-color: var(--border-light);
  background: var(--bg-3);
}

.type-card.selected {
  border-color: var(--blue);
  background: var(--blue-glow);
}

.type-icon {
  font-size: 2rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-3);
  margin-bottom: 8px;
}

.type-card.selected .type-icon { color: var(--blue); }

.type-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.type-desc { font-size: 0.78rem; color: var(--text-3); }

/* Form check */
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-2);
}

.check-input { display: none; }

.check-custom {
  width: 18px; height: 18px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  background: var(--bg-3);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.check-input:checked + .check-custom {
  background: var(--blue);
  border-color: var(--blue);
}

.check-input:checked + .check-custom::after {
  content: '✓';
  font-size: 0.7rem;
  color: white;
  font-weight: 700;
}

.balance-pill {
  background: var(--blue-glow);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--blue-light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* ── Notifications ───────────────────────────────────────────── */
.notif-list {
  list-style: none;
  padding: 4px 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-3); }

.notif-unread { background: rgba(59,130,246,0.04); }

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-success .notif-dot { background: var(--green); }
.notif-danger  .notif-dot { background: var(--red); }
.notif-warning .notif-dot { background: var(--yellow); }
.notif-info    .notif-dot { background: var(--blue); }

.notif-msg { font-size: 0.85rem; color: var(--text-2); }
.notif-time { font-size: 0.72rem; color: var(--text-3); margin-top: 3px; display: block; }

/* Pulse dot */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(249,115,22,0); }
}

/* ── Employee Grid (Admin) ───────────────────────────────────── */
.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
  align-items: stretch;
}

.employee-card-link {
  text-decoration: none;
  display: flex;
  min-height: 0;
}

.employee-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  grid-template-rows: auto minmax(1.75rem, 1fr);
  gap: 6px 12px;
  align-items: start;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: all var(--transition);
}

.employee-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.employee-card-warn { border-color: rgba(249,115,22,0.3); }

.emp-avatar {
  grid-row: 1 / -1;
  align-self: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.emp-info {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.emp-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-email {
  font-size: 0.76rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-balance {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.balance-pos  { color: var(--green); }
.balance-neg  { color: var(--red); }
.balance-zero { color: var(--text-3); }

.emp-badges {
  grid-column: 2 / -1;
  grid-row: 2;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: flex-start;
  align-self: stretch;
  min-height: 1.75rem;
}

/* ── Employee Detail Header ──────────────────────────────────── */
.emp-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.emp-detail-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: white;
  flex-shrink: 0;
}

.emp-detail-info { flex: 1; }
.emp-detail-info h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }

.emp-detail-balance {
  text-align: right;
}

/* ── Profile ─────────────────────────────────────────────────── */
.profile-avatar-big {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

/* ── User Cell ───────────────────────────────────────────────── */
.user-cell { display: flex; align-items: center; gap: 10px; }

.mini-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  display: grid; place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ── Empty States ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}

.empty-sm { padding: 24px; }

.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { margin-bottom: 16px; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.15s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity:0; }
  to   { transform: scale(1); opacity:1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h4 {
  font-family: var(--font-display);
  font-weight: 600;
}

.modal-close {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 1rem; padding: 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px 22px; }

.modal-overlay[hidden] {
  display: none !important;
}

.modal-body p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.5;
}

.modal-summary {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* ── Auth Page ───────────────────────────────────────────────── */
.auth-page { background: var(--bg); }

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-visual {
  background: linear-gradient(135deg, #0a0f1e 0%, #0f1a35 50%, #091428 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(59,130,246,0.12) 0%, transparent 60%),
    radial-gradient(circle at 70% 20%, rgba(99,102,241,0.08) 0%, transparent 50%);
}

.auth-visual-inner {
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-logo {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 24px rgba(59,130,246,0.5));
}

.auth-brand {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-tagline {
  color: rgba(255,255,255,0.45);
  font-size: 0.95rem;
  font-weight: 300;
}

.auth-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.decor-ring {
  position: absolute;
  border: 1px solid rgba(59,130,246,0.12);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: rotate 20s linear infinite;
}

.ring-1 { width: 300px; height: 300px; animation-duration: 25s; }
.ring-2 { width: 500px; height: 500px; animation-duration: 35s; animation-direction: reverse; }
.ring-3 { width: 700px; height: 700px; animation-duration: 45s; }

@keyframes rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-2);
}

.auth-form-inner {
  width: 100%;
  max-width: 400px;
}

.auth-form-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-form-sub {
  color: var(--text-3);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

.auth-form .form-group { margin-bottom: 20px; }

.auth-form button[type="submit"] {
  margin-top: 1rem;
}

/* ── Misc ────────────────────────────────────────────────────── */
.text-muted  { color: var(--text-3); font-size: 0.82rem; }
.link-subtle { color: var(--text-2); }
.link-subtle:hover { color: var(--text); }

.balance-inline { color: var(--text-3); font-style: italic; font-size: 0.85rem; }

.page-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close { display: block; }

  .sidebar-overlay.active { display: block; }

  .main-wrapper { margin-left: 0; }

  .topbar-burger { display: flex; }

  .main-content { padding: 20px 16px 32px; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }

  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-panel { padding: 32px 24px; }

  .type-selector { grid-template-columns: 1fr; }
  .type-selector-3 { grid-template-columns: 1fr; }

  .table th, .table td { padding: 10px 12px; }

  .employee-grid { grid-template-columns: 1fr; }

  .emp-detail-header { flex-direction: column; text-align: center; }
  .emp-detail-balance { text-align: center; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .card-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   CORRECTIFS v2 — Ajouts au design system
   ============================================================ */

/* ── Alerte heures dues ──────────────────────────────────── */
.alert-due {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  animation: slideIn .3s ease;
}
.alert-due-icon { font-size: 1.4rem; flex-shrink: 0; }
.alert-due strong { color: var(--red); }
.alert-due p { font-size: .85rem; color: var(--text-3); margin-top: 4px; }

/* ── KPI "heures dues" ───────────────────────────────────── */
.kpi-due { color: var(--red); }

/* ── Expiration inline ───────────────────────────────────── */
.expiry-inline { font-size: .85rem; }
.expiry-red    { color: #fca5a5; font-weight: 600; }
.expiry-orange { color: #fdba74; font-weight: 600; }
.expiry-chip-red { border-color: rgba(239,68,68,.4); background: var(--red-bg); color: #fca5a5; }

/* ── Suivi heures dues (table) ───────────────────────────── */
.catchup-progress {
  font-size: .82rem;
  font-family: var(--font-mono, monospace);
  padding: 3px 8px;
  border-radius: 4px;
}
.catchup-ok      { background: var(--green-bg); color: #86efac; }
.catchup-partial { background: var(--orange-bg); color: #fdba74; }

/* ── Time range ──────────────────────────────────────────── */
.time-range {
  font-family: var(--font-mono, monospace);
  font-size: .82rem;
  color: var(--text-2);
}

/* ── Filtre bar admin ────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-select {
  width: auto;
  min-width: 160px;
  padding: 7px 12px;
  font-size: .85rem;
}

/* ── Employee card "heures dues" ─────────────────────────── */
.employee-card-due { border-color: rgba(239,68,68,.35); }
.emp-balance-col {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  align-self: center;
  gap: 2px;
}
.emp-due           { font-size: .72rem; color: var(--red); font-weight: 600; }

/* ── Notification dropdown ───────────────────────────────── */
.notif-wrapper {
  position: relative;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 300;
  animation: scaleIn .15s ease;
  overflow: hidden;
}

.notif-wrapper:hover .notif-dropdown,
.notif-wrapper.open  .notif-dropdown { display: block; }

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.notif-mark-all {
  background: none;
  border: none;
  color: var(--blue-light);
  font-size: .78rem;
  cursor: pointer;
}
.notif-mark-all:hover { text-decoration: underline; }

.notif-dropdown-list {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.notif-dd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-dd-item:last-child { border-bottom: none; }
.notif-dd-item:hover { background: var(--bg-3); }
.notif-dd-item.unread { background: rgba(59,130,246,.04); }

.notif-dd-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-info    .notif-dd-dot { background: var(--blue); }
.notif-success .notif-dd-dot { background: var(--green); }
.notif-warning .notif-dd-dot { background: var(--yellow); }
.notif-danger  .notif-dd-dot { background: var(--red); }

.notif-dd-msg  { font-size: .83rem; color: var(--text-2); line-height: 1.4; }
.notif-dd-time { font-size: .72rem; color: var(--text-3); margin-top: 3px; display: block; }
.notif-empty   { padding: 24px; text-align: center; color: var(--text-3); font-size: .85rem; }

/* ── Formulaire demande v2 ───────────────────────────────── */
.form-hint-box {
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: .85rem;
  margin-bottom: 16px;
  line-height: 1.5;
}
.info-hint { background: var(--blue-glow); border: 1px solid rgba(59,130,246,.3); color: var(--blue-light); }
.warn-hint { background: var(--orange-bg); border: 1px solid rgba(249,115,22,.35); color: #fdba74; }
.negative-blocked-alert {
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,.4);
  color: #fca5a5;
  margin-bottom: 16px;
}

.rtt-hint {
  background: rgba(168,85,247,.1);
  border: 1px solid rgba(168,85,247,.3);
  color: #d8b4fe;
}

/* Expiry preview */
.expiry-preview {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 42px;
  justify-content: center;
}
.expiry-auto-label { font-size: .75rem; color: var(--text-3); }
.expiry-auto-value { font-size: .95rem; font-weight: 600; color: var(--green); font-family: var(--font-display); }

.balance-pill-neg { background: var(--red-bg); border-color: rgba(239,68,68,.4); color: #fca5a5; }

/* Calc result */
.calc-result {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
}
.calc-row:last-child { border-bottom: none; }
.calc-row-total { font-weight: 600; }
.calc-label { color: var(--text-3); }
.calc-value { color: var(--text); font-family: var(--font-display); font-weight: 600; }
.balance-pos-text { color: var(--green); }
.balance-neg-text { color: var(--red); }

/* Catchup plan */
.catchup-section {
  background: rgba(239,68,68,.05);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.catchup-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.catchup-title  { font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--red); }
.catchup-slot   { margin-bottom: 8px; }
.catchup-slot-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.catchup-slot-inner .form-input { flex: 1; min-width: 120px; }
.slot-sep { color: var(--text-3); font-size: .85rem; flex-shrink: 0; }
.catchup-total {
  margin-top: 10px;
  font-size: .85rem;
  color: var(--text-2);
  padding-top: 10px;
  border-top: 1px solid rgba(239,68,68,.2);
}
.catchup-warn { color: var(--red); font-size: .8rem; }

/* ── Cases week-end (GAIN) ───────────────────────────────── */
.weekend-checks {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.weekend-check-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.weekend-check-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.check-hint {
  font-size: .75rem;
  color: var(--text-3);
  margin-left: 4px;
}
.check-hint-orange { color: var(--orange); }
.check-custom-orange { border-color: var(--orange) !important; }
.check-input:checked + .check-custom-orange {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
}

/* Icônes de type */
.type-icon-gain  { color: var(--green); }
.type-icon-recup { color: var(--blue-light); }

/* Infos dimanche ×2 dans résultat calcul */
.calc-info-row { padding: 6px 0 0; }
.calc-sunday-badge {
  background: var(--orange-bg);
  border: 1px solid rgba(249,115,22,.3);
  color: #fdba74;
  font-size: .78rem;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Fiche de demande ────────────────────────────────────── */
.fiche-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.fiche-header-left { display: flex; align-items: center; gap: 18px; }
.fiche-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-3);
  line-height: 1;
}
.fiche-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.fiche-meta { font-size: .82rem; color: var(--text-3); margin-top: 4px; }
.fiche-header-right { text-align: right; }
.fiche-hours {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.fiche-hours-unit { font-size: 1rem; font-weight: 400; color: var(--text-3); }
.fiche-hours-inline {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.fiche-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) { .fiche-grid { grid-template-columns: 1fr; } }

.fiche-info-grid { padding: 4px 0; }
.fiche-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--border);
}
.fiche-info-row:last-child { border-bottom: none; }
.fiche-info-label {
  flex: 0 0 180px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 2px;
}
.fiche-info-value { flex: 1; font-size: .9rem; color: var(--text); }

.fiche-decision-body { padding: 16px 22px; }
.fiche-decision-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.fiche-decision-comment {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .9rem;
  color: var(--text-2);
  font-style: italic;
}

.card-refused { border-color: rgba(239,68,68,.35); }

.fiche-actions-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.fiche-divider {
  text-align: center;
  font-size: .78rem;
  color: var(--text-3);
  position: relative;
  margin: 4px 0;
}
.fiche-divider::before, .fiche-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.fiche-divider::before { left: 0; }
.fiche-divider::after  { right: 0; }

.fiche-emp-card { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }

/* Statut timeline */
.fiche-status-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  opacity: .4;
}
.fiche-status-step.active { opacity: 1; }
.fiche-step-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border-light);
  flex-shrink: 0;
  margin-top: 4px;
}
.fiche-step-dot.done       { background: var(--blue); }
.fiche-step-dot.done-green { background: var(--green); }
.fiche-step-dot.done-red   { background: var(--red); }
.fiche-step-label  { font-size: .88rem; font-weight: 500; color: var(--text); }
.fiche-step-date   { font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.fiche-status-connector {
  width: 2px; height: 24px;
  background: var(--border);
  margin: 4px 0 4px 5px;
}

/* ── Lignes cliquables (table salarié) ───────────────────── */
.table-clickable .row-link { cursor: pointer; }
.table-clickable .row-link:hover td { background: rgba(59,130,246,.06); }

.row-refusal-reason { cursor: pointer; }
.refusal-reason-cell {
  background: rgba(239,68,68,.05) !important;
  border-left: 3px solid var(--red);
  padding: 8px 16px !important;
  font-size: .83rem;
  color: #fca5a5;
}
.refusal-reason-cell strong { color: var(--red); }

/* ── Plan rattrapage feedback ────────────────────────────── */
.catchup-ok-msg {
  color: #86efac;
  font-size: .8rem;
  font-weight: 600;
}

/* ── Tags de filtre type ─────────────────────────────────── */
.type-tag-group { display:flex; gap:6px; }
.type-tag {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-2);
  transition: all var(--transition);
  font-family: var(--font-body);
}
.type-tag:hover    { background: var(--bg-3); color: var(--text); }
.type-tag.active   { background: var(--bg-3); color: var(--text); border-color: var(--border-light); }
.type-tag-gain.active  { background: var(--green-bg); color: #86efac; border-color: rgba(34,197,94,.4); }
.type-tag-recup.active { background: var(--blue-glow); color: var(--blue-light); border-color: rgba(59,130,246,.4); }
.type-tag-refused.active { background: var(--red-bg); color: #fca5a5; border-color: rgba(239,68,68,.4); }

[data-theme="light"] .type-tag-gain.active  { color: #15803d; border-color: rgba(21,128,61,.35); }
[data-theme="light"] .type-tag-recup.active { color: #1d4ed8; border-color: rgba(29,78,216,.35); }
[data-theme="light"] .type-tag-refused.active { color: #b91c1c; border-color: rgba(185,28,28,.35); }

.filter-count { font-size:.8rem; color:var(--text-3); align-self:center; }

/* ── Page affectations ───────────────────────────────────── */
.assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.assignment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.assignment-item input[type="checkbox"] { display: none; }
.assignment-item:hover { border-color: var(--border-light); }
.assignment-item-active {
  background: var(--blue-glow);
  border-color: rgba(59,130,246,.4);
}
.assignment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  display: grid; place-items: center;
  font-weight: 700; color: white;
  font-size: .85rem; flex-shrink: 0;
}
.assignment-name  { font-size: .88rem; font-weight: 600; color: var(--text); }
.assignment-email { font-size: .75rem; color: var(--text-3); }
.assignment-check {
  margin-left: auto;
  color: var(--blue-light);
  font-weight: 700;
  font-size: .9rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.assignment-item-active .assignment-check { opacity: 1; }

/* ── Filtres 2 niveaux ───────────────────────────────────── */
.filter-bar-stack {
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-row-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  min-width: 60px;
  flex-shrink: 0;
}
.filter-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

/* ── Expiry chip cliquable ───────────────────────────────── */
.expiry-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition);
}
.expiry-chip-link:hover { opacity: .8; }
.expiry-chip-sub {
  font-size: .72rem;
  opacity: .7;
}

/* ── Page paramètres ─────────────────────────────────────── */
.days-selector { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.day-chip {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: .85rem;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--transition);
  user-select: none;
}
.day-chip input { display: none; }
.day-chip:hover { border-color: var(--border-light); color: var(--text); }
.day-chip-active {
  background: var(--blue-glow);
  border-color: rgba(59,130,246,.4);
  color: var(--blue-light);
  font-weight: 600;
}

.settings-checks { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.settings-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.settings-check-item .check-custom { margin-top: 2px; flex-shrink: 0; }
.settings-check-label { font-size: .9rem; font-weight: 500; color: var(--text); }
.settings-check-hint  { font-size: .78rem; color: var(--text-3); margin-top: 2px; }

.card-footer-actions {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  background: var(--bg-3);
}

/* ── Tableau planning (settings + employee detail) ───────── */
.sched-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.sched-table th {
  padding:8px 12px;
  background:var(--bg-3);
  color:var(--text-3);
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.06em;
  text-align:left;
  border-bottom:1px solid var(--border);
}
.sched-table td {
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
.sched-table tr:last-child td { border-bottom:none; }
.sched-table tr.day-inactive td { opacity:.4; }
.sched-table tr.day-inactive td:first-child { opacity:1; }

.sched-time {
  background:var(--bg-3);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:5px 8px;
  color:var(--text);
  font-family:var(--font-body);
  font-size:.83rem;
  width:94px;
}
.sched-time:focus { border-color:var(--blue); outline:none; }
.sched-time:disabled { opacity:.3; cursor:not-allowed; }

/* ── Badge RTT ───────────────────────────────────────────── */
.badge-rtt {
  background: rgba(168,85,247,.15);
  color: #d8b4fe;
  border: 1px solid rgba(168,85,247,.4);
}

/* ── Theme toggle (paramètres / profil) ─────────────────── */
.theme-toggle-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.theme-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.theme-option input { display: none; }

.theme-option.active,
.theme-option:hover {
  border-color: var(--blue);
  background: var(--blue-glow);
  color: var(--text);
}

.topbar-theme-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 8px 10px;
  transition: border-color var(--transition), color var(--transition);
}

.topbar-theme-btn:hover {
  border-color: var(--blue);
  color: var(--text);
}

/* ── Calendar ─────────────────────────────────────────────── */
.calendar-card {
  padding: 22px;
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.cal-nav,
.cal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-nav-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
}

.cal-nav-btn:hover {
  border-color: var(--blue);
}

.cal-month-label {
  min-width: 190px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.cal-grid {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cal-day-headers,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-day-headers {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.cal-day-header {
  padding: 12px 10px;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.cal-empty,
.cal-day {
  min-height: 112px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cal-day:nth-child(7n),
.cal-empty:nth-child(7n) {
  border-right: none;
}

.cal-day {
  padding: 10px;
  background: var(--bg-2);
}

.cal-day-weekend {
  background: rgba(255,255,255,.02);
}

.cal-day-num {
  margin-bottom: 8px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-3);
}

.cal-event {
  display: block;
  margin-top: 4px;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: .72rem;
  font-weight: 700;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cal-events-panel {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.cal-events-panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.cal-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 18px;
  color: var(--text-2);
  font-size: .82rem;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cal-legend-dot,
.cal-event-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: .35rem;
}

@media (max-width: 768px) {
  .calendar-card {
    padding: 16px;
  }

  .cal-day {
    min-height: 88px;
    padding: 7px;
  }

  .cal-month-label {
    min-width: auto;
  }
}

/* ── Symfony form defaults ─────────────────────────────────── */
form label { display: block; margin-top: .75rem; font-weight: 500; color: var(--text-2); font-size: .88rem; }
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="datetime-local"],
form select,
form textarea,
.form-input {
  width: 100%;
  margin-top: .35rem;
  padding: 9px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .9rem;
  box-sizing: border-box;
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--blue);
  outline: none;
}

form button[type="submit"]:not(.btn-sm) {
  margin-top: 1rem;
}

form .form-actions .btn,
form .form-actions button[type="submit"] {
  margin-top: 0;
}

.table .btn,
.card-header .btn,
.action-buttons .btn {
  margin-top: 0;
}
