* { box-sizing: border-box; }

:root {
  --sidebar-bg: #15171d;
  --sidebar-bg-alt: #1c1f27;
  --sidebar-text: #cdd1da;
  --sidebar-text-dim: #7d8291;
  --sidebar-border: #262a34;

  --primary: #D6293E;
  --primary-hover: #C21F33;
  --primary-soft: rgba(214, 41, 62, 0.1);

  --interne: #D6293E;
  --externe: #2461E0;
  --directionnelle: #C98A1F;
  --trajet: #2E9E7A;

  --bg: #f2f3f6;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #e6e8ec;
  --text: #1b1e25;
  --text-muted: #6b7280;
  --text-faint: #9aa0ab;
  --shadow-sm: 0 1px 2px rgba(20, 20, 35, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 20, 35, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
}

:root[data-theme="dark"] {
  --bg: #101216;
  --surface: #181b21;
  --surface-alt: #1e222a;
  --border: #2a2e37;
  --text: #eef0f3;
  --text-muted: #9aa1ad;
  --text-faint: #6b7280;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

input, textarea, select, button { user-select: text; }
button { user-select: none; }

.app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--sidebar-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 22px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8f1826);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(214, 41, 62, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; color: #fff; }
.brand-text span { font-size: 12px; color: var(--sidebar-text-dim); }

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 18px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

a.nav-item { text-decoration: none; }
.nav-item:hover { background: var(--sidebar-bg-alt); color: #fff; }
.nav-item.active {
  background: var(--primary-soft);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-item.active .nav-icon { background-color: var(--primary); }

.nav-item-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.nav-icon[data-icon="calendar"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="list"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="settings"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Ccircle cx='9' cy='6' r='2' fill='black'/%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Ccircle cx='16' cy='12' r='2' fill='black'/%3E%3Cline x1='4' y1='18' x2='20' y2='18'/%3E%3Ccircle cx='10' cy='18' r='2' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Ccircle cx='9' cy='6' r='2' fill='black'/%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Ccircle cx='16' cy='12' r='2' fill='black'/%3E%3Cline x1='4' y1='18' x2='20' y2='18'/%3E%3Ccircle cx='10' cy='18' r='2' fill='black'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="external"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="theme"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='none'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='none'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="pdf"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="users"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="bell"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="lock"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="menu"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E"); }

.nav-icon[data-icon="logout"] { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E"); }

.sidebar-quota {
  margin-top: auto;
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ring-wrap { position: relative; width: 108px; height: 108px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--sidebar-bg-alt); stroke-width: 9; }
.ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s cubic-bezier(.4,0,.2,1), stroke 0.3s ease;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-center span { font-size: 18px; font-weight: 700; color: #fff; }
.ring-center small { font-size: 10px; color: var(--sidebar-text-dim); text-transform: uppercase; letter-spacing: .04em; }
.sidebar-quota-label { font-size: 11.5px; color: var(--sidebar-text-dim); text-transform: uppercase; letter-spacing: .04em; }

.sidebar-user {
  padding: 10px 8px;
  border-top: 1px solid var(--sidebar-border);
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--sidebar-text);
}
.sidebar-user strong { display: block; color: #fff; font-size: 13.5px; margin-bottom: 2px; }

.sidebar-footer { display: flex; justify-content: center; gap: 8px; padding-top: 10px; }
.sidebar-footer .icon-btn { color: var(--sidebar-text); background: transparent; border-color: var(--sidebar-border); }
.sidebar-footer .icon-btn:hover { background: var(--sidebar-bg-alt); color: #fff; }
.sidebar-footer .nav-icon { background-color: currentColor; }

/* ---------- CONTENT ---------- */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 34px 40px;
}

.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }

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

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.view-header h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }

.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav h1 { min-width: 190px; text-align: center; }

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

/* ---------- BUTTONS ---------- */
button { font-family: inherit; cursor: pointer; }

.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 4px 14px rgba(214, 41, 62, 0.25);
}
.primary-btn:hover { background: var(--primary-hover); }
.primary-btn:active { transform: scale(0.97); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.secondary-btn:hover { border-color: var(--primary); color: var(--primary); }
.secondary-btn .nav-icon { background-color: currentColor; }

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}
.ghost-btn:hover { color: var(--text); border-color: var(--text-faint); }

.danger-btn {
  background: transparent;
  border: 1px solid #e0455533;
  color: #e04555;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}
.danger-btn:hover { background: #e0455514; }

.success-btn {
  background: #2a9d5c;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}
.success-btn:hover { background: #24884f; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- SUMMARY CARDS ---------- */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.card.accent { border-color: rgba(214,41,62,0.25); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 60%); }
.card.muted { opacity: 0.92; }

.card-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-info {
  font-size: 9.5px;
  text-transform: none;
  background: rgba(201, 138, 31, 0.15);
  color: var(--directionnelle);
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0;
}
.card-value { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
#card-remaining.negative .card-value { color: var(--primary); }
.card-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.card-carry { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.card-carry-value { font-size: 17px; font-weight: 700; color: var(--trajet); }
.card-carry-label { font-size: 10.5px; color: var(--text-faint); line-height: 1.3; }
.card-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}
.card-total strong { font-size: 16px; color: var(--text); }
.card-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.card-line strong { font-size: 13px; color: var(--primary); }
.card-line.received strong { color: var(--trajet); }
.card-link {
  margin-top: 10px;
  padding: 0;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--externe);
  cursor: pointer;
}
.card-link:hover { text-decoration: underline; }

.bookmarklet-btn {
  align-self: flex-start;
  display: inline-block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  cursor: grab;
}
.hq-steps { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.hq-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--trajet) 15%, transparent);
  color: var(--trajet);
  margin-left: 6px;
}

.transfer-list-title {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.transfer-list { display: flex; flex-direction: column; gap: 8px; }
.transfer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
}
.transfer-item small { display: block; font-size: 11.5px; color: var(--text-faint); }
.transfer-item .amount { font-weight: 700; white-space: nowrap; color: var(--primary); }
.transfer-item.received .amount { color: var(--trajet); }
.card-hint { font-size: 11px; color: var(--text-faint); margin-top: 6px; line-height: 1.4; }

.hors-decompte-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}
.hors-decompte-row strong { margin-left: auto; color: var(--text); font-size: 14px; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.progress-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 6px;
  background: var(--border);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
  width: 0%;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

/* ---------- HR SUBMISSION ROW ---------- */
.hr-submission-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 13.5px;
}
.hr-submission-row label.checkbox-label { flex: 0 0 auto; max-width: none; color: var(--text); font-weight: 600; }
.hr-submission-row input[type="date"] { width: auto; }
.hr-submission-row .settings-hint { margin: 0; }

/* ---------- PENDING NOTIFICATION BANNER ---------- */
.pending-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  border: 1px solid rgba(214,41,62,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 22px;
}
.pending-banner .nav-icon { width: 22px; height: 22px; background-color: var(--primary); flex-shrink: 0; }
.pending-banner-text { flex: 1; }
.pending-banner-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.pending-banner-text span { font-size: 12.5px; color: var(--text-muted); }

.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.pending-item-info { flex: 1; font-size: 13px; }
.pending-item-info strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.pending-item-info span { color: var(--text-muted); }
.pending-item-actions { display: flex; gap: 8px; }

/* ---------- GROUP ASSIGN ---------- */
.group-assign {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.group-assign label.checkbox-label {
  max-width: none;
  color: var(--text);
  font-weight: 500;
  padding: 4px 2px;
}

/* ---------- CALENDAR ---------- */
.calendar-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
}

.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 96px;
  gap: 6px;
}

.day-cell {
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  background: var(--surface-alt);
}
.day-cell:hover { border-color: var(--primary); }
.day-cell.outside { opacity: 0.35; }
.day-cell.selected { border-color: var(--primary); background: var(--primary-soft); }
.day-cell.has-pending { border-style: dashed; border-color: var(--directionnelle); }
.day-cell.today .day-number { color: var(--primary); font-weight: 800; }
.day-cell.today::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.day-number { font-size: 13px; font-weight: 600; color: var(--text); }

.day-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.day-dot { width: 7px; height: 7px; border-radius: 50%; }
.day-dot.pending { border: 1px solid #fff; box-shadow: 0 0 0 1px var(--text-faint); }

.day-hours {
  margin-top: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.day-hours span { display: inline-flex; align-items: center; gap: 4px; }
.day-hours .dot-inline { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ---------- DAY PANEL ---------- */
.day-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-height: 300px;
}
.day-panel-header h3 { margin: 0 0 12px; font-size: 15px; }
.empty-hint { color: var(--text-faint); font-size: 13px; line-height: 1.5; }

.day-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.day-entry:hover { border-color: var(--primary); background: var(--surface-alt); }
.day-entry.pending { border-style: dashed; border-color: var(--directionnelle); }
.day-entry-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.category-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }
.category-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.category-badge-muted {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-faint);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
}
.status-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(201, 138, 31, 0.15);
  color: var(--text);
  margin-left: 6px;
}
.day-entry-time { font-size: 11.5px; color: var(--text-muted); }
.day-entry-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.day-entry-duration { font-weight: 700; font-size: 13px; }

.day-add-btn {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.day-add-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- TABLE / HISTORY ---------- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.entries-table { width: 100%; border-collapse: collapse; }
.entries-table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-faint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.entries-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.entries-table tbody tr:hover { background: var(--surface-alt); }
.entries-table tbody tr:last-child td { border-bottom: none; }
.entries-table .month-header td {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
}
.entries-table .month-header .month-total { float: right; color: var(--text-faint); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.row-actions button:hover { background: var(--surface-alt); color: var(--primary); }

select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- SETTINGS / ADMIN ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 920px;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-card.wide { grid-column: 1 / -1; }
.settings-card h2 { margin: 0; font-size: 15px; }
.settings-hint { font-size: 12px; color: var(--text-faint); margin: -6px 0 0; line-height: 1.5; }
.settings-hint.inline { margin: 0; display: inline; font-weight: 400; }

.trajet-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--trajet) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--trajet) 30%, transparent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
}
.trajet-checkbox input { accent-color: var(--trajet); width: 16px; height: 16px; }

.compensation-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.compensation-title { font-size: 12.5px; font-weight: 600; color: var(--text-muted); flex-basis: 100%; }
.compensation-row label.checkbox-label { flex: 0 0 auto; color: var(--text); }
.compensation-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.compensation-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-left: 6px;
}

label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); flex: 1; }
label.small { max-width: 130px; flex: 0 0 auto; }
label.checkbox-label { flex-direction: row; align-items: center; gap: 8px; max-width: none; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], textarea {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }

