/* TrayFlow design system — hand-authored, no build step.
   Loaded from base.html. Semantic component classes; pages compose these
   instead of ad-hoc utility soup. */

:root {
  /* Navy sidebar keyed to the Final Way logo's dark frame */
  --nav:        #132747;
  --nav-line:   #ffffff18;
  --nav-ink:    #c3d0e4;
  --nav-ink-dim:#8494ad;
  --nav-active: #26426f;
  --nav-active-ico: #82b1e7;

  /* Accent = the Final Way logo blue, deepened for AA contrast on white */
  --accent:     #2f6cb5;
  --accent-ink: #265c9c;
  --accent-tint:#e9f1fa;
  --logo-blue:  #3f7fc6;

  --bg:      #f3f5f8;
  --surface: #ffffff;
  --raise:   #f8fafc;

  --ink:   #1e2a3a;
  --muted: #647084;
  --faint: #97a2b3;
  --line:  #e4e8ef;

  --ok-ink:#3f7c62;    --ok-bg:#ebf6ef;
  --warn-ink:#8a6d2e;  --warn-bg:#fbf2e1;
  --danger-ink:#b04a41; --danger-bg:#fceceb;
  --info-ink:#3a6a92;  --info-bg:#eaf2f8;

  --radius: 9px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px #12233f0d, 0 8px 24px -12px #12233f1f;
  --sidebar-w: 244px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: -.7px; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 650; }
