/*
 * Staff interface styles — the first real screens (D516).
 *
 * The palette and proportions are the approved mockups' (four-screen proposal
 * and G1-RECOVERY). The product is a light interface; it paints its own ground
 * so it never borrows the browser's.
 *
 * Fonts are the system stack, with Inter first where it is installed. No
 * webfont is fetched: a sign-in page that calls a third-party host tells that
 * host who is signing in, and when.
 */
:root {
  color-scheme: light;
  --app: #f6f9fc;
  --surface: #ffffff;
  --sunk: #eef2f6;
  --rule: #e3e8ee;
  --rule-strong: #d4dde7;
  --ink: #0d253d;
  --ink-soft: #606f87;
  --ink-faint: #656f78;
  --accent: #533afd;
  --accent-soft: #f1effe;
  --deep: #4434d4;
  --success: #0b7a5e;
  --success-soft: #e6f3ef;
  --focus: #533afd;
  --warn: #7c5410;
  --warn-soft: #fbf3e2;
  --danger: #a32c2c;
  --danger-soft: #fbeaea;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

/* Author `display` rules (.card is a grid) would otherwise beat the browser's
   own [hidden] rule, and every step of the flow would show at once. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  background: var(--app);
  color: var(--ink);
  font:
    15px/1.55 Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 420px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 48px 64px;
  display: grid;
  gap: 16px;
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  margin-bottom: 4px;
}
.brandmark .sq {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent);
}
.brandmark span {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 14px;
}

h1 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.3;
  text-wrap: balance;
}
.sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.fine {
  margin: 0;
  font-size: 12px;
  color: var(--ink-faint);
}
.fine.center {
  text-align: center;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 5px;
}
input {
  accent-color: var(--accent);
}
input[type='email'],
input[type='password'],
input[type='text'] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 9px 11px;
}
input.code {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  font-size: 17px;
}
input:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  font: inherit;
  cursor: pointer;
}
.btn {
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--surface);
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
}
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn:disabled {
  cursor: not-allowed;
  background: var(--sunk);
  border-color: var(--sunk);
  color: var(--ink-faint);
}
.btn:focus-visible,
.link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.link {
  justify-self: start;
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
}

.notice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 7px;
  font-size: 13.5px;
}
.notice.ok {
  background: var(--success-soft);
  color: var(--success);
}
.notice.caution {
  background: var(--warn-soft);
  color: var(--warn);
}
.notice .icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--surface);
}
.notice.ok .icon {
  background: var(--success);
}
.notice.caution .icon {
  background: var(--warn);
}
.notice b {
  display: block;
  margin-bottom: 2px;
}

.qr-row {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 16px;
  align-items: center;
}
.qr {
  width: 148px;
  height: 148px;
  max-width: 100%;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 8px;
  display: block;
}
.key {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--sunk);
  border-radius: 5px;
  padding: 7px 9px;
  word-break: break-all;
  color: var(--ink-soft);
}

.codes {
  margin: 0;
  padding: 14px 16px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
  background: var(--sunk);
  border-radius: 7px;
}
.codes li {
  font-family: var(--mono);
  font-size: 14.5px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin: 0;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.stack {
  display: grid;
  gap: 8px;
}

@media (max-width: 420px) {
  .qr-row,
  .codes,
  .pair {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.stack.wide {
  gap: 16px;
}

/* ── Staff app shell (inbox, D518) ─────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
/* A column, not a grid: the error banner is often hidden, and a hidden row in
   a fixed grid template hands the stretching row to the wrong element. */
body.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.topbar .brandmark {
  margin: 0;
}
.error.banner {
  margin: 12px 16px 0;
}
.inbox {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
}
.inbox-list {
  border-right: 1px solid var(--rule);
  background: var(--surface);
  overflow-y: auto;
}
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--rule);
}
.list-head h1 {
  margin: 0;
  font-size: 15px;
}
.count {
  font-size: 12px;
  color: var(--ink-faint);
}
.cases {
  list-style: none;
  margin: 0;
  padding: 0;
}
.case {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}
.case:hover {
  background: var(--app);
}
.case.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.case:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.case-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.case-name {
  font-weight: 600;
  font-size: 14px;
}
.case-time {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.case-snippet {
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill {
  justify-self: start;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--deep);
}
.empty {
  margin: 0;
  padding: 24px 16px;
  font-size: 13.5px;
  color: var(--ink-faint);
}
.thread {
  display: grid;
  min-height: 0;
  background: var(--app);
}
.thread #open {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.thread #open > .messages {
  flex: 1;
  min-height: 0;
}
.thread #open[hidden] {
  display: none !important;
}
.thread-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.thread-head h2 {
  margin: 0;
  font-size: 15px;
}
.thread-head .back {
  display: none;
}
.messages {
  list-style: none;
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.bubble {
  max-width: 76%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.in {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-bottom-left-radius: 3px;
}
.bubble.out {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  border-bottom-right-radius: 3px;
}
.bubble.held {
  background: var(--warn-soft);
  border-color: #ead9b3; /* warning border for held message bubble */
}
.bubble .meta {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-faint);
}
.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--rule);
}
.composer textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 9px 11px;
  resize: vertical;
  min-height: 44px;
}
.composer textarea:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer .btn {
  width: auto;
}
.choose-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

