/* ===========================================================================
   HydroApps — application styles (sidebar layout)
   Built on the HydroTeam design system tokens (static/ds). Translates the
   Claude Design prototype into reusable, production CSS.
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ht-blue); text-decoration: none; }
img { display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 6px; }

@keyframes ha-spin { to { transform: rotate(360deg); } }
@keyframes ha-shimmer { 0% { background-position: -360px 0; } 100% { background-position: 360px 0; } }
@keyframes ha-fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ha-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.ha-screen { animation: ha-fadeup .26s var(--ease-out); }

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

.sidebar {
  flex: none; width: 248px; background: #fff;
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  min-height: 100vh; position: sticky; top: 0;
}
.sidebar__brand {
  padding: 22px 22px 18px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 11px;
}
.brand-mark { height: 30px; width: 30px; object-fit: contain; }
.brand-word {
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  letter-spacing: .03em; color: var(--text-strong);
}
.brand-word b { color: var(--ht-blue); font-weight: 800; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: 6px; cursor: pointer;
  font-family: var(--font-heading); font-size: 14px; font-weight: 500;
  color: var(--text-body); transition: background .15s var(--ease-out);
}
.nav-item:hover { background: var(--sand-50); }
.nav-item.active { background: var(--blue-50); color: var(--ht-blue); font-weight: 700; }
.nav-item svg { flex: none; }
.pending-pill {
  margin-left: auto; background: var(--ht-orange); color: #fff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  border-radius: var(--radius-pill); padding: 1px 7px;
}

.sidebar__user {
  padding: 14px 16px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 11px;
}
.sidebar__user .who { flex: 1; min-width: 0; }
.sidebar__user .who-name {
  font-size: 13px; font-weight: 600; color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__user .who-role {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint);
}
.icon-btn { background: none; border: none; padding: 0; cursor: pointer; color: var(--text-faint); flex: none; display: flex; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue-500);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 13px; flex: none;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11px; background: var(--ink-100); color: var(--ink-600); }
.avatar--lg { width: 42px; height: 42px; font-size: 14px; }

.content { flex: 1; overflow-x: hidden; }
.content__inner { max-width: 1080px; margin: 0 auto; padding: 34px 40px 80px; }

/* ---------- typography helpers ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ht-blue); margin-bottom: 8px;
}
.eyebrow--orange { color: var(--ht-orange); }
.page-title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: 30px; letter-spacing: -.01em; color: var(--text-strong); margin: 0;
}
.page-title--xl { font-size: 34px; }
.page-sub { color: var(--text-muted); font-size: 14px; margin: 8px 0 0; max-width: 620px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.bars { height: 13px; margin-bottom: 14px; }
.section-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  padding: 11px 22px; font-family: var(--font-heading); font-weight: 700;
  font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
  background: var(--ht-blue); color: #fff; transition: filter .15s var(--ease-out);
  text-decoration: none; line-height: 1;
}
.btn:hover { filter: brightness(1.06); }
.btn--orange { background: var(--ht-orange); }
.btn--success { background: var(--success); }
.btn--lg { padding: 14px 30px; font-size: 14px; }
.btn--sm { padding: 9px 16px; font-size: 12px; }
.btn--outline { background: transparent; color: var(--ht-blue); border: 2px solid var(--ht-blue); padding: 9px 16px; }
.btn--outline:hover { background: var(--blue-50); filter: none; }
.btn--danger-outline { background: transparent; color: var(--danger); border: 2px solid var(--danger); padding: 9px 18px; }
.btn--danger-outline:hover { background: #FBE3E0; filter: none; }
.btn--ghost { background: transparent; color: var(--text-muted); border: 2px solid var(--border-strong); padding: 9px 18px; }
.btn--ghost:hover { background: var(--sand-50); filter: none; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }

/* radio-driven segmented control (Expenses/Mileage, One-way/Return; works without JS) */
.seg { display: inline-flex; gap: 6px; }
.seg label { position: relative; cursor: pointer; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
/* the <span> is the visible chip; selected state via adjacent-sibling — no :has() needed */
.seg label span {
  display: inline-flex; align-items: center; padding: 0 18px; height: 42px;
  border-radius: var(--radius-sm); border: 2px solid var(--border-strong);
  background: #fff; color: var(--text-muted); font-family: var(--font-heading);
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
}
.seg input:checked + span { border-color: var(--ht-blue); background: var(--ht-blue); color: #fff; }
.seg--sm label span { height: 38px; padding: 0 14px; }

/* ---------- forms ---------- */
.label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 6px;
}
.input, .select {
  width: 100%; border: 2px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; color: var(--text-strong); background: #fff;
  font-family: var(--font-body);
}
.input:focus, .select:focus { outline: none; border-color: var(--ht-blue); }
.form-inline { display: inline; }
.input--mono { font-family: var(--font-mono); }
.input--slim { border-width: 1.5px; border-radius: 4px; padding: 9px; font-size: 13px; }
.form-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.help { color: var(--text-faint); font-size: 12px; margin-top: 8px; line-height: 1.5; }

/* ---------- cards & panels ---------- */
.card { background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.card--pad { padding: 22px; }
.card--shadow { box-shadow: var(--shadow-xs); }
.stack > * + * { margin-top: 18px; }

.panel { background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
}
.panel__title {
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-strong); margin: 0;
}
.empty { padding: 40px 20px; text-align: center; color: var(--text-faint); font-size: 14px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left; padding: 14px 16px; background: var(--sand-50);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); font-weight: 400;
}
.table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 14px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-family: var(--font-mono); font-weight: 700; color: var(--text-strong); }
.table .col-num { text-align: right; }
.table .strong { color: var(--text-strong); font-weight: 600; }
.table .muted { color: var(--text-muted); }
.table .mono { font-family: var(--font-mono); }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--sand-50); }
.subrow td { padding-top: 0; border-bottom: 1px solid var(--border-subtle); }
.subrow .meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: 12.5px; }
.tiny-label { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: var(--radius-sm);
  background: var(--ink-100); color: var(--ink-700);
}
.badge--draft { background: var(--ink-100); color: var(--ink-700); }
.badge--submitted { background: var(--orange-50); color: var(--orange-700); }
.badge--approved { background: #E2F3EC; color: var(--success); }
.badge--rejected { background: #FBE3E0; color: var(--danger); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono);
  font-size: 10px; color: var(--ht-blue); border: 1px solid var(--blue-100);
  border-radius: 3px; padding: 2px 6px; cursor: pointer; text-transform: uppercase; letter-spacing: .05em;
}
.chip--return { background: var(--blue-50); border: none; padding: 1px 5px; font-size: 9px; cursor: default; }
.kind-tag { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ht-blue); font-weight: 600; }
.del-x { cursor: pointer; color: var(--text-faint); font-size: 16px; line-height: 1; background: none; border: none; }
.del-x:hover { color: var(--danger); }

