/* FiberOps Mission Control: same palette, type and sign-in look as the app itself. */
:root {
  --bg: #F2F5FB; --surface: #FFFFFF; --surface2: #E7ECF7; --ink: #0E1B3D; --muted: #55607A; --line: #DCE3F1;
  --brand: #2F5BFF; --brand-ink: #FFFFFF; --brand-soft: #E8EEFF; --brand-text: #2A50E6;
  --ok: #17603C; --ok-bg: #DDF3E8; --warn: #85470D; --warn-bg: #FBEBD3; --bad: #A32A1E; --bad-bg: #FCE3E0;
  --shadow: 0 1px 2px rgba(14,27,61,.08), 0 4px 14px rgba(14,27,61,.05); --radius: 18px; color-scheme: light;
  --dot-ok: #17B884; --dot-bad: #E5483B; --dot-warn: #E8A33A;
}
:root[data-theme="dark"] {
  --bg: #0A1020; --surface: #131B2F; --surface2: #1B2642; --ink: #E9EEFC; --muted: #9DA9C7; --line: #26314F;
  --brand: #7A97FF; --brand-ink: #0A1024; --brand-soft: #1D2A55; --brand-text: #A9BEFF;
  --ok: #7BE0AC; --ok-bg: #123526; --warn: #FFC680; --warn-bg: #3A2A0C; --bad: #FF9E94; --bad-bg: #421B1B;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  --dot-ok: #34D399; --dot-bad: #FF8378; --dot-warn: #FFC680;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 15px; margin: 0 0 10px; letter-spacing: .01em; }
a { color: var(--brand-text); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }

/* header */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px 40px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; margin-bottom: 8px; background: var(--bg); }
.top .grow { flex: 1; }
.brandrow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brandrow img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 6px 16px -6px rgba(47,91,255,.5); }
.brandrow b { display: block; font-size: 17px; line-height: 1.1; } .brandrow span { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }

.dhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .dhead h2 { margin: 0; }
/* cards + stats */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.status { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); border: 1px solid transparent; }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(7, 1fr); } .status { grid-column: 3 / -1; } }
.status-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.status-body { display: flex; flex-direction: column; min-width: 0; } .status-body b { font-size: 20px; font-weight: 800; letter-spacing: -.01em; } .status-body > span { font-size: 13px; opacity: .85; }
.status-body ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; } .status-body li[data-open] { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; } .status-body li.more { list-style: none; margin-left: -18px; opacity: .8; }
.status.ok { background: var(--ok-bg); color: var(--ok); } .status.ok .status-dot { background: var(--dot-ok); animation: status-pulse 2.2s ease-out infinite; }
.status.warn { background: var(--warn-bg); color: var(--warn); } .status.warn .status-dot { background: var(--dot-warn); }
.status.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); } .status.bad .status-dot { background: var(--dot-bad); animation: status-pulse 1.2s ease-out infinite; }
@keyframes status-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@media (prefers-reduced-motion: reduce) { .status-dot { animation: none !important; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle, var(--brand-soft), transparent 70%); }
.stat b { display: block; font-size: 28px; line-height: 1.1; font-weight: 800; } .stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat.warnish b { color: var(--warn); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; background: var(--surface2); }
th:first-child { border-top-left-radius: 10px; } th:last-child { border-top-right-radius: 10px; }
tr.row { cursor: pointer; } tr.row:hover td { background: var(--brand-soft); }
.scroll { overflow-x: auto; }

/* status */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 8px; }
.dot.ok { background: var(--dot-ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot-ok) 25%, transparent); }
.dot.bad { background: var(--dot-bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot-bad) 25%, transparent); }
.dot.warn { background: var(--dot-warn); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface2); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.spark { display: inline-flex; gap: 1px; align-items: flex-end; height: 16px; vertical-align: middle; }
.spark i { display: block; width: 3px; height: 100%; background: var(--dot-ok); border-radius: 1px; } .spark i.d { background: var(--dot-bad); }

