/* Operator layout and controls. The shared theme supplies colours, fonts and focus colour. */
body.backoffice {
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
.backoffice a, .backoffice .access-panel a:not(.button) { color:var(--win); }
.backoffice :focus-visible, .backoffice .field :focus-visible { outline:2px solid var(--win); outline-offset:3px; }
.backoffice .skip-link { color:var(--bg); background:var(--text); }

.backoffice .app-header {
  max-width:1440px;
  height:auto;
  margin:auto;
  padding:12px clamp(16px, 3vw, 40px);
  border-bottom:1px solid var(--border);
}
.backoffice .brand, .backoffice .sign-out button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:fit-content;
  min-height:44px;
  padding:0 12px;
  border:1px solid var(--border-strong);
  border-radius:8px;
  color:var(--text);
  background:transparent;
}
.backoffice .brand { flex-wrap:wrap; gap:8px; }
.backoffice .brand:hover, .backoffice .sign-out button:hover { border-color:var(--teal-mid); text-decoration:none; }
.backoffice .wordmark { font-size:16px; font-weight:300; letter-spacing:2px; text-transform:uppercase; white-space:nowrap; }
.backoffice .wordmark strong { font-weight:800; color:var(--win); }
.backoffice .brand-tag, .backoffice .sign-out button,
.backoffice .eyebrow, .backoffice .app-footer {
  font:600 12px/1.4 var(--mono);
  letter-spacing:.07em;
  text-transform:uppercase;
}
.backoffice .brand-tag { margin:0; padding:2px 6px; border:1px solid var(--border-strong); border-radius:5px; color:var(--muted); }
.backoffice .app-layout {
  display:grid;
  grid-template-columns:228px minmax(0, 1fr);
  border:0;
  min-height:calc(100vh - 69px);
}
.backoffice .app-navigation {
  position:sticky;
  top:0;
  align-self:start;
  min-height:calc(100dvh - 69px);
  max-height:100dvh;
  overflow-y:auto;
  padding:24px 12px;
  gap:3px;
}
.backoffice .app-navigation a {
  min-height:44px;
  padding:10px 14px;
  border-radius:10px;
  color:var(--muted);
  font-size:14px;
  line-height:1.4;
}
.backoffice .app-navigation a:hover { color:var(--text); background:var(--panel); }
.backoffice .app-navigation a.active { color:var(--text); background:var(--teal); }
.backoffice .app-main { width:100%; min-width:0; max-width:1180px; margin:0 auto; padding:32px clamp(20px, 3vw, 48px) 40px; }
.backoffice .app-footer { color:var(--tertiary); margin:32px auto 0; padding:18px 0; }
.backoffice > .app-footer { max-width:1440px; padding-inline:clamp(16px, 3vw, 40px); }

.backoffice .page-heading { display:block; margin:0 0 22px; overflow-wrap:anywhere; }
.backoffice .eyebrow { color:var(--win); margin:0 0 6px; }
.backoffice h1 { font-size:clamp(28px, 3vw, 38px); line-height:1.12; font-weight:400; letter-spacing:-.045em; margin:0 0 10px; }
.backoffice h2 { font-size:21px; font-weight:600; line-height:1.25; margin-bottom:8px; }
.backoffice h3 { font-size:16px; font-weight:600; margin:16px 0 6px; }
.backoffice .intro { font-size:15px; }
.backoffice .app-main p { max-width:76ch; }
.backoffice .panel { padding:clamp(18px, 2vw, 26px); border-radius:var(--radius); overflow-wrap:anywhere; }
.backoffice .panel > :where(:last-child) { margin-bottom:0; }
.backoffice .workspace-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; }
.backoffice .workspace-grid .panel { display:flex; flex-direction:column; align-items:flex-start; }
.backoffice .workspace-grid .button { margin-top:auto; }

.backoffice .access-main { max-width:440px; padding:24px 16px 48px; }
.backoffice .access-panel { padding:24px; margin-top:20px; }
.backoffice .access-panel h1 { font-size:clamp(32px, 5vw, 40px); line-height:1.05; font-weight:300; margin:10px 0 16px; }
.backoffice .access-panel h1 strong { font-weight:800; }
.backoffice .access-panel form { margin-top:22px; }
.backoffice .access-panel form + p { margin:12px 0 0; }
.backoffice .access-panel input[autocomplete="one-time-code"] { font:500 22px/1.4 var(--mono); letter-spacing:.3em; text-align:center; }
.backoffice .access-panel details { margin:16px 0 20px; }

