/* Personeelsportaal - layout: sidebar on desktop, bottom tab bar on phones (installed app). System fonts only: no external requests. */
/* BNL Shipping house style. Brand colours: navy #0a1f4e (headings, menu bar), deep #05122e, button blue #103480,
   accent #2e6ccc, light blue #5a8ee0, soft background #eef4ff, text #0d1f3c, muted #52658a / #8094b5, lines #e5ecf7.
   A few in-between tints (marked "tint") are derived from these for hover and dark-mode surfaces. */
:root {
  --bg: #eef4ff;
  --surface: #ffffff;
  --surface-2: #e5ecf7;
  --ink: #0d1f3c;
  --muted: #52658a;
  --line: #e5ecf7;
  --line-strong: #8094b5; /* form fields: 3:1 against white */
  --accent: #103480;
  --accent-ink: #ffffff;
  --accent-soft: #dde8fa; /* tint of #5a8ee0 */
  --mark: #2e6ccc;
  --mark-ink: #ffffff;
  --brand: #0a1f4e;
  --brand-ink: #ffffff;
  --heading: #0a1f4e;
  --ok: #2b7a4b; --ok-soft: #e1f2e8;
  --warn: #9a5c12; --warn-soft: #fbefd9;
  --bad: #b23a2e; --bad-ink: #ffffff; --bad-soft: #f9e3e0;
  --info: #2e6ccc; --info-soft: #eef4ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 31, 78, .06), 0 4px 16px rgba(10, 31, 78, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 62px;
  color-scheme: light;
}
/* Dark: follows the system, unless a page/host forces data-theme. Surfaces in deep navy (tints of #05122e / #0a1f4e). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05122e; --surface: #0a1f4e; --surface-2: #122a5e; --ink: #eef4ff; --muted: #8094b5; --line: #1f3a72; --line-strong: #8094b5;
    --accent: #5a8ee0; --accent-ink: #05122e; --accent-soft: #0f2756; --mark: #eef4ff; --mark-ink: #05122e;
    --brand: #0a1f4e; --brand-ink: #ffffff; --heading: #eef4ff;
    --ok: #63c48b; --ok-soft: #12301f; --warn: #e8ad55; --warn-soft: #3a2c14; --bad: #ef7d70; --bad-ink: #05122e; --bad-soft: #3d1e1a; --info: #5a8ee0; --info-soft: #102a5c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #05122e; --surface: #0a1f4e; --surface-2: #122a5e; --ink: #eef4ff; --muted: #8094b5; --line: #1f3a72; --line-strong: #8094b5;
  --accent: #5a8ee0; --accent-ink: #05122e; --accent-soft: #0f2756; --mark: #eef4ff; --mark-ink: #05122e;
  --brand: #0a1f4e; --brand-ink: #ffffff; --heading: #eef4ff;
  --ok: #63c48b; --ok-soft: #12301f; --warn: #e8ad55; --warn-soft: #3a2c14; --bad: #ef7d70; --bad-ink: #05122e; --bad-soft: #3d1e1a; --info: #5a8ee0; --info-soft: #102a5c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.modal-open { overflow: hidden; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-wrap; }
.sel { user-select: all; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.warn-text { color: var(--warn); }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.boot, .loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .5rem 1rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.btn.danger { background: var(--bad); color: var(--bad-ink); }
.btn.ghost-danger { background: transparent; color: var(--bad); border-color: var(--bad-soft); margin-right: auto; }
.btn.sm { min-height: 32px; padding: .25rem .65rem; font-size: .85rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); font-size: 1.3rem; cursor: pointer; line-height: 1; }

/* ---------- language switch ---------- */
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); }
.langs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em; padding: .25rem .55rem; border-radius: 999px; cursor: pointer; }
.langs button.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(120% 60% at 0% 0%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem; box-shadow: var(--shadow); display: grid; gap: 1rem; }
.auth-card.wide { max-width: 760px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-foot { margin: 0; text-align: center; font-size: .85rem; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.brand-mark.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 1rem; }
.stack { display: grid; gap: .9rem; }
.steps { padding-left: 1.2rem; display: grid; gap: .75rem; margin: 0; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: max-content; margin: .5rem 0; border: 1px solid var(--line); }
.qr img { display: block; }
.secret { display: block; padding: .5rem; background: var(--surface-2); border-radius: 8px; word-break: break-all; margin-top: .4rem; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; padding: 0; list-style: none; margin: .75rem 0; }
.codes code { display: block; background: var(--surface); padding: .35rem .5rem; border-radius: 6px; text-align: center; }
.code-input { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
.field { display: grid; gap: .3rem; min-width: 0; }
.field > span, .sched-edit legend { font-size: .85rem; font-weight: 600; color: var(--ink); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: .6rem .7rem; width: 100%; min-height: 44px; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: .45rem; }
.hint { color: var(--muted); font-size: .8rem; }
.check { display: flex; gap: .55rem; align-items: center; }
.form-error { color: var(--bad); background: var(--bad-soft); padding: .6rem .8rem; border-radius: 10px; margin: 0; font-size: .9rem; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.grid-form .full { grid-column: 1 / -1; }
.form-heading { font-size: .95rem; margin-top: .4rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.form-note { margin: 0; }
.sched-edit { border: 0; padding: 0; margin: 0; }
.sched-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.sched-grid label { display: grid; gap: .2rem; font-size: .75rem; text-align: center; color: var(--muted); text-transform: capitalize; }
.sched-grid select { padding: .4rem .2rem; font-size: .8rem; min-height: 40px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 18, 46, .55); z-index: 50; display: grid; place-items: center; padding: 16px; }
.sheet { width: 100%; max-width: 640px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.form { padding: 1.25rem; display: grid; gap: 1rem; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.modal-head h2 { font-size: 1.2rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; position: sticky; bottom: -1.25rem; background: var(--surface); padding: .75rem 0 .25rem; margin-bottom: -.25rem; }
.intro { margin: 0; color: var(--muted); }
.more-menu { display: grid; gap: .25rem; }
.more-menu a { display: flex; align-items: center; gap: .75rem; padding: .8rem .6rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.more-menu a:hover, .more-menu a.active { background: var(--surface-2); }
.cred { background: var(--surface-2); padding: .9rem; border-radius: 10px; white-space: pre-wrap; margin: 0; font-size: .9rem; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); z-index: 60; background: var(--ink); color: var(--bg);
  padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.err { background: var(--bad); color: var(--bad-ink); }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--brand); color: var(--brand-ink); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: .75rem; height: 58px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--brand-ink); font-weight: 700; min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: .6rem; }
.me-chip { display: flex; align-items: center; gap: .5rem; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: .2rem; border-radius: 999px; }
.me-text { display: grid; text-align: left; line-height: 1.15; }
.me-text small { color: var(--muted); font-size: .75rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: .95rem; }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.sidenav { position: sticky; top: calc(58px + env(safe-area-inset-top)); align-self: start; height: calc(100vh - 58px); overflow: auto; padding: 1rem .75rem; display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .93rem; }
.sidenav a:hover { background: var(--surface-2); color: var(--ink); }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); }
.nav-group { margin: 1rem .75rem .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-logout { margin-top: auto; border: 0; background: none; color: var(--muted); font: inherit; text-align: left; padding: .6rem .75rem; cursor: pointer; border-radius: 10px; }
.nav-logout:hover { background: var(--surface-2); }
main { min-width: 0; outline: none; }
.tabbar { display: none; }
.page { padding: 1.5rem max(16px, env(safe-area-inset-right)) 3rem max(16px, env(safe-area-inset-left)); display: grid; gap: 1rem; max-width: 1080px; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.section-title { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: .5rem; }
.crumbs { margin: -.5rem 0 0; font-size: .9rem; }
.crumbs a { text-decoration: none; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; min-width: 0; display: grid; gap: .6rem; align-content: start; }
.card h2 { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cards.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.more-link { font-size: .8rem; font-weight: 600; text-decoration: none; }
.sub-h { font-size: .85rem; color: var(--muted); font-weight: 700; margin-top: .4rem; display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.lead { font-size: 1.02rem; margin: 0; }
.callout { background: var(--info-soft); color: var(--ink); border-radius: var(--radius); padding: .85rem 1rem; font-size: .9rem; }
.callout.warn { background: var(--warn-soft); }
.callout.ok { background: var(--ok-soft); }
.danger-zone { border-color: var(--bad-soft); }
.enc-note { margin: 0; font-size: .8rem; color: var(--muted); display: flex; gap: .35rem; align-items: center; }
.enc-note::before { content: ""; width: 10px; height: 12px; border: 2px solid var(--ok); border-radius: 2px; border-top-width: 5px; flex: none; }
.empty { color: var(--muted); margin: 0; font-size: .9rem; }

/* balance meter */
.balance .big { display: flex; align-items: baseline; gap: .5rem; }
.balance .num { font: 800 2.6rem/1 var(--font-num); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--accent); }
.balance .unit { color: var(--muted); }
.meter { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex; }
.m-used { background: var(--accent); }
.m-pend { background: var(--mark); }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; }
.k-used { background: var(--accent); } .k-pend { background: var(--mark); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: grid; gap: .15rem; }
.stat .num { font: 750 1.6rem/1.1 var(--font-num); font-variant-numeric: tabular-nums; }
.stat span:last-child { color: var(--muted); font-size: .85rem; }
.stat.warn .num { color: var(--warn); }

/* quick actions */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.qa { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font: inherit; font-weight: 650; text-align: left; cursor: pointer; text-decoration: none; }
.qa .ico { color: var(--accent); width: 26px; height: 26px; }
.qa span { max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
.qa:hover { border-color: var(--accent); }
.qa.warn { background: var(--warn-soft); border-color: transparent; }
.qa.warn .ico { color: var(--warn); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--mark); color: var(--mark-ink); font-size: .72rem; font-style: normal; font-weight: 800; }
.qa .badge { position: absolute; top: .7rem; right: .7rem; }

/* lists */
.mini { list-style: none; margin: 0; padding: 0; display: grid; }
.mini li { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .92rem; flex-wrap: wrap; }
.mini li:first-child { border-top: 0; }
.mini li > span:nth-child(2) { color: var(--muted); font-variant-numeric: tabular-nums; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.row { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); align-items: flex-start; }
.row:first-child { border-top: 0; }
.row.sick { }
.row.muted-row { opacity: .65; }
.row-main { display: grid; gap: .15rem; min-width: 0; }
.row-title { font-weight: 650; text-decoration: none; color: var(--ink); }
a.row-title:hover { color: var(--accent); }
.row-sub { color: var(--muted); font-size: .87rem; font-variant-numeric: tabular-nums; }
.row-note { font-size: .85rem; color: var(--ink); }
.row-note.decision { color: var(--muted); font-style: italic; }
.row-link { font-size: .85rem; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; flex: none; max-width: 55%; }
.row-acts { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.who { font-weight: 700; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.pw { color: var(--warn); font-size: .82rem; font-weight: 600; }
.check-row { display: flex; gap: .65rem; align-items: flex-start; cursor: pointer; }
.check-row input { margin-top: .15rem; }

.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.st-pending, .st-reported { background: var(--warn-soft); color: var(--warn); }
.st-approved, .st-recovered, .st-paid { background: var(--ok-soft); color: var(--ok); }
.st-rejected, .st-sick_open { background: var(--bad-soft); color: var(--bad); }
.st-neutral { background: var(--surface-2); color: var(--muted); }

.dl { display: grid; gap: 0; margin: 0; }
.dl > div { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.dl > div:first-child { border-top: 0; }
.dl dt { color: var(--muted); font-size: .87rem; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

/* alerts */
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.alert { display: flex; gap: .7rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.alert:first-child { border-top: 0; }
.alert p { margin: 0; font-size: .92rem; }
.alert small { color: var(--muted); }
.alert .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; flex: none; background: var(--info); }
.sev-high .dot { background: var(--bad); }
.sev-medium .dot { background: var(--mark); }

/* schedule */
.sched { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sd { display: grid; justify-items: center; gap: 1px; padding: .35rem .1rem; border-radius: 8px; font-size: .72rem; background: var(--surface-2); color: var(--muted); }
.sd b { text-transform: capitalize; color: var(--ink); font-size: .78rem; }
.sd i { font-style: normal; }
.sd.m-office { background: var(--accent-soft); color: var(--accent); }
.sd.m-home { background: var(--warn-soft); color: var(--warn); }
.sd.m-flex { background: var(--info-soft); color: var(--info); }
.sd.m-off { opacity: .55; }

/* tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: .6rem .85rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .92rem; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.add-row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .75rem; align-content: start; }
.person-head { display: flex; gap: .75rem; align-items: center; }
.person-head h3 { font-size: 1rem; }
.person-head p { margin: 0; }
.contact { display: grid; gap: .15rem; margin: 0; overflow-wrap: anywhere; }

.policy { border-top: 1px solid var(--line); padding: .6rem 0; }
.policy:first-of-type { border-top: 0; }
.policy summary { cursor: pointer; font-weight: 650; }
.policy div { padding-top: .5rem; color: var(--ink); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-top: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .me-text { display: none; }
  .page { padding-bottom: calc(var(--tabbar-h) + 2rem + env(safe-area-inset-bottom)); padding-top: 1.1rem; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabbar-h); color: var(--muted); text-decoration: none;
    font: inherit; font-size: .68rem; font-weight: 600; border: 0; background: none; cursor: pointer; min-width: 0; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .tabbar a.active { color: var(--accent); }
  .cards.two { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 1.35rem; }
  .modal { padding: 0; place-items: end stretch; }
  .sheet { max-width: none; border-radius: 18px 18px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 520px) {
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .row { flex-direction: column; gap: .5rem; }
  .row-side { align-items: flex-start; max-width: none; flex-direction: row; flex-wrap: wrap; }
  .row-acts { justify-content: flex-start; }
  .langs button { padding: .25rem .45rem; }
  .brand-name { max-width: 34vw; }
  .dl > div { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .sched-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- BNL house style ---------- */
h1, h2 { color: var(--heading); }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; padding: 2px; flex: none; display: block; }
.auth-logo { display: block; width: 120px; max-width: 50%; height: auto; background: #fff; border-radius: 12px; padding: 6px; }
.topbar .avatar { background: rgba(255, 255, 255, .16); color: var(--brand-ink); }
.topbar .icon-btn, .topbar .btn.ghost { color: var(--brand-ink); border-color: rgba(255, 255, 255, .35); background: transparent; }
.topbar .langs { background: transparent; border-color: rgba(255, 255, 255, .35); }
.topbar .langs button { color: var(--brand-ink); }
.topbar .langs button.on { background: var(--brand-ink); color: var(--brand); }
.topbar a, .topbar button { color: inherit; }
.topbar .me-text small { color: #c9d6ee; } /* tint: readable on navy (contrast > 9:1) */
/* Dark: active menu item in near-white (light blue on the dark tint was 4.4:1, just under AA), light-blue bar as marker */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidenav a.active { color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); } }
:root[data-theme="dark"] .sidenav a.active { color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
/* Session timeout warning: its own layer above the form modal, so a half-filled form underneath is kept */
.session-warn { position: fixed; inset: 0; z-index: 70; background: rgba(5, 18, 46, .55); display: grid; place-items: center; padding: 16px; }
.session-warn .sheet { max-width: 440px; padding: 1.25rem 1.4rem; display: grid; gap: .75rem; }
.session-warn p { margin: 0; }