/* controls */
button, .btn { font: inherit; font-weight: 700; background: var(--brand); color: var(--brand-ink); border: 1.5px solid var(--brand); border-radius: 12px; padding: 9px 16px; min-height: 40px; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); } button.ghost:hover:not(:disabled) { border-color: var(--brand); }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; width: 100%; background: var(--surface2); color: var(--ink); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 5px; }
.seg { display: inline-flex; background: var(--surface2); border-radius: 999px; padding: 3px; }
.seg button { background: transparent; border: 0; color: var(--muted); border-radius: 999px; padding: 6px 12px; min-height: 32px; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.banner { padding: 11px 14px; border-radius: 12px; margin-bottom: 12px; background: var(--surface2); border: 1px solid var(--line); font-weight: 600; }
.banner.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); } .banner.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.err { border-top: 1px solid var(--line); padding: 9px 0; } .err pre { white-space: pre-wrap; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; font-size: 14px; } .kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 24px 4px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: sp .8s linear infinite; } @keyframes sp { to { transform: rotate(360deg); } }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 0 0; }
.view-in { animation: viewin .35s ease-out both; } @keyframes viewin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* sign-in (same look as the app) */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse 900px 620px at 12% -8%, rgba(47,91,255,.16), transparent 60%), radial-gradient(ellipse 820px 620px at 108% 108%, rgba(23,184,132,.14), transparent 60%), var(--bg); }
:root[data-theme="dark"] .login { background: radial-gradient(ellipse 900px 620px at 12% -8%, rgba(122,151,255,.24), transparent 60%), radial-gradient(ellipse 820px 620px at 108% 108%, rgba(52,211,153,.18), transparent 60%), var(--bg); }
.login .card { width: 100%; max-width: 420px; padding: 36px 32px 26px; display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 1; border-radius: 24px; text-align: center;
  box-shadow: 0 1px 2px rgba(14,27,61,.06), 0 28px 64px -16px rgba(14,27,61,.22); }
:root[data-theme="dark"] .login .card { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 28px 64px -16px rgba(0,0,0,.65); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 2px; }
.login-mark { position: relative; width: 128px; height: 128px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.login-mark::before { content: ''; position: absolute; inset: -22px; border-radius: 40px; z-index: 0; background: radial-gradient(circle, rgba(47,91,255,.30) 0%, rgba(23,184,132,.22) 55%, transparent 75%); filter: blur(20px); }
:root[data-theme="dark"] .login-mark::before { background: radial-gradient(circle, rgba(122,151,255,.34) 0%, rgba(52,211,153,.26) 55%, transparent 75%); }
.login-mark img { position: relative; z-index: 1; width: 104px; height: 104px; border-radius: 24px; box-shadow: 0 10px 26px rgba(14,27,61,.2); }
.login-title { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.login-sub { color: var(--muted); font-size: 14px; margin: 0; }
.login .seg { align-self: center; }
.login.lp-wait .card { opacity: 0; }
.lp-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2; overflow: visible; }
.lp-fx path { fill: none; stroke-linecap: round; opacity: 0; }
.lp-fx .lp-trail { stroke-width: 1.4; }
.lp-fx .lp-head { stroke-width: 3.2; filter: url(#lpGlow); }
.login.lp-play .lp-fx .lp-trail { animation: lp-trail 1.15s cubic-bezier(.5,.05,.3,1) both; }
.login.lp-play .lp-fx .lp-head { animation: lp-comet .9s cubic-bezier(.55,.05,.35,1) both; }
.login.lp-play .lp-fx path:nth-of-type(2), .login.lp-play .lp-fx path:nth-of-type(5) { animation-delay: .08s; }
.login.lp-play .lp-fx path:nth-of-type(3), .login.lp-play .lp-fx path:nth-of-type(6) { animation-delay: .16s; }
.login.lp-play .card { animation: lp-card .5s ease-out both; }
.login.lp-play .login-mark img { animation: lp-hit .7s ease-out .78s both, lp-wipe .55s cubic-bezier(.3,.7,.2,1) .98s both; }
.login.lp-play .lp-row { animation: lp-rise .45s ease-out both; }
@keyframes lp-trail { 0% { opacity: .55; stroke-dasharray: 1 1; stroke-dashoffset: 1; } 70% { opacity: .45; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dasharray: 1 1; stroke-dashoffset: 0; } }
@keyframes lp-comet { 0% { opacity: 1; stroke-dasharray: .22 1.3; stroke-dashoffset: .22; } 92% { opacity: 1; } 100% { opacity: 0; stroke-dasharray: .22 1.3; stroke-dashoffset: -1.02; } }
@keyframes lp-card { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes lp-hit { 0% { opacity: .35; filter: drop-shadow(0 0 0 rgba(0,204,250,0)); } 35% { opacity: 1; filter: drop-shadow(0 0 16px rgba(0,204,250,.95)) brightness(1.35); } 100% { opacity: 1; filter: drop-shadow(0 0 0 rgba(0,204,250,0)); } }
@keyframes lp-wipe { from { clip-path: inset(0 calc((1 - var(--lp-icon, 1)) * 100%) 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes lp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .login.lp-wait .card { opacity: 1; } }
