/* ============================================================
   Construction Management & Operations Platform
   Shared design system - flat, navy/blue (Cosmos), professional
   ============================================================ */

:root {
  /* Brand (Cosmos Real Estates: navy + royal blue from the logo).
     Variable names are kept so every component picks the new colours up. */
  --forest:        #1b2459;   /* sidebar, dark headers (deep navy) */
  --forest-2:      #27317a;   /* sidebar hover / raised */
  --forest-3:      #111842;   /* sidebar deep accents */
  --green:         #2b3a97;   /* primary buttons, links, active (logo blue) */
  --green-strong:  #222e7e;   /* primary hover */
  --green-soft:    #5b6bc2;   /* secondary accent */
  --sage:          #eceff8;   /* card tint, hover rows */
  --sage-2:        #d9def1;   /* borders on tinted areas */
  --mint:          #f4f6fc;   /* subtle fills */

  /* Neutrals */
  --bg:            #f4f5f8;
  --card:          #ffffff;
  --border:        #e2e4ec;
  --border-strong: #cdd1dd;
  --text:          #1e2235;
  --text-muted:    #5f6577;
  --text-faint:    #8a8fa0;

  /* Status (flat, muted) */
  --ok:            #2e7d4f;
  --ok-bg:         #e6f2ea;
  --warn:          #9a6b18;
  --warn-bg:       #f4ebd8;
  --bad:           #a5382f;
  --bad-bg:        #f4e2df;
  --info:          #3b5ba5;
  --info-bg:       #e8edf8;

  --sidebar-w:     260px;
  --topbar-h:      60px;
  --radius:        6px;
  --radius-sm:     4px;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--text); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   App shell
   ============================================================ */

#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--forest);
  color: #d2d7ec;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Sidebar brand --- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--forest-3);
}
.brand .mark {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.brand .name {
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
  line-height: 1.25;
}
.brand .name small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: #9ba3cf;
}

/* --- Sidebar nav --- */
.nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 20px;
}
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb { background: var(--forest-2); border-radius: 4px; }

.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 0; }
.nav-group-label {
  padding: 6px 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aeb5dd; /* 7.2:1 on the sidebar navy (WCAG AA for small text) */
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 20px;
  color: #c6cbe6;
  font-size: 13px;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; color: #8e97c8; }
.nav-item:hover { background: var(--forest-2); color: #fff; text-decoration: none; }
.nav-item:hover i { color: #d5daf0; }
.nav-item.active {
  background: var(--forest-2);
  color: #fff;
  border-left-color: var(--green-soft);
  font-weight: 500;
}
.nav-item.active i { color: var(--green-soft); }

/* --- Sidebar user block --- */
.side-user {
  border-top: 1px solid var(--forest-3);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; font-size: 12.5px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 11px; color: #9ba3cf; }
.side-user .logout { color: #9ba3cf; font-size: 13px; padding: 6px; }
.side-user .logout:hover { color: #fff; }

/* ============================================================
   Topbar
   ============================================================ */
#topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.crumb { font-size: 13px; color: var(--text-muted); }
.crumb b { color: var(--text); font-weight: 600; }
.crumb i { margin: 0 8px; font-size: 10px; color: var(--text-faint); }

.topbar-search {
  margin-left: auto;
  position: relative;
  width: 280px;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px 0 34px;
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--bg);
}
.topbar-search input:focus { outline: none; border-color: var(--green); background: #fff; }
.topbar-search i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 13px;
}

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--sage); color: var(--text); }
.icon-btn .badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--bad);
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
}
.topbar .avatar { width: 32px; height: 32px; flex-basis: 32px; }

/* ============================================================
   Page layout
   ============================================================ */
.main { padding: 24px; flex: 1; }
.page { max-width: 1280px; margin: 0 auto; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 20px; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--sage); text-decoration: none; }
.btn i { font-size: 12px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-strong); }
.btn-danger { background: var(--card); border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--sage); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-head h3 { font-size: 14px; }
.card-head .sub { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* KPI card */
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.kpi .label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
}
.kpi .label i { color: var(--green); font-size: 12px; }
.kpi .value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  margin-top: 8px;
  letter-spacing: -0.01em;
}
.kpi .delta { font-size: 12px; margin-top: 4px; color: var(--text-muted); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--bad); }

/* ============================================================
   Badges / pills
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  background: var(--sage);
  color: var(--text);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}
.badge.plain::before { display: none; }
.badge-ok    { background: var(--ok-bg);   color: var(--ok); }
.badge-warn  { background: var(--warn-bg); color: var(--warn); }
.badge-bad   { background: var(--bad-bg);  color: var(--bad); }
.badge-info  { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--bg);      color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--mint);
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:hover { background: var(--sage); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); }
table.data .row-link { cursor: pointer; }
table.data .strong { font-weight: 600; }
.t-sub { color: var(--text-muted); font-size: 12px; }
/* in a table cell it is a second line under the main text (never run together: "NameEMP-0003") */
td .t-sub, dd .t-sub { display: block; }

/* mini progress bar for tables */
.bar {
  height: 6px;
  background: var(--sage-2);
  border-radius: 3px;
  overflow: hidden;
  min-width: 90px;
}
.bar > span { display: block; height: 100%; background: var(--green); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }

/* ============================================================
   Toolbar (search + filters above tables)
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.field {
  position: relative;
}
.field input, .field select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--card);
  color: var(--text);
}
.field.search input { padding-left: 32px; min-width: 240px; }
.field.search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 12px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--green); }

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.seg button {
  border: none;
  background: var(--card);
  padding: 0 12px;
  height: 34px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--sage); }
.seg button.active { background: var(--green); color: #fff; }

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: var(--font-ui);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   Misc utilities
   ============================================================ */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 16px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12px; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* definition list */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13px; }
