/* Operations console. Colours and type from the Touchwork XOP design system. */
:root {
  --orange-50: #fff3eb; --orange-500: #ff6700; --orange-700: #b84800;
  --navy-50: #eff2f7; --navy-400: #6579a5; --navy-600: #33476e; --navy-700: #24365c;
  --slate-0: #ffffff; --slate-50: #f4f6f8; --slate-100: #ebeef2; --slate-200: #dce1e8; --slate-300: #c2cad4; --slate-400: #9aa5b3; --slate-600: #566171; --slate-700: #3d4653;
  --teal-50: #e6f5f4; --teal-400: #159189; --teal-600: #0a5e59;
  --success-50: #e7f5ee; --success-100: #bfe5d2; --success-500: #128a5b; --success-700: #0b5c3c;
  --warning-50: #fdf3e3; --warning-500: #b4690e; --warning-700: #7c470a;
  --danger-50: #fcebeb; --danger-100: #f6c9c9; --danger-500: #c62828; --danger-700: #8e1b1b;
  --font-sans: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
*, *::before { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--slate-50); }
body { color: var(--slate-700); font-family: var(--font-sans); font-size: 14.5px; line-height: 1.5; }
h1, h2, h3, p, ol, dl, dd { margin: 0; }
a { color: var(--navy-700); }
a:hover { color: var(--teal-600); }
button, select, input { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(255, 103, 0, 0.4); outline-offset: 2px; }
.c-loading { padding: 40px; color: var(--slate-600); }
.c-mono { font-family: var(--font-mono); font-size: 12.5px; }
.c-muted { color: var(--slate-600); }
.c-small { font-size: 12.5px; }
.c-strong { color: var(--navy-700); font-weight: 600; }
.c-eyebrow { font: 600 11px/1.2 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate-600); }

/* shell */
.c-shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.c-nav { flex: 1 1 232px; max-width: 280px; background: var(--navy-700); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; }
.c-brand { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
.c-brand b { font-size: 16px; }
.c-brand small { font-size: 12.5px; color: rgba(255, 255, 255, 0.72); }
.c-dots { display: flex; gap: 5px; align-items: center; }
.c-dots i { border-radius: 50%; background: var(--orange-500); width: 11px; height: 11px; }
.c-dots i:nth-child(2) { width: 8px; height: 8px; }
.c-dots i:nth-child(3) { width: 6px; height: 6px; }
.c-dots i:nth-child(4) { width: 4px; height: 4px; }
.c-links { display: flex; flex-direction: column; gap: 4px; }
.c-links a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: rgba(255, 255, 255, 0.82); }
.c-links a[aria-current='page'] { color: #fff; background: rgba(255, 255, 255, 0.12); font-weight: 600; }
.c-env { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); font-size: 12.5px; color: rgba(255, 255, 255, 0.78); }
.c-env b { color: #fff; }
.c-main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.c-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.c-head > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.c-head h1 { font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--navy-700); letter-spacing: -0.018em; }
.c-head p { color: var(--slate-600); max-width: 72ch; }
h2 { font-size: 17px; font-weight: 700; color: var(--navy-700); }