/* ── Inbox slice 2a: queue tabs, unclaimed rows, reply clocks ───────────── */
.qtabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--sunk);
}
.qtab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.qtab[aria-selected='true'] {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}
.qtab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.inbox-list [role='tabpanel'][hidden] {
  display: none;
}
.inbox-list > [role='tabpanel'] > .fine {
  margin: 0;
  padding: 10px 16px 0;
}
.list-notice {
  margin: 10px 10px 0;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--warn-soft);
  color: var(--warn);
}
.tri {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.tri .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tri .wait {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-faint);
}
.tri .btn {
  width: auto;
  padding: 6px 13px;
  font-size: 12.5px;
}
.pill.mute {
  background: var(--sunk);
  color: var(--ink-soft);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.case-clock {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.case-clock.overdue {
  color: var(--warn);
  font-weight: 600;
}
.case-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.case-anchor {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-faint);
}
.case-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.thread-who {
  flex: 1;
  min-width: 0;
}
.thread-head .sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
}

@media (max-width: 760px) {
  .inbox {
    grid-template-columns: 1fr;
  }
  .inbox-list {
    border-right: 0;
  }
  .inbox.reading .inbox-list {
    display: none;
  }
  .inbox:not(.reading) .thread {
    display: none;
  }
  .thread-head .back {
    display: inline;
  }
  .bubble {
    max-width: 88%;
  }
}

/* ── Inbox slice 2b: hand to colleague ──────────────────────────────────── */
.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}
.btn.small {
  width: auto;
  padding: 5px 11px;
  font-size: 12.5px;
}
.handover-state {
  margin: 0;
  padding: 9px 16px;
  font-size: 13px;
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid var(--rule);
}
.handover {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.handover select,
.handover textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 8px 10px;
}
.handover textarea {
  resize: vertical;
}
.handover select:focus-visible,
.handover textarea:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.handover-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.handover-actions .btn {
  width: auto;
}

/* ── Inbox slice 2c: stream status, held sends, 24-hour lock ────────────── */
.stream-status {
  margin: 10px 16px 0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--warn-soft);
  color: var(--warn);
}
.held-notice {
  margin: 6px 0 0;
  padding-top: 5px;
  border-top: 1px solid #ead9b3; /* warning divider for held notice */
  font-size: 11.5px;
  color: var(--warn);
  line-height: 1.4;
}
.lock-notice {
  margin: 10px 16px 0;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #ead9b3; /* warning border for 24h lock notice */
}
.locked-picker-wrap {
  padding: 8px 16px 0;
  background: var(--surface);
}
.locked-picker-wrap select,
.locked-picker {
  width: 100%;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
  background: var(--sunk);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: not-allowed;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
}
.composer textarea:disabled {
  background: var(--sunk);
  color: var(--ink-faint);
  cursor: not-allowed;
}

/* ── Manager screen (A2) ────────────────────────────────────────────── */

/* Top-bar nav tabs for manager sections */
.mgr-nav {
  display: flex;
  gap: 4px;
}

