/* Raje Brothers Co. console */
:root {
  --side: #1B1F33;
  --side-hi: #262B47;
  --side-text: #B9BFD6;
  --side-dim: #7C83A3;
  --canvas: #F1F3F6;
  --surface: #FFFFFF;
  --sunk: #F7F8FA;
  --line: #DFE3EA;
  --line-strong: #C9CFDA;
  --ink: #161A24;
  --ink-2: #3A4152;
  --muted: #5F6779;
  --accent: #0E7C7B;
  --accent-hi: #0B6968;
  --accent-wash: #E3F2F1;
  --ok: #1D8752;   --ok-wash: #E3F4EA;
  --warn: #A9650A; --warn-wash: #FBF0DD;
  --crit: #C0392B; --crit-wash: #FBE6E3;
  --off: #7E8597;  --off-wash: #ECEEF2;
  --pend: #4F5FB8; --pend-wash: #E8EBF8;
  --none: #E3E6EC;
  --radius: 8px;
  --radius-sm: 5px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--canvas); font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.sr, .sprite { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
svg use { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand:hover { text-decoration: none; color: #fff; }
.brand b { display: block; font-size: 14.5px; font-weight: 650; letter-spacing: .005em; }
.brand small { display: block; font-size: 12px; color: var(--side-dim); }
.nav { padding: 10px 10px; flex: 1; }
.nav-group { margin: 16px 10px 6px; font-size: 11.5px; color: var(--side-dim); font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--side-text); font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--side-hi); color: #fff; text-decoration: none; }
.nav a.on { background: var(--side-hi); color: #fff; box-shadow: inset 3px 0 0 #3FB6AE; }
.count { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 650; background: #3A4166; color: #fff; padding: 0 7px; border-radius: 10px; line-height: 19px; }
.side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.side-foot span { display: block; color: #fff; font-weight: 600; }
.side-foot small { display: block; color: var(--side-dim); margin-bottom: 6px; }
.side-foot .linkbtn { color: var(--side-text); }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.top { height: 58px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--ink); cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--sunk); border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; height: 36px; }
.search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search input { border: 0; background: transparent; flex: 1; font: inherit; height: 100%; outline: none; min-width: 0; }
.search:focus-within { border-color: var(--accent); background: #fff; }
.search-spacer { flex: 1; }
.nudge { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--warn); background: var(--warn-wash); padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.main { padding: 26px 28px 40px; flex: 1; max-width: 1440px; width: 100%; }
.foot { padding: 16px 28px 22px; color: var(--muted); font-size: 12.5px; display: flex; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.scrim { position: fixed; inset: 0; background: rgba(15,18,30,.45); z-index: 19; }

/* ---------- page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ph .crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ph .crumb a { color: var(--muted); }
.ph .sub { color: var(--muted); margin: 4px 0 0; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--sunk); text-decoration: none; color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hi); color: #fff; }
.btn-danger { color: var(--crit); border-color: #E7B9B3; }
.btn-danger:hover { background: var(--crit-wash); color: var(--crit); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--crit); }
.inline { display: inline; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=file], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 11px; min-height: 38px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.check b { display: block; font-weight: 600; }
.check span small { display: block; color: var(--muted); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-narrow { max-width: 720px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.error-box { background: var(--crit-wash); color: #8E2A20; border: 1px solid #F0C4BE; padding: 10px 12px; border-radius: 7px; margin-bottom: 16px; }

/* ---------- flash */
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { padding: 10px 14px; border-radius: 7px; border: 1px solid; font-weight: 500; }
.flash-ok { background: var(--ok-wash); border-color: #BFE3CD; color: #145F3A; }
.flash-info { background: var(--pend-wash); border-color: #CBD1F0; color: #34418A; }
.flash-warn { background: var(--warn-wash); border-color: #EFD6AA; color: #7A4806; }
.flash-error { background: var(--crit-wash); border-color: #F0C4BE; color: #8E2A20; }

/* ---------- panels and tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-h p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.panel-b { padding: 16px; }
.panel-b > :last-child { margin-bottom: 0; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 9px 16px; background: var(--sunk); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFBFC; }
.tbl .num { text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.tbl .sm { font-size: 12.5px; color: var(--muted); }
.cell-main b { display: block; font-weight: 600; color: var(--ink); }
.cell-main a b { color: var(--ink); }
.cell-main a:hover b { color: var(--accent); }
.cell-main small { display: block; color: var(--muted); font-size: 12.5px; }

.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-even { grid-template-columns: 1fr 1fr; }

/* ---------- status */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 9px 2px 8px; border-radius: 20px; white-space: nowrap; line-height: 20px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: var(--ok-wash); }
.pill-warn { color: var(--warn); background: var(--warn-wash); }
.pill-crit { color: var(--crit); background: var(--crit-wash); }
.pill-offline { color: var(--off); background: var(--off-wash); }
.pill-pending { color: var(--pend); background: var(--pend-wash); }
.pill-run { color: var(--accent); background: var(--accent-wash); }
.pill-run .dot { animation: pulse 1.2s ease-in-out infinite; }
.pill-neutral { color: var(--ink-2); background: var(--off-wash); }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pill-run .dot { animation: none; } }

/* The heartbeat strip: 48 half-hour cells, worst state in each. */
.strip { display: inline-grid; grid-template-columns: repeat(48, 1fr); gap: 2px; width: 192px; height: 18px; vertical-align: middle; }
.strip i { display: block; border-radius: 1.5px; background: var(--none); }
.strip .s-ok { background: #3BAA72; }
.strip .s-warn { background: #E0A43A; }
.strip .s-crit { background: #D9534A; }
.strip-big { width: 100%; height: 34px; gap: 3px; }
.strip-big i { border-radius: 2px; }
.strip-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- fleet summary */
.fleet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.fleet a { padding: 14px 16px; color: var(--ink); border-right: 1px solid var(--line); display: block; }
.fleet a:last-child { border-right: 0; }
.fleet a:hover { background: var(--sunk); text-decoration: none; }
.fleet .n { font-size: 26px; font-weight: 650; line-height: 1.1; display: flex; align-items: center; gap: 8px; }
.fleet .n i { width: 10px; height: 10px; border-radius: 50%; }
.fleet .lbl { font-size: 13px; color: var(--muted); margin-top: 3px; display: block; }
.fleet .on-ok i { background: var(--ok); }
.fleet .on-warn i { background: var(--warn); }
.fleet .on-crit i { background: var(--crit); }
.fleet .on-offline i { background: var(--off); }
.fleet .on-pending i { background: var(--pend); }
.fleet .on-crit .n, .fleet .on-offline.has .n { color: var(--crit); }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.facts > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- checks */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .ind { width: 10px; height: 10px; border-radius: 50%; }
.checks .ind.ok { background: var(--ok); }
.checks .ind.warn { background: var(--warn); }
.checks .ind.crit { background: var(--crit); }
.checks b { font-weight: 600; }
.checks span { color: var(--muted); font-size: 13px; text-align: right; }

/* ---------- meters & charts */
.bar { width: 100%; height: 6px; display: block; margin-top: 6px; }
.bar-bg { fill: var(--none); }
.bar-fg.ok { fill: var(--accent); }
.bar-fg.warn { fill: #E0A43A; }
.bar-fg.crit { fill: #D9534A; }
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meters > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.meters > div:last-child { border-right: 0; }
.meters .lbl { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.meters .val { font-size: 20px; font-weight: 650; }
.spark { width: 100%; height: 54px; display: block; margin-top: 8px; }
.spark .grid { stroke: var(--line); stroke-dasharray: 3 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

/* ---------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs em { font-style: normal; font-size: 11.5px; background: var(--warn-wash); color: var(--warn); border-radius: 10px; padding: 0 6px; margin-left: 4px; }

/* ---------- misc */
.mutedtxt { color: var(--muted); }
.small { font-size: 12.5px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: var(--off-wash); color: var(--ink-2); }
.tag-stage { background: var(--pend-wash); color: var(--pend); }
.notice { border: 1px solid var(--line); background: var(--sunk); border-radius: 7px; padding: 12px 14px; margin-bottom: 16px; }
.notice-warn { background: var(--warn-wash); border-color: #EFD6AA; }
.notice-key { background: #FFFDF5; border-color: #EAD9A6; }
.codebox { position: relative; background: #12162A; color: #DDE3F5; border-radius: 7px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; margin: 8px 0 12px; }
.codebox .copy { position: absolute; top: 8px; right: 8px; background: #2A3050; color: #DDE3F5; border: 0; border-radius: 5px; font: 600 12px var(--font); padding: 4px 8px; cursor: pointer; }
.logview { background: #12162A; color: #D3DAEE; border-radius: 0 0 var(--radius) var(--radius); padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow: auto; margin: 0; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 10px; }
.danger-zone { border-color: #EDC6C1; }
.danger-zone .panel-h { background: #FDF6F5; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 18px 50px rgba(20,24,40,.25); }
dialog::backdrop { background: rgba(15,18,30,.5); }
dialog .panel-b { padding: 20px; }
dialog h2 { margin-bottom: 8px; font-size: 17px; }

.limit { display: flex; align-items: center; gap: 10px; }
.limit svg.bar { width: 120px; margin: 0; }

/* ---------- auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); background: var(--surface); }
.auth-art { background: var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .brand { padding: 0; border: 0; }
.auth-art h1 { font-size: 30px; max-width: 420px; font-weight: 600; letter-spacing: -0.015em; }
.auth-art p { color: var(--side-text); max-width: 420px; margin-top: 10px; }
.auth-art .fake { display: grid; gap: 8px; margin-top: 34px; max-width: 420px; }
.auth-art .fake div { display: flex; align-items: center; gap: 12px; color: var(--side-text); font-size: 13px; }
.auth-art .fake .strip { width: 220px; }
.auth-art .fake .strip i { background: #2D3354; }
.auth-art .fake .strip .s-ok { background: #3BAA72; }
.auth-art .fake .strip .s-warn { background: #E0A43A; }
.auth-art small { color: var(--side-dim); }
.auth-form { padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h2 { font-size: 22px; margin-bottom: 6px; }
.auth-form .lead { color: var(--muted); margin-bottom: 24px; }
.auth-form .btn { width: 100%; justify-content: center; height: 42px; font-size: 14.5px; }
.auth-form .foot-note { margin-top: 26px; color: var(--muted); font-size: 12.5px; }
.otp { letter-spacing: .35em; font-size: 20px !important; text-align: center; font-family: var(--mono); }

/* ---------- responsive */
@media (max-width: 1180px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .fleet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fleet a:nth-child(3) { border-right: 0; }
  .fleet a:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s ease; z-index: 20; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .top { padding: 0 16px; }
  .main { padding: 18px 16px 32px; }
  .foot { padding: 14px 16px 20px; }
  .facts, .meters { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(2n), .meters > div:nth-child(2n) { border-right: 0; }
  .facts > div:nth-child(n+3), .meters > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cols-even, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { padding: 32px 20px; }
  .nudge { display: none; }
  .hide-sm { display: none; }
}
@media (max-width: 600px) {
  .fleet { grid-template-columns: 1fr 1fr; }
  .fleet a { border-right: 1px solid var(--line) !important; border-top: 1px solid var(--line); }
  .fleet a:nth-child(-n+2) { border-top: 0; }
  .fleet a:nth-child(2n) { border-right: 0 !important; }
  .strip { width: 144px; gap: 1px; }
  .strip-big { width: 100%; gap: 1px; }
  .tbl th, .tbl td { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