/* pieces */
.c-card { background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; box-shadow: 0 1px 3px rgba(36, 54, 92, 0.08), 0 1px 2px rgba(36, 54, 92, 0.04); min-width: 0; }
.c-pad { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.c-card-head { padding: 12px 16px; border-bottom: 1px solid var(--slate-200); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.c-card-head.c-stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.c-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.c-tile { background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.c-tile.c-accent { border-top: 3px solid var(--orange-500); }
.c-tile-value { font-size: 26px; font-weight: 700; color: var(--navy-700); font-variant-numeric: tabular-nums; }
.c-tile-value.c-mid { font-size: 22px; }
.c-teal { color: var(--teal-600); } .c-orange { color: var(--orange-700); } .c-grey { color: var(--slate-600); } .c-red { color: var(--danger-700); } .c-green { color: var(--success-700); }
.c-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--navy-50); color: var(--navy-600); white-space: nowrap; }
.c-pill.c-configured { background: var(--teal-50); color: var(--teal-600); }
.c-pill.c-retired { background: var(--slate-100); color: var(--slate-600); }
.c-pill.c-new { background: var(--orange-50); color: var(--orange-700); }
.c-pill.c-ok { background: var(--success-50); color: var(--success-700); }
.c-pill.c-warn { background: var(--warning-50); color: var(--warning-700); }
.c-pill.c-bad { background: var(--danger-50); color: var(--danger-700); }
.c-alert { padding: 2px 8px; border-radius: 999px; font-family: var(--font-mono); font-size: 11.5px; background: var(--warning-50); color: var(--warning-700); }
.c-alert.c-bad { background: var(--danger-50); color: var(--danger-700); }
.c-chip { padding: 2px 8px; border-radius: 5px; font-size: 12px; background: var(--slate-100); color: var(--slate-700); }
.c-chip.c-off { background: transparent; border: 1px dashed var(--slate-300); color: var(--slate-600); }
.c-row-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.c-btn { height: 40px; padding: 0 16px; border-radius: 5px; border: 1px solid var(--slate-300); background: #fff; color: var(--navy-700); font-weight: 600; font-size: 14px; }
.c-btn.c-primary { border: 0; background: var(--orange-500); color: #fff; }
.c-btn.c-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.c-status { border-radius: 8px; padding: 10px 14px; font-weight: 600; background: var(--success-50); border: 1px solid var(--success-100); color: var(--success-700); }
.c-status.c-bad { background: var(--danger-50); border-color: var(--danger-100); color: var(--danger-700); }
.c-status.c-warn { background: var(--warning-50); border-color: var(--warning-500); color: var(--warning-700); }
.c-confirm { border-color: var(--orange-500); }
.c-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--navy-700); }
.c-field input, .c-field select { height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--slate-300); background: #fff; color: var(--navy-700); font-size: 14px; font-weight: 400; }
.c-field input.c-mono { font-family: var(--font-mono); }
.c-field input.c-invalid { border-color: var(--danger-500); }
.c-field span { font-weight: 400; font-size: 12.5px; color: var(--slate-600); }
.c-field span.c-red { color: var(--danger-700); }
.c-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 16px; }
.c-toggle { height: 38px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; background: #fff; color: var(--navy-700); border: 1px solid var(--slate-300); }
.c-toggle[aria-pressed='true'] { background: var(--orange-50); color: var(--orange-700); border-color: var(--orange-500); }
.c-seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--slate-100); padding: 4px; border-radius: 8px; }
.c-head > .c-seg { flex-direction: row; flex: none; gap: 4px; }
.c-seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 5px; font-size: 13.5px; font-weight: 600; background: transparent; color: var(--slate-600); }
.c-seg button[aria-pressed='true'] { background: #fff; color: var(--navy-700); box-shadow: 0 1px 3px rgba(36, 54, 92, 0.12); }

/* tables as grids */
.c-scroll { overflow-x: auto; }
.c-grid { font-size: 13.5px; }
.c-grid > div { display: grid; gap: 0 14px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--slate-200); }
.c-grid > div:first-child { border-top: 0; background: var(--slate-50); font: 600 11px/1.2 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-600); }
.c-grid > div.c-attention { background: #fffaf6; }
.c-grid > .c-empty { display: block; padding: 32px 16px; text-align: center; color: var(--slate-600); }
.c-two { display: flex; flex-direction: column; min-width: 0; }
.c-two a { font-weight: 600; text-decoration: none; }
.c-bar { height: 5px; border-radius: 3px; background: var(--slate-100); overflow: hidden; }
.c-bar i { display: block; height: 5px; }
.g-terminals { min-width: 1040px; }
.g-terminals > div { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.9fr) 118px 100px 120px 130px minmax(0, 1.3fr) 112px; }
.g-settings { min-width: 800px; }
.g-settings > div { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, 1.2fr) 110px; }
.g-downlinks { min-width: 820px; }
.g-downlinks > div { grid-template-columns: 120px 110px minmax(0, 1.8fr) 110px 60px 130px; }
.g-inventory { min-width: 860px; }
.g-inventory > div { grid-template-columns: minmax(0, 1.3fr) 90px 90px minmax(0, 1.6fr) 110px 150px; }
.g-dead { min-width: 900px; }
.g-dead > div { grid-template-columns: minmax(0, 1.7fr) 100px minmax(0, 1.2fr) minmax(0, 1.4fr) 120px 140px; }
.g-batches { min-width: 560px; }
.g-batches > div { grid-template-columns: minmax(0, 1.3fr) 70px minmax(0, 1.8fr) 110px; }
.g-csv > div { grid-template-columns: 52px minmax(0, 1.2fr) minmax(0, 1.6fr); padding: 8px 10px; border-color: var(--danger-100); }
.g-csv > div:first-child { background: var(--danger-50); color: var(--danger-700); }
.g-csv { border: 1px solid var(--danger-100); border-radius: 8px; overflow: hidden; }