.settings-row { display: flex; gap: 12px; align-items: flex-end; }
.settings-row.actions { align-items: center; }

.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.test-result { font-size: 12.5px; font-weight: 600; }
.test-result.ok { color: #2a9d5c; }
.test-result.error { color: var(--primary); }

.users-table td, .users-table th { padding: 12px 14px; }
.role-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary);
}
.inactive-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: var(--surface-alt); color: var(--text-faint); border: 1px solid var(--border);
}

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 15, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }

.modal {
  width: 460px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  animation: modalIn 0.2s cubic-bezier(.2,.8,.3,1);
}
.modal.wide { width: 640px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 16px; }

.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------- TUTORIAL ---------- */
.tutorial-step { display: none; }
.tutorial-step.active { display: block; }
.tutorial-step h3 { margin: 0 0 8px; font-size: 16px; }
.tutorial-step p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.tutorial-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.tutorial-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tutorial-dot.active { background: var(--primary); }

/* ---------- AUTH PAGES ---------- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--sidebar-bg);
  background-image: radial-gradient(circle at 20% 20%, rgba(214,41,62,0.18), transparent 40%);
}
.auth-card {
  width: 380px;
  max-width: 92vw;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 30px 28px;
}
.auth-brand { border-bottom: none; padding-bottom: 18px; margin-bottom: 4px; justify-content: center; }
.auth-brand .brand-text strong { color: var(--text); }
.auth-brand .brand-text span { color: var(--text-muted); }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.auth-submit { width: 100%; padding: 11px; margin-top: 4px; }
.auth-error {
  background: rgba(214,41,62,0.1); color: var(--primary); border: 1px solid rgba(214,41,62,0.25);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 12px;
}
.auth-success {
  background: rgba(42,157,92,0.1); color: #2a9d5c; border: 1px solid rgba(42,157,92,0.25);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 12px;
}
.auth-hint { font-size: 12px; color: var(--text-faint); text-align: center; margin-top: 16px; }
.auth-hint a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ---------- TOASTS ---------- */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  font-weight: 600;
  min-width: 220px;
  animation: toastIn 0.2s ease;
  border-left: 3px solid var(--primary);
}
.toast.success { border-left-color: #2a9d5c; }
.toast.error { border-left-color: #e04555; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

@media (max-width: 1180px) {
  .calendar-wrapper { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ---------- MOBILE NAV (hamburger / off-canvas sidebar) ---------- */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 75;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 15, 0.5);
  z-index: 65;
}

@media (max-width: 860px) {
  .sidebar-toggle { display: flex; }

  .app {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    width: 100%;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .app.sidebar-open .sidebar-backdrop { display: block; }

  .content { padding: 76px 16px 32px; overflow-y: visible; }

  .view-header { gap: 10px; }
  .view-header h1 { font-size: 18px; }
  .month-nav h1 { min-width: 0; }

  .summary-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 12px 14px; }
  .card-value { font-size: 20px; }

  .calendar-grid { grid-auto-rows: 62px; gap: 4px; }
  .day-cell { padding: 4px; gap: 2px; }
  .day-number { font-size: 11.5px; }
  .day-hours { font-size: 9px; }
  .calendar-weekdays { font-size: 9.5px; padding-bottom: 6px; }

  .settings-row { flex-direction: column; align-items: stretch; }
  label.small { max-width: none; }

  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }

  /* Tableaux -> fiches empilées (au lieu d'un défilement horizontal illisible) */
  .entries-table thead { display: none; }
  .entries-table, .entries-table tbody, .entries-table tr { display: block; width: 100%; }
  .entries-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 4px 12px;
  }
  .entries-table tbody tr:last-child { margin-bottom: 0; }
  .entries-table td {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 10px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    font-size: 13px;
  }
  .entries-table tr td:last-child { border-bottom: none; }
  .entries-table td[data-label]::before {
    content: attr(data-label);
    margin-right: auto;
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-faint);
    text-align: left;
    flex-shrink: 0;
  }
  .entries-table td.row-actions { border-bottom: none; padding-top: 4px; }
  .entries-table .month-header {
    border: none;
    background: transparent;
    margin: 14px 0 6px;
    padding: 0;
  }
  .entries-table .month-header td {
    display: block;
    text-align: left;
    border-bottom: none;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .day-hours { display: none; }
  .card-value { font-size: 18px; }
  .ring-wrap { width: 88px; height: 88px; }
}
