/* ops/public/ops.css: the ops console (Ali's mockups, 2026-10-29). The admin's Polaris look: grey page,
   white cards, Inter (else the system font), PixelChat's brand blue and DM Mono "/ 01" labels. */
@font-face { font-family: "DM Mono"; src: url("/static/dm-mono-400.woff2?v=1") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #f1f1f1; --card: #ffffff; --text: #303030; --muted: #616161; --border: #e3e3e3; --row: #ebebeb; --head: #f7f7f7;
  --brand: #2c5498; --primary: #303030; --primary-text: #ffffff; --focus: #005bd3; --critical: #8e1f0b; --critical-bg: #fee9e8;
  --success: #0c5132; --success-bg: #cdfee1; --warning: #5e4200; --warning-bg: #ffd6a4; --attention: #4f4700; --attention-bg: #fff1a8;
  --info: #00527c; --info-bg: #e0f0ff; --callout: #f7f7f7;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
a { color: var(--focus); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 22px; font-weight: 650; margin: 0; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 650; }
.mono { font-family: var(--mono); }
.mono-label { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.break { overflow-wrap: anywhere; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The brand mark: the favicon's "P" in brand blue. */
.brand { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.logo-mark { width: 24px; height: 24px; color: var(--brand); }
.logo-dot { fill: currentColor; }
.brand-name { color: var(--brand); font-weight: 650; font-size: 18px; }
.brand-ops { color: var(--muted); font-weight: 600; }

/* Signed out: one card in the middle. */
.plain-main { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; min-width: 0; }
.card-narrow { width: 100%; max-width: 460px; padding: 28px; }
.card-title { margin-bottom: 16px; }

/* Signed in: the side navigation and the page. */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { display: flex; flex-direction: column; padding: 24px 16px; gap: 4px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 550; }
.nav-item:hover { background: #ebebeb; }
.nav-active { background: #e3e3e3; }
.whoami { margin-top: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; overflow-wrap: anywhere; }
.whoami p { margin: 0 0 2px; }
.main { padding: 24px 24px 48px 8px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-sub { margin-bottom: 16px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { padding: 16px 16px 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .whoami { margin-top: 12px; }
  .main { padding: 16px 16px 40px; }
}

/* Forms */
.stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 550; }
input[type="email"], input[type="password"], input:not([type]), input[type="text"], select {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #8a8a8a; border-radius: 8px; min-height: 40px; padding: 8px 12px; width: 100%;
}
select { padding-right: 32px; }
.button { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600; color: var(--text); background: #fff;
  border: 1px solid #d4d4d4; border-radius: 8px; min-height: 36px; padding: 6px 16px; cursor: pointer; text-decoration: none; text-align: center; }
.button:hover { background: #f7f7f7; }
.button-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); min-height: 40px; }
.button-primary:hover { background: #1a1a1a; }
.button-critical-plain { color: var(--critical); }
.button[disabled] { opacity: .6; cursor: progress; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--focus); text-decoration: underline; cursor: pointer; }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: end; margin-bottom: 12px; }
@media (max-width: 900px) { .invite-row { grid-template-columns: 1fr; } }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 4px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.callout { background: var(--callout); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }

/* Tables */
/* position: relative keeps a screen-reader label inside a table that scrolls: an absolutely positioned one would
   widen the page on a phone. */
.table-wrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-weight: 600; color: var(--muted); background: var(--head); padding: 10px 16px; font-size: 13px; }
th:first-child { border-radius: 8px 0 0 8px; } th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 14px 16px; border-bottom: 1px solid var(--row); vertical-align: middle; }
td p { margin: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form + form { margin-left: 8px; }
.row-muted td { color: var(--muted); }

/* Badges and banners */
.badge { display: inline-block; border-radius: 8px; padding: 2px 8px; font-size: 13px; font-weight: 550; background: #e3e3e3; color: var(--text); white-space: nowrap; }
.badge-admin { background: var(--warning-bg); color: var(--warning); }
.badge-support { background: var(--info-bg); color: var(--info); }
.badge-attention { background: var(--attention-bg); color: var(--attention); }
.badge-warning { background: var(--attention-bg); color: var(--attention); }
.banner { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.banner p:last-child { margin: 0; }
.banner-success { background: var(--success-bg); color: var(--success); }
.banner-critical { background: var(--critical-bg); color: var(--critical); }
.banner-warning { background: var(--attention-bg); color: var(--attention); }

/* The authenticator app and recovery codes */
.authenticator { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 12px; }
@media (max-width: 560px) { .authenticator { grid-template-columns: 1fr; } }
.qr { width: 200px; height: 200px; max-width: 100%; }
.qr-bg { fill: #fff; } .qr-fg { fill: #000; }
.secret { font-size: 15px; letter-spacing: .06em; overflow-wrap: anywhere; }
.codes { columns: 2; column-gap: 32px; font-size: 16px; padding-left: 24px; margin: 12px 0 16px; }
.codes li { margin-bottom: 6px; }

/* Build step 2: Stores, one store, Billing, Costs and margins */
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-critical { background: var(--critical-bg); color: var(--critical); }
.badge-private { background: #ece6ff; color: #4a2c8f; }
.banner-info { background: var(--info-bg); color: var(--info); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { padding: 16px 20px; }
.metric-label { color: var(--muted); margin: 0 0 4px; }
.metric-value { font-size: 26px; font-weight: 700; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .metrics { grid-template-columns: 1fr; } }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr; } }
input[type="search"], input[type="date"] { font: inherit; color: var(--text); background: #fff; border: 1px solid #8a8a8a; border-radius: 8px; min-height: 40px; padding: 8px 12px; width: 100%; }
td { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin-bottom: 12px; }
.kv p { margin: 0 0 2px; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } }
.bars { display: block; width: 100%; height: 120px; margin-bottom: 12px; }
.bar { fill: var(--brand); }
.timeline { list-style: none; padding: 0; margin: 0 0 8px; }
.timeline li { padding: 4px 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid #d4d4d4; border-radius: 8px; background: #fff; color: var(--text); text-decoration: none; font-weight: 600; }
.tab-active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.form-grid .field { font-weight: 550; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; border: 0; padding: 0; margin: 0; }
.checks legend { font-weight: 550; padding: 0; margin-bottom: 6px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-foot p { margin: 0; }

/* Build step 3: the Support inbox (Ali's mockup "Support inbox as Support role"). */
.two-col-inbox { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); }
@media (max-width: 1000px) { .two-col-inbox { grid-template-columns: 1fr; } }
.ticket-list { display: flex; flex-direction: column; gap: 4px; }
.ticket-row { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.ticket-row:hover { background: var(--head); }
.ticket-row-selected { background: var(--row); }
.ticket-row-top { display: flex; justify-content: space-between; gap: 12px; }
.ticket-row-top > :first-child { min-width: 0; overflow-wrap: anywhere; }
.text-critical { color: var(--critical); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin-bottom: 2px; overflow-wrap: anywhere; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.support-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.support-msg { border-radius: 10px; padding: 10px 12px; background: var(--callout); min-width: 0; }
.support-msg-team { background: var(--info-bg); }
.support-msg-note { background: var(--attention-bg); }
.support-msg p:last-child { margin-bottom: 0; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.support-copy { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.support-copy summary { cursor: pointer; font-weight: 550; }
.support-copy-msg { border-left: 3px solid var(--border); padding: 2px 0 2px 10px; margin: 10px 0; }
.chip { display: inline-block; border-radius: 8px; padding: 4px 10px; background: var(--head); border: 1px solid var(--border); font-size: 13px; }
.spacer { flex: 1; }
form.inline { display: inline; }
textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #8a8a8a; border-radius: 8px; resize: vertical; }

/* Team: allowed addresses (build step 4), edited in place */
.allowlist-edit { margin-top: 6px; }
.allowlist-edit summary { cursor: pointer; color: var(--focus); text-decoration: underline; width: fit-content; }
.allowlist-edit form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 8px 0; }
.allowlist-edit .field { flex: 1 1 18rem; min-width: 14rem; font-weight: 400; }
/* With the addresses column, a member's actions (role, remove) stack in their cell instead of running past it. */
form.inline select { width: auto; }
td.actions.actions-stack { white-space: normal; }
td.actions.actions-stack form.inline { display: flex; justify-content: flex-end; }
td.actions.actions-stack form + form { margin: 6px 0 0; }

/* Health (build step 4): a card's note in a tone, the recent alerts */
.tone-attention { color: var(--attention); font-weight: 550; }
.tone-critical { color: var(--critical); font-weight: 550; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