.dl dt { color: var(--text-muted); }
.dl dd { margin: 0; }

/* progress meter block */
.meter { margin-bottom: 12px; }
.meter .between { margin-bottom: 6px; font-size: 12.5px; }
.meter .between b { font-family: var(--font-mono); font-weight: 500; }
.meter .track { height: 8px; background: var(--sage-2); border-radius: 4px; overflow: hidden; }
.meter .track > span { display: block; height: 100%; background: var(--green); }
.meter .track.warn > span { background: var(--warn); }
.meter .track.bad > span { background: var(--bad); }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.feed li:last-child { border-bottom: none; }
.feed .fi {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.feed .ft { flex: 1; }
.feed .ft time { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 2px; font-family: var(--font-mono); }

/* alert list */
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.alerts li:last-child { border-bottom: none; }
.alerts li i { margin-top: 2px; font-size: 13px; }
.alerts li.warn i { color: var(--warn); }
.alerts li.bad i { color: var(--bad); }
.alerts li .a-sub { color: var(--text-muted); font-size: 12px; }

/* pipeline / stepper */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0;
}
.step {
  flex: 1;
  min-width: 92px;
  text-align: center;
  position: relative;
  padding-top: 26px;
}
.step::before {
  content: "";
  position: absolute;
  top: 9px; left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-strong);
}
.step:last-child::before { display: none; }
.step .dot {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  color: var(--text-faint);
  z-index: 1;
}
.step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.done::before { background: var(--green); }
.step.current .dot { background: var(--card); border-color: var(--green); color: var(--green); }
.step .s-label { font-size: 11.5px; color: var(--text-muted); }
.step.done .s-label, .step.current .s-label { color: var(--text); font-weight: 500; }

/* approval trail */
.trail { list-style: none; margin: 0; padding: 0; position: relative; }
.trail::before {
  content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.trail li { position: relative; padding: 0 0 18px 40px; font-size: 13px; }
.trail li:last-child { padding-bottom: 0; }
.trail li .tn {
  position: absolute; left: 4px; top: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--sage); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  border: 2px solid var(--card);
}
.trail li.ok .tn { background: var(--ok-bg); color: var(--ok); }
.trail li.bad .tn { background: var(--bad-bg); color: var(--bad); }
.trail li.pending .tn { background: var(--warn-bg); color: var(--warn); }
.trail li b { font-weight: 600; }
.trail li time { color: var(--text-faint); font-family: var(--font-mono); font-size: 11.5px; }

/* photo thumbs */
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
  width: 108px; height: 80px;
  background: var(--sage);
  border: 1px solid var(--sage-2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-soft);
  font-size: 16px;
}
.thumb.big { width: 150px; height: 110px; }

/* status pill group (attendance) */
.pill-group { display: inline-flex; gap: 4px; }
.pill {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
}
.pill:hover { border-color: var(--border-strong); }
.pill.on-present  { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bg); }
.pill.on-absent   { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bg); }
.pill.on-late     { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bg); }
.pill.on-excused  { background: var(--info-bg); color: var(--info); border-color: var(--info-bg); }
.pill.on-half_day { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bg); }

/* chat */
.chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 48px - 120px);
  min-height: 420px;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg .avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 10px; }
.msg .bubble {
  background: var(--mint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}
.msg .bubble p { margin: 0 0 8px; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--sage); border-color: var(--sage-2); }
.msg .who { font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.chat-input {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  gap: 8px;
}
.chat-input input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 13px;
}
.chat-input input:focus { outline: none; border-color: var(--green); }

/* letterhead preview */
.letter {
  background: #fff;
  border: 1px solid var(--border);
  padding: 40px 44px;
  font-size: 13px;
  line-height: 1.7;
  max-width: 620px;
  min-height: 700px;
}
.letter .lh {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--forest);
  padding-bottom: 14px;
  margin-bottom: 28px;
}
.letter .lh .lmark {
  display: flex; align-items: center; gap: 10px;
}
.letter .lh .lmark .mark {
  width: 40px; height: 40px; background: var(--forest); color: #fff;
  display: flex; align-items: center; justify-content: center; border-radius: 4px;
  font-size: 16px;
}
.letter .lh .lmark b { font-size: 15px; display: block; }
.letter .lh .lmark span { font-size: 11px; color: var(--text-muted); }
.letter .lh .lcontact { text-align: right; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.letter .stamp {
  margin-top: 40px;
  display: inline-block;
  border: 2px solid var(--green);
  color: var(--green);
  padding: 8px 16px;
  border-radius: 4px;
  transform: rotate(-6deg);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* calendar */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}
.cal .cal-h {
  background: var(--mint);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
}
.cal .cal-d {
  background: var(--card);
  min-height: 104px;
  padding: 6px 7px;
  font-size: 12px;
}
.cal .cal-d.dim { background: var(--bg); color: var(--text-faint); }
.cal .cal-d .dn { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.cal .cal-d.today .dn { color: var(--green); font-weight: 700; }
.cal .ev {
  display: block;
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10.5px;
  background: var(--sage);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal .ev.warn { background: var(--warn-bg); color: var(--warn); }
.cal .ev.bad { background: var(--bad-bg); color: var(--bad); }
.cal .ev.info { background: var(--info-bg); color: var(--info); }
.cal .ev.hol { background: #efe7f7; color: #6a3fa5; }

/* permissions matrix */
.matrix td.chk { text-align: center; }
.matrix .yes { color: var(--green); }
.matrix .no { color: var(--border-strong); }

/* toast */
#toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--forest);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 100;
  display: flex; align-items: center; gap: 9px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast i { color: var(--green-soft); }

/* empty state */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-muted);
}
.empty i { font-size: 22px; color: var(--border-strong); margin-bottom: 10px; display: block; }

/* login */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .auth-aside { display: none; } }
.auth-aside {
  background: var(--forest);
  color: #dadef0;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-aside .brand .name { color: #fff; }
.auth-aside h2 { color: #fff; font-size: 24px; line-height: 1.35; max-width: 420px; margin-top: 40px; }
.auth-aside .pts { list-style: none; padding: 0; margin: 28px 0 0; }
.auth-aside .pts li { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.auth-aside .pts li i { color: var(--green-soft); margin-top: 3px; }
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-card { width: 100%; max-width: 360px; }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; }
.auth-card > p { color: var(--text-muted); margin: 0 0 24px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--card);
}
.form-group textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--green); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }

