:root {
  --bg: #08111f;
  --bg-2: #0d1728;
  --panel: rgba(17, 28, 47, .82);
  --panel-2: rgba(23, 36, 58, .84);
  --panel-solid: #121f33;
  --text: #eef4ff;
  --muted: #8fa0b8;
  --muted-2: #6d7b90;
  --line: rgba(255,255,255,.08);
  --accent: #7c8cff;
  --accent-2: #53d6c3;
  --good: #4fd1a3;
  --warn: #f4c86a;
  --bad: #ff718c;
  --info: #79b8ff;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 15% 0%, #152446 0, var(--bg) 36%, #060b14 100%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display:none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.app-shell { min-height: 100vh; display:grid; grid-template-columns: 270px 1fr; }
.sidebar { position: sticky; top:0; height:100vh; border-right:1px solid var(--line); padding:22px 16px; display:flex; flex-direction:column; background:rgba(6,13,24,.74); backdrop-filter: blur(18px); z-index:20; }
.brand-wrap { display:flex; gap:12px; align-items:center; padding:4px 8px 22px; }
.brand-mark { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; font-weight:900; letter-spacing:.5px; background: linear-gradient(135deg, #7c8cff, #53d6c3); color:#07121c; box-shadow:0 10px 30px rgba(96,121,255,.22); }
.brand-title { font-weight:800; letter-spacing:.2px; }
.brand-subtitle { margin-top:2px; font-size:12px; color:var(--muted); }
.nav { display:flex; flex-direction:column; gap:4px; }
.nav-item { display:flex; align-items:center; gap:11px; border:0; background:transparent; padding:11px 12px; border-radius:12px; cursor:pointer; color:#b5c2d5; text-align:left; transition:.18s ease; }
.nav-item:hover { background:rgba(255,255,255,.05); color:white; }
.nav-item.active { background:linear-gradient(90deg, rgba(124,140,255,.18), rgba(83,214,195,.08)); color:white; box-shadow: inset 0 0 0 1px rgba(124,140,255,.16); }
.nav-icon { width:20px; text-align:center; opacity:.9; }
.nav-badge { margin-left:auto; min-width:22px; height:20px; padding:0 7px; border-radius:999px; display:grid; place-items:center; background:rgba(255,113,140,.18); color:#ff91a6; font-size:11px; font-weight:800; }
.sidebar-bottom { margin-top:auto; display:grid; gap:12px; }
.privacy-card { display:flex; gap:10px; padding:12px; border-radius:14px; background:rgba(79,209,163,.08); border:1px solid rgba(79,209,163,.16); }
.privacy-card strong { display:block; font-size:12px; }
.privacy-card span { display:block; margin-top:2px; font-size:11px; color:#9bb8b0; line-height:1.35; }
.privacy-dot { width:9px; height:9px; border-radius:50%; background:var(--good); margin-top:4px; box-shadow:0 0 0 5px rgba(79,209,163,.08); }
.system-mini { display:flex; gap:8px; align-items:center; padding:8px 10px; color:#b5c2d5; font-size:12px; }
.status-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.status-dot.online { background:var(--good); box-shadow:0 0 12px rgba(79,209,163,.4); }
.status-dot.degraded { background:var(--warn); }
.status-dot.offline { background:var(--bad); }
.main { min-width:0; }
.topbar { height:86px; padding:0 28px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:15; background:linear-gradient(180deg, rgba(8,17,31,.94), rgba(8,17,31,.72)); backdrop-filter:blur(18px); border-bottom:1px solid var(--line); }
.top-left { display:flex; align-items:center; gap:12px; }
.topbar h1 { margin:0; font-size:23px; letter-spacing:-.3px; }
.topbar p { margin:4px 0 0; color:var(--muted); font-size:13px; }
.top-actions { display:flex; align-items:center; gap:10px; }
.global-search { width:min(34vw, 430px); height:42px; display:flex; align-items:center; gap:8px; padding:0 12px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.035); }
.global-search input { flex:1; border:0; outline:0; background:transparent; color:white; min-width:0; }
.global-search input::placeholder { color:#6e7c91; }
.icon-btn,.avatar-btn { border:1px solid var(--line); background:rgba(255,255,255,.035); border-radius:12px; height:42px; min-width:42px; cursor:pointer; }
.avatar-btn { font-weight:800; background:linear-gradient(135deg, rgba(124,140,255,.32), rgba(83,214,195,.18)); }
.content { padding:26px 28px 42px; max-width:1600px; margin:0 auto; }
.grid { display:grid; gap:16px; }
.grid.kpi { grid-template-columns:repeat(6, minmax(0,1fr)); }
.grid.two { grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr); }
.grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.card { border:1px solid var(--line); background:linear-gradient(180deg, rgba(20,33,54,.82), rgba(13,23,40,.82)); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
.card.pad { padding:18px; }
.kpi-card { padding:16px; min-height:116px; position:relative; }
.kpi-label { color:var(--muted); font-size:12px; }
.kpi-value { font-size:28px; font-weight:850; margin-top:12px; letter-spacing:-.7px; }
.kpi-foot { color:var(--muted); font-size:11px; margin-top:8px; }
.kpi-glow { position:absolute; width:84px; height:84px; border-radius:50%; filter:blur(26px); opacity:.18; right:-25px; top:-24px; background:var(--accent); }
.section-head { padding:18px 20px 0; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.section-head h2 { margin:0; font-size:16px; }
.section-head p { margin:5px 0 0; color:var(--muted); font-size:12px; }
.section-body { padding:14px 20px 20px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th, td { padding:13px 12px; text-align:left; border-bottom:1px solid var(--line); white-space:nowrap; }
th { color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
td { font-size:13px; color:#dfe7f5; }
tr.clickable { cursor:pointer; }
tr.clickable:hover td { background:rgba(255,255,255,.025); }
.badge { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:5px 9px; font-size:11px; font-weight:800; border:1px solid transparent; }
.badge.good { background:rgba(79,209,163,.09); color:#7ee4bf; border-color:rgba(79,209,163,.18); }
.badge.warn { background:rgba(244,200,106,.1); color:#f3cf7f; border-color:rgba(244,200,106,.18); }
.badge.bad { background:rgba(255,113,140,.1); color:#ff91a6; border-color:rgba(255,113,140,.18); }
.badge.info { background:rgba(121,184,255,.1); color:#9dccff; border-color:rgba(121,184,255,.18); }
.badge.neutral { background:rgba(255,255,255,.05); color:#b8c4d7; border-color:var(--line); }
.btn { border:1px solid var(--line); background:rgba(255,255,255,.05); padding:9px 12px; border-radius:11px; cursor:pointer; transition:.18s ease; font-weight:700; font-size:12px; }
.btn:hover { transform:translateY(-1px); background:rgba(255,255,255,.075); }
.btn.primary { background:linear-gradient(135deg, #7788ff, #5ccfbd); color:#07121c; border:0; }
.btn.danger { background:rgba(255,113,140,.1); color:#ff9aad; border-color:rgba(255,113,140,.22); }
.btn.ghost { background:transparent; }
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.input, .select, .textarea { border:1px solid var(--line); background:rgba(255,255,255,.035); color:white; border-radius:12px; outline:none; }
.input,.select { height:40px; padding:0 12px; }
.textarea { padding:12px; min-height:92px; resize:vertical; }
.input:focus,.select:focus,.textarea:focus { border-color:rgba(124,140,255,.55); box-shadow:0 0 0 3px rgba(124,140,255,.08); }
.service-list { display:grid; gap:10px; }
.service-row { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:12px 14px; border-radius:14px; border:1px solid var(--line); background:rgba(255,255,255,.025); }
.service-name { display:flex; align-items:center; gap:9px; font-weight:750; font-size:13px; }
.service-detail { margin-top:3px; color:var(--muted); font-size:11px; }
.server-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.server-card { padding:16px; border-radius:16px; border:1px solid var(--line); background:rgba(255,255,255,.025); }
.server-top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.server-id { font-weight:850; font-size:18px; }
.server-region { color:var(--muted); font-size:11px; margin-top:2px; }
.loadbar { height:8px; border-radius:99px; background:rgba(255,255,255,.06); overflow:hidden; margin:14px 0 10px; }
.loadbar > span { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg, var(--good), var(--warn)); }
.metric-row { display:flex; justify-content:space-between; gap:12px; margin-top:8px; font-size:12px; }
.metric-row span:first-child { color:var(--muted); }
.banner { border:1px solid rgba(121,184,255,.16); background:linear-gradient(135deg, rgba(121,184,255,.08), rgba(124,140,255,.06)); border-radius:16px; padding:15px 16px; display:flex; align-items:flex-start; gap:12px; }
.banner .bicon { width:34px; height:34px; border-radius:11px; display:grid; place-items:center; background:rgba(121,184,255,.1); }
.banner strong { display:block; font-size:13px; }
.banner p { margin:4px 0 0; color:#9eafc4; font-size:12px; line-height:1.45; }
.issue-row { display:grid; grid-template-columns:minmax(260px,1.8fr) 90px 90px 100px 120px; gap:10px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.issue-code { font-weight:800; font-size:13px; }
.issue-summary { margin-top:4px; color:var(--muted); font-size:11px; }
.delta-up { color:#ff8da4; font-weight:800; }
.delta-down { color:#7de0bb; font-weight:800; }
.drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.46); z-index:50; backdrop-filter:blur(3px); }
.drawer { position:fixed; right:0; top:0; bottom:0; width:min(720px, 92vw); z-index:60; background:#0b1423; border-left:1px solid var(--line); box-shadow:-30px 0 80px rgba(0,0,0,.45); overflow:auto; }
.drawer-head { position:sticky; top:0; z-index:2; padding:20px 22px; background:rgba(11,20,35,.94); backdrop-filter:blur(14px); border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:12px; }
.drawer-title { font-size:18px; font-weight:850; }
.drawer-sub { margin-top:3px; color:var(--muted); font-size:12px; }
.drawer-body { padding:20px 22px 34px; }
.user-hero { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:16px; }
.user-id { font-size:13px; color:#aebbd0; }
.action-row { display:flex; flex-wrap:wrap; gap:8px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.detail-box { padding:13px; border-radius:14px; background:rgba(255,255,255,.025); border:1px solid var(--line); }
.detail-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.detail-value { margin-top:5px; font-size:13px; font-weight:750; word-break:break-word; }
.device-card { margin-top:10px; padding:14px; border-radius:14px; background:rgba(255,255,255,.025); border:1px solid var(--line); }
.device-top { display:flex; justify-content:space-between; gap:10px; }
.device-name { font-weight:800; }
.device-meta { margin-top:5px; color:var(--muted); font-size:11px; }
.chat-layout { display:grid; grid-template-columns:310px 1fr; min-height:640px; }
.ticket-list { border-right:1px solid var(--line); padding:10px; background:rgba(255,255,255,.012); }
.ticket-item { padding:13px; border-radius:14px; cursor:pointer; border:1px solid transparent; margin-bottom:6px; }
.ticket-item:hover { background:rgba(255,255,255,.03); }
.ticket-item.active { background:rgba(124,140,255,.08); border-color:rgba(124,140,255,.16); }
.ticket-title { font-size:12px; font-weight:800; }
.ticket-meta { margin-top:5px; display:flex; gap:7px; color:var(--muted); font-size:10px; }
.chat-pane { min-width:0; display:flex; flex-direction:column; }
.chat-head { padding:16px 18px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:12px; align-items:center; }
.chat-messages { flex:1; padding:18px; display:flex; flex-direction:column; gap:10px; min-height:410px; }
.msg { max-width:78%; padding:11px 13px; border-radius:14px; font-size:12px; line-height:1.45; }
.msg.user { align-self:flex-start; background:rgba(255,255,255,.055); border:1px solid var(--line); }
.msg.support { align-self:flex-end; background:linear-gradient(135deg, rgba(124,140,255,.18), rgba(83,214,195,.12)); border:1px solid rgba(124,140,255,.14); }
.msg.internal { align-self:center; max-width:92%; background:rgba(244,200,106,.07); border:1px dashed rgba(244,200,106,.2); color:#d8caa5; }
.msg-time { margin-top:5px; font-size:9px; color:var(--muted-2); }
.composer { border-top:1px solid var(--line); padding:14px; display:grid; gap:8px; }
.composer-row { display:flex; gap:8px; }
.composer textarea { flex:1; }
.timeline { display:grid; gap:10px; }
.timeline-item { display:grid; grid-template-columns:60px 1fr; gap:12px; font-size:12px; }
.timeline-item .time { color:var(--muted); }
.toast-host { position:fixed; right:24px; bottom:24px; z-index:100; display:grid; gap:8px; }
.toast { padding:12px 14px; border-radius:12px; background:#17253b; border:1px solid var(--line); box-shadow:var(--shadow); font-size:12px; animation:toastIn .2s ease; }
@keyframes toastIn { from { transform:translateY(8px); opacity:0; } to { transform:none; opacity:1; } }
.mobile-only { display:none; }
.empty { padding:34px; text-align:center; color:var(--muted); }
.statline { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.right { text-align:right; }
.spark { height:30px; display:flex; align-items:end; gap:3px; }
.spark i { width:5px; border-radius:4px; background:rgba(124,140,255,.5); display:block; }
.hr { height:1px; background:var(--line); margin:16px 0; }
.modal-note { font-size:11px; color:var(--muted); line-height:1.5; }

@media (max-width: 1250px) {
  .grid.kpi { grid-template-columns:repeat(3,1fr); }
  .server-grid { grid-template-columns:1fr; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:-290px; width:270px; transition:.2s ease; }
  .sidebar.open { left:0; box-shadow:30px 0 70px rgba(0,0,0,.48); }
  .mobile-only { display:inline-grid; place-items:center; }
  .grid.two { grid-template-columns:1fr; }
  .chat-layout { grid-template-columns:1fr; }
  .ticket-list { border-right:0; border-bottom:1px solid var(--line); max-height:250px; overflow:auto; }
}
@media (max-width: 720px) {
  .topbar { padding:0 14px; height:78px; }
  .topbar p { display:none; }
  .global-search { display:none; }
  .content { padding:18px 14px 34px; }
  .grid.kpi { grid-template-columns:repeat(2,1fr); }
  .grid.three { grid-template-columns:1fr; }
  .detail-grid { grid-template-columns:1fr; }
  .issue-row { grid-template-columns:1fr 70px 70px; }
  .issue-row > :nth-child(4), .issue-row > :nth-child(5) { display:none; }
  .drawer { width:100vw; }
}

/* Production boot / fail-closed state */
.boot-shell{min-height:100vh;display:grid;place-items:center;padding:32px;background:radial-gradient(circle at 15% 15%,rgba(79,110,247,.18),transparent 35%),radial-gradient(circle at 85% 80%,rgba(44,201,159,.12),transparent 32%),var(--bg)}
.boot-card{width:min(680px,100%);background:linear-gradient(180deg,rgba(20,28,52,.96),rgba(12,18,35,.98));border:1px solid var(--border);border-radius:24px;padding:30px;box-shadow:0 28px 90px rgba(0,0,0,.35)}
.boot-brand{display:flex;align-items:center;gap:12px;margin-bottom:28px}.boot-brand>div{display:flex;flex-direction:column}.boot-brand strong{font-size:18px}.boot-brand small{color:var(--muted);margin-top:2px}
.boot-status{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.08em;margin-bottom:14px}.boot-status.bad{background:rgba(255,87,100,.12);color:var(--bad);border:1px solid rgba(255,87,100,.25)}
.boot-card h1{font-size:28px;margin:0 0 10px}.boot-card>p{color:var(--muted);line-height:1.65;margin:0 0 18px}.boot-card pre{white-space:pre-wrap;word-break:break-word;background:#090e1c;border:1px solid var(--border);padding:14px;border-radius:12px;color:#c7d2fe;margin-bottom:20px}
.boot-rule{display:flex;gap:12px;padding:14px;border-radius:14px;background:rgba(44,201,159,.08);border:1px solid rgba(44,201,159,.18);margin:20px 0}.boot-rule>span{width:10px;height:10px;border-radius:50%;background:var(--good);margin-top:4px;box-shadow:0 0 18px rgba(44,201,159,.7)}.boot-rule>div{display:flex;flex-direction:column;gap:4px}.boot-rule small{color:var(--muted);line-height:1.45}