/* ---------- filter tabs ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-subtle);
  background: #fff; color: var(--text-muted); font-family: var(--font-heading);
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.tab:hover { border-color: var(--border-strong); }
.tab.active { background: var(--ht-blue); border-color: var(--ht-blue); color: #fff; }
.tab .count { font-family: var(--font-mono); font-size: 11px; opacity: .8; }

/* ---------- stat cards ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { flex: 1; min-width: 170px; background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px 18px; }
.stat__value { font-family: var(--font-mono); font-weight: 700; font-size: 28px; line-height: .9; letter-spacing: -.03em; }
.stat__label { font-family: var(--font-heading); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-muted); margin-top: 10px; }

/* ---------- dashboard tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile {
  position: relative; background: #fff; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 24px; cursor: pointer; overflow: hidden;
  box-shadow: var(--shadow-xs); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
  color: inherit; display: block;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tile__accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--ht-blue); }
.tile__accent--orange { background: var(--ht-orange); }
.tile__icon { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--blue-50); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.tile__icon--orange { background: var(--orange-50); }
.tile__icon--muted { background: var(--ink-100); }
.tile h3 { font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: var(--text-strong); margin: 0 0 6px; }
.tile p { color: var(--text-muted); font-size: 13.5px; line-height: 1.55; margin: 0; }
.tile--soon { background: var(--sand-50); border: 1px dashed var(--border-strong); opacity: .75; cursor: default; box-shadow: none; }
.tile--soon:hover { transform: none; box-shadow: none; }
.tile__count { position: absolute; top: 22px; right: 22px; background: var(--ht-orange); color: #fff; font-family: var(--font-mono); font-weight: 700; font-size: 12px; border-radius: var(--radius-pill); padding: 3px 9px; }

/* ---------- toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--ink-300); border-radius: var(--radius-pill); transition: background .2s var(--ease-out); }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .2s var(--ease-out); }
.switch input:checked + .track { background: var(--ht-blue); }
.switch input:checked + .track .knob { left: 22px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.setting-row .title { font-weight: 600; color: var(--text-strong); font-size: 14px; }
.setting-row .desc { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- detail header & decision panel ---------- */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-meta { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 14px; }
.detail-meta .total { font-family: var(--font-mono); color: var(--text-strong); font-size: 16px; margin-left: 4px; font-weight: 700; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; cursor: pointer; margin-bottom: 16px; }
.back-link:hover { color: var(--ht-blue); }