/* terminal detail */
.c-crumb { font-size: 13px; color: var(--slate-600); }
.c-title { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.c-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.c-steps li { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 3px solid var(--slate-200); }
.c-steps li.c-done { border-top-color: var(--teal-400); }
.c-steps li span:first-child { font-size: 13.5px; font-weight: 600; color: var(--navy-700); }
.c-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--slate-200); }
.c-tabs button { height: 40px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--slate-600); font-weight: 600; font-size: 14px; }
.c-tabs button[aria-selected='true'] { border-bottom-color: var(--orange-500); color: var(--navy-700); }
.c-history { list-style: none; padding: 0; }
.c-history li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 110px; gap: 12px; padding: 10px 0; border-top: 1px solid var(--slate-200); }
.c-history li:first-child { border-top: 0; }

/* delivery */
.c-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.c-wide { flex: 999 1 520px; }
.c-narrow { flex: 1 1 340px; }
.c-chart { display: flex; gap: 8px; }
.c-chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: 180px; width: 44px; text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--slate-600); }
.c-chart-bars { position: relative; flex: 1; height: 180px; display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid var(--slate-300); background: linear-gradient(to bottom, var(--slate-100) 1px, transparent 1px) 0 0 / 100% 50%; }
.c-chart-bars span { flex: 1; border-radius: 3px 3px 0 0; background: var(--navy-400); min-height: 1px; }
.c-chart-bars span:last-child { background: var(--orange-500); }
.c-chart-x { display: flex; justify-content: space-between; margin-left: 52px; font-family: var(--font-mono); font-size: 11px; color: var(--slate-600); }
.c-type { display: grid; grid-template-columns: 130px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 13.5px; }
.c-type i { display: block; height: 8px; border-radius: 4px; background: var(--slate-100); overflow: hidden; }
.c-type i b { display: block; height: 8px; background: var(--navy-400); }
.c-type span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.c-health { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; font-weight: 700; background: var(--success-50); color: var(--success-700); }
.c-health i { width: 8px; height: 8px; border-radius: 50%; background: var(--success-500); }
.c-health.c-bad { background: var(--danger-50); color: var(--danger-700); }
.c-health.c-bad i { background: var(--danger-500); }
.c-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; border: 1.5px dashed var(--slate-300); border-radius: 12px; background: var(--slate-50); text-align: center; cursor: pointer; }
.c-code { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--slate-300); background: var(--slate-25, #fafbfc); color: var(--navy-800, #1a2844); font: 400 13px/1.5 var(--font-mono); resize: vertical; tab-size: 2; white-space: pre; overflow: auto; }
.c-code:focus { outline: none; border-color: var(--teal-400, #159189); box-shadow: 0 0 0 3px rgba(21, 145, 137, 0.26); }
.c-file { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.c-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.c-file:focus-within { box-shadow: 0 0 0 3px rgba(21, 145, 137, 0.26); }
.c-viewer { border-radius: 12px; overflow: hidden; border: 1px solid var(--slate-200); }

@media (max-width: 760px) {
  .c-nav { max-width: none; flex-basis: 100%; }
  .c-env { margin-top: 0; }
  .c-main { padding: 20px 16px 40px; }
}

/* sign-in and accounts */
.c-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: linear-gradient(155deg, #24365c 0%, #1a2844 100%); }
.c-login-card { width: 100%; max-width: 400px; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.c-login-card h1 { margin: 4px 0 0; font-size: 24px; color: var(--navy-700); }
.c-login-card p { margin: 0; }
.c-login-brand { display: flex; align-items: center; gap: 10px; color: var(--navy-700); font-size: 14px; }
.c-login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.c-login-form .c-btn { align-self: stretch; }
.c-env-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.c-env-actions a, .c-env-actions button { color: #fff; font: inherit; font-weight: 600; background: none; border: 0; padding: 4px 0 0; text-decoration: none; cursor: pointer; }
.c-env-actions a:hover, .c-env-actions button:hover { text-decoration: underline; }
.c-env-actions a[aria-current='page'] { text-decoration: underline; }
.g-accounts { min-width: 860px; }
.g-accounts > div { grid-template-columns: minmax(0, 1.5fr) 130px 150px 130px 80px minmax(0, 2fr); }
.g-accounts select { height: 32px; border-radius: 6px; border: 1px solid var(--slate-300); padding: 0 8px; background: #fff; color: var(--navy-700); }
.c-secret { border-color: var(--warning-500); background: var(--warning-50); }
.c-secret-value { font: 500 18px/1.3 var(--font-mono); letter-spacing: 0.04em; color: #1a2844; background: #fff; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--slate-200); user-select: all; }