/* ============================================================
   Field / mobile app
   ============================================================ */
.field-stage {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  gap: 20px;
}
.field-topnote {
  max-width: 390px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}
.phone {
  width: 390px;
  max-width: 100%;
  border: 2px solid var(--forest);
  border-radius: 30px;
  padding: 10px;
  background: var(--forest);
}
.phone-screen {
  background: var(--bg);
  border-radius: 22px;
  overflow: hidden;
  height: 780px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.f-statusbar {
  background: var(--forest);
  color: #d2d7ec;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 18px;
  display: flex;
  justify-content: space-between;
}
.f-appbar {
  background: var(--forest);
  color: #fff;
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.f-appbar .f-title { font-size: 15px; font-weight: 600; flex: 1; }
.f-appbar .f-title small { display: block; font-weight: 400; font-size: 11px; color: #9ba3cf; }
.f-appbar i { font-size: 15px; color: #d2d7ec; }
.f-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.f-tabbar {
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.f-tabbar a {
  flex: 1;
  padding: 9px 2px 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 10px;
}
.f-tabbar a i { display: block; font-size: 15px; margin-bottom: 3px; }
.f-tabbar a.active { color: var(--green); }
.f-tabbar a:hover { text-decoration: none; color: var(--green); }

.f-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.f-card h4 { font-size: 13px; margin-bottom: 4px; }
.f-list { list-style: none; margin: 0; padding: 0; }
.f-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.f-list li:last-child { border-bottom: none; }
.f-list li .f-ic {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 6px;
  background: var(--sage);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.f-list li .f-main { flex: 1; }
.f-list li .f-main b { display: block; font-weight: 500; }
.f-list li .f-main span { font-size: 11.5px; color: var(--text-muted); }
.f-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.f-btn:hover { background: var(--green-strong); text-decoration: none; }
.f-btn.ghost { background: var(--card); color: var(--green); border: 1px solid var(--green); }
.f-field { margin-bottom: 12px; }
.f-field label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; }
.f-field input, .f-field select, .f-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--card);
}
.f-field textarea { min-height: 74px; resize: vertical; }
.f-upload {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}
.f-upload i { display: block; font-size: 18px; color: var(--green-soft); margin-bottom: 6px; }
.f-kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.f-kpi .k {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px;
}
.f-kpi .k .v { font-family: var(--font-mono); font-size: 19px; font-weight: 500; }
.f-kpi .k .l { font-size: 11px; color: var(--text-muted); }
.f-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 4px 0 8px;
}

/* ============================================================
   Form controls - professional styling
   ============================================================ */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], input[type="date"],
input[type="time"], input[type="month"], input[type="tel"],
select, textarea {
  font-family: var(--font-ui);
  color: var(--text);
  background-color: var(--card);
}

/* Every text box, date, number and dropdown gets the app's look, wherever it sits
   (filters, toolbars, table cells), not the browser's default thin black box.
   :where() keeps this at zero specificity, so any component rule still wins. */
:where(input:not([type]), input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], input[type="date"], input[type="time"],
input[type="month"], input[type="week"], input[type="datetime-local"], input[type="tel"], input[type="url"], select) {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 13px;
  line-height: normal;
  box-sizing: border-box;
  transition: border-color .12s;
}
:where(textarea) {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  box-sizing: border-box;
}
:where(input, select, textarea):hover:not(:disabled) { border-color: var(--border-strong); }
:where(input, select, textarea):focus { border-color: var(--green); outline: none; }
:where(input, select, textarea):disabled { background-color: var(--bg); color: var(--text-muted); cursor: not-allowed; }
:where(input, select, textarea)::placeholder { color: var(--text-faint); }
/* a dropdown whose options are still loading shouldn't shrink to a stub */
:where(select) { min-width: 160px; }
/* inside tables, a little more compact */
:where(td) :where(input, select) { height: 32px; padding: 0 8px; min-width: 0; }

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23616b63' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px !important;
  cursor: pointer;
}
select::-ms-expand { display: none; }

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
  filter: grayscale(1);
}
input[type="date"]::-webkit-datetime-edit { color: var(--text); }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { height: 22px; opacity: 0.5; }

input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  flex: 0 0 16px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--card);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  vertical-align: -3px;
  transition: background .12s, border-color .12s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--green); }
input[type="checkbox"]::before {
  content: "";
  width: 10px; height: 10px;
  transform: scale(0);
  transition: transform .12s ease;
  background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="radio"]::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .12s ease;
}
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: var(--green);
  border-color: var(--green);
}
input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green-soft);
  outline-offset: 1px;
}