.decide-panel {
  background-image: linear-gradient(120deg, rgba(2,30,55,.94), rgba(3,63,113,.9)), var(--water-bg);
  background-size: cover; background-position: center;
  border-radius: var(--radius-md); padding: 22px; margin: 22px 0; color: #fff;
  animation: ha-pop .25s var(--ease-out) both;
}
.decide-panel .eyebrow { color: var(--ht-sky); margin-bottom: 6px; }
.decide-panel .form-row { align-items: center; }
.decide-panel .input { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.decide-panel .input::placeholder { color: rgba(255,255,255,.6); }

/* the "add ride" form — labelled fields that wrap responsively */
.add-row { padding: 18px 16px; background: var(--sand-50); border-top: 1px solid var(--border-subtle); }
.mform { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.mfield { display: flex; flex-direction: column; gap: 5px; }
.mfield > label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.mfield--grow { flex: 1 1 220px; min-width: 200px; }
.mform-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.preview-amount { font-family: var(--font-mono); font-weight: 700; font-size: 16px; color: var(--ht-blue); min-width: 64px; }

/* address autocomplete — fixed-positioned (set by JS) so it isn't clipped by the panel */
.ac { position: relative; }
.ac-menu { position: fixed; z-index: 50; list-style: none; margin: 0; padding: 4px;
  background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto; }
.ac-menu li { padding: 8px 10px; border-radius: 4px; font-size: 13px; line-height: 1.35; cursor: pointer; color: var(--text-body); }
.ac-menu li:hover, .ac-menu li.active { background: var(--blue-50); color: var(--ht-blue); }
.file-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: #fff; color: var(--text-muted); font-family: var(--font-heading); font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap; }
.file-btn.has-file { border-color: var(--ht-blue); background: var(--blue-50); color: var(--ht-blue); }
.file-btn input[type=file] { display: none; }

/* ---------- history timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 18px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ht-blue); margin-top: 3px; }
.tl-dot--submitted { background: var(--ht-orange); }
.tl-dot--approved { background: var(--success); }
.tl-dot--emailed { background: var(--ht-sky); }
.tl-dot--email_failed { background: var(--warning); }
.tl-dot--email_skipped { background: var(--ink-300); }
.tl-dot--rejected { background: var(--danger); }
.tl-line { width: 2px; flex: 1; background: var(--border-subtle); margin-top: 3px; min-height: 12px; }
.tl-body .what { font-size: 14px; color: var(--text-strong); }
.tl-body .when { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.tl-body .comment { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; font-style: italic; }

/* ---------- approvals cards ---------- */
.approval { overflow: hidden; }
.approval__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; flex-wrap: wrap; }
.approval__who { display: flex; gap: 14px; align-items: center; }
.approval__name { font-weight: 700; color: var(--text-strong); font-size: 16px; }
.approval__sub { color: var(--text-muted); font-size: 13.5px; }
.approval__total { font-family: var(--font-mono); font-weight: 700; font-size: 22px; color: var(--text-strong); letter-spacing: -.02em; text-align: right; }
.approval__actions { display: flex; gap: 10px; align-items: center; padding: 14px 22px; background: var(--sand-50); border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.view-link { color: var(--ht-blue); font-size: 12.5px; font-weight: 600; cursor: pointer; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2,30,55,.62); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 460px; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal--wide { max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border-subtle); }
.modal__title { font-family: var(--font-heading); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-strong); }
.modal__close { cursor: pointer; color: var(--text-faint); font-size: 22px; line-height: 1; background: none; border: none; }
.modal__body { padding: 24px; }
.modal__foot { padding: 13px 22px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 10px; }

