:root {
  --navy: #122336;
  --navy-2: #1c3148;
  --blue: #1477df;
  --blue-soft: #eaf3ff;
  --ink: #1d2b3a;
  --muted: #6f7f90;
  --line: #dfe6ed;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --green: #159447;
  --orange: #e8890b;
  --red: #c92c36;
  --shadow: 0 7px 24px rgba(25, 48, 74, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden], .login-view:not(.is-active), .dashboard-view:not(.is-active) { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.dashboard-view { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; color: #d9e5f1; background: linear-gradient(180deg, var(--navy), #0d1b2a); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; height: 72px; padding: 0 24px; font-size: 15px; font-weight: 700; letter-spacing: .08em; }
.brand-mark { color: #fff; font-size: 25px; font-weight: 900; letter-spacing: -.1em; }
.sidebar nav { display: grid; gap: 5px; padding: 18px 12px; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; padding: 12px 13px; border-radius: 8px; color: #b9c9d9; text-decoration: none; font-size: 14px; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(20, 119, 223, .82); }
.sidebar-footer { margin-top: auto; padding: 22px 24px; color: #8ea4b9; font-size: 11px; line-height: 1.65; }
.workspace { min-width: 0; flex: 1; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; color: #d5e1ed; background: var(--navy-2); }
.breadcrumbs { font-size: 13px; font-weight: 650; }
.breadcrumbs span { margin: 0 8px; color: #7890a7; }
.topbar-actions { display: flex; align-items: center; gap: 17px; font-size: 12px; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: #c4d1de; }
.connection-state i, .live-badge i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--red); }
.connection-state.online i, .live-badge i { background: var(--green); }
.connection-state.online { color: #cdeed9; }
.user-chip { padding: 8px 11px; border-left: 1px solid rgba(255,255,255,.16); color: #fff; font-weight: 650; }
.content { max-width: 1640px; margin: 0 auto; padding: 34px 36px 55px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 31px; letter-spacing: -.035em; }
h2 { margin-bottom: 3px; font-size: 16px; }
h3 { margin-top: 25px; font-size: 13px; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.notice { margin: 0 0 18px; padding: 12px 15px; border: 1px solid #f4c77d; border-radius: 7px; color: #75500d; background: #fff8e9; font-size: 13px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 11px; margin-bottom: 18px; }
.kpi-card { min-height: 106px; display: flex; align-items: flex-start; gap: 11px; padding: 18px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.kpi-card > div { min-width: 0; display: grid; gap: 4px; }
.kpi-card span:not(.kpi-icon) { color: var(--muted); font-size: 12px; white-space: nowrap; }
.kpi-card strong { font-size: 27px; letter-spacing: -.04em; }
.kpi-card small { color: #9aa8b6; font-size: 10px; }
.kpi-icon { width: 27px; height: 27px; display: inline-grid; place-items: center; border-radius: 50%; font-size: 15px; font-weight: 800; }
.kpi-icon.green { color: var(--green); background: #e3f5e9; }.kpi-icon.orange { color: var(--orange); background: #fff0d7; }.kpi-icon.red { color: var(--red); background: #fde5e6; }.kpi-icon.blue { color: var(--blue); background: var(--blue-soft); }
.filter-panel { display: grid; grid-template-columns: repeat(6, minmax(115px, 1fr)); gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #eef3f7; }
label { display: grid; gap: 5px; color: #627487; font-size: 11px; font-weight: 750; }
input, select { width: 100%; height: 35px; padding: 0 10px; border: 1px solid #cdd8e2; border-radius: 5px; color: var(--ink); background: #fff; outline: none; font-size: 12px; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,119,223,.12); }
.panel { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-heading > div { display: flex; align-items: baseline; gap: 10px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 11px; font-weight: 750; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 910px; }
th { padding: 11px 14px; color: #8392a0; background: #fbfcfd; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { padding: 13px 14px; border-top: 1px solid #edf1f4; font-size: 12px; vertical-align: middle; }
tbody tr { transition: background .15s ease; }.activity-row:hover { background: #f7fbff; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 5px 8px; border-radius: 4px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-running { color: var(--green); background: #e7f6eb; }.status-waiting { color: #a96100; background: #fff1d8; }.status-stopped { color: var(--red); background: #fde7e8; }.status-idle, .status-completed, .status-unknown { color: #647689; background: #edf1f4; }
.platform-name { color: var(--blue); font-weight: 750; }.session-title { font-weight: 750; }.session-id { display: block; margin-top: 3px; color: #9aa7b3; font-size: 10px; }.activity-text { max-width: 260px; color: #506274; }.action-button { padding: 6px 10px; border: 1px solid #cbd8e4; border-radius: 5px; color: var(--blue); background: #fff; font-size: 11px; font-weight: 750; }
.empty-state { padding: 30px !important; color: #8c9aa8; text-align: center; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.device-card { padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #fcfdfe; }.device-card-header { display: flex; justify-content: space-between; gap: 10px; }.device-card h3 { margin: 0 0 5px; font-size: 14px; }.device-online { color: var(--green); font-size: 11px; font-weight: 750; }.device-offline { color: var(--red); font-size: 11px; font-weight: 750; }.device-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; }.device-meta dt { color: #8b99a7; font-size: 10px; }.device-meta dd { margin: 3px 0 0; color: #45586a; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secondary-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 35px; padding: 0 14px; border: 1px solid #c9d8e7; border-radius: 5px; color: var(--blue); background: #fff; font-size: 12px; font-weight: 750; text-decoration: none; }.primary-button { border-color: var(--blue); color: #fff; background: var(--blue); }.secondary-button:hover { background: var(--blue-soft); }.icon-button { border: 0; color: inherit; background: transparent; font-size: 20px; }
.detail-drawer { position: fixed; z-index: 10; inset: 0 0 0 auto; width: min(430px, 100vw); overflow-y: auto; padding: 26px; border-left: 1px solid var(--line); background: #fff; box-shadow: -14px 0 40px rgba(18, 35, 54, .18); }.drawer-header { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 15px; }.drawer-header h2 { font-size: 20px; }.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 18px 0; border-bottom: 1px solid var(--line); }.detail-meta dt { color: #8a98a6; font-size: 10px; }.detail-meta dd { margin: 3px 0 0; font-size: 12px; overflow-wrap: anywhere; }.detail-tabs { display: flex; gap: 18px; margin: 18px 0; border-bottom: 1px solid var(--line); }.detail-tabs button { padding: 0 0 9px; border: 0; color: #8392a0; background: transparent; font-size: 12px; }.detail-tabs button.active { border-bottom: 2px solid var(--blue); color: var(--blue); font-weight: 750; }.timeline { display: grid; gap: 15px; padding-left: 12px; border-left: 2px solid #dce7f1; }.timeline-item { position: relative; padding-left: 10px; }.timeline-item::before { content: ""; position: absolute; top: 5px; left: -18px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }.timeline-time { color: #8795a2; font-size: 10px; }.timeline-title { margin: 2px 0; font-size: 12px; font-weight: 750; }.timeline-message { color: #647487; font-size: 11px; }.drawer-actions { display: flex; gap: 8px; margin-top: 24px; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 0, #284c6d, var(--navy) 56%); }.login-card { width: min(420px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; color: #fff; background: rgba(12, 29, 46, .86); box-shadow: 0 20px 80px rgba(0,0,0,.2); }.login-card .brand-mark { margin-bottom: 38px; color: #58a8ff; }.login-card h1 { font-size: 26px; }.login-card .muted { color: #a9bdcf; }.stack-form { display: grid; gap: 8px; margin-top: 25px; }.stack-form label { color: #bad0e2; }.stack-form input { height: 42px; border-color: #55718b; color: #fff; background: #1c344b; }.stack-form .primary-button { margin-top: 10px; height: 42px; }.form-error { margin: 15px 0 0; color: #ffb4b8; font-size: 12px; }
@media (max-width: 1150px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); }.filter-panel { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .sidebar { display: none; }.topbar { padding: 0 16px; }.breadcrumbs { display: none; }.topbar-actions { margin-left: auto; gap: 10px; }.topbar-actions .muted { display: none; }.content { padding: 24px 14px 40px; }.page-heading { align-items: flex-start; }.page-heading .secondary-button { margin-top: 3px; }.kpi-grid { grid-template-columns: repeat(2, 1fr); }.filter-panel { grid-template-columns: 1fr 1fr; }.kpi-card { min-height: 96px; padding: 13px 10px; }.kpi-card strong { font-size: 23px; }.detail-drawer { padding: 20px; } }
@media (max-width: 430px) { .filter-panel { grid-template-columns: 1fr; }.kpi-grid { gap: 7px; }.kpi-card { gap: 7px; }.kpi-card span:not(.kpi-icon) { white-space: normal; }.user-chip { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