/* ============================================================
   Sidebar collapse
   ============================================================ */
#sidebar { transition: width .18s ease; }
.content { transition: margin-left .18s ease; }

.icon-btn.compact { border-color: transparent; background: transparent; }
.icon-btn.compact:hover { background: var(--sage); }

body.sidebar-collapsed #sidebar { width: 66px; }
body.sidebar-collapsed .content { margin-left: 66px; }
body.sidebar-collapsed .brand .name,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .side-user .who,
body.sidebar-collapsed .side-user .logout { display: none; }
body.sidebar-collapsed .brand { justify-content: center; padding: 18px 0; }
body.sidebar-collapsed .nav { padding-top: 8px; }
body.sidebar-collapsed .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--forest-3); }
body.sidebar-collapsed .nav-group:first-child { border-top: none; margin-top: 0; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; border-left: none; }
body.sidebar-collapsed .nav-item.active { border-left: none; box-shadow: inset 3px 0 0 var(--green-soft); }
body.sidebar-collapsed .nav-item i { width: auto; font-size: 15px; }
body.sidebar-collapsed .side-user { justify-content: center; padding: 12px 0; }

/* tooltip for collapsed nav */
body.sidebar-collapsed .nav-item { position: relative; }
body.sidebar-collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--forest-3);
  color: #fff;
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
  z-index: 50;
}
body.sidebar-collapsed .nav-item:hover::after { opacity: 1; }

/* ============================================================
   Topbar dropdown (profile)
   ============================================================ */
.profile-menu { position: relative; }
.profile-menu .avatar { cursor: pointer; border: none; }
.profile-menu .avatar:hover { background: var(--green-strong); }

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 22px rgba(20, 51, 42, 0.12);
  padding: 6px;
  z-index: 60;
}
.dropdown[hidden] { display: none; }
.dropdown .dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.dropdown .dd-head .avatar { width: 34px; height: 34px; flex-basis: 34px; cursor: default; }
.dropdown .dd-head b { display: block; font-size: 13px; }
.dropdown .dd-head span { font-size: 11.5px; color: var(--text-muted); }
.dropdown a, .dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  font-family: var(--font-ui);
  cursor: pointer;
  text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--sage); text-decoration: none; }
.dropdown a i, .dropdown button i { width: 15px; text-align: center; color: var(--text-muted); }
.dropdown .dd-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* ============================================================
   Modal / overlay
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 51, 42, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px;
  z-index: 90;
  overflow-y: auto;
  opacity: 0;
  transition: opacity .15s ease;
}
.overlay.open { opacity: 1; }
.overlay[hidden] { display: none; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 14px 44px rgba(20, 51, 42, 0.2);
  transform: translateY(-8px);
  transition: transform .15s ease;
}
.overlay.open .modal { transform: none; }
.modal.lg { max-width: 780px; }
.modal.sm { max-width: 420px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; }
.modal-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }
.modal-head .x {
  background: none; border: none;
  font-size: 15px; color: var(--text-muted);
  cursor: pointer; padding: 2px 4px; line-height: 1;
}
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 18px; }
.modal-body .form-row { margin-bottom: 0; }
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--mint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  margin-top: 4px;
}