/* Pane: fills remaining height and scrolls */
.mgr-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Employee-guard notice */
.mgr-guard {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Transfer / team list */
.mgr-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mgr-item {
  display: grid;
  gap: 3px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.mgr-item-name {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
}
.mgr-item-meta {
  font-size: 12.5px;
}
.mgr-item-reason {
  font-size: 12.5px;
  color: var(--ink-faint);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mgr-item-wait {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.mgr-item .btn.small {
  justify-self: end;
  margin-top: 4px;
}

/* Decision dialog */
.mgr-dialog {
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0 0 0 / 0.14); /* modal elevation shadow */
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
}
.mgr-dialog::backdrop {
  background: rgba(0 0 0 / 0.35); /* dialog backdrop overlay */
}
.mgr-dialog-title {
  margin: 0;
  font-size: 16px;
}
.mgr-dialog-meta {
  font-size: 13.5px;
  color: var(--ink-soft);
}
.mgr-dialog-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.mgr-dialog-actions .btn {
  width: auto;
}
.mgr-dialog textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 9px 11px;
  resize: vertical;
}
.mgr-dialog textarea:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Team view: clock list per staff member */
.mgr-clock-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
.mgr-clock-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.mgr-clock-label {
  color: var(--ink-soft);
}

@media (max-width: 760px) {
  .mgr-dialog {
    width: calc(100vw - 32px);
  }
}

/* ── Screen 04: Settings screen (A3) ─────────────────────────────────────── */
.suggested-notice {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #ead9b3; /* warning border for suggested values notice */
}

.role-notice {
  margin: 8px 16px 0;
  padding: 6px 12px;
  background: var(--sunk);
  color: var(--ink-soft);
  border-radius: 4px;
}

.settings-content {
  max-width: 760px;
  margin: 20px auto;
  padding: 0 16px 40px;
}

.settings-pane {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.settings-pane h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.settings-pane h2 {
  margin: 20px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-group input[type='text'],
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.form-group input:disabled,
.form-group textarea:disabled {
  background: var(--sunk);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.days-schedule {
  margin: 20px 0;
}

.days-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-row {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: var(--app);
  border: 1px solid var(--rule);
  border-radius: 6px;
  gap: 8px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.split-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}

.day-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.time-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-range input[type='time'] {
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--surface);
}

.durations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.duration-card {
  padding: 16px;
  background: var(--app);
  border: 1px solid var(--rule);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.duration-card label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-unit input[type='number'] {
  width: 100px;
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--surface);
}

.input-with-unit .unit {
  font-size: 13px;
  color: var(--ink-soft);
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

/* ── A4: Documents Checklist Panel (G2-CHECKLIST) ────────────────────────── */
.documents-panel {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  box-sizing: border-box;
  width: 100%;
}

.docs-details {
  width: 100%;
}

.docs-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  user-select: none;
  gap: 12px;
}

.docs-summary::-webkit-details-marker {
  display: none;
}

.docs-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}

.docs-badge {
  background: var(--accent);
  color: var(--surface);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
}

.docs-readiness {
  font-size: 11.5px;
  color: var(--ink-soft);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-content {
  padding: 12px 16px;
  background: var(--app);
  max-height: 380px;
  overflow-y: auto;
  box-sizing: border-box;
}

.docs-loading {
  margin: 6px 0;
  color: var(--ink-faint);
}

.docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-item {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.doc-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-label {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink);
  word-break: break-word;
}

.doc-state-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.doc-state-required {
  background: #fdf2e9; /* orange status tint for required document */
  color: #a04000; /* status text: dark orange for required doc */
  border: 1px solid #f5cba7; /* status border: soft orange for required doc */
}

.doc-state-received {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-soft);
}

.doc-state-needs_review {
  background: #fef9e7; /* yellow status tint for needs_review document */
  color: #b7950b; /* status text: dark yellow for needs_review doc */
  border: 1px solid #f9e79f; /* status border: soft yellow for needs_review doc */
}

.doc-state-missing {
  background: #fadbd8; /* red status tint for missing document */
  color: #922b21; /* status text: dark red for missing doc */
  border: 1px solid #f5b7b1; /* status border: soft red for missing doc */
}

.doc-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-word;
}

.doc-attachment-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 12.5px;
}

.doc-quarantined {
  background: #fadbd8; /* red status tint for quarantined document */
  color: #922b21; /* status text: dark red for quarantined doc */
  font-weight: 600;
  border: 1px solid #f5b7b1; /* status border: soft red for quarantined doc */
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 4px;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.doc-upload-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.doc-history-list {
  margin: 6px 0 0;
  padding-left: 20px;
  border-top: 1px dashed var(--rule);
  padding-top: 6px;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.doc-history-list li {
  margin-bottom: 3px;
}

.docs-add-form {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}

.docs-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.docs-input-label {
  flex: 2;
  min-width: 140px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
}

.docs-input-note {
  flex: 3;
  min-width: 140px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
}

@media (max-width: 760px) {
  .documents-panel {
    border-radius: 0;
  }
  .docs-summary {
    padding: 10px 12px;
  }
  .docs-content {
    padding: 10px 12px;
    max-height: none;
    overflow-x: hidden;
  }
  .docs-add-row {
    flex-direction: column;
    align-items: stretch;
  }
  .docs-input-label,
  .docs-input-note,
  #docs-add-submit {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .docs-readiness {
    font-size: 10.5px;
    max-width: 180px;
  }
  .doc-actions {
    gap: 6px;
  }
}

/* ── Quotation screens / panel (A5 / G4-QUOTES) ─────────────────────────── */
.quotations-panel {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.quotes-details {
  border: 0;
}

.quotes-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  transition: background 0.15s ease;
}

.quotes-summary:hover {
  background: var(--bg);
}

.quotes-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quotes-title {
  letter-spacing: -0.01em;
}

.quotes-badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--rule-strong);
  color: var(--ink);
}

