/* ============================================================
   Signed-in surfaces — client portal and staff console.
   Shell geometry follows the elox portal: teal sidebar, white topbar,
   calm canvas. Loaded after brand.css.
   ============================================================ */

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; background: var(--canvas); }

.sidebar {
  background: var(--teal); color: var(--on-teal);
  display: flex; flex-direction: column;
  padding: 22px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { padding: 4px 10px 24px; }
.sidebar__group {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(156,196,212,0.7); padding: 16px 12px 7px;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--on-teal-muted); font-size: 14.5px; font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.navlink:hover { background: var(--teal-deep); color: #fff; }
.navlink.is-active { background: var(--teal-800); color: #fff; }
.navlink__icon { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.navlink__count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--amber); color: #3A2A06; border-radius: 999px; padding: 1px 7px;
}
.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.10); }
.sidebar__who { font-size: 12.5px; color: var(--on-teal-muted); padding: 0 12px; line-height: 1.45; }
.sidebar__who strong { color: #fff; font-weight: 600; display: block; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); border-bottom: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  position: sticky; top: 0; z-index: 5;
}
.topbar__title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.content { padding: 26px 28px 60px; max-width: 1180px; width: 100%; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar__nav { flex-direction: row; overflow-x: auto; }
  .sidebar__group, .sidebar__foot { display: none; }
  .content { padding: 20px 16px 50px; }
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 23px; font-weight: 600; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 14.5px; }

/* stat tiles */
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-card);
}
.stat__label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.045em; }
.stat__value { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.05; margin-top: 8px; letter-spacing: -0.025em; }
.stat__sub { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.stat--alert { border-color: rgba(210,85,59,0.35); }
.stat--alert .stat__value { color: var(--bad); }
.stat--teal .stat__value { color: var(--teal); }

.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.cols--even { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) { .cols, .cols--even { grid-template-columns: 1fr; } }

/* filing tracker — the retention story (SPEC §8.1) */
.trk { display: grid; }
.trk__row { display: grid; grid-template-columns: 24px 1fr; gap: 15px; }
.trk__gut { display: grid; grid-template-rows: auto 1fr; justify-items: center; }
.trk__dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; background: var(--surface); border: 3px solid var(--border); }
.trk__dot--done { background: var(--good); border-color: var(--good); }
.trk__dot--now { background: var(--amber); border-color: var(--amber-tint); }
.trk__line { width: 3px; height: 100%; min-height: 22px; background: var(--border); }
.trk__line--done { background: var(--good); }
.trk__body { padding-bottom: 18px; }
.trk__t { font-weight: 600; font-size: 14.5px; }
.trk__m { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.trk__when { font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.trk__row:last-child .trk__line { display: none; }

/* list rows */
.feed { display: flex; flex-direction: column; }
.feed__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed__row:last-child { border-bottom: none; }
.feed__name { font-weight: 600; font-size: 14px; }
.feed__meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.feed__time { margin-left: auto; font-size: 12.5px; color: var(--faint); white-space: nowrap; }

/* mail items — SOP is pinned and loud (SPEC §10) */
.mailitem {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 15px; align-items: start;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); margin-bottom: 11px;
}
.mailitem--sop { border-color: rgba(210,85,59,0.45); background: #FFFBFA; }
.mailitem--unread .mailitem__subj::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); margin-right: 8px; vertical-align: 2px;
}
.mailitem__ico { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--canvas); display: grid; place-items: center; color: var(--muted); }
.mailitem--sop .mailitem__ico { background: var(--bad-tint); color: var(--bad-ink); }
.mailitem__subj { font-weight: 600; font-size: 14.5px; }
.mailitem__meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.mailitem__sla { font-size: 12.5px; margin-top: 6px; color: var(--good-ink); font-weight: 600; }

/* compliance calendar */
.cal { display: grid; gap: 11px; }
.calrow {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 18px; align-items: center;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
}
.calrow--blocked { border-color: rgba(201,138,18,0.45); background: #FFFDF7; }
.calrow__date { text-align: center; border-right: 1px solid var(--border); padding-right: 16px; }
.calrow__d { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1; }
.calrow__mo { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-top: 4px; }
.calrow__t { font-weight: 600; font-size: 14.5px; }
.calrow__m { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* documents vault */
.docrow { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 15px; align-items: center; }
.docrow__ico { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--canvas); display: grid; place-items: center; color: var(--muted); }

/* staff exception queue */
.exc {
  display: grid; grid-template-columns: 1fr 320px; gap: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-card);
}
@media (max-width: 860px) { .exc { grid-template-columns: 1fr; } }
.exc__reason { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 5px; }
.exc__shot {
  border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden;
  background: var(--canvas); font-size: 12px; color: var(--faint);
}
.exc__shotbar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #EDF2F5; border-bottom: 1px solid var(--border); }
.exc__url { font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exc__actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }

/* diff */
.diff { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.7; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.diff div { padding: 2px 11px; }
.diff .del { background: var(--bad-tint); color: var(--bad-ink); }
.diff .add { background: var(--good-tint); color: var(--good-ink); }
.diff .ctx { color: var(--muted); }

/* kill switch */
.killrow {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  border: 1px solid rgba(210,85,59,0.35); background: #FFFBFA; border-radius: var(--r-md);
}
.switch { width: 46px; height: 26px; border-radius: 999px; background: var(--border); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch--on { background: var(--good); }
.switch--on::after { left: 23px; }

/* empty state */
.empty {
  border: 1px dashed var(--border); border-radius: var(--r-md);
  padding: 40px; text-align: center; color: var(--muted); background: var(--surface-2);
}
.empty h3 { font-size: 16px; margin-bottom: 6px; }

/* An attention item inside the dashboard's narrow right column. It was a .calrow
   with the action in a second grid column, which holds at 1440px and collapses
   into a ~9-character text column on a 1366px laptop. Stacked, it cannot. */
.alertbox {
  padding: 16px 18px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface);
}
.alertbox--warn { border-color: rgba(201,138,18,0.45); background: #FFFDF7; }
.alertbox .btn { margin-top: 13px; }

/* The calendar row's three columns need ~430px to read. Below that -- a narrow
   panel, or a phone -- the date stops being a gutter and becomes a first line. */
@media (max-width: 1150px) {
  .calrow { grid-template-columns: 1fr; gap: 10px; }
  .calrow__date {
    display: flex; align-items: baseline; gap: 7px; text-align: left;
    border-right: none; padding-right: 0;
  }
  .calrow__mo { margin-top: 0; }
}
