:root {
  color-scheme: dark;
  --bg: #090c12;
  --bg-elevated: #0d1119;
  --panel: #10151f;
  --panel-2: #141b27;
  --panel-3: #192231;
  --border: #222c3b;
  --border-strong: #314056;
  --text: #f2f5f9;
  --muted: #8996a8;
  --muted-2: #697587;
  --accent: #7c9cff;
  --accent-strong: #9bb2ff;
  --accent-dim: rgba(124, 156, 255, 0.12);
  --green: #42d39a;
  --green-dim: rgba(66, 211, 154, 0.12);
  --amber: #f3bd63;
  --amber-dim: rgba(243, 189, 99, 0.12);
  --red: #ff7188;
  --red-dim: rgba(255, 113, 136, 0.12);
  --cyan: #55cce6;
  --purple: #b48cff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 244px;
  --ease: 180ms ease;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -20%, rgba(87, 111, 190, 0.11), transparent 35rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.drawer-open { overflow: hidden; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--accent-strong); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection { background: rgba(124, 156, 255, 0.3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #283345; border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #080b12;
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  color: var(--muted);
}

.boot-screen p { margin: 0; font-size: 13px; letter-spacing: .03em; }

.brand-mark {
  position: relative;
  width: 45px;
  height: 45px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(124, 156, 255, .32);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(124, 156, 255, .2), rgba(124, 156, 255, .05));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 10px 30px rgba(30, 48, 104, .2);
}
.brand-mark span { display: block; border-radius: 2px; background: var(--accent-strong); animation: mark-pulse 1.5s ease-in-out infinite; }
.brand-mark span:nth-child(1) { height: 42%; animation-delay: -1s; }
.brand-mark span:nth-child(2) { height: 80%; animation-delay: -.5s; }
.brand-mark span:nth-child(3) { height: 58%; }
.brand-mark-small { width: 35px; height: 35px; padding: 8px; border-radius: 10px; }
.brand-mark-small span { animation: none; }
@keyframes mark-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* Login */
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-panel {
  min-height: 100vh;
  padding: clamp(38px, 6vw, 86px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(rgba(124, 156, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 156, 255, .035) 1px, transparent 1px),
    radial-gradient(circle at 20% 65%, rgba(73, 103, 193, .18), transparent 28rem),
    #0b0f17;
  background-size: 38px 38px, 38px 38px, auto, auto;
}
.login-panel::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(124,156,255,.08);
  border-radius: 50%;
  right: -130px;
  bottom: 7%;
  box-shadow: 0 0 0 60px rgba(124,156,255,.018), 0 0 0 130px rgba(124,156,255,.012);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 13px; font-weight: 700; letter-spacing: -.01em; font-size: 16px; }
.login-copy { max-width: 620px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 10px; color: var(--accent-strong); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.login-copy h1 { margin: 0 0 22px; max-width: 590px; font-size: clamp(38px, 5vw, 66px); line-height: 1.02; letter-spacing: -.05em; font-weight: 650; }
.login-copy > p:last-child { margin: 0; max-width: 540px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.login-signals { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 680px; }
.login-signals > div { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: rgba(15,20,30,.76); backdrop-filter: blur(9px); }
.login-signals strong { font-size: 12px; }
.login-signals small { grid-column: 2; color: var(--muted-2); font-size: 10px; }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; }
.signal-ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); }
.login-form-wrap { display: grid; place-items: center; min-height: 100vh; padding: 35px; }
.login-card { width: min(100%, 410px); }
.login-card-heading { margin-bottom: 31px; }
.login-card-heading h2 { margin: 0 0 5px; font-size: 29px; letter-spacing: -.035em; }
.login-card-heading > p:last-child { margin: 0; color: var(--muted); }
.field { display: grid; gap: 8px; margin: 0 0 18px; color: #bdc6d2; font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea, .select, .search-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #0d121b;
  color: var(--text);
  transition: border var(--ease), box-shadow var(--ease), background var(--ease);
}
.field input { height: 47px; padding: 0 13px; }
.field textarea { min-height: 110px; padding: 11px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .select:focus, .search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,156,255,.11); background: #101621; }
.password-input { display: block; position: relative; }
.password-input input { padding-right: 49px; }
.input-action { position: absolute !important; top: 6px; right: 6px; border: 0 !important; background: transparent !important; }
.form-alert { margin-bottom: 18px; padding: 11px 13px; border: 1px solid rgba(255,113,136,.35); border-radius: 9px; color: #ffacb9; background: var(--red-dim); font-size: 12px; }
.login-security { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 20px 0 0; color: var(--muted-2); font-size: 11px; }
.login-security svg { width: 14px; height: 14px; }

/* Controls */
.button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  transition: transform var(--ease), border-color var(--ease), background var(--ease), opacity var(--ease);
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: wait; }
.button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { background: linear-gradient(180deg, #91aaff, #748fef); border-color: #94acff; color: #0a0e17; box-shadow: inset 0 1px rgba(255,255,255,.28), 0 5px 18px rgba(62,90,184,.22); }
.button-primary:hover:not(:disabled) { background: linear-gradient(180deg, #a2b7ff, #839bf1); }
.button-secondary { border-color: var(--border-strong); background: rgba(17,23,34,.8); color: #c7cfda; }
.button-secondary:hover:not(:disabled) { border-color: #43536b; background: #171e2a; }
.button-danger { border-color: rgba(255,113,136,.28); background: var(--red-dim); color: #ff9bac; }
.button-block { width: 100%; min-height: 47px; }
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  cursor: pointer;
  transition: border var(--ease), background var(--ease);
}
.icon-button:hover { background: var(--panel-2); border-color: var(--border-strong); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 19px 14px 14px;
  border-right: 1px solid var(--border);
  background: rgba(11,15,23,.94);
  backdrop-filter: blur(16px);
}
.sidebar-brand { height: 54px; padding: 0 9px; display: flex; align-items: center; gap: 11px; }
.sidebar-brand > div:last-child { display: grid; line-height: 1.25; }
.sidebar-brand strong { font-size: 14px; letter-spacing: -.015em; }
.sidebar-brand small { color: var(--muted-2); font-size: 10px; }
.primary-nav { display: grid; gap: 4px; margin-top: 30px; }
.nav-item {
  position: relative;
  width: 100%;
  min-height: 43px;
  padding: 0 11px;
  display: grid;
  grid-template-columns: 19px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  transition: background var(--ease), color var(--ease), border var(--ease);
}
.nav-item:hover { background: rgba(255,255,255,.025); color: #cad2de; }
.nav-item.active { border-color: rgba(124,156,255,.17); background: var(--accent-dim); color: #dbe3ff; }
.nav-item.active::before { content: ""; position: absolute; left: -15px; top: 10px; bottom: 10px; width: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { min-width: 23px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 10px; background: rgba(255,255,255,.055); color: var(--muted); font-size: 9px; }
.nav-count-warn { background: var(--amber-dim); color: var(--amber); }
.nav-count-safe { background: var(--green-dim); color: var(--green); }
.sidebar-foot { display: grid; gap: 12px; margin-top: auto; }
.policy-mini { display: flex; gap: 9px; align-items: center; padding: 11px; border: 1px solid rgba(66,211,154,.15); border-radius: 10px; background: rgba(66,211,154,.045); }
.policy-mini svg { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.policy-mini div { display: grid; line-height: 1.35; }
.policy-mini strong { color: #bdebd9; font-size: 10px; }
.policy-mini small { color: #6f9f8e; font-size: 9px; }
.user-button { width: 100%; min-height: 52px; padding: 7px 9px; display: grid; grid-template-columns: 32px 1fr 17px; gap: 9px; align-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; }
.user-button:hover { border-color: var(--border); background: rgba(255,255,255,.02); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #28395f, #17233f); color: #bed0ff; font-size: 10px; font-weight: 800; }
.user-copy { display: grid; line-height: 1.3; min-width: 0; }
.user-copy strong { overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.user-copy small { color: var(--muted-2); font-size: 9px; }
.user-button > svg { width: 16px; height: 16px; fill: none; stroke: var(--muted-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); padding: 29px clamp(24px, 3.5vw, 54px) 60px; }
.workspace-header { min-height: 72px; display: flex; justify-content: space-between; align-items: start; gap: 28px; }
.workspace-header h1 { margin: 0; font-size: 27px; line-height: 1.15; letter-spacing: -.035em; }
.workspace-header > div:first-child > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.updated-label { margin-right: 4px; color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.policy-banner { margin: 24px 0; min-height: 76px; padding: 14px 17px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 13px; border: 1px solid rgba(66,211,154,.16); border-radius: 12px; background: linear-gradient(90deg, rgba(66,211,154,.075), rgba(66,211,154,.025)); }
.policy-banner .policy-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--green-dim); color: var(--green); }
.policy-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.policy-banner strong { color: #d9f5e9; font-size: 12px; }
.policy-banner p { margin: 2px 0 0; color: #78998c; font-size: 10px; }
.mobile-bar, .sidebar-scrim { display: none; }

/* Shared content */
.view-stack { display: grid; gap: 18px; }
.section-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(150deg, rgba(18,24,35,.94), rgba(13,18,27,.96)); box-shadow: inset 0 1px rgba(255,255,255,.018); }
.panel-header { min-height: 63px; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 13px; letter-spacing: -.01em; }
.panel-header p { margin: 3px 0 0; color: var(--muted-2); font-size: 10px; }
.panel-body { padding: 18px; }
.panel-action { border: 0; background: transparent; color: var(--accent-strong); cursor: pointer; font-size: 10px; font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.kpi { position: relative; min-height: 134px; padding: 17px; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: linear-gradient(145deg, rgba(18,24,35,.95), rgba(13,18,27,.96)); }
.kpi::after { content: ""; position: absolute; right: -36px; bottom: -48px; width: 110px; height: 110px; border-radius: 50%; background: var(--kpi-glow, rgba(124,156,255,.08)); filter: blur(8px); }
.kpi.glow-green { --kpi-glow: rgba(66,211,154,.09); }
.kpi.glow-amber { --kpi-glow: rgba(243,189,99,.09); }
.kpi.glow-purple { --kpi-glow: rgba(180,140,255,.09); }
.kpi.glow-accent { --kpi-glow: rgba(124,156,255,.09); }
.kpi.kpi-small { min-height: 100px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-label { color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.kpi-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-dim); color: var(--accent-strong); }
.kpi-icon.green { background: var(--green-dim); color: var(--green); }
.kpi-icon.amber { background: var(--amber-dim); color: var(--amber); }
.kpi-icon.purple { background: rgba(180,140,255,.11); color: var(--purple); }
.kpi-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi-value { margin: 13px 0 2px; font-size: 29px; line-height: 1; letter-spacing: -.045em; font-weight: 680; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 9px; }
.trend-up { color: var(--green); }
.trend-warn { color: var(--amber); }
.chip { min-height: 22px; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip-safe, .chip-healthy, .chip-succeeded { border-color: rgba(66,211,154,.19); background: var(--green-dim); color: var(--green); }
.chip-warning, .chip-scheduled, .chip-queued, .chip-unknown, .chip-partially_succeeded { border-color: rgba(243,189,99,.18); background: var(--amber-dim); color: var(--amber); }
.chip-error, .chip-failed, .chip-suspended, .chip-locked, .chip-auth_error, .chip-proxy_error { border-color: rgba(255,113,136,.18); background: var(--red-dim); color: var(--red); }
.chip-running { border-color: rgba(85,204,230,.19); background: rgba(85,204,230,.1); color: var(--cyan); }
.chip-cancelled, .chip-unchecked, .chip-skipped, .chip-idle { color: #929cab; }
.chip-info { border-color: rgba(124,156,255,.19); background: var(--accent-dim); color: var(--accent-strong); }
.chip-neutral::before, .chip-info::before { display: none; }
.metric-row { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid rgba(34,44,59,.7); }
.metric-row:last-child { border: 0; }
.metric-row span { color: var(--muted); font-size: 10px; }
.metric-row strong { text-align: right; font-size: 10px; font-weight: 650; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.subtle { color: var(--muted-2); }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Charts */
.donut-layout { min-height: 190px; display: flex; align-items: center; justify-content: center; gap: clamp(25px, 4vw, 50px); }
.donut { --value: 0; --color: var(--green); position: relative; flex: 0 0 auto; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--color) calc(var(--value) * 1%), #202938 0); }
.donut::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #111722; box-shadow: inset 0 0 0 1px var(--border); }
.donut-center { position: relative; z-index: 1; display: grid; justify-items: center; }
.donut-center strong { font-size: 25px; line-height: 1.15; letter-spacing: -.04em; }
.donut-center small { color: var(--muted-2); font-size: 9px; }
.legend { min-width: 135px; display: grid; gap: 12px; }
.legend-item { display: grid; grid-template-columns: 7px 1fr auto; align-items: center; gap: 8px; font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; }
.legend-dot.tone-0 { background: var(--green); }
.legend-dot.tone-1 { background: var(--amber); }
.legend-dot.tone-2 { background: var(--red); }
.legend-dot.tone-3 { background: var(--muted-2); }
.legend-dot.tone-4 { background: var(--accent); }
.legend-item span:nth-child(2) { color: var(--muted); }
.legend-item strong { font-variant-numeric: tabular-nums; }
.bars { min-height: 190px; display: flex; flex-direction: column; justify-content: center; gap: 17px; }
.bar-item { display: grid; grid-template-columns: 85px 1fr 31px; align-items: center; gap: 11px; font-size: 10px; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 7px; overflow: hidden; border-radius: 999px; background: #202938; }
.bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #a2b6ff); }
.bar-fill.green { background: linear-gradient(90deg, #2dac7e, var(--green)); }
.bar-fill.amber { background: linear-gradient(90deg, #c78d32, var(--amber)); }
.bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Tables & filters */
.toolbar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-wrap { position: relative; width: min(290px, 100%); }
.search-wrap svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; fill: none; stroke: var(--muted-2); stroke-width: 1.8; stroke-linecap: round; }
.search-input { height: 36px; padding: 0 11px 0 35px; font-size: 11px; }
.select { width: auto; min-width: 125px; height: 36px; padding: 0 31px 0 10px; font-size: 10px; }
.result-count { color: var(--muted-2); font-size: 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.data-table th { height: 42px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--muted-2); font-size: 9px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.data-table td { height: 58px; padding: 9px 14px; border-bottom: 1px solid rgba(34,44,59,.66); color: #cbd3df; font-size: 10px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--ease); }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: rgba(124,156,255,.035); }
.account-cell { min-width: 165px; display: flex; align-items: center; gap: 10px; }
.account-avatar { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(124,156,255,.15); border-radius: 9px; background: linear-gradient(145deg, #222f4e, #141c2e); color: #b7c7f5; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.account-avatar.project { border-color: rgba(180,140,255,.2); background: linear-gradient(145deg, #34264d, #211830); color: #d8c1ff; }
.account-cell > div { min-width: 0; display: grid; line-height: 1.35; }
.account-cell strong { color: #e8edf5; font-size: 10px; }
.account-cell small { color: var(--muted-2); font-size: 9px; }
.table-action { border: 0; background: transparent; color: var(--accent-strong); cursor: pointer; font-size: 10px; font-weight: 700; }
.table-empty { height: 190px !important; text-align: center; color: var(--muted-2) !important; }
.sort-button { border: 0; background: transparent; color: inherit; padding: 0; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; }

/* Jobs, audit, sync */
.timeline-list { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 12px; padding: 13px 0; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 40px; bottom: -1px; width: 1px; background: var(--border); }
.timeline-icon { position: relative; z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: #151c27; color: var(--muted); }
.timeline-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.timeline-icon.ok { border-color: rgba(66,211,154,.2); background: var(--green-dim); color: var(--green); }
.timeline-icon.warn { border-color: rgba(243,189,99,.2); background: var(--amber-dim); color: var(--amber); }
.timeline-icon.error { border-color: rgba(255,113,136,.2); background: var(--red-dim); color: var(--red); }
.timeline-copy { min-width: 0; padding-top: 1px; }
.timeline-copy strong { display: block; color: #dbe1e9; font-size: 10px; }
.timeline-copy p { margin: 2px 0 0; color: var(--muted-2); font-size: 9px; overflow-wrap: anywhere; }
.timeline-time { padding-top: 3px; color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.job-row-main { display: grid; gap: 2px; }
.job-row-main strong { font-size: 10px; }
.job-row-main small { max-width: 210px; color: var(--muted-2); font-size: 8px; }
.job-error { max-width: 240px; color: #ff9aaa; white-space: normal; }
.sync-run { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 12px 0; border-bottom: 1px solid rgba(34,44,59,.68); }
.sync-run:last-child { border: 0; }
.sync-run-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--muted-2); }
.sync-run-dot.success, .sync-run-dot.succeeded { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.sync-run-dot.running { background: var(--cyan); box-shadow: 0 0 0 3px rgba(85,204,230,.1); }
.sync-run-dot.failed, .sync-run-dot.error { background: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.sync-run-copy { display: grid; }
.sync-run-copy strong { font-size: 10px; }
.sync-run-copy small { color: var(--muted-2); font-size: 9px; }
.sync-run-time { color: var(--muted-2); font-size: 9px; }

/* Fleet follow automation */
.fleet-follow-status-panel { overflow: hidden; }
.fleet-follow-panel-header { flex-wrap: wrap; }
.fleet-follow-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.fleet-follow-schedule-controls { display: flex; align-items: end; gap: 7px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.014); }
.fleet-follow-schedule-controls label { display: grid; gap: 4px; color: var(--muted-2); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.fleet-follow-schedule-controls input { width: 92px; min-width: 0; height: 31px; padding-inline: 8px; color: var(--text); font-size: 10px; letter-spacing: 0; text-transform: none; }
.fleet-follow-hours { display: flex; align-items: center; gap: 5px; }
.fleet-follow-hours input { width: 78px; }
.fleet-follow-hours small { color: var(--muted); font-size: 8px; letter-spacing: 0; text-transform: lowercase; }
.fleet-follow-status-body { display: grid; gap: 17px; }
.fleet-follow-progress-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.fleet-follow-progress-head > div { min-width: 0; display: grid; gap: 4px; }
.fleet-follow-progress-head strong { color: #e7ecf4; font-size: 15px; letter-spacing: -.015em; overflow-wrap: anywhere; }
.fleet-follow-progress-head small { color: var(--muted); font-size: 10px; }
.fleet-follow-progress-head > span { flex: 0 0 auto; color: var(--accent-strong); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.fleet-follow-progress { height: 8px; }
.fleet-follow-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.fleet-follow-counts > div { min-width: 0; padding: 11px 12px; border: 1px solid rgba(34,44,59,.72); border-radius: 9px; background: rgba(255,255,255,.014); }
.fleet-follow-counts small { display: block; margin-bottom: 3px; color: var(--muted-2); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.fleet-follow-counts strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.fleet-follow-details { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid rgba(34,44,59,.72); border-radius: 10px; background: rgba(255,255,255,.012); }
.fleet-follow-details > div { min-width: 0; display: grid; gap: 4px; padding: 11px 13px; }
.fleet-follow-details > div:not(:last-child) { border-right: 1px solid rgba(34,44,59,.72); }
.fleet-follow-details span { color: var(--muted-2); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.fleet-follow-details strong { overflow: hidden; color: #cbd3df; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.fleet-follow-filters { flex: 1 1 auto; }
.fleet-follow-filters .search-wrap { width: min(235px, 100%); }
.fleet-follow-job { display: block; max-width: 190px; color: var(--muted); font-size: 9px; }
.fleet-follow-table .account-cell { min-width: 145px; }

/* Usage */
.usage-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.usage-summary > div { padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.015); }
.usage-summary small { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 9px; }
.usage-summary strong { font-size: 18px; letter-spacing: -.03em; }
.usage-groups { display: grid; gap: 13px; }
.usage-card { padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.012); }
.usage-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 13px; }
.usage-card-head strong { font-size: 11px; }
.usage-card-head small { color: var(--muted-2); font-size: 9px; }
.quota-list { display: grid; gap: 13px; }
.quota-line { display: grid; gap: 6px; }
.quota-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; }
.quota-label strong { color: #cdd5df; font-weight: 650; }
.progress { height: 6px; overflow: hidden; border-radius: 99px; background: #202938; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.progress > span.medium { background: var(--amber); }
.progress > span.high { background: var(--red); }
.signal-dot.tone-green { background: var(--green); }
.signal-dot.tone-amber { background: var(--amber); }
.signal-dot.tone-red { background: var(--red); }
.signal-dot.tone-cyan { background: var(--cyan); }
.signal-dot.tone-accent { background: var(--accent); }
.usage-mode-note { display: flex; gap: 10px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 10px; }
.usage-mode-note svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: var(--accent-strong); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* System */
.status-hero { min-height: 140px; padding: 20px; display: flex; align-items: center; gap: 17px; }
.status-orb { flex: 0 0 auto; width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid rgba(66,211,154,.2); border-radius: 16px; background: var(--green-dim); color: var(--green); box-shadow: 0 0 35px rgba(66,211,154,.08); }
.status-orb.error { border-color: rgba(255,113,136,.2); background: var(--red-dim); color: var(--red); }
.status-orb svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.status-copy h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.025em; }
.status-copy p { margin: 0; color: var(--muted); font-size: 10px; }
.scope-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.scope-pill { padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: rgba(255,255,255,.02); color: #b9c4d1; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; }
.capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.capability { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(34,44,59,.7); border-radius: 8px; color: var(--muted); font-size: 9px; }
.capability-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.capability-indicator.on { background: var(--green); }
.key-expiry { padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.015); }
.key-expiry-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 10px; }
.key-expiry p { margin: 7px 0 0; color: var(--muted-2); font-size: 9px; }
.coverage-warning { margin-top: 12px; padding: 10px 11px; display: flex; gap: 9px; border: 1px solid rgba(243,189,99,.18); border-radius: 9px; background: var(--amber-dim); color: #c9a970; font-size: 9px; line-height: 1.5; }
.coverage-warning svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: var(--amber); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Drawer */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  width: min(510px, 94vw);
  overflow-y: auto;
  border-left: 1px solid var(--border-strong);
  background: #0d121b;
  box-shadow: -30px 0 80px rgba(0,0,0,.42);
  animation: drawer-in 200ms ease both;
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: 0; } }
.drawer-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(3,5,9,.68); backdrop-filter: blur(3px); }
.drawer-header { position: sticky; top: 0; z-index: 2; min-height: 80px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); background: rgba(13,18,27,.93); backdrop-filter: blur(12px); }
.drawer-header h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.drawer-content { padding: 20px; display: grid; gap: 17px; }
.account-hero { display: flex; align-items: center; gap: 14px; }
.account-hero .account-avatar { width: 49px; height: 49px; border-radius: 13px; font-size: 13px; }
.account-hero-copy { min-width: 0; display: grid; }
.account-hero-copy strong { font-size: 17px; letter-spacing: -.025em; }
.account-hero-copy small { color: var(--muted); }
.drawer-section { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.drawer-section-head { padding: 11px 13px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.015); }
.drawer-section-head h3 { margin: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.drawer-section-body { padding: 5px 13px; }
.drawer-section-body.pad { padding: 13px; }
.notes-form { display: grid; gap: 10px; }
.note-history { display: grid; gap: 8px; margin-bottom: 14px; }
.note-item { padding: 10px 11px; border: 1px solid rgba(34,44,59,.78); border-radius: 8px; background: rgba(255,255,255,.012); }
.note-item p { margin: 0; color: #c9d2de; font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-item footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted-2); font-size: 8px; }
.change-item p { white-space: normal; }
.notes-form textarea { width: 100%; min-height: 88px; padding: 10px; resize: vertical; border: 1px solid var(--border-strong); border-radius: 8px; background: #0a0f17; color: var(--text); font: inherit; font-size: 10px; }
.notes-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.notes-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notes-actions small { color: var(--muted-2); font-size: 9px; }

/* Loading, empty, errors, toast */
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.skeleton { position: relative; overflow: hidden; min-height: 110px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent); transform: translateX(-100%); animation: skeleton 1.3s infinite; }
@keyframes skeleton { to { transform: translateX(100%); } }
.empty-state { min-height: 270px; padding: 35px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-icon { width: 47px; height: 47px; margin-bottom: 12px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-2); color: var(--muted); }
.empty-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h2, .empty-state h3 { margin: 0 0 5px; font-size: 14px; }
.empty-state p { max-width: 410px; margin: 0 0 15px; color: var(--muted); font-size: 10px; }
.error-state .empty-icon { border-color: rgba(255,113,136,.2); background: var(--red-dim); color: var(--red); }
.empty-state.mini-empty { min-height: 150px; padding: 18px; }
.is-dim { opacity: .65; }
.fill-pct-0 { width: 0%; }
.donut-pct-0 { --value: 0; }
.fill-pct-5 { width: 5%; }
.donut-pct-5 { --value: 5; }
.fill-pct-10 { width: 10%; }
.donut-pct-10 { --value: 10; }
.fill-pct-15 { width: 15%; }
.donut-pct-15 { --value: 15; }
.fill-pct-20 { width: 20%; }
.donut-pct-20 { --value: 20; }
.fill-pct-25 { width: 25%; }
.donut-pct-25 { --value: 25; }
.fill-pct-30 { width: 30%; }
.donut-pct-30 { --value: 30; }
.fill-pct-35 { width: 35%; }
.donut-pct-35 { --value: 35; }
.fill-pct-40 { width: 40%; }
.donut-pct-40 { --value: 40; }
.fill-pct-45 { width: 45%; }
.donut-pct-45 { --value: 45; }
.fill-pct-50 { width: 50%; }
.donut-pct-50 { --value: 50; }
.fill-pct-55 { width: 55%; }
.donut-pct-55 { --value: 55; }
.fill-pct-60 { width: 60%; }
.donut-pct-60 { --value: 60; }
.fill-pct-65 { width: 65%; }
.donut-pct-65 { --value: 65; }
.fill-pct-70 { width: 70%; }
.donut-pct-70 { --value: 70; }
.fill-pct-75 { width: 75%; }
.donut-pct-75 { --value: 75; }
.fill-pct-80 { width: 80%; }
.donut-pct-80 { --value: 80; }
.fill-pct-85 { width: 85%; }
.donut-pct-85 { --value: 85; }
.fill-pct-90 { width: 90%; }
.donut-pct-90 { --value: 90; }
.fill-pct-95 { width: 95%; }
.donut-pct-95 { --value: 95; }
.fill-pct-100 { width: 100%; }
.donut-pct-100 { --value: 100; }
.toast-region { position: fixed; right: 19px; bottom: 19px; z-index: 200; width: min(360px, calc(100vw - 38px)); display: grid; gap: 9px; }
.toast { padding: 12px 14px; display: grid; grid-template-columns: 7px 1fr auto; align-items: start; gap: 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: #151c27; box-shadow: var(--shadow); animation: toast-in 180ms ease both; }
.toast-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.toast.success .toast-dot { background: var(--green); }
.toast.error .toast-dot { background: var(--red); }
.toast strong { display: block; font-size: 10px; }
.toast p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.toast button { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Responsive */
@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .span-3 { grid-column: span 6; }
  .span-4 { grid-column: span 6; }
  .span-5, .span-7 { grid-column: span 6; }
  .fleet-follow-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-follow-details > div:nth-child(even) { border-right: 0; }
  .fleet-follow-details > div:nth-child(-n+4) { border-bottom: 1px solid rgba(34,44,59,.72); }
}

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .login-panel { display: none; }
  .login-form-wrap { background: radial-gradient(circle at 50% 25%, rgba(70,96,177,.15), transparent 25rem); }
  .sidebar { transform: translateX(-100%); transition: transform 210ms ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(3,5,9,.66); }
  .sidebar-scrim:not([hidden]) { display: block; }
  .mobile-bar { position: sticky; top: 0; z-index: 20; height: 57px; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); background: rgba(9,12,18,.92); backdrop-filter: blur(14px); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-size: 12px; }
  .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); }
  .status-dot.error { background: var(--red); box-shadow: 0 0 0 4px var(--red-dim); }
  .workspace { margin-left: 0; padding: 25px 18px 50px; }
  .workspace-header { align-items: center; }
  .updated-label { display: none; }
}

@media (max-width: 700px) {
  .workspace-header { align-items: start; }
  .workspace-header h1 { font-size: 23px; }
  .workspace-header > div:first-child > p:last-child { max-width: 210px; }
  #refresh-view { width: 38px; padding: 0; }
  #refresh-view span { display: none; }
  #sync-fleet span { display: none; }
  #sync-fleet { width: 38px; padding: 0; }
  .policy-banner { grid-template-columns: 34px 1fr; }
  .policy-banner > .chip { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: 1; }
  .skeleton-grid { grid-template-columns: 1fr; }
  .panel-header { padding: 13px 14px; }
  .panel-body { padding: 14px; }
  .donut-layout { flex-direction: column; }
  .legend { width: 100%; }
  .toolbar { align-items: stretch; }
  .toolbar-group { width: 100%; }
  .search-wrap { width: 100%; }
  .select { flex: 1; min-width: 0; }
  .usage-summary { grid-template-columns: 1fr; }
  .capability-grid { grid-template-columns: 1fr; }
  .timeline-time { display: none; }
  .fleet-follow-panel-header { align-items: stretch; }
  .fleet-follow-header-actions { justify-content: flex-start; }
  .fleet-follow-header-actions .button { margin-left: auto; }
  .fleet-follow-schedule-controls { order: 3; width: 100%; }
  .fleet-follow-progress-head { align-items: start; }
  .fleet-follow-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-follow-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-follow-details > div:nth-child(even) { border-right: 0; }
  .fleet-follow-details > div:nth-child(-n+4) { border-bottom: 1px solid rgba(34,44,59,.72); }
  .fleet-follow-filters .search-wrap { width: 100%; }
}

@media (max-width: 420px) {
  .login-form-wrap { padding: 24px; }
  .workspace { padding-inline: 13px; }
  .policy-banner { padding: 12px; }
  .policy-banner p { display: none; }
  .fleet-follow-progress-head { display: grid; }
  .fleet-follow-counts, .fleet-follow-details { grid-template-columns: 1fr; }
  .fleet-follow-details > div { border-right: 0 !important; border-bottom: 1px solid rgba(34,44,59,.72); }
  .fleet-follow-details > div:last-child { border-bottom: 0; }
}