.quotes-total-summary {
  font-size: 12px;
  color: var(--ink-soft);
}

.quotes-content {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}

.quotes-loading {
  margin: 0;
  font-style: italic;
}

.quotes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); /* subtle card elevation shadow */
}

.quote-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quote-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quote-number {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.quote-ver-pill {
  font-size: 11px;
  padding: 1px 6px;
}

.quote-state-pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
}

.quote-state-pill.draft {
  background: #f1f5f9; /* slate status tint for draft quote */
  color: #475569; /* status text: slate for draft quote */
}

.quote-state-pill.sent {
  background: #fef3c7; /* amber status tint for sent quote */
  color: #92400e; /* status text: dark amber for sent quote */
}

.quote-state-pill.accepted {
  background: var(--success-soft);
  color: var(--success);
}

.quote-state-pill.declined {
  background: #fef2f2; /* red status tint for declined quote */
  color: #991b1b; /* status text: dark red for declined quote */
}

.quote-sent-card {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid var(--rule);
}

.quote-sent-card.draft {
  background: var(--surface);
  color: var(--ink-soft);
}

.quote-sent-card.reported {
  background: #fffbeb; /* amber status tint for reported quote */
  border-color: #fde68a; /* status border: soft amber for reported quote */
  color: #92400e; /* status text: dark amber for reported quote */
  font-weight: 500;
}

.quote-sent-card.submitted {
  background: var(--success-soft);
  border-color: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}

.quote-card-total-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0;
  font-size: 14px;
}

.quote-total-label {
  color: var(--ink-soft);
  font-weight: 600;
}

.quote-card-total {
  color: var(--ink);
  font-size: 15px;
}

.quote-tax-line {
  margin: 0;
  color: var(--ink-faint);
  font-style: italic;
}

.quote-decision-badge {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.quote-decision-badge.accepted {
  background: var(--success-soft);
  border-color: var(--success-soft);
  color: var(--success);
}

.quote-decision-badge.declined {
  background: #fef2f2; /* red status tint for declined decision badge */
  border-color: #fecaca; /* status border: soft red for declined badge */
  color: #991b1b; /* status text: dark red for declined badge */
}

.quote-actions-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}

.quote-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quote-channel-input,
.quote-decline-input {
  max-width: 220px;
  flex: 1;
}

.quote-pdf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quote-pdf-notice {
  color: var(--ink-faint);
}

.quote-history-details {
  border-top: 1px dashed var(--rule);
  padding-top: 8px;
}

.quote-history-summary {
  cursor: pointer;
  color: var(--ink-soft);
}

.quote-history-summary:hover {
  color: var(--ink);
}

.quote-history-content {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quotes-subheading {
  margin: 6px 0 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.quotes-version-list,
.quotes-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quotes-version-item {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quotes-history-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Quotation Builder Form ─────────────────────────────────────────────── */
.quotes-actions-bar {
  display: flex;
  justify-content: flex-start;
}

.quotes-builder-form {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); /* form elevation shadow */
}

.quotes-builder-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.tax-notice {
  margin: 0;
  color: var(--ink-faint);
}

.quotes-builder-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quotes-field-currency {
  width: 130px;
}

.quotes-field-note {
  flex: 1;
  min-width: 200px;
}

.quotes-lines-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: auto;
}

.quotes-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.quotes-lines-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
}

.quotes-lines-table td {
  padding: 6px 8px;
  vertical-align: top;
}

.col-qty {
  width: 80px;
}

.col-price {
  width: 130px;
}

.col-total {
  width: 150px;
  text-align: right;
}

.col-act {
  width: 36px;
  text-align: center;
}

.line-col-total {
  text-align: right;
  padding-top: 14px !important;
  font-size: 12.5px;
  color: var(--ink);
}

.btn-line-remove {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  margin-top: 6px;
}

.btn-line-remove:hover {
  background: #fef2f2; /* destructive action red hover */
  color: #ef4444; /* destructive action text hover color */
  border-color: #fca5a5; /* destructive action border hover color */
}

.line-error-msg {
  margin-top: 4px;
  font-size: 11px;
}

.quotes-builder-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

.quotes-subtotal-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.tax-status-text {
  margin: 0;
  color: var(--ink-faint);
}

.quotes-builder-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

@media (max-width: 760px) {
  .quotes-summary {
    padding: 10px 14px;
  }
  .quotes-content {
    padding: 12px 14px;
  }
  .quotes-builder-meta {
    flex-direction: column;
  }
  .quotes-field-currency {
    width: 100%;
  }
  .quotes-field-note {
    width: 100%;
  }
  .quote-action-row {
    flex-direction: column;
    align-items: stretch;
  }
  .quote-channel-input,
  .quote-decline-input {
    max-width: 100%;
  }
}