.choice {
  display: flex; gap: 16px; align-items: center; padding: 20px;
  border: 2px solid var(--border-subtle); border-radius: var(--radius-md);
  cursor: pointer; width: 100%; text-align: left; background: #fff;
}
.choice + .choice { margin-top: 14px; }
.choice:hover { border-color: var(--ht-orange); }
.choice__icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex: none; background: var(--blue-50); }
.choice__icon--orange { background: var(--orange-50); }
.choice__title { font-weight: 700; color: var(--text-strong); font-size: 15px; }
.choice__desc { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.ai-note { display: flex; align-items: center; gap: 8px; background: var(--sky-50); border: 1px solid var(--sky-300); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 18px; font-size: 12.5px; color: var(--sky-600); font-weight: 600; }

/* camera scanner */
.cam-wrap { position: relative; background: #0B1620; border-radius: var(--radius-md); overflow: hidden; min-height: 280px; display: flex; align-items: center; justify-content: center; }
.cam-wrap video { width: 100%; display: block; }
.cam-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(2,30,55,.72); color: #fff; font-size: 12px; padding: 5px 12px; border-radius: var(--radius-pill); white-space: nowrap; }
.spinner { animation: ha-spin 1s linear infinite; }
.shimmer { height: 14px; border-radius: 3px; background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%); background-size: 360px 100%; animation: ha-shimmer 1.2s infinite linear; }
.pdf-frame { width: 100%; height: 70vh; border: none; }

/* ---------- toast & flashes ---------- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--ink-900); color: #fff; padding: 12px 22px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: ha-pop .2s var(--ease-out) both; display: flex; align-items: center; gap: 10px; }
.toast__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ht-sky); }
.toast--error .toast__dot { background: var(--ht-orange); }

/* ---------- login ---------- */
.login { display: flex; width: 100%; min-height: 100vh; }
.login__brand {
  flex: 1.1; position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px; color: #fff; min-height: 100vh;
  background-image: linear-gradient(160deg, rgba(2,30,55,.82), rgba(2,30,55,.94)), var(--water-bg);
  background-size: cover; background-position: center;
}
.login__brand-top { display: flex; align-items: center; gap: 14px; }
.login__brand-top .brand-word { color: #fff; }
.login__brand-top .brand-word b { color: var(--ht-sky); }
.login__hero { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 54px; line-height: .98; letter-spacing: -.02em; }
.login__hero-sub { max-width: 380px; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.6; margin-top: 22px; }
.login__foot { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.login__form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; min-height: 100vh; background: var(--surface-page); }
.login__form { width: 100%; max-width: 380px; }
.login__form h1 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 30px; letter-spacing: -.01em; color: var(--text-strong); margin: 0 0 6px; }
.login__ms { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; border: 2px solid var(--border-strong); border-radius: var(--radius-sm); padding: 13px; font-family: var(--font-heading); font-weight: 600; font-size: 15px; color: var(--text-strong); cursor: pointer; text-decoration: none; }
.login__ms:hover { background: var(--sand-50); }
.login__divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.login__divider span { flex: 1; height: 1px; background: var(--border-subtle); }

/* ---------- error page ---------- */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.error-page .code { font-family: var(--font-mono); font-size: 64px; font-weight: 700; color: var(--ht-blue); letter-spacing: -.03em; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; min-height: 0; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar__brand { border-bottom: none; flex: 1; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 0 100%; padding: 8px; }
  .nav-item { padding: 8px 11px; }
  .sidebar__user { border-top: none; }
  .content__inner { padding: 24px 18px 64px; }
  .grid-2 { grid-template-columns: 1fr; }
  .mfield, .mfield--grow { flex: 1 1 100%; min-width: 0; }
  .login { flex-direction: column; }
  .login__brand { min-height: 320px; }
  .login__hero { font-size: 40px; }
}
[hidden] { display: none !important; }
