/* ApexControl — dark ApexFFA theme */
:root {
  --bg: #08080a; --bg-2: #0e0e11; --panel: #131316; --panel-2: #1a1a1f; --panel-3: #222228;
  --border: #26262d; --border-2: #33333b; --track: #2a2a31;
  --text: #f3f3f5; --text-2: #c9c9d1; --muted: #8d8d99;
  --red: #e5202e; --red-2: #ff3d4a; --red-glow: rgba(229, 32, 46, .35); --red-soft: rgba(229, 32, 46, .12);
  --purple: #8b5cf6; --purple-2: #a78bfa; --purple-soft: rgba(139, 92, 246, .14);
  --green: #22c55e; --amber: #f5a524; --blue: #3b82f6; --cyan: #22d3ee; --pink: #ec4899;
  --radius: 14px; --radius-sm: 10px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, "JetBrains Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--red-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
small { color: var(--muted); }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
::selection { background: var(--red); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b2b33; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--red-2); outline-offset: 2px; }
.ic { flex: none; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0d0d10, #09090b); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.brand { padding: 22px 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.brand-logo { width: 56px; height: 46px; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.brand-name b { color: var(--red); }
.brand-sub { color: var(--muted); font-size: 12px; }
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, var(--red), #b3121e); color: #fff; box-shadow: 0 4px 18px var(--red-glow); }
.nav a .pill { margin-left: auto; }
.nav a.ai-link .ic { color: var(--purple-2); }
.nav a.active.ai-link .ic { color: #fff; }
.side-foot { margin-top: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.side-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.side-card b { display: block; font-size: 14px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 26px; border-bottom: 1px solid var(--border); background: rgba(8, 8, 10, .85); backdrop-filter: blur(8px); position: relative; z-index: 20; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; padding: 10px 14px 10px 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--text); font: inherit; }
.search > .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); max-height: 420px; overflow: auto; }
.search-results h5 { margin: 6px 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--panel-3); text-decoration: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.conn { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); padding: 7px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 10px rgba(34, 197, 94, .7); }
.dot.off { background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.dot.warn { background: var(--amber); }
.bell { position: relative; }
.bell .count { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.userchip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.userchip:hover { background: var(--panel); }
.userchip .avatar { border-radius: 8px; }
.userchip b { display: block; font-size: 14px; }
.userchip small { color: var(--red-2); font-weight: 600; }
.menu { position: absolute; right: 26px; top: 64px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; min-width: 220px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: none; border: 0; color: var(--text); font: inherit; border-radius: 8px; cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--panel-3); text-decoration: none; }

.content { flex: 1; overflow-y: auto; padding: 24px 26px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; display: flex; align-items: center; gap: 12px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.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)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-side { grid-template-columns: 320px minmax(0, 1fr); }
.card { background: linear-gradient(180deg, var(--panel), #101013); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.card-head h3 .ic { color: var(--red); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.card.ai { background: linear-gradient(160deg, rgba(139, 92, 246, .16), var(--panel) 55%); border-color: rgba(139, 92, 246, .35); }
.card.ai .card-head h3 .ic { color: var(--purple-2); }
.card.danger { border-color: rgba(229, 32, 46, .45); }
.link-more { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }

.stat { display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden; min-height: 108px; }
.stat .stat-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); flex: none; }
.stat .stat-ic.green { background: rgba(34, 197, 94, .12); color: var(--green); }
.stat .stat-ic.purple { background: var(--purple-soft); color: var(--purple-2); }
.stat .stat-ic.amber { background: rgba(245, 165, 36, .12); color: var(--amber); }
.stat .stat-ic.blue { background: rgba(59, 130, 246, .12); color: var(--blue); }
.stat-label { color: var(--text-2); font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat .spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 52px; opacity: .95; pointer-events: none; }

/* banner */
.banner { position: relative; border-radius: 18px; overflow: hidden; min-height: 196px; border: 1px solid var(--border); display: flex; align-items: center; margin-bottom: 18px; background: #0b0508; }
.banner svg.art { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 8, 10, .96) 0%, rgba(8, 8, 10, .8) 34%, rgba(8, 8, 10, .1) 70%, rgba(8, 8, 10, .35) 100%); }
.banner-text { position: relative; padding: 26px 30px; max-width: 640px; }
.banner-text h1 { font-size: 34px; line-height: 1.12; }
.banner-text h1 em { font-style: italic; color: var(--red); font-weight: 900; text-shadow: 0 0 24px var(--red-glow); }
.banner-text p { color: var(--text-2); margin-top: 10px; font-size: 16px; }
.banner-status { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); background: rgba(10, 10, 12, .82); border: 1px solid rgba(229, 32, 46, .55); border-radius: 14px; padding: 16px 22px; min-width: 200px; box-shadow: 0 0 30px rgba(229, 32, 46, .18); }
.banner-status .big { font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.banner-status small { font-size: 14px; color: var(--text-2); }

/* lists */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--border); min-width: 0; }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.row-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); flex: none; }
.row-ic.red { color: var(--red-2); background: var(--red-soft); }
.row-ic.amber { color: var(--amber); background: rgba(245, 165, 36, .12); }
.row-ic.green { color: var(--green); background: rgba(34, 197, 94, .12); }
.row-ic.purple { color: var(--purple-2); background: var(--purple-soft); }
.row-ic.blue { color: var(--blue); background: rgba(59, 130, 246, .12); }
a.list-row { color: inherit; }
a.list-row:hover { background: var(--panel-2); text-decoration: none; border-radius: 8px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
tr.click { cursor: pointer; }
.cell-player { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cell-player .avatar { border-radius: 6px; }
.nowrap { white-space: nowrap; }
.trunc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; }
.badge-red { color: #ff6b74; background: rgba(229, 32, 46, .15); border-color: rgba(229, 32, 46, .35); }
.badge-orange { color: #ff9f5a; background: rgba(255, 140, 50, .14); border-color: rgba(255, 140, 50, .3); }
.badge-gold { color: #ffc94a; background: rgba(255, 201, 74, .13); border-color: rgba(255, 201, 74, .3); }
.badge-pink { color: #f472b6; background: rgba(236, 72, 153, .14); border-color: rgba(236, 72, 153, .3); }
.badge-purple { color: var(--purple-2); background: var(--purple-soft); border-color: rgba(139, 92, 246, .35); }
.badge-cyan { color: #67e8f9; background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .3); }
.badge-blue { color: #7aa7ff; background: rgba(59, 130, 246, .14); border-color: rgba(59, 130, 246, .3); }
.badge-green { color: #4ade80; background: rgba(34, 197, 94, .13); border-color: rgba(34, 197, 94, .3); }
.badge-gray { color: #b4b4c0; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
.pill { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--red); color: #fff; letter-spacing: .04em; }
.pill.purple { background: var(--purple); }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(34, 197, 94, .12); color: #4ade80; }
.status-chip.off { background: var(--red-soft); color: #ff6b74; }
.status-chip.neutral { background: var(--panel-3); color: var(--text-2); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--panel-3); border-color: #44444e; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--red-2), var(--red)); border-color: var(--red); color: #fff; box-shadow: 0 4px 16px var(--red-glow); }
.btn.primary:hover { background: var(--red-2); }
.btn.danger { background: rgba(229, 32, 46, .14); border-color: rgba(229, 32, 46, .5); color: #ff6b74; }
.btn.danger:hover { background: rgba(229, 32, 46, .24); }
.btn.ai { background: linear-gradient(180deg, #9b6dff, var(--purple)); border-color: var(--purple); color: #fff; box-shadow: 0 4px 16px rgba(139, 92, 246, .35); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { background: none; border: 0; color: var(--text-2); padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.qa:hover { border-color: rgba(229, 32, 46, .6); background: #1f1f25; }
.qa .ic { color: var(--red-2); }
.qa.blue .ic { color: var(--blue); }
.qa.gold .ic { color: #ffc94a; }
.qa:disabled { opacity: .4; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field small { font-size: 12.5px; }
input, select, textarea { background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 14px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
textarea { resize: vertical; min-height: 90px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--red); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 160px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--red); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--text); }

/* tooltip */
.tip { position: relative; display: inline-flex; color: var(--muted); cursor: help; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; background: #000; color: var(--text); border: 1px solid var(--border-2); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 400; line-height: 1.4; z-index: 60; white-space: normal; text-transform: none; letter-spacing: 0; box-shadow: 0 8px 22px rgba(0, 0, 0, .6); }

/* gauges & charts */
.gauges { display: flex; justify-content: space-around; gap: 10px; flex-wrap: wrap; }
.gauge { position: relative; width: 92px; text-align: center; }
.gauge-val { position: absolute; top: 31px; left: 0; right: 0; font-size: 18px; font-weight: 800; }
.gauge-label { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.chart-wrap { position: relative; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .xhair { stroke: var(--border-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; background: rgba(0, 0, 0, .92); border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; min-width: 150px; }
.chart-tip i, .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }

/* states */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h4 { color: var(--text); font-size: 16px; }
.empty p { max-width: 460px; font-size: 14px; }
.empty.small { padding: 18px; }
.empty .ic { color: var(--border-2); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border-2); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.spinner.purple { border-top-color: var(--purple); }
@keyframes spin { to { transform: rotate(360deg); } }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); font-size: 14px; color: var(--text-2); margin-bottom: 14px; }
.callout .ic { margin-top: 2px; }
.callout.warn { border-color: rgba(245, 165, 36, .4); background: rgba(245, 165, 36, .07); }
.callout.warn .ic { color: var(--amber); }
.callout.danger { border-color: rgba(229, 32, 46, .45); background: var(--red-soft); }
.callout.danger .ic { color: var(--red-2); }
.callout.info .ic { color: var(--blue); }
.callout.ai { border-color: rgba(139, 92, 246, .4); background: var(--purple-soft); }
.callout.ai .ic { color: var(--purple-2); }

/* toasts & modal */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--border-2); border-left: 4px solid var(--green); padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: 420px; font-size: 14px; transition: opacity .4s, transform .4s; }
.toast-error { border-left-color: var(--red); }
.toast-error .ic { color: var(--red-2); }
.toast-ok .ic { color: var(--green); }
.toast.out { opacity: 0; transform: translateY(8px); }
.modal-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; z-index: 80; padding: 20px; backdrop-filter: blur(3px); }
.modal { background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px; width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 60px rgba(0, 0, 0, .6); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* console / code */
.console { background: #050506; border: 1px solid var(--border); border-radius: 12px; font-family: var(--mono); font-size: 12.8px; line-height: 1.55; padding: 12px 14px; height: calc(100vh - 330px); min-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.console .l-WARN { color: #fbbf24; }
.console .l-ERROR, .console .l-FATAL { color: #ff6b74; }
.console .l-cmd { color: #67e8f9; }
.console .l-out { color: #a7f3d0; }
.console .t { color: #6b6b78; }
.console mark { background: rgba(229, 32, 46, .35); color: #fff; }
.cmdbar { display: flex; gap: 10px; margin-top: 12px; }
.cmdbar input { font-family: var(--mono); }
.code { background: #050506; border: 1px solid var(--border); border-radius: 12px; padding: 12px 0; font-family: var(--mono); font-size: 12.8px; line-height: 1.6; overflow: auto; white-space: pre; max-height: calc(100vh - 300px); }
.code .ln { display: inline-block; width: 46px; padding-right: 12px; text-align: right; color: #4b4b55; user-select: none; }
.code .k { color: #ff7a85; } .code .s { color: #a5e3a1; } .code .n { color: #f5c46b; } .code .b { color: #c4a5ff; } .code .c { color: #6b6b78; font-style: italic; }
.editor { width: 100%; min-height: calc(100vh - 330px); font-family: var(--mono); font-size: 13px; line-height: 1.6; background: #050506; tab-size: 2; white-space: pre; }
.diff { font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 60vh; background: #050506; }
.diff-row { display: flex; white-space: pre; }
.diff-row .ln { width: 44px; flex: none; text-align: right; padding-right: 8px; color: #4b4b55; }
.diff-row code { padding: 0 10px; font-size: inherit; }
.dadd { background: rgba(34, 197, 94, .1); } .dadd code { color: #86efac; }
.ddel { background: rgba(229, 32, 46, .12); } .ddel code { color: #fca5a5; }
.diff-gap { color: var(--muted); text-align: center; background: var(--panel-2); }

/* files */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; margin-bottom: 12px; }
.crumbs a { color: var(--text-2); }
.crumbs span { color: var(--muted); }
.file-row .ic { color: var(--muted); }
.file-row.dir .ic { color: #ffc94a; }

/* lp tree */
.tree { font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--border-2); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: 4px 0; }
.tree .node { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; }
.tree .node:hover { border-color: var(--red); }
.tree .node small { color: var(--muted); }
.group-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); }
.group-list a:hover { background: var(--panel-2); text-decoration: none; }
.group-list a.on { background: var(--red-soft); border: 1px solid rgba(229, 32, 46, .4); }
.weight { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.staged { border: 1px dashed rgba(245, 165, 36, .6); background: rgba(245, 165, 36, .06); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 12px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--panel-3); border: 1px solid var(--border-2); }
.msg.bot { align-self: flex-start; background: var(--purple-soft); border: 1px solid rgba(139, 92, 246, .3); }
.msg.bot h4 { margin: 10px 0 4px; font-size: 14.5px; }
.msg.bot ul { margin: 6px 0; padding-left: 20px; }
.msg.bot code { background: rgba(0, 0, 0, .35); padding: 1px 5px; border-radius: 5px; }
.msg .tools { margin-top: 8px; font-size: 12px; color: var(--purple-2); }
.chat-input { display: flex; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.chat-input textarea { min-height: 48px; height: 48px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.suggest button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.suggest button:hover { border-color: var(--purple); color: var(--text); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1000px 500px at 50% -10%, rgba(229, 32, 46, .22), transparent 60%), var(--bg); }
.auth-box { width: min(420px, 100%); }
.auth-box .card { padding: 26px; }
.auth-box .brand { padding-bottom: 22px; }

.foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 26px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.foot .tag { letter-spacing: .4em; font-size: 11px; }
.foot .tag b { color: var(--red); }

@media (max-width: 1400px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qa-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) { .g3, .g-main, .g2, .g-side { grid-template-columns: minmax(0, 1fr); } .banner-status { display: none; } }
@media (max-width: 820px) { .shell { grid-template-columns: 1fr; } .sidebar { display: none; } .g4 { grid-template-columns: 1fr; } .conn span.label { display: none; } }

/* ---------- smooth page transitions & feedback ---------- */
.content { transition: opacity .14s ease; }
.content.leaving { opacity: .4; pointer-events: none; }
.content.entering > * { animation: pageIn .32s cubic-bezier(.2, .8, .2, 1) both; }
.content.entering > *:nth-child(2) { animation-delay: .04s; }
.content.entering > *:nth-child(3) { animation-delay: .08s; }
.content.entering > *:nth-child(n+4) { animation-delay: .11s; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 1000; background: linear-gradient(90deg, var(--red), var(--purple)); box-shadow: 0 0 10px var(--red-glow); opacity: 0; pointer-events: none; }
#progress.run { opacity: 1; width: 75%; transition: width 2.5s cubic-bezier(.1, .7, .2, 1); }
#progress.done { opacity: 0; width: 100%; transition: width .15s ease, opacity .3s ease .15s; }
.card { transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.btn, .qa, .icon-btn, .userchip { transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease, opacity .15s ease; }
.btn:active, .qa:active { transform: scale(.97); }
.modal-wrap { animation: fadeIn .16s ease both; }
.modal-wrap > * { animation: popIn .22s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.tabs button { transition: color .15s ease, background .15s ease, border-color .15s ease; }
#tab { animation: pageIn .24s cubic-bezier(.2, .8, .2, 1) both; }
.skeleton { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) {
  .content.entering > *, #tab, .modal-wrap, .modal-wrap > *, .skeleton { animation: none !important; }
  .content, #progress { transition: none !important; }
}

/* ---------- staff activity ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.bars .bar { flex: 1; min-width: 4px; background: linear-gradient(180deg, var(--red-2), var(--red)); border-radius: 4px 4px 2px 2px; position: relative; transition: height .4s cubic-bezier(.2, .8, .2, 1), opacity .15s; }
.bars .bar:hover { opacity: .8; }
.bars .bar.zero { background: var(--track); }
.bars-x { display: flex; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; vertical-align: middle; }
.spark i { width: 5px; background: var(--red); border-radius: 2px; opacity: .85; }
.spark i.z { background: var(--track); }
.hbar { height: 8px; border-radius: 6px; background: var(--track); overflow: hidden; min-width: 80px; }
.hbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--red-2)); border-radius: 6px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: linear-gradient(180deg, var(--panel), #101013); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.kpi .s { color: var(--muted); font-size: 12.5px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.perm { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); font-size: 14px; }
.perm.yes .ic { color: var(--green); }
.perm.no { opacity: .6; }
.perm.no .ic { color: var(--muted); }

/* ---------- proof ---------- */
.proof-box { margin: 4px 0 6px; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.proof-box summary { cursor: pointer; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.proof-list { display: grid; gap: 12px; margin-bottom: 14px; }
.proof-item { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 8px; }
.proof-item img, .proof-item video { max-width: 100%; max-height: 360px; border-radius: 8px; display: block; background: #000; }
.proof-item a { word-break: break-all; }