small { font-size: 12px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--muted); }
.eyebrow {
  font-size: 10px; font-weight: 750; letter-spacing: 1.6px;
  color: var(--accent); text-transform: uppercase;
}
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- App shell ---------------------------------------------------- */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  background: var(--nav); color: var(--nav-ink);
  display: flex; flex-direction: column; padding: 22px 14px 0;
  transition: width .15s ease;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 9px; padding: 0 10px 4px;
  color: #fff; font-size: 20px; font-weight: 650; letter-spacing: -.6px;
}
.brand-mark {
  width: 28px; height: 28px; flex: none; border: 1px solid #3d5c8e; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; color: #8fb6e8; font-weight: 600;
}
.brand-mark b { color: #fff; font-weight: 700; }
.brand-dot { color: var(--logo-blue); }

.sidebar .org {
  margin: 18px 4px 20px; padding: 11px 10px; display: flex; gap: 9px; align-items: center;
  background: #ffffff0a; border: 1px solid var(--nav-line); border-radius: 8px;
}
.org-badge {
  width: 30px; height: 30px; flex: none; border-radius: 7px; display: grid; place-items: center;
  background: #2c467a; color: #bcd2ef; font-size: 11px; font-weight: 600;
}
.org strong { display: block; font-size: 12px; color: #e2ece9; }
.org small { font-size: 10px; color: var(--nav-ink-dim); }

.sidebar nav { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.nav-label {
  font-size: 9px; letter-spacing: 1.4px; color: var(--nav-ink-dim);
  padding: 0 12px; margin: 16px 0 6px; text-transform: uppercase;
}
.nav-label:first-child { margin-top: 4px; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0;
  border-radius: 7px; font-size: 13px; color: var(--nav-ink);
}
.nav-link .ico { width: 18px; flex: none; text-align: center; font-size: 15px; color: var(--nav-ink-dim); }
.nav-link .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: #ffffff10; }
.nav-link.active { background: var(--nav-active); color: #fff; }
.nav-link.active .ico { color: var(--nav-active-ico); }
.nav-link .pill {
  margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 999px; background: #c0492f; color: #fff;
}

.sidebar .foot {
  display: flex; align-items: center; gap: 9px; padding: 14px 6px 18px;
  border-top: 1px solid var(--nav-line);
}
.foot .avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: #36568c; color: #c9dcf5; font-size: 12px; font-weight: 600;
}
.foot strong { display: block; font-size: 12px; color: #e2ece9; }
.foot small { font-size: 10px; color: var(--nav-ink-dim); }
.foot form { margin-left: auto; }
.foot .signout { border: 0; background: none; color: var(--nav-ink-dim); font-size: 18px; padding: 4px; }
.foot .signout:hover { color: #fff; }

.main { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .15s ease; }

/* ---------- Collapsed sidebar (desktop rail) --------------------------- */
/* Round chevron button straddling the sidebar's right edge. */
.rail-toggle {
  position: absolute; top: 64px; right: -13px; z-index: 31;
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 6px #1223401f; transition: transform .15s ease, color .1s;
}
.rail-toggle:hover { color: var(--accent); }
.rail-toggle::before { content: "\2039\2039"; letter-spacing: -3px; }   /* ‹‹ */
.shell.rail .rail-toggle::before { content: "\203A\203A"; }             /* ›› */
@media (max-width: 900px) { .rail-toggle { display: none; } }

.shell.rail { --sidebar-w: 64px; }
.shell.rail .sidebar { padding-left: 10px; padding-right: 10px; }
.shell.rail .brand { justify-content: center; padding: 0; }
.shell.rail .brand-name,
.shell.rail .brand-dot,
.shell.rail .org,
.shell.rail .nav-label,
.shell.rail .foot > div { display: none; }
.shell.rail .nav-link { justify-content: center; padding: 10px 0; gap: 0; }
.shell.rail .nav-link .ico { margin: 0; }
.shell.rail .nav-link .pill {
  position: absolute; top: 3px; right: 5px; margin: 0; min-width: 8px; height: 8px;
  padding: 0; font-size: 0; border-radius: 50%;
}
.shell.rail .foot { flex-direction: column; gap: 8px; align-items: center; }
.shell.rail .foot form { margin: 0; }

/* Collapsed: hide labels inline, show them as a hover fly-out tooltip. */
.shell.rail .nav-link .lbl {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 12px; padding: 5px 10px; border-radius: 6px;
  background: var(--nav); color: #fff; font-size: 12px; white-space: nowrap;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .1s;
  z-index: 40;
}
.shell.rail .nav-link:hover .lbl { opacity: 1; }

.topbar {
  height: 60px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
}
.crumbs { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.crumbs strong { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: #c4cecc; }
.menu-btn { display: none; border: 0; background: none; font-size: 19px; color: var(--accent); }
.env-tag {
  font-size: 10px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: #52a98f; display: inline-block; margin-right: 5px; }

.content { padding: 26px 28px 40px; width: 100%; max-width: 1400px; margin: 0 auto; }

.scrim { display: none; }

/* ---------- Page header ------------------------------------------------- */
.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin-bottom: 22px;
}
.pagehead .lead { margin-top: 8px; color: var(--muted); font-size: 13px; }
.pagehead .actions { display: flex; gap: 9px; flex: none; }

/* ---------- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 37px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: #3c4f4b;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: #eef4f2; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 3px #056a5814; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.sm { min-height: 30px; padding: 5px 10px; font-size: 11px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; }
.btn[disabled] { opacity: .55; cursor: default; }

.textlink { font-size: 11px; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ---------- Cards / metrics -------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.cards.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
a.card:hover { border-color: #cdd8d5; }
.card .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.card .ico-box {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  background: #f0f4f3; color: #6c8a80; font-size: 15px;
}
.card .ico-box.ok { background: var(--ok-bg); color: var(--ok-ink); }
.card .ico-box.warn { background: var(--warn-bg); color: var(--warn-ink); }
.card .ico-box.danger { background: var(--danger-bg); color: var(--danger-ink); }
.card .value { display: block; margin: 12px 0 10px; font-size: 27px; font-weight: 650; letter-spacing: -.6px; }
.card .value em { font-size: 13px; font-style: normal; font-weight: 500; color: var(--faint); }
.card .value .slash { color: var(--faint); font-weight: 400; }
.card .value .bad { color: var(--danger-ink); }
.card .foot { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }
.card.attn { border-color: #e6cf9f; }
.card.attn .value { color: var(--warn-ink); }
.card.alarm { border-color: #e7b7b0; }

/* ---------- Panel ---------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; margin-bottom: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel + .panel { margin-top: 20px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #edf1ef;
}
.panel-head h2 .count { font-size: 10px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.panel-head p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; padding: 13px 20px; background: var(--raise); font-size: 11px; font-weight: 600; color: var(--accent); }

.rowlink { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #f0f3f1; }
.rowlink:last-child { border-bottom: 0; }
.rowlink:hover { background: var(--raise); }
.rowlink .lead { flex: 1; min-width: 0; }
.rowlink strong { font-size: 12px; font-weight: 600; }
.rowlink small { display: block; font-size: 10px; color: var(--faint); margin-top: 3px; }
.rowlink .end { text-align: right; white-space: nowrap; }
.thumb {
  width: 32px; height: 34px; flex: none; border-radius: 7px; display: grid; place-items: center;
  background: #f1f5f3; color: #8aa79a; font-size: 18px;
}

/* ---------- Toolbar / filters --------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar .spacer { flex: 1; }

/* ---------- Inputs ------------------------------------------------------- */
input, select, textarea {
  width: 100%; border: 1px solid #dde5e2; border-radius: var(--radius-sm);
  padding: 9px 11px; background: #fff; color: var(--ink); font-size: 12px;
}
input::placeholder { color: #9aa6a3; }
select { max-width: 220px; }
textarea { min-height: 90px; }

.field { }
.field > label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.field .hint { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-panel { max-width: 720px; padding: 24px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 8px 12px; background: var(--danger-bg); color: var(--danger-ink); border-radius: var(--radius-sm); font-size: 11px; }
.field .err, p.err { margin: 4px 0 0; font-size: 11px; color: var(--danger-ink); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: auto; }
.confirm-box { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: 13px; line-height: 1.7; }
.confirm-box.danger { border-color: #e7c1bc; background: var(--danger-bg); color: var(--danger-ink); }
.hintline { font-size: 11px; color: var(--faint); margin-top: 8px; }

/* ---------- Table ------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; text-align: left; }
table.data th {
  padding: 10px 18px; font-size: 10px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: #8a9891; background: var(--raise);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 13px 18px; font-size: 12px; border-bottom: 1px solid #eef2f0; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td, table.data tr.hoverable:hover td { background: var(--raise); }
table.data td .t { font-weight: 600; color: #3d5b50; }
table.data td small { display: block; font-size: 10px; color: var(--faint); margin-top: 3px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, ui-monospace, monospace; font-size: 11px; }
.low { color: var(--warn-ink); font-weight: 600; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.pager .grp { display: flex; gap: 7px; }

/* ---------- Badges ----------------------------------------------------- */
.badge { display: inline-block; font-size: 9px; font-weight: 600; border-radius: 5px; padding: 3px 7px; white-space: nowrap; letter-spacing: .2px; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.danger { background: var(--danger-bg); color: var(--danger-ink); }
.badge.neutral { background: #eff3f2; color: #6f7f78; }
.badge.info { background: var(--info-bg); color: var(--info-ink); }

/* ---------- Misc ------------------------------------------------------- */
.empty { padding: 34px 20px; text-align: center; color: var(--faint); font-size: 12px; }
.flash { margin-bottom: 16px; padding: 11px 15px; border-radius: var(--radius-sm); font-size: 12px; border: 1px solid; }
.flash.success { background: var(--ok-bg); border-color: #cfe6d9; color: var(--ok-ink); }
.flash.error { background: var(--danger-bg); border-color: #ecc7c3; color: var(--danger-ink); }
.flash.info { background: var(--surface); border-color: var(--line); color: var(--ink); }
.appfoot { margin-top: auto; padding: 22px 28px; color: var(--faint); font-size: 10px; display: flex; justify-content: space-between; }

/* ---------- Responsive ----------------------------------------------------- */
/* ---------- Section heading (between panels) --------------------------- */
.subhead { margin: 0 0 8px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.section { margin-bottom: 22px; }
.section > .subhead + * { margin-top: 0; }

/* ---------- Grids ----------------------------------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin-bottom: 20px; }
.grid-13 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* ---------- Back link + detail header -------------------------------- */
.backlink { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.backlink:hover { color: var(--accent); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Action bar (workflow buttons on detail pages) ----------- */
.actionbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actionbar form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.actionbar input[type=text] { width: 130px; min-height: 30px; padding: 5px 8px; }

/* ---------- Info panels (dl-style key/value) ----------------------- */
.infogrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.infocard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 13px; }
.infocard .k { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--faint); }
.infocard .v { margin-top: 5px; }
.infocard .v.big { font-size: 15px; font-weight: 600; }
dl.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px 20px; margin: 0; padding: 18px 20px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
dl.kv dt { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); }
dl.kv dd { margin: 4px 0 0; }

/* ---------- Chips (filter pills) ----------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip { font-size: 11px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); white-space: nowrap; }
.chip:hover { background: var(--raise); }
.chip.on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }

/* ---------- Tabs (scope toggles) --------------------------------- */
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.tabs a { padding: 7px 13px; font-size: 12px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line); }
.tabs a:last-child { border-right: 0; }
.tabs a.on { background: var(--accent); color: #fff; }

/* ---------- Calendar (visit plan) ------------------------------- */
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head span { padding: 9px 10px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); background: var(--raise); text-align: left; }
.cal-week { border-top: 1px solid var(--line); }
.cal-day { min-height: 108px; padding: 8px; border-right: 1px solid #eef2f0; }
.cal-day:last-child { border-right: 0; }
.cal-day.pad { background: var(--raise); }
.cal-day .d { font-size: 11px; color: var(--faint); text-align: right; margin-bottom: 5px; }
.cal-ev { display: block; font-size: 10px; padding: 3px 6px; margin-bottom: 3px; border-radius: 4px;
  background: var(--accent-tint); color: var(--accent-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.done { background: var(--ok-bg); color: var(--ok-ink); }
.cal-ev.cancelled { background: #eef2f0; color: var(--faint); text-decoration: line-through; }

/* ---------- Formset line cards -------------------------------- */
.line-card { border: 1px solid var(--line); border-radius: 7px; padding: 14px; margin-bottom: 12px; }
.line-card .line-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.line-card .line-top span { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); }
.line-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.line-grid .full { grid-column: 1 / -1; }
.line-grid label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }

/* ---------- Two-column form grid ---------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Login ----------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-story { background: var(--nav); color: var(--nav-ink); padding: 48px 52px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-story .brand { color: #fff; font-size: 22px; font-weight: 650; letter-spacing: -.6px; display: flex; align-items: center; gap: 9px; }
.auth-story h1 { color: #eef3fb; font-size: 44px; line-height: 1.15; letter-spacing: -1.5px; font-weight: 550; margin: 22px 0; }
.auth-story p { max-width: 340px; color: var(--nav-ink-dim); line-height: 1.85; }
.auth-flow { display: flex; gap: 12px; margin-top: 36px; }
.auth-flow > div { border: 1px solid #35558c; border-radius: 9px; padding: 12px 14px; font-size: 10px; color: #7c96bd; min-width: 92px; }
.auth-flow strong { display: block; margin-top: 8px; color: #cdddf4; font-size: 12px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 340px; }
.auth-card .pill { font-size: 9px; letter-spacing: 1px; background: var(--accent-tint); color: var(--accent-ink); padding: 6px 10px; border-radius: 4px; font-weight: 700; }
.auth-card h2 { font-size: 27px; letter-spacing: -.6px; margin-top: 20px; font-weight: 650; }
.auth-card form { margin-top: 24px; }
.auth-card .field { margin-bottom: 15px; }
.auth-card .btn { width: 100%; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 11px; color: var(--faint); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-foot { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-story { display: none; }
}

@media (max-width: 1180px) {
  :root { --sidebar-w: 214px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-13 { grid-template-columns: 1fr; }
  .line-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .16s ease; box-shadow: 20px 0 45px #0004; }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: #0b1a1c66; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-block; }
  .content { padding: 20px 16px 32px; }
  .topbar { padding: 0 16px; }
  .pagehead { flex-direction: column; align-items: stretch; }
  .pagehead .actions { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .line-grid { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; }
  .actionbar { width: 100%; }
  .cal-day { min-height: 76px; }
  table.data th, table.data td { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .toolbar select, .toolbar .grow { width: 100%; max-width: none; flex-basis: 100%; }
}
