/* =========================================================
   TimeSheet - feuille de style principale
   1. Jetons de design      5. Tableaux
   2. Structure             6. Grille de saisie
   3. Navigation            7. Composants (badges, alertes, modales, toasts)
   4. Formulaires           8. Responsive & impression
   ========================================================= */

/* ---------- 1. Jetons de design -------------------------------------- */
:root {
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-050: #eef2ff;
  --ok: #059669;
  --ok-050: #ecfdf5;
  --warn: #b45309;
  --warn-050: #fffbeb;
  --danger: #e11d48;
  --danger-050: #fff1f2;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --sidebar: #111827;
  --sidebar-ink: #cbd5e1;
  --sidebar-active: rgba(255, 255, 255, .09);

  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e5e7eb;
  --line-2: #eef2f7;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px -4px rgba(15, 23, 42, .12), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .25);
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #151b2d;
  --surface-2: #1b2237;
  --sidebar: #090d19;
  --sidebar-ink: #94a3b8;
  --ink: #e8edf7;
  --ink-2: #a9b4c7;
  --ink-3: #6b7789;
  --line: #273046;
  --line-2: #1f273b;
  --brand-050: #1e1b4b;
  --ok-050: #052e2b;
  --warn-050: #2d1e05;
  --danger-050: #350c1a;
  --shadow: 0 4px 18px -6px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

::selection { background: var(--brand); color: #fff; }

/* ---------- 2. Structure ---------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.page-title { font-size: 1.05rem; margin: 0; font-weight: 650; flex: 1; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.content { padding: 22px; max-width: 1280px; width: 100%; margin: 0 auto; }
.content-wide { max-width: none; }

.section { margin-bottom: 26px; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px;
  justify-content: space-between; margin-bottom: 18px;
}
.page-head .sub { color: var(--ink-2); margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 3. Navigation --------------------------------------------- */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 60;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 20px 16px; color: #fff; font-weight: 700; letter-spacing: -.02em;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  font-size: 12px; letter-spacing: .04em; box-shadow: 0 4px 12px rgba(79, 70, 229, .45);
}
.brand-text { font-size: 15px; }
.sidebar-close { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-group { margin-bottom: 18px; }
.nav-label {
  display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: #64748b; padding: 0 10px 7px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; margin-bottom: 2px; border-radius: 10px;
  color: var(--sidebar-ink); font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--sidebar-active); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.version { display: block; padding: 6px 11px 0; font-size: 11px; color: #64748b; }

.burger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

.langswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.langswitch .lang {
  padding: 6px 9px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--ink-3); background: var(--surface); line-height: 1.5;
}
.langswitch .lang:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.langswitch .lang.is-active { background: var(--brand); color: #fff; }
.bare-lang { position: fixed; top: 16px; right: 16px; }

.usermenu { position: relative; }
.usermenu-btn {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 11px; cursor: pointer;
  color: var(--ink); text-align: left;
}
.usermenu-btn small { display: block; font-size: 10.5px; color: var(--ink-3); line-height: 1.1; }
.usermenu-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.avatar {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; font-size: 11.5px; font-weight: 700;
}
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.usermenu-pop.open { display: block; }
.usermenu-pop a {
  display: block; padding: 9px 11px; border-radius: 8px; color: var(--ink); font-size: 13px;
}
.usermenu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.usermenu-pop a.danger { color: var(--danger); }

/* ---------- 4. Formulaires -------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -18px -18px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--ink-2); font-size: 12.5px; margin: 2px 0 0; }
.card-pad-0 { padding: 0; }
.card-pad-0 .card-head { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

label, .label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px;
}
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px; }

.field { margin-bottom: 14px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; color: var(--ink); margin-bottom: 10px; }
.check input { width: auto; margin-top: 2px; accent-color: var(--brand); }

.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; font: inherit; font-size: 13.5px; font-weight: 600;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 10px -2px rgba(79, 70, 229, .5); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 5. Tableaux ------------------------------------------------ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.2px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.center, table.data th.center { text-align: center; }
table.data tfoot td { font-weight: 700; background: var(--brand-050); border-top: 1px solid var(--line); }
table.data .row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.code { font-family: var(--mono); font-size: 12.3px; color: var(--ink-2); }

.empty {
  padding: 40px 20px; text-align: center; color: var(--ink-3);
}
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 8px; }

/* Tuiles de statistiques */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.stat-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--ink-2); }
.stat.accent { background: linear-gradient(140deg, var(--brand), #6366f1); border-color: transparent; color: #fff; }
.stat.accent .stat-label, .stat.accent .stat-sub { color: rgba(255, 255, 255, .78); }

.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.over > span { background: var(--danger); }

/* ---------- 6. Grille de saisie --------------------------------------- */
.ts-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px;
}
.period-nav { display: flex; align-items: center; gap: 6px; }
.period-nav .current { font-weight: 650; min-width: 148px; text-align: center; font-size: 14.5px; }

.ts-scroll {
  overflow: auto; max-height: calc(100vh - 300px); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}

table.ts { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
table.ts th, table.ts td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 0; }
table.ts thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface-2);
  font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase;
  letter-spacing: .04em; padding: 7px 8px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.ts thead tr.days th { padding: 4px 0; text-align: center; }
table.ts th.day, table.ts td.day { width: 44px; min-width: 44px; max-width: 44px; text-align: center; }
table.ts thead th .dnum { display: block; font-size: 12.5px; color: var(--ink); }
table.ts thead th .dlet { display: block; font-size: 9.5px; color: var(--ink-3); font-weight: 600; }
table.ts thead th.we { background: color-mix(in srgb, var(--ink-3) 12%, var(--surface-2)); }
table.ts thead th.today { background: var(--brand-050); box-shadow: inset 0 -2px 0 var(--brand); }

table.ts td.cell-project, table.ts td.cell-desc { padding: 4px 6px; }
table.ts .col-project { width: 220px; min-width: 220px; }
table.ts .col-desc { width: 260px; min-width: 260px; }
table.ts .col-total { min-width: 74px; }
table.ts .sticky-l { left: 0; }
table.ts .sticky-l2 { left: 220px; box-shadow: 1px 0 0 var(--line); }

table.ts tbody td.we { background: color-mix(in srgb, var(--ink-3) 7%, transparent); }
table.ts tbody tr:hover td { background: color-mix(in srgb, var(--brand) 4%, transparent); }

.sticky-l { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.sticky-l2 { position: sticky; z-index: 4; background: var(--surface); }
table.ts thead .sticky-l, table.ts thead .sticky-l2 { z-index: 6; background: var(--surface-2); }

.hcell {
  width: 44px; height: 34px; border: 0; background: transparent; text-align: center;
  font: inherit; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums;
  padding: 0; border-radius: 0;
}
.hcell:focus {
  outline: 2px solid var(--brand); outline-offset: -2px; background: var(--surface);
  box-shadow: none; position: relative; z-index: 3;
}
.hcell.filled { font-weight: 650; }
.hcell.invalid { background: var(--danger-050); color: var(--danger); font-weight: 700; }

.ts select.line-project, .ts input.line-desc {
  border: 1px solid transparent; background: transparent; border-radius: 7px;
  font-size: 13px; padding: 6px 8px;
}
.ts select.line-project:hover, .ts input.line-desc:hover { border-color: var(--line); background: var(--surface); }
.ts select.line-project:focus, .ts input.line-desc:focus { border-color: var(--brand); background: var(--surface); }

table.ts td.total, table.ts tfoot td { font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
table.ts tfoot td {
  position: sticky; bottom: 0; z-index: 5; background: var(--brand-050);
  border-top: 1px solid var(--line); padding: 8px 6px; font-size: 12.8px;
}
table.ts tfoot td.sticky-l, table.ts tfoot td.sticky-l2 { z-index: 7; background: var(--brand-050); }
table.ts tfoot td.over { color: var(--danger); }

.row-del {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  color: var(--ink-3); cursor: pointer; display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.row-del:hover { background: var(--danger-050); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

.save-state { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.save-state.dirty .dot { background: var(--warn); }
.save-state.saved .dot { background: var(--ok); }
.save-state.error .dot { background: var(--danger); }

/* ---------- 7. Composants --------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-draft { background: var(--surface-2); color: var(--ink-2); }
.badge-submitted { background: var(--warn-050); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badge-approved, .badge-paid { background: var(--ok-050); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.badge-rejected, .badge-missing, .badge-cancelled { background: var(--danger-050); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.badge-sent { background: var(--brand-050); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }

.alert {
  padding: 11px 14px; border-radius: 11px; margin-bottom: 12px; font-size: 13.2px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
}
.alert-success { background: var(--ok-050); border-color: color-mix(in srgb, var(--ok) 28%, transparent); color: var(--ok); }
.alert-error { background: var(--danger-050); border-color: color-mix(in srgb, var(--danger) 28%, transparent); color: var(--danger); }
.alert-warning { background: var(--warn-050); border-color: color-mix(in srgb, var(--warn) 28%, transparent); color: var(--warn); }
.alert-info { background: var(--brand-050); border-color: color-mix(in srgb, var(--brand) 25%, transparent); color: var(--brand-600); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert li { margin-bottom: 2px; }

.flashes { margin-bottom: 4px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center; z-index: 90; padding: 5vh 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; border: 1px solid var(--line);
}
.modal-lg { max-width: 940px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--ink-3); cursor: pointer; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--sidebar); color: #fff; padding: 11px 15px; border-radius: 11px;
  box-shadow: var(--shadow-lg); font-size: 13.2px; max-width: 380px;
  animation: toast-in .22s ease-out;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
.toast.warn { background: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.8px; font-weight: 600; color: var(--ink-2);
}
.pill.is-active, .pill:hover { background: var(--brand); border-color: var(--brand); color: #fff; text-decoration: none; }

.muted { color: var(--ink-2); }
.small { font-size: 12.3px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* Page de connexion */
body.bare {
  display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background: radial-gradient(1000px 600px at 15% -5%, #e0e7ff 0%, transparent 55%),
              radial-gradient(900px 500px at 110% 110%, #dbeafe 0%, transparent 50%), var(--bg);
}
[data-theme="dark"] body.bare, body.bare[data-theme="dark"] {
  background: radial-gradient(900px 500px at 15% -5%, #1e1b4b 0%, transparent 55%), var(--bg);
}
.auth {
  width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px 28px;
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; color: #fff; }
.auth h1 { font-size: 1.2rem; margin-bottom: 3px; }
.auth .sub { color: var(--ink-2); font-size: 13px; margin-bottom: 20px; }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.3px; color: var(--ink-3); text-align: center; }
.bare .flashes, .bare .legal { width: 100%; max-width: 410px; }
.legal { max-width: 780px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.legal h2 { margin-top: 22px; }
.legal li { margin-bottom: 5px; }

/* Rapport d'import */
.import-summary { display: grid; gap: 10px; }
.import-month {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2);
}
.import-month.has-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-050); }
.import-month h4 { margin: 0 0 4px; font-size: 13.5px; }
.import-month ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- 8. Responsive & impression -------------------------------- */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sidebar-close { display: block; }
  .burger { display: block; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .content { padding: 15px; }
  .topbar { padding: 10px 14px; }
  .usermenu-name, .usermenu-btn small { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .ts-scroll { max-height: none; }
  table.ts .col-project { width: 170px; min-width: 170px; }
  table.ts .col-desc { width: 180px; min-width: 180px; }
  table.ts .sticky-l2 { left: 170px; }
  .page-head { flex-direction: column; align-items: stretch; }
}

@media print {
  .sidebar, .topbar, .page-actions, .ts-toolbar, .toast-stack, .btn { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  table.data thead th { background: #eef2ff !important; -webkit-print-color-adjust: exact; }
}