/* ── Screen 04: WhatsApp Settings Pane (A12) ────────────────────────────── */
#pane-whatsapp .list-head {
  gap: 8px 16px;
  flex-wrap: wrap;
}

#whatsapp-status-badge {
  white-space: nowrap;
}

.whatsapp-panel-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.whatsapp-card {
  background: var(--app);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.whatsapp-card:empty {
  display: none;
}

.whatsapp-card .whatsapp-number {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--ink);
  margin: 0;
}

.whatsapp-card .whatsapp-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.whatsapp-card .whatsapp-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.whatsapp-card .btn {
  width: auto;
  min-width: 140px;
}

.whatsapp-card .whatsapp-spinner-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.whatsapp-spinner-icon {
  width: 16px;
  height: 16px;
  border: 2px solid var(--rule-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--surface);
}

.btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
/* Approved inbox A+B. Shared tokens also theme the manager and settings screens. */
body.app {
  --navy: #0f2340;
  --navy-2: #18304f;
  --navy-ink: #a9b8cc;
  --app: #f5f6f4;
  --surface: #fff;
  --sunk: #f4f5f3;
  --rule: #e5e6e1;
  --rule-strong: #d6d8d1;
  --ink: #14202e;
  --ink-soft: #56616e;
  --ink-faint: #8b939c;
  --accent: #1f9d6b;
  --accent-soft: #e3f3eb;
  --deep: #16794f;
  --success: #16794f;
  --success-soft: #e3f3eb;
  --focus: #1f9d6b;
  --warn: #b26b0c;
  --warn-soft: #fcf0db;
  --danger: #cc3b33;
  --danger-soft: #fbe6e4;
  --bubble: #dff2e7;
  --wall: #eef2ee;
}
body.app {
  font-family: 'Instrument Sans', system-ui, sans-serif;
}
body.app.inbox-app {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  height: 100vh;
}
.app-sidebar {
  grid-row: 1 / 4;
  background: var(--navy);
  color: var(--navy-ink);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.workspace {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 8px 18px;
  line-height: 1.35;
}
.workspace-mark {
  flex: none;
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.workspace strong {
  display: block;
  color: white;
  font-size: 13px;
}
.workspace small {
  display: block;
  font-size: 12px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
}
.sidebar-nav [role='tablist'],
#service-filters {
  display: contents;
}
.side-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--navy-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.side-link:hover,
.side-link.active {
  background: var(--navy-2);
  color: white;
}
.side-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}
.side-link .mono {
  margin-left: auto;
  font-size: 11px;
}
.side-label {
  margin: 19px 10px 5px;
  font-size: 11px;
  font-weight: 600;
  color: #6f84a0;
}
.service-key {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.sidebar-foot {
  margin-top: auto;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--navy-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.side-signout {
  color: white;
  border: 0;
  background: none;
  padding: 3px;
  font-size: 12px;
}
.side-link:focus-visible,
.side-signout:focus-visible,
#details-toggle:focus-visible,
#details-close:focus-visible {
  outline: 2px solid #90d9b6;
  outline-offset: 2px;
}
body.inbox-app > .error.banner,
body.inbox-app > .stream-status.banner {
  position: fixed;
  z-index: 8;
  top: 10px;
  left: 240px;
  right: 320px;
  margin: 0;
}
body.inbox-app > .stream-status.banner {
  top: 54px;
}
body.inbox-app .inbox {
  grid-column: 2;
  display: grid;
  grid-template-columns: 356px minmax(0, 1fr) 304px;
  min-height: 0;
  min-width: 0;
  height: 100vh;
}
body.inbox-app .inbox-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.inbox-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 16px 13px;
}
.inbox-list-head h1 {
  margin: 0;
  font-size: 17px;
}
.deadline-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--rule);
}
.deadline-tile {
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
}
.deadline-tile strong {
  display: block;
  font: 700 18px/1.2 var(--mono);
}
.deadline-tile.late {
  background: var(--danger-soft);
  color: var(--danger);
}
.deadline-tile.soon {
  background: var(--warn-soft);
  color: var(--warn);
}
.deadline-tile.ok {
  background: var(--success-soft);
  color: var(--success);
}
body.inbox-app .inbox-list [role='tabpanel'] {
  min-height: 0;
  overflow: auto;
}
body.inbox-app .cases {
  padding: 6px 8px;
}
body.inbox-app .case {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 10px;
  border: 0;
  border-radius: 10px;
}
body.inbox-app .case:hover {
  background: var(--sunk);
}
body.inbox-app .case.selected {
  background: var(--accent-soft);
  box-shadow: none;
}
.case-content {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
body.inbox-app .case-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.inbox-app .case-snippet {
  font-size: 12.5px;
}
body.inbox-app .case-pills {
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 4px;
  min-width: 0;
}
.deadline-badge {
  font: 11px var(--mono);
  border-radius: 5px;
  padding: 2px 5px;
  white-space: nowrap;
}
.deadline-badge.overdue {
  color: var(--danger);
  background: var(--danger-soft);
}
.deadline-badge.soon {
  color: var(--warn);
  background: var(--warn-soft);
}
.deadline-badge.ontime,
.deadline-badge.waiting {
  color: var(--success);
  background: var(--success-soft);
}
.case-service {
  color: var(--ink-faint);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.inbox-app .thread {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  background: var(--wall);
}
body.inbox-app .thread #open {
  height: 100%;
  min-width: 0;
}
body.inbox-app .thread-head {
  padding: 12px 20px;
}
body.inbox-app .thread-head .contact-avatar {
  width: 40px;
  height: 40px;
}
body.inbox-app .thread-head .sub {
  font-family: 'Instrument Sans', system-ui, sans-serif;
}
body.inbox-app .messages {
  background: var(--wall);
  padding: 20px 7% 10px;
  gap: 7px;
}
body.inbox-app .bubble {
  max-width: 70%;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 1px 1px #14202e0f;
}
body.inbox-app .bubble.in {
  border-top-left-radius: 4px;
}
body.inbox-app .bubble.out {
  background: var(--bubble);
  border-top-right-radius: 4px;
}
body.inbox-app .bubble.held {
  background: var(--warn-soft);
}
body.inbox-app .bubble .meta {
  text-align: right;
  font-size: 10.5px;
}
.deadline-bar {
  margin: 0;
  padding: 8px 20px;
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid #f1dfba;
  font-size: 12px;
  font-weight: 600;
}
.deadline-bar.overdue {
  background: var(--danger-soft);
  color: var(--danger);
}
.deadline-bar.ontime,
.deadline-bar.waiting {
  background: var(--success-soft);
  color: var(--success);
}
body.inbox-app .composer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 20px;
}
body.inbox-app .composer textarea {
  resize: none;
  min-height: 58px;
}
.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.composer-actions .btn {
  width: auto;
}
.suggestion-panel {
  background: #efebfc;
  color: #6a4fd0;
  border-top: 1px solid #d6caed;
  padding: 10px 20px;
  font-size: 12.5px;
}
.suggestion-panel p {
  margin: 0 0 7px;
}
.suggestion-panel button {
  display: inline-block;
  margin-right: 10px;
}
.case-panel {
  min-width: 0;
  overflow: auto;
  background: white;
  border-left: 1px solid var(--rule);
}
.inbox:not(.reading) .case-panel {
  display: none;
}
.case-panel-head {
  padding: 16px 18px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.case-panel-head h2 {
  margin: 0;
  font-size: 14px;
}
.case-facts {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 7px 8px;
  padding: 0 18px 16px;
  margin: 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12.5px;
}
.case-facts dt {
  color: var(--ink-faint);
}
.case-facts dd {
  margin: 0;
  font-weight: 500;
}
body.inbox-app .documents-panel,
body.inbox-app .quotations-panel {
  border-bottom: 1px solid var(--rule);
}
body.inbox-app .docs-content,
body.inbox-app .quotes-content {
  overflow-x: auto;
  padding: 10px 14px;
}
body.inbox-app .docs-summary,
body.inbox-app .quotes-summary {
  padding: 14px 18px;
}
#details-toggle,
#details-close {
  display: none;
}
@media (max-width: 1100px) {
  body.inbox-app .inbox {
    grid-template-columns: 356px minmax(0, 1fr);
  }
  body.inbox-app .case-panel {
    display: none;
  }
  body.inbox-app .case-panel.expanded {
    display: block;
    position: fixed;
    z-index: 10;
    top: 0;
    right: 0;
    width: min(360px, 90vw);
    height: 100vh;
    box-shadow: -12px 0 35px #14202e30;
  }
  #details-toggle,
  #details-close {
    display: inline-block;
  }
}
@media (max-width: 760px) {
  body.app.inbox-app {
    display: block;
  }
  body.inbox-app .app-sidebar {
    display: none;
  }
  body.inbox-app .inbox {
    display: grid;
    grid-template-columns: 1fr;
  }
  body.inbox-app .inbox:not(.reading) .thread {
    display: none;
  }
  body.inbox-app .inbox.reading .inbox-list {
    display: none;
  }
  body.inbox-app .bubble {
    max-width: 88%;
  }
  body.inbox-app .thread-head {
    padding: 10px 12px;
  }
  body.inbox-app .thread-actions {
    flex-wrap: nowrap;
  }
  body.inbox-app .thread-actions .pill {
    display: none;
  }
  body.inbox-app > .error.banner,
  body.inbox-app > .stream-status.banner {
    left: 8px;
    right: 8px;
  }
}
body.app.admin-app {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
body.admin-app > .app-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
}
body.admin-app > .topbar {
  grid-column: 2;
  grid-row: 1;
}
body.admin-app > #manager-content,
body.admin-app > .settings-content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  overflow: auto;
}
body.admin-app > .settings-content {
  width: min(100%, 800px);
}
body.admin-app > .error.banner,
body.admin-app > .suggested-notice,
body.admin-app > .status.banner,
body.admin-app > .role-notice,
body.admin-app > .mgr-guard {
  grid-column: 2;
  z-index: 2;
}
@media (max-width: 760px) {
  body.app.admin-app {
    display: flex;
    overflow: auto;
  }
  body.admin-app > .app-sidebar {
    display: none;
  }
}
@media (max-width: 760px) {
  body.app.inbox-app {
    display: flex;
    flex-direction: column;
  }
  body.inbox-app .app-sidebar {
    display: flex;
    flex: none;
    padding: 6px 10px;
  }
  body.inbox-app .workspace,
  body.inbox-app .sidebar-foot,
  body.inbox-app .sidebar-nav > .side-link,
  body.inbox-app .sidebar-nav > .side-label,
  body.inbox-app #service-filters {
    display: none;
  }
  body.inbox-app .sidebar-nav {
    overflow: visible;
  }
  body.inbox-app .sidebar-nav [role='tablist'] {
    display: flex;
    gap: 4px;
  }
  body.inbox-app .sidebar-nav [role='tablist'] .side-link {
    width: auto;
  }
  body.inbox-app .inbox {
    flex: 1;
    height: auto;
    min-height: 0;
  }
  body.inbox-app .inbox-list {
    min-height: 0;
  }
}
body.admin-app > .error.banner,
body.admin-app > .suggested-notice,
body.admin-app > .status.banner,
body.admin-app > .role-notice {
  position: fixed;
  top: 58px;
  left: 240px;
  right: 16px;
  width: auto;
  margin: 0;
}
body.admin-app > .status.banner {
  top: 108px;
}
body.admin-app > .role-notice {
  top: 158px;
}
body.admin-app > .mgr-guard {
  grid-row: 2;
}
body.inbox-app .case-clock.deadline-badge {
  align-items: flex-start;
  white-space: normal;
}
body.inbox-app .deadline-badge.overdue {
  color: var(--danger);
}
body.inbox-app .deadline-badge .case-anchor {
  color: inherit;
  font-size: 9px;
}
@media (max-width: 760px) {
  body.inbox-app .thread-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 5px 10px;
  }
  body.inbox-app .thread-head .back {
    grid-column: 1 / -1;
    justify-self: start;
  }
  body.inbox-app .thread-head .contact-avatar {
    grid-column: 1;
  }
  body.inbox-app .thread-who {
    grid-column: 2;
    min-width: 0;
  }
  body.inbox-app .thread-who .sub {
    overflow-wrap: anywhere;
  }
  body.inbox-app .thread-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  body.inbox-app .app-sidebar {
    flex-direction: row;
    align-items: center;
  }
  body.inbox-app .sidebar-nav {
    flex: 1;
    min-width: 0;
  }
  body.inbox-app .sidebar-foot {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }
  body.inbox-app .sidebar-foot > span {
    display: none;
  }
}

