/* =====================================================================
   Vohitsara - feuille de style
   Palette sobre : bleu marine / blanc, accents vert et rouge reserves
   aux statuts. Aucune dependance externe (chargement rapide).
   ===================================================================== */

:root {
  --navy-900: #0f2a47;
  --navy-800: #163353;
  --navy-700: #1b3a5c;
  --navy-600: #27567f;
  --navy-500: #356a97;
  --primary: #1f5f8b;
  --primary-soft: #eaf1f7;

  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --ink: #16222e;
  --ink-2: #34465a;
  --muted: #6b7a8c;
  --muted-2: #94a3b4;

  --success: #1a7f4b;
  --success-bg: #e8f6ee;
  --warn: #a96400;
  --warn-bg: #fdf3e3;
  --danger: #b3261e;
  --danger-bg: #fdedec;
  --info: #1f5f8b;
  --info-bg: #eaf1f7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 71, .06), 0 1px 3px rgba(15, 42, 71, .04);
  --shadow: 0 2px 4px rgba(15, 42, 71, .05), 0 6px 18px rgba(15, 42, 71, .06);
  --shadow-lg: 0 10px 30px rgba(15, 42, 71, .12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

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

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; color: var(--navy-900); font-weight: 650; }
h1 { font-size: 1.5rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
h4 { font-size: .9rem; }
p { margin: 0 0 .75rem; }

/* ------------------------------- Barre haute ------------------------ */

.topbar {
  background: var(--navy-900);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 20px rgba(15,42,71,.18);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--navy-600); display: flex; }
.brand-mark svg rect { fill: rgba(255,255,255,.14); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.02rem; letter-spacing: .02em; }
.brand-text small {
  font-size: .68rem; color: #a8bcd0; max-width: 30ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav {
  display: flex;
  gap: .15rem;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: .1rem 0;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #c6d5e3;
  padding: .42rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 550;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.nav a.is-active { background: rgba(255,255,255,.16); color: #fff; }

.userbox {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
  margin-left: auto;
}
.userbox-info { text-align: right; line-height: 1.2; }
.userbox-info strong { display: block; font-size: .82rem; }
.userbox-info small { font-size: .68rem; color: #a8bcd0; }
.userbox-menu { display: flex; gap: .5rem; align-items: center; font-size: .78rem; }
.userbox-menu a, .linkbtn {
  color: #c6d5e3; background: none; border: 0; padding: 0;
  font: inherit; cursor: pointer; text-decoration: none;
}
.userbox-menu a:hover, .linkbtn:hover { color: #fff; text-decoration: underline; }

/* ------------------------------- Contenu ---------------------------- */

.content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.page-head .sub { color: var(--muted); font-size: .86rem; margin: 0; }
.page-head h1 { margin-bottom: .15rem; }

.footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
}
.footer .sep { margin: 0 .4rem; color: var(--muted-2); }
.footer-meta { margin-top: .25rem; color: var(--muted-2); }
.footer-credit {
  margin-top: .35rem;
  color: var(--muted-2);
  font-size: .72rem;
  letter-spacing: .02em;
}
.footer-credit a { color: inherit; }

/* ------------------------------- Cartes ----------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.card-head h2, .card-head h3 { margin: 0; font-size: .95rem; }
.card-head .hint { font-size: .76rem; color: var(--muted); font-weight: 400; }
.card-body { padding: 1rem; }
.card-body.tight { padding: .6rem .75rem; }
.card-foot {
  padding: .7rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .82rem;
  color: var(--muted);
}

/* ------------------------------- KPI -------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .8rem;
  margin-bottom: 1rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--navy-600);
}
.kpi.kpi-success::before { background: var(--success); }
.kpi.kpi-warn::before { background: var(--warn); }
.kpi.kpi-danger::before { background: var(--danger); }
.kpi.kpi-plain::before { background: var(--border-strong); }

.kpi-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: .3rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.kpi-value {
  font-size: 1.4rem;
  font-weight: 680;
  color: var(--navy-900);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.kpi-value.small { font-size: 1.1rem; }
.kpi-note { font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.kpi-value.neg { color: var(--danger); }
.kpi-value.pos { color: var(--success); }

/* ------------------------------- Boutons ---------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .48rem .85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--navy-700);
  color: #fff;
  font-size: .84rem;
  font-weight: 570;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--navy-600); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent; color: var(--ink-2); border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--muted-2); }
.btn-light { background: #fff; color: var(--navy-700); border-color: #fff; }
.btn-light:hover { background: #eef4f9; color: var(--navy-900); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #94201a; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #14663c; }
.btn-sm { padding: .32rem .6rem; font-size: .78rem; }
.btn-xs { padding: .22rem .45rem; font-size: .72rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ------------------------------- Formulaires ------------------------ */

form.inline { display: inline; }

label { display: block; font-size: .8rem; font-weight: 570; color: var(--ink-2); margin-bottom: .22rem; }
.label-hint { font-weight: 400; color: var(--muted); font-size: .74rem; }

input[type=text], input[type=number], input[type=password], input[type=date],
input[type=email], input[type=tel], input[type=search], input[type=file], select, textarea {
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .86rem;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(53, 106, 151, .14);
}
input[type=file] { padding: .35rem .4rem; font-size: .78rem; }
textarea { min-height: 68px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5l4-4' stroke='%236b7a8c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .5rem center; background-size: 12px; padding-right: 1.6rem; }

.grid { display: grid; gap: .7rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field-actions { display: flex; align-items: flex-end; gap: .5rem; }
.form-note { font-size: .76rem; color: var(--muted); margin-top: .3rem; }

.checkbox { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 500; }
.checkbox input { width: auto; }
.checkbox label { margin: 0; font-weight: 500; }

/* ------------------------------- Tableaux --------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  min-width: 520px;
}
table.data th, table.data td {
  padding: .5rem .6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data thead th {
  background: var(--surface-2);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody tr:hover { background: #fafcfe; }
table.data tfoot td {
  background: var(--surface-2);
  font-weight: 650;
  color: var(--navy-900);
  border-top: 2px solid var(--border-strong);
  border-bottom: 0;
}
table.data.compact th, table.data.compact td { padding: .35rem .5rem; font-size: .8rem; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.tiny { font-size: .72rem; }
.strong { font-weight: 650; }
.mono { font-family: var(--mono); font-size: .8em; }
.neg { color: var(--danger); }
.pos { color: var(--success); }
.strike { text-decoration: line-through; color: var(--muted); }

.empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
}

/* ------------------------------- Badges ----------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 620;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: #bfe3cd; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d9a8; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: #f5c8c4; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: #c3d8ea; }
.badge-muted { background: #eef1f5; color: var(--muted); border-color: #dbe2ea; }
.badge-navy { background: #e7eef5; color: var(--navy-700); border-color: #c9d9e8; }

/* ------------------------------- Progression ------------------------ */

.progress {
  height: 8px;
  background: #e8edf3;
  border-radius: 999px;
  overflow: hidden;
  min-width: 70px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--navy-600);
  border-radius: 999px;
  transition: width .4s ease;
}
.progress.thin { height: 5px; }
.progress.success > span { background: var(--success); }
.progress.warn > span { background: var(--warn); }
.progress.danger > span { background: var(--danger); }

.progress-line { display: flex; align-items: center; gap: .5rem; }
.progress-line .progress { flex: 1 1 auto; }
.progress-line .pct { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }

/* ------------------------------- Alertes ---------------------------- */

.alert {
  display: flex;
  gap: .6rem;
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  margin-bottom: .55rem;
  font-size: .85rem;
  align-items: flex-start;
}
.alert-icon { flex: 0 0 auto; font-weight: 700; line-height: 1.4; }
.alert-title { font-weight: 640; display: block; }
.alert-text { color: var(--ink-2); font-size: .82rem; }
.alert-danger { background: var(--danger-bg); border-color: #f3c7c3; color: var(--danger); }
.alert-warning { background: var(--warn-bg); border-color: #f0d9a8; color: var(--warn); }
.alert-info { background: var(--info-bg); border-color: #c3d8ea; color: var(--info); }
.alert-success { background: var(--success-bg); border-color: #bfe3cd; color: var(--success); }
.alert-list { margin-bottom: 1rem; }

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .87rem;
  font-weight: 520;
  border: 1px solid;
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: #bfe3cd; }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: #f3c7c3; }
.flash-close { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: inherit; line-height: 1; opacity: .6; }
.flash-close:hover { opacity: 1; }

/* ------------------------------- Graphiques ------------------------- */

.chart-flex {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.chart-donut { width: 180px; height: 180px; flex: 0 0 auto; }
.donut-value { font-size: 15px; font-weight: 700; fill: var(--navy-900); font-family: var(--font); }
.donut-label { font-size: 10px; fill: var(--muted); font-family: var(--font); text-transform: uppercase; letter-spacing: .06em; }
.donut-center { font-size: 10px; fill: var(--muted); font-family: var(--font); }

.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; min-width: 200px; }
.legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .28rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .83rem;
}
.legend li:last-child { border-bottom: 0; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.legend-label { flex: 1 1 auto; color: var(--ink-2); }
.legend-pct { font-weight: 650; color: var(--navy-900); font-variant-numeric: tabular-nums; }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { margin-bottom: .6rem; }
.bar-head { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: .2rem; gap: .5rem; }
.bar-head span { color: var(--ink-2); }
.bar-track { height: 7px; background: #eaeff5; border-radius: 999px; overflow: hidden; display: flex; }
.bar-fill { background: var(--navy-600); border-radius: 999px; }

.dual-bar { display: flex; flex-direction: column; gap: .18rem; }
.dual-bar .row { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--muted); }
.dual-bar .row .progress { flex: 1 1 auto; }
.dual-bar .tag { width: 3.6em; flex: 0 0 auto; color: var(--muted-2); }

/* ------------------------------- Divers ----------------------------- */

.tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: .5rem .75rem;
  font: inherit;
  font-size: .85rem;
  font-weight: 570;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  text-decoration: none;
}
.tabs button:hover, .tabs a:hover { color: var(--navy-700); text-decoration: none; }
.tabs button.is-active, .tabs a.is-active { color: var(--navy-900); border-bottom-color: var(--navy-700); }

details.panel { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .6rem; background: #fff; }
details.panel > summary {
  padding: .6rem .85rem;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 600;
  color: var(--navy-800);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: '+'; font-weight: 400; font-size: 1.1rem; color: var(--muted); }
details.panel[open] > summary::after { content: '\2212'; }
details.panel[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface-2); }
details.panel .panel-body { padding: .85rem; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: var(--primary-soft); flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: var(--navy-700);
  border: 1px solid var(--border);
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }

.person { display: flex; align-items: center; gap: .5rem; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.split-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }

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

.hstack { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.vstack { display: flex; flex-direction: column; gap: .5rem; }
.spacer { flex: 1 1 auto; }
.text-right { text-align: right; }
.mt0 { margin-top: 0; } .mt1 { margin-top: .5rem; } .mt2 { margin-top: 1rem; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: .5rem; } .mb2 { margin-bottom: 1rem; }

.pill-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--primary-soft); color: var(--navy-700);
  border-radius: 999px; padding: .18rem .6rem; font-size: .75rem; font-weight: 570;
}

.mini-table { width: 100%; font-size: .82rem; border-collapse: collapse; }
.mini-table td { padding: .3rem 0; border-bottom: 1px dashed var(--border); }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 570; }

.day-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .6rem;
  background: #fff;
  font-size: .78rem;
}
.day-card.is-today { border-color: var(--navy-500); box-shadow: 0 0 0 2px rgba(53,106,151,.12); background: #f7fbff; }
.day-card.is-past { opacity: .72; }
.day-card .day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .3rem; }
.day-card .day-head strong { font-size: .82rem; color: var(--navy-800); text-transform: capitalize; }
.day-card .day-head span { font-size: .7rem; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }

.journal-item { border-left: 3px solid var(--navy-600); padding: .5rem .75rem; margin-bottom: .6rem; background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.journal-item .ji-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; margin-bottom: .25rem; flex-wrap: wrap; }
.journal-item .ji-head strong { color: var(--navy-800); }
.io-list { display: flex; gap: .35rem; flex-wrap: wrap; margin: .3rem 0; }
.io { font-size: .74rem; padding: .12rem .45rem; border-radius: 999px; font-weight: 570; }
.io.in { background: var(--success-bg); color: var(--success); }
.io.out { background: var(--warn-bg); color: var(--warn); }

.row-line { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .35rem; background: #fff; }
.row-line .grow { flex: 1 1 auto; min-width: 0; }
.row-line .trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- Connexion -------------------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background:
    radial-gradient(1200px 500px at 50% -10%, #1d4368 0%, transparent 70%),
    var(--navy-900);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-head { padding: 1.4rem 1.5rem 1rem; text-align: center; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.login-head .brand-mark { justify-content: center; display: flex; margin-bottom: .5rem; color: var(--navy-800); }
.login-head .brand-mark svg rect { fill: var(--navy-800); }
.login-head h1 { font-size: 1.25rem; margin-bottom: .2rem; }
.login-head p { font-size: .8rem; color: var(--muted); margin: 0; }
.login-body { padding: 1.25rem 1.5rem 1.5rem; }
.login-foot { padding: .75rem 1.5rem 1.25rem; text-align: center; font-size: .74rem; color: var(--muted-2); }

/* ------------------------------- Impression ------------------------- */

@media print {
  .topbar, .footer, .btn, .no-print, .tabs { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  table.data { min-width: 0; font-size: 9pt; }
  table.data thead th { background: #eee !important; }
  a { color: #000; text-decoration: none; }
}

/* ------------------------------- Mobile ----------------------------- */

@media (max-width: 760px) {
  body { font-size: 14px; }
  .content { padding: .9rem .7rem 2.5rem; }
  .topbar-inner { padding: .5rem .7rem; gap: .5rem; }
  .brand-text small { max-width: 22ch; }
  .userbox-info { display: none; }
  .userbox { gap: .5rem; }
  .nav { order: 3; width: 100%; flex-basis: 100%; margin: 0 -.7rem; padding: .15rem .7rem .1rem; }
  .nav a { font-size: .82rem; padding: .38rem .6rem; }
  h1 { font-size: 1.25rem; }
  .kpi-value { font-size: 1.2rem; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .55rem; }
  .kpi { padding: .7rem .8rem; }
  .card-body { padding: .8rem; }
  .chart-donut { width: 150px; height: 150px; margin: 0 auto; }
  .chart-flex { justify-content: center; }
  .page-head { align-items: flex-start; }
  .table-wrap { margin: 0 -.8rem; padding: 0 .8rem; }
  .plan-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 1.05rem; }
  .brand-text small { display: none; }
}

.public-body .content { max-width: 1000px; }