.backoffice .button {
  min-height:44px;
  padding:10px 16px;
  border-radius:14px;
  font-family:inherit;
  font-size:15px;
  font-weight:600;
  letter-spacing:0;
}
.backoffice .button-primary { color:var(--bg); background:var(--text); border:1px solid var(--text); }
.backoffice .button-secondary { color:var(--text); background:transparent; border:1px solid var(--border-strong); }
.backoffice .button-danger, .backoffice .button-destructive { color:var(--error); background:transparent; border-color:var(--red); }
.backoffice .button:hover { filter:none; }
.backoffice .button-primary:hover { background:white; }
.backoffice .button-secondary:hover { border-color:var(--teal-mid); }
.backoffice .button-destructive:hover, .backoffice .button-danger:hover { border-color:var(--error); }
.backoffice .button:disabled { opacity:.65; }
.backoffice .access-panel .full-width { min-height:48px; }
.backoffice .field { margin:16px 0; }
.backoffice .field label { color:var(--muted); font-size:14px; font-weight:500; }
.backoffice input:not([type="checkbox"], [type="radio"], [type="hidden"]), .backoffice select, .backoffice textarea {
  min-height:44px;
  max-width:100%;
  padding:10px 12px;
  border:1px solid var(--input-border);
  border-radius:12px;
  color:var(--text);
  background:var(--input);
  font:inherit;
  font-size:16px;
}
.backoffice .access-panel input { min-height:48px; }
.backoffice .field :is(input, select, textarea):focus-visible { border-color:var(--win); }
.backoffice .field label:has(input[type="checkbox"]) { align-content:center; min-height:44px; cursor:pointer; }
.backoffice .field input[type="checkbox"] {
  width:20px;
  height:20px;
  min-height:0;
  margin:0 6px 0 0;
  padding:0;
  vertical-align:middle;
  accent-color:var(--teal-mid);
}
.backoffice .field-hint, .backoffice .installation-guide p { font-size:13px; color:var(--muted); }
.backoffice .notice { border-radius:14px; font-size:14px; }
.backoffice .switch-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:0 0 12px; }
.backoffice .switch-row .button { margin:0; }
.backoffice .status-chip, .backoffice .status { font-size:13px; font-weight:600; border-radius:999px; }
.backoffice .page-heading > .status { font-size:13px; margin:0; }
.backoffice .installation-facts .status-ready { width:fit-content; padding:4px 10px; border-radius:999px; }
.backoffice :has(+ details.more) { margin-bottom:0; }
.backoffice details.more { margin:6px 0 16px; }
.backoffice details > summary { width:fit-content; color:var(--win); font-weight:600; cursor:pointer; }
.backoffice details.more > summary { font-size:14px; }
.backoffice details.more > :is(p, ol) { margin:8px 0 0; }

/* The covers move with the contents; each shadow disappears when its edge is reached. */
.backoffice .activity-scroll, .backoffice .app-navigation {
  --edge-shadow:color-mix(in srgb, var(--win) 45%, transparent);
  --scroll-shadows:
    linear-gradient(to right, var(--scroll-cover) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--scroll-cover) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--edge-shadow), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--edge-shadow), transparent) right center / 12px 100% no-repeat scroll;
}
.backoffice .activity-scroll {
  --scroll-cover:var(--panel);
  background:var(--scroll-shadows);
  overflow:auto;
  max-height:65vh;
  margin:12px 0;
}
.backoffice .activity-table { width:100%; border-spacing:0; font-size:14px; line-height:1.45; font-variant-numeric:tabular-nums; }
.backoffice .activity-table :is(th, td) { text-align:left; vertical-align:middle; padding:9px 12px; border-bottom:1px solid var(--border-strong); white-space:nowrap; }
.backoffice .activity-table thead th {
  position:sticky;
  top:0;
  z-index:1;
  background:var(--panel-raised);
  color:var(--muted);
  font:600 12px/1.5 var(--mono);
  letter-spacing:.06em;
  text-transform:uppercase;
}
.backoffice .activity-table .numeric { text-align:right; }
.backoffice :is(.balance-summary, .detail-table) { table-layout:fixed; }
.backoffice :is(.balance-summary, .detail-table) :is(th, td) { white-space:normal; overflow-wrap:anywhere; }
.backoffice :is(.balance-summary, .detail-table) th { color:var(--muted); font-weight:500; width:38%; }
.backoffice .balance-summary .available-balance { color:var(--green); font-size:20px; font-weight:700; }
@media (hover:hover) {
  .backoffice .activity-table tbody tr:hover { background:var(--warning-bg); }
}

@media (width < 900px) {
  .backoffice .app-layout { display:block; }
  .backoffice .app-main:not(.access-main) { padding:24px 16px calc(92px + env(safe-area-inset-bottom)); }
  .backoffice > .app-footer { padding-bottom:calc(92px + env(safe-area-inset-bottom)); }
  .backoffice .app-navigation {
    position:fixed;
    z-index:5;
    inset:auto 0 0;
    min-height:0;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:flex-start;
    overflow-x:auto;
    gap:4px;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom));
    border:0;
    border-top:1px solid var(--border-strong);
    overscroll-behavior-x:contain;
    scroll-snap-type:x proximity;
    --scroll-cover:var(--bg);
    background:var(--scroll-shadows), var(--bg);
  }
  .backoffice .app-navigation a { flex:none; flex-direction:row; white-space:nowrap; scroll-snap-align:start; }
}
@media (max-width:600px) {
  .backoffice .app-header { padding:10px 12px; gap:6px; }
  .backoffice .workspace-grid { grid-template-columns:minmax(0, 1fr); }
  .backoffice .app-main a:not(.button, .brand) { display:inline-flex; align-items:center; min-height:44px; min-width:44px; }
  .backoffice details > summary { min-height:44px; min-width:44px; line-height:44px; }
}
@media (prefers-reduced-motion:no-preference) {
  .backoffice .button { transition:transform var(--motion), border-color var(--motion), background-color var(--motion); }
  .backoffice .button:hover { transform:translateY(-1px); }
  .backoffice .button:active { transform:scale(.98); }
}

/* Stations: a read from Amazon that failed, or that no phone took, stands out in its row. */
.backoffice .activity-table td.is-failed { color:var(--danger); }