/* ============================================================
   Drawer (notifications)
   ============================================================ */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 51, 42, 0.32);
  z-index: 90;
  opacity: 0;
  transition: opacity .18s ease;
}
.drawer-scrim.open { opacity: 1; }
.drawer-scrim[hidden] { display: none; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 384px;
  max-width: 92vw;
  background: var(--card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 91;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-head h3 { font-size: 14px; }
.drawer-head .x { background: none; border: none; font-size: 15px; color: var(--text-muted); cursor: pointer; }
.drawer-head .x:hover { color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--border); }
.notif {
  display: flex;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif.unread { background: var(--mint); }
.notif .ni {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.notif.warn .ni { background: var(--warn-bg); color: var(--warn); }
.notif.bad .ni { background: var(--bad-bg); color: var(--bad); }
.notif .nt b { font-weight: 600; }
.notif .nt time { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 3px; font-family: var(--font-mono); }

/* ============================================================
   Lock screen
   ============================================================ */
.lock {
  position: fixed;
  inset: 0;
  background: var(--forest);
  color: #fff;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
}
.lock[hidden] { display: none; }
.lock .lk-mark {
  width: 56px; height: 56px;
  background: var(--green);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.lock h2 { color: #fff; font-size: 18px; }
.lock p { color: #9ba3cf; font-size: 13px; margin: 0; }
.lock .lk-form { display: flex; gap: 8px; margin-top: 6px; }
.lock input {
  width: 200px;
  height: 42px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid var(--forest-3);
  background: var(--forest-2);
  color: #fff;
  font-family: var(--font-mono);
  letter-spacing: 5px;
  font-size: 15px;
}
.lock input:focus { outline: none; border-color: var(--green-soft); }
.lock .clock { font-family: var(--font-mono); font-size: 34px; color: #fff; }

/* fullscreen tweak */
:fullscreen .content { margin-left: var(--sidebar-w); }
:fullscreen.sidebar-collapsed .content { margin-left: 66px; }

/* ============================================================
   Date range filter
   ============================================================ */
.daterange { position: relative; display: inline-block; }
.daterange > .btn i.fa-chevron-down { font-size: 9px; opacity: .7; }
.dr-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 22px rgba(20, 51, 42, 0.12);
  padding: 6px;
  z-index: 55;
}
.dr-menu[hidden] { display: none; }
.dr-menu .dr-preset {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  background: none;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}
.dr-menu .dr-preset:hover { background: var(--sage); }
.dr-menu .dr-preset.active { background: var(--green); color: #fff; }
.dr-custom { border-top: 1px solid var(--border); margin-top: 6px; padding: 9px 6px 3px; }
.dr-custom .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 6px; }
.dr-custom .form-row { gap: 8px; margin-bottom: 8px; }
.dr-custom input[type="date"] { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 4px; padding: 0 8px; font-family: var(--font-ui); font-size: 12px; }
.dr-custom .btn { width: 100%; justify-content: center; }
.dr-caption { font-size: 12.5px; color: var(--text-muted); }
.dr-caption b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }

/* ============================================================
   AI floating assistant
   ============================================================ */
.fab-ai {
  position: fixed;
  bottom: 22px; right: 22px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  z-index: 70;
  box-shadow: 0 4px 16px rgba(20, 51, 42, 0.28);
}
.fab-ai:hover { background: var(--forest-2); }
.fab-ai i { color: var(--green-soft); }
.ai-panel {
  position: fixed;
  bottom: 84px; right: 22px;
  width: 384px;
  max-width: calc(100vw - 44px);
  height: 520px;
  max-height: calc(100vh - 130px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 14px 44px rgba(20, 51, 42, 0.22);
  display: flex;
  flex-direction: column;
  z-index: 71;
  overflow: hidden;
}
.ai-panel[hidden] { display: none; }
.ai-panel-head {
  background: var(--forest);
  color: #fff;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-panel-head b { font-size: 13px; display: block; }
.ai-panel-head .sub { font-size: 11px; color: #9ba3cf; }
.ai-panel-head button { background: none; border: none; color: #d2d7ec; cursor: pointer; font-size: 14px; padding: 2px 4px; }
.ai-panel-head button:hover { color: #fff; }
.ai-panel .chat { height: auto; flex: 1; min-height: 0; }
.ai-panel .chat-log { padding: 14px; gap: 12px; }
.ai-panel .msg { max-width: 92%; }
.ai-panel .chat-input { padding: 10px; }
.ai-panel .chat-input input { height: 36px; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.ai-suggest button {
  border: 1px solid var(--border);
  background: var(--mint);
  border-radius: 14px;
  padding: 5px 10px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.ai-suggest button:hover { border-color: var(--green); color: var(--text); }

/* ============================================================
   Signature pad
   ============================================================ */
.sigpad {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--mint);
  height: 170px;
  position: relative;
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
}
.sigpad canvas { width: 100%; height: 100%; display: block; }
.sigpad .sig-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
  pointer-events: none;
}
.sigpad.signed .sig-hint { display: none; }

/* ============================================================
   Dashboard site status cards, misc ERP bits
   ============================================================ */
.site-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--card);
}
.site-card h4 { font-size: 13px; margin-bottom: 8px; }
.site-card .sc-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; color: var(--text-muted); }
.site-card .sc-row b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }

.progressbar-inline { display: flex; align-items: center; gap: 8px; }
.progressbar-inline .bar { flex: 1; }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* letterhead-ish sign box */
.sign-block {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 14px;
  display: flex;
  gap: 40px;
}
.sign-block .sig-slot { flex: 1; }
.sign-block .sig-slot .line { border-bottom: 1px solid var(--text); height: 40px; margin-bottom: 6px; display:flex; align-items:flex-end; }
.sign-block .sig-slot .line img { max-height: 38px; }
.sign-block .sig-slot small { color: var(--text-muted); }

/* editable payroll-style cell */
td.editable { background: var(--mint); }
td.editable input {
  width: 90px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

/* progress steps for send-all */
.sendbar {
  height: 8px;
  background: var(--sage-2);
  border-radius: 4px;
  overflow: hidden;
}
.sendbar > span { display: block; height: 100%; background: var(--green); transition: width .3s ease; }

/* ============================================================
   Form errors, confirmations, busy state (shared modal contract)
   ============================================================ */
.modal-error {
  border: 1px solid var(--bad);
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.modal-error[hidden] { display: none; }
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-bg); }
.field-err { color: var(--bad); font-size: 12px; margin-top: 4px; }
.req { color: var(--bad); }
.mt4 { margin-top: 4px; }
.confirm-msg { font-size: 14px; line-height: 1.55; }
.confirm-msg ul { margin: 8px 0 0 18px; padding: 0; }
.btn-danger[data-modal-submit] { background: var(--bad); color: #fff; }
.btn-danger[data-modal-submit]:hover { background: #8d2f27; }
.btn[disabled] { opacity: .65; cursor: not-allowed; }
#toast.is-bad i { color: #ffb4ab; }
#toast.is-warn i { color: #f3c969; }
#toast { max-width: min(560px, calc(100vw - 32px)); }
.coming-soon { opacity: .6; pointer-events: none; }

/* ============================================================
   Shell additions: logo, search results, notification buttons,
   lock errors, breadcrumb separator
   ============================================================ */
.brand .mark img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-sm); background: #fff; }
.brand .side-close { display: none; margin-left: auto; background: transparent; border-color: var(--forest-3); color: #d2d7ec; }
.crumb-sep { margin: 0 8px; color: var(--text-faint); }
.topbar-search input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  min-width: 320px; max-height: 70vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(20, 51, 42, .16); z-index: 80; padding: 6px 0;
}
.search-results .sr-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); padding: 8px 14px 4px; }
.search-results .sr-item { display: block; padding: 7px 14px; color: var(--text); font-size: 13px; }
.search-results .sr-item:hover, .search-results .sr-item:focus { background: var(--sage); text-decoration: none; outline: none; }
.search-results .sr-item span { display: block; font-size: 11.5px; color: var(--text-muted); }
.search-results .sr-empty { padding: 10px 14px; font-size: 13px; color: var(--text-muted); }
button.notif { width: 100%; text-align: left; background: transparent; border: none; border-bottom: 1px solid var(--border); font: inherit; color: inherit; cursor: default; }
button.notif.unread { background: var(--mint); }
button.notif.has-link { cursor: pointer; }
button.notif.has-link:hover { background: var(--sage); }
.lock .lk-err { color: #ffb4ab; }
.lock .lk-mark i { font-size: 18px; }
body.is-locked { overflow: hidden; }
/* keep the floating assistant clear of the last row of content */
body.has-fab .main { padding-bottom: 88px; }

/* ============================================================
   Phone & tablet (<= 900px): off-canvas sidebar, stacked layout
   ============================================================ */
.side-scrim { display: none; }
.grid > * { min-width: 0; }
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); transition: transform .2s ease; width: min(280px, 85vw); box-shadow: none; }
  body.sidebar-collapsed #sidebar { width: min(280px, 85vw); }
  body.sidebar-collapsed #sidebar .brand .name,
  body.sidebar-collapsed #sidebar .nav-group-label,
  body.sidebar-collapsed #sidebar .nav-item span,
  body.sidebar-collapsed #sidebar .side-user .who,
  body.sidebar-collapsed #sidebar .side-user .logout { display: revert; }
  body.sidebar-open #sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.sidebar-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(14, 18, 48, .45); z-index: 39; }
  .brand .side-close { display: flex; }
  .content, body.sidebar-collapsed .content, :fullscreen .content { margin-left: 0; }
  #topbar { padding: 0 12px; gap: 8px; }
  #topbar .crumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .topbar-search { width: auto; flex: 0 1 220px; margin-left: 0; }
  .main { padding: 16px; }
  .page-head { flex-wrap: wrap; }
  .page-head .actions { flex-wrap: wrap; flex-shrink: 1; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .dr-custom .form-row { grid-template-columns: 1fr; }
  .card { min-width: 0; }
  .tabs { overflow-x: auto; scrollbar-width: thin; }
  .modal { max-width: calc(100vw - 24px); }
}
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
  .topbar-search { flex: 1 1 auto; }
  .topbar-search input { padding-right: 6px; }
  #topbar .crumb { display: none; }
  .search-results { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 4px); min-width: 0; }
  .page-head h1 { font-size: 18px; }
  .form-row { grid-template-columns: 1fr; }
  .page-head .actions > * { flex: 1 1 auto; }
  .fab-ai { width: 42px; height: 42px; bottom: 14px; right: 14px; font-size: 15px; }
  .kpi .value { font-size: 20px; }
  .drawer { width: 100vw; max-width: 100vw; }
}

/* Users & roles */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.form-group > .check { margin-bottom: 6px; }
.cred-box { display: grid; gap: 10px; border: 1px dashed var(--border); border-radius: 6px; padding: 12px; background: var(--bg); }
.cred-box .mono { font-size: 15px; user-select: all; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
table.matrix tr.grp-start td { border-top: 2px solid var(--border); }
table.matrix td.chk input { width: 16px; height: 16px; cursor: pointer; }

/* Settings */
.logo-preview { display: flex; align-items: center; justify-content: center; min-height: 120px; border: 1px dashed var(--border); border-radius: 6px; background: var(--bg); margin-bottom: 10px; padding: 10px; }
.logo-preview img { max-height: 110px; max-width: 100%; object-fit: contain; }
table.data.compact td, table.data.compact th { padding: 6px 8px; }
table.data.compact input { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 4px; padding: 0 8px; font: inherit; }
label.btn { cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }
.sb-total { margin-top: 6px; padding: 10px 12px; background: var(--bg); border-radius: 6px; font-size: 14px; }
.nowrap { white-space: nowrap; }

/* Letters */
.letter-paper { background: #fff; width: 100%; max-width: 640px; min-height: 600px; padding: 36px 40px; box-shadow: 0 2px 12px rgba(0,0,0,.08); border-radius: 4px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.choice input { margin-top: 3px; }
@media (max-width: 560px) { .letter-paper { padding: 18px; } }
.warn-note { border-color: var(--warn) !important; background: var(--warn-bg) !important; color: var(--warn) !important; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: none; }
.checklist li.bad i { color: var(--bad); } .checklist li.warn i { color: var(--warn); } .checklist li.info i { color: var(--info); }

/* ---------- Field app: shell additions ---------- */
.f-iconbtn { background: none; border: 0; padding: 6px; margin: -6px; color: #d2d7ec; cursor: pointer; display: inline-flex; }
.f-iconbtn:focus-visible { outline: 2px solid #fff; border-radius: 4px; }
.phone-screen { position: relative; }
#f-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); max-width: 340px; width: calc(100% - 48px); text-align: center;
  background: #1b2459; color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 13px; z-index: 300; opacity: 0; pointer-events: none; transition: opacity .2s; }
#f-toast.show { opacity: 1; }
#f-toast.bad { background: var(--bad, #b23a2e); }
.f-sheet-back { position: fixed; inset: 0; background: rgba(14, 18, 48, .45); z-index: 250; display: flex; align-items: flex-end; justify-content: center; }
.f-sheet { background: var(--card); width: 100%; max-width: 420px; border-radius: 14px 14px 0 0; padding: 18px 18px 22px; max-height: 80vh; overflow-y: auto; }
.f-sheet h4 { font-size: 15px; margin: 0 0 6px; }
.f-sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.f-btn.danger { background: var(--bad, #b23a2e); }
.f-btn:disabled { opacity: .6; cursor: default; }
.f-menu-user { display: flex; flex-direction: column; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.f-menu-list { display: flex; flex-direction: column; }
.f-menu-list button { display: flex; gap: 10px; align-items: center; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 12px 2px; text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.f-menu-list button i { width: 16px; color: var(--text-faint); }
.f-menu-list button.on i { color: var(--green); }
.f-menu-list button.danger, .f-menu-list button.danger i { color: var(--bad, #b23a2e); }
.f-err { background: var(--bad-bg); color: var(--bad, #b23a2e); border-radius: var(--radius); padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.f-field .f-invalid, .f-invalid { border-color: var(--bad, #b23a2e) !important; box-shadow: 0 0 0 2px var(--bad-bg); }
.f-field .hint { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.f-field .req { color: var(--bad, #b23a2e); }
.f-seg { display: flex; width: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.f-seg button { flex: 1; background: var(--card); border: 0; padding: 9px 4px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-muted); }
.f-seg button.active { background: var(--green); color: #fff; }
.f-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.f-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.f-upload { cursor: pointer; display: block; }
.f-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.f-notice-body { white-space: pre-line; }
@media (max-width: 500px) {
  .field-stage { padding: 0; gap: 0; }
  .field-topnote { display: none; }
  .phone { width: 100%; border: 0; border-radius: 0; padding: 0; }
  .phone-screen { border-radius: 0; height: 100vh; height: 100dvh; }
}

/* Held until the page has loaded its data (app.js page gate) */
[data-wait] { opacity: .55; cursor: progress; }
.table-wrap[data-kbd-scroll]:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ============================================================
   Letters: Google-Docs-style writing workspace
   ============================================================ */
.doc-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1280px) { .doc-shell { grid-template-columns: 1fr; } }
.doc-bar { position: sticky; top: var(--topbar-h); z-index: 20; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.doc-bar-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.doc-bar-top .doc-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.doc-bar-top .doc-name i { color: var(--green); font-size: 18px; }
.doc-bar-top .doc-state { font-size: 12px; color: var(--text-muted); }
.doc-bar-top .grow { flex: 1; }
#docToolbar { min-height: 40px; }
#docToolbar .tox-tinymce-inline { border: none !important; box-shadow: none !important; position: static !important; width: 100% !important; }
#docToolbar .tox .tox-editor-header { border: none; box-shadow: none; padding: 0; }
#docToolbar .tox .tox-menubar, #docToolbar .tox .tox-toolbar, #docToolbar .tox .tox-toolbar__primary, #docToolbar .tox .tox-toolbar-overlord { background: var(--card) !important; }
.doc-canvas { background: #e9ebf2; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 16px 40px; overflow-x: auto; }
.doc-sheet {
  position: relative; width: 794px; min-height: 1123px; margin: 0 auto; background: #fff; color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(20, 24, 60, .18), 0 6px 18px rgba(20, 24, 60, .08);
  padding: 151px 83px 128px; line-height: 1.5;
}
.doc-sheet .lh-logo { position: absolute; top: 34px; left: 0; right: 0; text-align: center; pointer-events: none; }
.doc-sheet .lh-logo img { height: 92px; }
.doc-sheet .lh-wm { position: absolute; left: 50%; top: 449px; width: 491px; margin-left: -245px; opacity: 1; pointer-events: none; z-index: 0; }
.doc-sheet .lh-band { position: absolute; left: 26px; right: 26px; bottom: 30px; background: #2b3a97; color: #fff; text-align: center; font: 11px/1.7 Arial, Helvetica, sans-serif; padding: 7px 10px; }
.doc-sheet .lh-band i { margin-right: 5px; font-size: 10px; }
.doc-sheet .lh-band span + span { margin-left: 26px; }
.doc-sheet > * { position: relative; z-index: 1; }
.doc-sheet .lh-logo, .doc-sheet .lh-wm, .doc-sheet .lh-band { position: absolute; }
.doc-sheet .lt-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; font-size: .92em; }
.doc-sheet .lt-recipient { margin-bottom: 16px; line-height: 1.4; }
.doc-sheet .lt-subject { font-weight: bold; text-decoration: underline; text-align: center; text-transform: uppercase; margin: 2px 0 14px; }
.doc-sheet .lt-ph { color: #9aa0b4; font-style: italic; }
.doc-sheet [data-goto] { cursor: pointer; border-radius: 3px; }
.doc-sheet [data-goto]:hover { background: #f1f3fb; box-shadow: 0 0 0 4px #f1f3fb; }
.doc-sheet .lt-body { min-height: 160px; outline: none; text-align: justify; }
.doc-sheet .lt-body:focus { box-shadow: none; }
.doc-sheet .lt-body p { margin: 0 0 10.6px; }
.doc-sheet .lt-body table { border-collapse: collapse; width: 100%; margin: 8px 0 12px; }
.doc-sheet .lt-body th, .doc-sheet .lt-body td { border: 1px solid #44506e; padding: 5px 8px; text-align: left; vertical-align: top; }
.doc-sheet .lt-body th { background: #2b3a97; color: #fff; }
.doc-sheet .lt-body blockquote { margin: 4px 0 10px 18px; padding-left: 10px; border-left: 3px solid #c8cee6; color: #333; }
.doc-sheet .lt-body ul, .doc-sheet .lt-body ol { margin: 2px 0 10px 24px; padding: 0; }
.doc-sheet .lt-body.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { color: #9aa0b4; font-style: italic; }
.doc-sheet .lt-nb { font-weight: bold; margin: 6px 0 12px; }
.doc-sheet .lt-closing { margin: 0 0 14px; text-align: justify; }
.doc-sheet .lt-signoff div { margin-bottom: 2px; }
.doc-sheet .lt-sigspace { height: 110px; border-bottom: 1px dashed #cfd3e4; width: 230px; margin: 6px 0 6px; display: flex; align-items: flex-end; color: #9aa0b4; font: italic 11px Arial, sans-serif; padding-bottom: 4px; }
.doc-sheet .lt-signame { font-weight: bold; }
.doc-sheet .memo-title { text-align: center; font-weight: bold; letter-spacing: 4px; font-size: 1.25em; color: #2b3a97; margin-bottom: 12px; }
.doc-sheet .memo-grid { display: grid; grid-template-columns: 90px 1fr; row-gap: 3px; margin-bottom: 8px; }
.doc-sheet .memo-grid b { font-weight: bold; }
.doc-sheet .memo-rule { border-top: 1.5px solid #2b3a97; margin: 6px 0 14px; }
.doc-side .card + .card { margin-top: 12px; }
.doc-side .card-head h3 { font-size: 13px; }
.doc-side .card-body { padding: 12px 14px; }
.doc-side .form-group { margin-bottom: 10px; }
.doc-side .form-group:last-child { margin-bottom: 0; }
.doc-side .form-group input, .doc-side .form-group select, .doc-side .form-group textarea { height: 34px; }
.doc-side .form-group textarea { height: auto; min-height: 60px; }
.doc-side .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.doc-side .flash { animation: docflash 1.2s ease; }
@keyframes docflash { 0% { box-shadow: 0 0 0 3px var(--green-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
.doc-banner { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
/* Download menu (nine forms) */
.dl-menu { position: relative; display: inline-block; }
.dl-menu > summary { list-style: none; }
.dl-menu > summary::-webkit-details-marker { display: none; }
.dl-menu .dl-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20, 24, 60, .15); width: 300px; padding: 6px 0; }
.dl-menu .dl-group { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 8px 14px 4px; }
.dl-menu .dl-pop a { display: flex; gap: 9px; align-items: center; padding: 7px 14px; color: var(--text); font-size: 13px; }
.dl-menu .dl-pop a:hover { background: var(--sage); text-decoration: none; }
.dl-menu .dl-pop a i { width: 15px; color: var(--green); }
.dl-menu .dl-pop a.off { color: var(--text-faint); pointer-events: none; }
.dl-menu .dl-pop a.off i { color: var(--text-faint); }
.letter-view { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 1000px) { .letter-view { grid-template-columns: 1fr; } }
.letter-view iframe { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: var(--radius); background: #e9ebf2; }
.modal.xl { width: min(1180px, calc(100vw - 32px)); max-width: none; }

/* ---------- Sign-in page: photo background (modern home at dusk, Unsplash licence) ---------- */
.auth { position: relative; overflow: hidden; isolation: isolate; background: var(--forest); }
.auth-bg {
  position: absolute; inset: 0; z-index: -1;
  background: url("../img/login-bg.jpg") center 40% / cover no-repeat;
  transform: scale(1.03); transition: transform 9s cubic-bezier(.2, .6, .3, 1);
}
.auth-bg::after {
  content: ""; position: absolute; inset: 0; transition: opacity .6s ease;
  background: linear-gradient(105deg, rgba(14, 19, 56, .93) 0%, rgba(27, 36, 89, .82) 40%, rgba(27, 36, 89, .38) 72%, rgba(27, 36, 89, .25) 100%);
}
.auth:hover .auth-bg { transform: scale(1.1); }
.auth:hover .auth-bg::after { opacity: .92; }
.auth-aside { background: transparent; position: relative; }
.auth-aside h2 { text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.auth-aside .pts li { padding: 7px 10px; margin-left: -10px; border-radius: 6px; transition: transform .25s ease, background-color .25s ease, color .25s ease; }
.auth-aside .pts li:hover { transform: translateX(6px); background: rgba(255, 255, 255, .08); color: #fff; }
.auth-aside .pts li i { color: #9fb0ff; }
.auth-main { background: transparent; }
.auth-card {
  background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 14px; padding: 34px 32px; max-width: 400px;
  box-shadow: 0 18px 50px rgba(8, 12, 40, .35);
  transition: transform .35s ease, box-shadow .35s ease;
}
.auth-card:hover, .auth-card:focus-within { transform: translateY(-4px); box-shadow: 0 28px 70px rgba(8, 12, 40, .45); }
.auth-photo-credit { position: absolute; right: 14px; bottom: 10px; font-size: 10.5px; color: rgba(255, 255, 255, .55); }
@media (max-width: 900px) {
  .auth-bg::after { background: linear-gradient(180deg, rgba(14, 19, 56, .85), rgba(27, 36, 89, .7)); }
  .auth-main { min-height: 100vh; padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-bg, .auth-card, .auth-aside .pts li { transition: none; }
  .auth:hover .auth-bg { transform: scale(1.03); }
  .auth-card:hover, .auth-card:focus-within, .auth-aside .pts li:hover { transform: none; }
}
/* the built-in Cosmos mark (white) sits on the brand blue, not on a white tile */
.brand .mark img.mark-default, .mark img.mark-default { width: 80%; height: auto; background: transparent; border-radius: 0; }
