/* Radway Command Center: dark navy glass, electric blue + cyan accents */
:root {
  --bg: #050912; --bg2: #0a1222; --panel: rgba(14, 24, 44, .62); --panel2: rgba(20, 34, 60, .55);
  --line: rgba(120, 170, 255, .14); --line2: rgba(120, 170, 255, .26);
  --text: #e8f0ff; --mute: #93a4c3; --dim: #63738f;
  --cyan: #22d3ee; --blue: #3b82f6; --violet: #8b5cf6;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --r: 18px; --ease: cubic-bezier(.2, .8, .2, 1);
  --f: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--f); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
code { font-family: var(--mono); font-size: .9em; color: var(--cyan); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }

/* animated backdrop */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 700px at 80% -10%, #0d2246 0%, transparent 60%), radial-gradient(900px 600px at -10% 110%, #0a1d3a 0%, transparent 60%), var(--bg); }
.bg::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(120, 170, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 170, 255, .045) 1px, transparent 1px); background-size: 44px 44px; mask: radial-gradient(70% 60% at 60% 30%, #000, transparent); }
.bg i { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); opacity: .32; }
.bg i:nth-child(1) { background: var(--blue); top: -160px; right: 8%; }
.bg i:nth-child(2) { background: var(--cyan); bottom: -220px; left: 18%; opacity: .18; }
.bg i:nth-child(3) { background: var(--violet); top: 40%; right: -200px; opacity: .14; }
@media (prefers-reduced-motion: no-preference) { .bg i { animation: drift 26s ease-in-out infinite alternate; } .bg i:nth-child(2) { animation-duration: 32s; } .bg i:nth-child(3) { animation-duration: 38s; } }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }

.glass { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 20px 50px -30px #000; }
.eyebrow { margin: 0; font: 600 11px/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(59, 130, 246, .08); cursor: pointer; font-weight: 600; font-size: 14px; transition: background .2s, border-color .2s, transform .15s, box-shadow .2s; }
.btn:hover { border-color: rgba(34, 211, 238, .6); background: rgba(34, 211, 238, .1); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: linear-gradient(135deg, var(--cyan), var(--blue)); border-color: transparent; color: #031022; box-shadow: 0 10px 30px -10px rgba(34, 211, 238, .6); }
.btn--primary:hover { background: linear-gradient(135deg, #67e8f9, #60a5fa); }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn.is-busy svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; color: var(--mute); cursor: pointer; padding: 4px; font-size: 13px; }
.linkbtn:hover { color: var(--text); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login__card { width: min(400px, 100%); padding: 34px 30px; display: grid; gap: 10px; }
.login__card h1 { margin: 0 0 12px; font-size: 30px; letter-spacing: -.02em; }
.login__card label { font-size: 13px; color: var(--mute); }
.login__card input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(5, 9, 18, .6); }
.login__card input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 211, 238, .15); }
.login__err { color: var(--bad); margin: 0; font-size: 14px; }
.login__note { margin: 6px 0 0; font-size: 12.5px; color: var(--dim); }
.logo svg, .side__brand svg { width: 44px; height: 44px; fill: none; stroke: var(--text); stroke-width: 3.3; stroke-linecap: round; stroke-linejoin: round; }
.logo .line, .side__brand .line { stroke: var(--cyan); filter: drop-shadow(0 0 4px rgba(34, 211, 238, .9)); }

/* layout */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.side { grid-row: 1 / 3; position: sticky; top: 12px; margin: 12px 0 12px 12px; height: calc(100vh - 24px); display: flex; flex-direction: column; padding: 18px 12px; overflow: auto; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font: 700 15px/1 var(--f); letter-spacing: .2em; }
.side__brand svg { width: 34px; height: 34px; }
.side__brand b { color: var(--cyan); margin-left: .35em; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 11px; background: none; text-align: left; color: var(--mute); cursor: pointer; font-size: 14px; transition: background .2s, color .2s; }
.nav button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button:hover { color: var(--text); background: rgba(120, 170, 255, .07); }
.nav button[aria-current="page"] { color: var(--text); background: linear-gradient(90deg, rgba(34, 211, 238, .16), rgba(59, 130, 246, .04)); box-shadow: inset 2px 0 0 var(--cyan); }
.nav .count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(248, 113, 113, .18); color: #fecaca; font: 600 11px/1.5 var(--mono); text-align: center; }
.side__foot { margin-top: auto; padding: 14px 8px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
.side__foot .linkbtn { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.dot.is-live { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.top { display: flex; align-items: center; gap: 14px; padding: 22px 28px 8px; }
.top h1 { margin: 2px 0 0; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; }
.top__actions { margin-left: auto; display: flex; gap: 8px; }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
.main { padding: 14px 28px 60px; display: grid; gap: 16px; align-content: start; }
.main:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) { .main > * { animation: rise .45s var(--ease) both; } .main > *:nth-child(2) { animation-delay: .04s; } .main > *:nth-child(3) { animation-delay: .08s; } .main > *:nth-child(4) { animation-delay: .12s; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; inset: 10px auto 10px 10px; width: 260px; height: auto; margin: 0; transform: translateX(-120%); transition: transform .35s var(--ease); }
  .app.menu-open .side { transform: none; }
  .menu-btn { display: flex; }
  .top { padding: 16px 16px 4px; }
  .main { padding: 10px 16px 60px; }
  .top__actions .btn span { display: none; }
}

/* cards + grids */
.card { padding: 18px 18px 16px; }
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h2 small { color: var(--dim); font-weight: 400; font-size: 12.5px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; transition: transform .25s var(--ease), border-color .25s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--line2); }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, .18), transparent 70%); }
.kpi span { display: block; color: var(--mute); font-size: 12.5px; }
.kpi b { display: block; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin-top: 4px; }
.kpi small { color: var(--dim); font-size: 12px; }
.kpi--bad b { color: var(--bad); } .kpi--warn b { color: var(--warn); } .kpi--ok b { color: var(--ok); }