.deadline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--warn-soft);
  border-bottom: 1px solid #f1dfba;
}
.deadline-row.overdue {
  background: var(--danger-soft);
}
.deadline-row.ontime,
.deadline-row.waiting {
  background: var(--success-soft);
}
body.inbox-app .deadline-row .deadline-bar {
  background: transparent;
  border: 0;
  flex: 1;
  min-width: 0;
}

/* PR 146 design review */
.side-icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.shift-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #45c88a;
}
body.inbox-app .case-clock.deadline-badge {
  display: inline-block;
  white-space: nowrap;
  font: 11px var(--mono);
}
body.inbox-app .case-clock-anchor {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
body.inbox-app .deadline-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  min-width: 0;
  padding: 0 20px;
  white-space: nowrap;
}
body.inbox-app .deadline-row .deadline-bar {
  flex: 0 1 auto;
  display: flex;
  min-width: 0;
  white-space: nowrap;
  padding: 8px 0;
}
body.inbox-app .clock-main {
  flex: none;
}
body.inbox-app .clock-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.inbox-app .clock-detail::before {
  content: ' · ';
}
.deadline-meter {
  flex: 0 0 130px;
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #dfcda8;
}
.deadline-meter[hidden] {
  display: none;
}
.deadline-meter > span {
  display: block;
  height: 100%;
  background: var(--warn);
}
.deadline-row.overdue .deadline-meter > span {
  background: var(--danger);
}
.deadline-row.ontime .deadline-meter > span {
  background: var(--success);
}
body.inbox-app .deadline-row .working-hours {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
  padding: 8px 0;
}
body.inbox-app .message-day {
  align-self: center;
  padding: 3px 9px;
  border-radius: 20px;
  background: white;
  color: var(--ink-soft);
  font-size: 11px;
  box-shadow: 0 1px 2px #14202e12;
}
body.inbox-app .message-event {
  align-self: center;
  padding: 7px 0;
  color: #6a4fd0;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
body.inbox-app .composer {
  margin: 12px 20px;
  padding: 0;
  gap: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  background: white;
  overflow: hidden;
}
body.inbox-app .composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #1f9d6b33;
}
body.inbox-app .composer textarea {
  width: 100%;
  min-height: 62px;
  padding: 12px;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
}
body.inbox-app .composer-actions {
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px 7px 10px;
}
.suggest-action {
  border: 0;
  background: none;
  color: #6a4fd0;
  font:
    600 12px 'Instrument Sans',
    system-ui,
    sans-serif;
  cursor: pointer;
}
.suggest-action:focus-visible {
  outline: 2px solid #6a4fd0;
  outline-offset: 2px;
}
body.inbox-app .docs-content,
body.inbox-app .quotes-content {
  background: white;
}
body.inbox-app .docs-empty,
body.inbox-app .quotes-empty {
  margin: 5px 0;
  padding: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 12px;
}
.docs-progress {
  display: block;
  width: 100%;
  height: 5px;
  margin: 3px 0 11px;
  accent-color: var(--success);
}
.docs-progress[hidden],
.docs-add-form[hidden] {
  display: none;
}
body.inbox-app .doc-item {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}
body.inbox-app .doc-item-head {
  justify-content: flex-start;
  gap: 7px;
}
.doc-check {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  color: white;
  font-size: 10px;
}
.doc-check.checked {
  background: var(--success);
  border-color: var(--success);
}
body.inbox-app .doc-label {
  min-width: 0;
  flex: 1;
  font-size: 12px;
}
body.inbox-app .doc-state-pill {
  flex: none;
  font-size: 10px;
}
.docs-add-toggle {
  margin-top: 10px;
  color: var(--success);
  font-size: 12px;
}
body.inbox-app .docs-add-form {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}
body.inbox-app .docs-add-row {
  display: grid;
  grid-template-columns: 1fr;
}
body.inbox-app .docs-add-row input {
  width: 100%;
  height: 32px;
  min-width: 0;
  box-sizing: border-box;
  background: white;
}
body.inbox-app .quotations-panel {
  position: relative;
}
body.inbox-app .quotes-actions-bar {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 1;
}
body.inbox-app .quotes-actions-bar .link {
  color: var(--success);
  font-size: 12px;
}
body.inbox-app .quote-card {
  padding: 10px;
  box-shadow: none;
}
body.inbox-app .quote-card-total {
  font: 700 22px/1.2 var(--mono);
}
.quote-lines-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 11px;
}
.quote-lines-summary li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 760px) {
  body.inbox-app .deadline-row {
    padding: 0 12px;
    gap: 6px;
  }
  .deadline-meter {
    flex-basis: 45px;
  }
  body.inbox-app .deadline-row .working-hours {
    font-size: 10px;
  }
  body.inbox-app .composer {
    margin: 10px 12px;
  }
}
.working-hours {
  margin: 0;
  padding: 8px 18px 8px 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .deadline-row {
    flex-wrap: wrap;
    gap: 0;
  }
  .working-hours {
    padding: 0 20px 8px;
    white-space: normal;
  }
}
@media (max-width: 760px) {
  body.inbox-app .deadline-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 45px;
    align-items: center;
  }
  body.inbox-app .deadline-row .deadline-bar {
    display: block;
    grid-column: 1;
    min-width: 0;
    padding-bottom: 2px;
  }
  body.inbox-app .clock-detail {
    display: block;
    font-size: 10px;
  }
  body.inbox-app .clock-detail::before {
    content: none;
  }
  body.inbox-app .deadline-meter {
    grid-column: 2;
    grid-row: 1;
  }
  body.inbox-app .deadline-row .working-hours {
    grid-column: 1 / -1;
    text-align: left;
  }
  .working-hours {
    padding: 0 20px 8px;
  }
}