/* lists + tables */
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; background: var(--panel2); border: 1px solid transparent; transition: border-color .2s, background .2s; }
.row:hover { border-color: var(--line2); }
.row__main { flex: 1; min-width: 0; }
.row__main b { display: block; font-weight: 600; }
.row__main small { display: block; color: var(--mute); font-size: 12.5px; overflow-wrap: anywhere; }
.num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; background: rgba(34, 211, 238, .12); color: var(--cyan); font: 700 13px var(--mono); }
.empty { color: var(--dim); font-size: 14px; padding: 8px 2px; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--dim); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: rgba(120, 170, 255, .03); }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 600 11px/1.4 var(--mono); letter-spacing: .04em; white-space: nowrap; border: 1px solid var(--line2); color: var(--mute); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-LIVE, .h-up { color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.s-TESTING, .s-IN-DEVELOPMENT, .s-PLANNING { color: var(--cyan); border-color: rgba(34, 211, 238, .35); }
.s-AWAITING-CLIENT, .s-MAINTENANCE, .h-slow, .l-warn { color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.s-BLOCKED, .h-down, .l-critical { color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.s-ARCHIVED, .h-none { color: var(--dim); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 8px; background: rgba(120, 170, 255, .08); color: var(--mute); font-size: 11.5px; }
.verified { color: var(--ok); font-size: 11.5px; } .unverified { color: var(--warn); font-size: 11.5px; }

/* project cards */
.pcard { display: grid; gap: 10px; padding: 16px; cursor: pointer; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; transform-style: preserve-3d; }
.pcard:hover { border-color: rgba(34, 211, 238, .45); box-shadow: 0 30px 60px -36px rgba(34, 211, 238, .45); transform: translateY(-3px) rotateX(1.5deg); }
.pcard__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pcard h3 { margin: 0; font-size: 15.5px; }
.pcard p { margin: 0; color: var(--mute); font-size: 13px; }
.pcard__next { padding: 9px 11px; border-radius: 11px; background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .18); font-size: 13px; }
.pcard__next b { color: var(--cyan); font: 600 10.5px var(--mono); letter-spacing: .12em; display: block; margin-bottom: 2px; }
.pcard__links { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard__links a { font-size: 12.5px; text-decoration: none; padding: 4px 9px; border-radius: 8px; background: rgba(59, 130, 246, .1); }
.cat-head { display: flex; align-items: baseline; gap: 10px; margin: 6px 2px -4px; }
.cat-head h2 { margin: 0; font-size: 13px; font-family: var(--mono); letter-spacing: .14em; color: var(--mute); font-weight: 600; text-transform: uppercase; }

/* health */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 30px; }
.spark i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--ok); opacity: .75; }
.spark i.bad { background: var(--bad); opacity: 1; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--cyan) calc(var(--p) * 1%), rgba(120, 170, 255, .12) 0); display: grid; place-items: center; flex: none; }
.ring b { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--bg2); font: 700 13px var(--mono); }

/* forms */
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--mute); }
.form input, .form select, .form textarea { min-height: 40px; padding: 8px 11px; border-radius: 11px; border: 1px solid var(--line2); background: rgba(5, 9, 18, .55); }
.form textarea { min-height: 70px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .14); }
.form .inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.form .inline > * { flex: 1 1 140px; }

/* assistant */
.chat { display: grid; gap: 10px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.msg { padding: 11px 14px; border-radius: 14px; max-width: 760px; white-space: pre-wrap; font-size: 14px; }
.msg--me { justify-self: end; background: rgba(59, 130, 246, .2); border: 1px solid rgba(59, 130, 246, .35); }
.msg--bot { background: var(--panel2); border: 1px solid var(--line); }
.msg--bot small { display: block; margin-top: 8px; color: var(--dim); font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(34, 211, 238, .06); cursor: pointer; font-size: 12.5px; color: var(--mute); }
.chips button:hover { color: var(--text); border-color: var(--cyan); }

/* modal + toast */
.modal { width: min(760px, 94vw); max-height: 88vh; padding: 0; color: var(--text); overflow: auto; }
.modal::backdrop { background: rgba(2, 5, 12, .7); backdrop-filter: blur(4px); }
.modal__head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 16px 18px; background: rgba(10, 18, 34, .95); border-bottom: 1px solid var(--line); z-index: 1; }
.modal__head h2 { margin: 0; font-size: 17px; flex: 1; }
.modal__body { padding: 16px 18px 20px; display: grid; gap: 14px; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
@media (prefers-reduced-motion: no-preference) { .modal[open] { animation: rise .3s var(--ease); } }
.toast { position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 60; padding: 11px 16px; border-radius: 12px; background: rgba(10, 18, 34, .95); border: 1px solid rgba(34, 211, 238, .4); box-shadow: 0 20px 40px -20px #000; font-size: 14px; }
.note { padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line2); color: var(--mute); font-size: 13px; }
.note b { color: var(--text); }
@media (max-width: 640px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 26px; } .kpi small { display: none; } }
