:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --panel: #131519;
  --panel-2: #191c21;
  --line: #272b32;
  --line-soft: #202329;
  --text: #f5f3ee;
  --muted: #979ca6;
  --accent: #d8ff5f;
  --accent-ink: #151a05;
  --blue: #71a7ff;
  --red: #ff7d7d;
  --sidebar: #101215;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 70% -20%, rgba(216,255,95,.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(430px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(19,21,25,.94);
  box-shadow: 0 32px 90px rgba(0,0,0,.4);
}
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center;
  margin-bottom: 30px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  font: 800 25px/1 Georgia, serif;
}
.brand-mark.small { width: 36px; height: 36px; margin: 0; border-radius: 10px; font-size: 19px; }
.eyebrow {
  margin: 0 0 7px; color: var(--muted); font-size: 11px;
  font-weight: 750; letter-spacing: .12em; text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(25px, 4vw, 34px); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: -.02em; }
.muted { color: var(--muted); line-height: 1.55; }
form { margin-top: 28px; }
label > span, form > label { display: block; margin-bottom: 8px; color: #c9ccd2; font-size: 12px; font-weight: 650; }
input, select {
  width: 100%; height: 44px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #0e1013; color: var(--text); outline: 0;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216,255,95,.1); }
.login-card .button { width: 100%; margin-top: 14px; }
.security-note { margin: 20px 0 0; color: #6f747d; font-size: 11px; line-height: 1.5; }
.form-error, .banner-error { color: #ffd2d2; background: rgba(255,77,77,.09); border: 1px solid rgba(255,125,125,.3); }
.form-error { padding: 9px 11px; margin: 12px 0 0; border-radius: 9px; font-size: 12px; }

.button {
  min-height: 40px; padding: 0 15px; border: 1px solid transparent;
  border-radius: 9px; font-weight: 700; transition: .16s ease;
}
.button:disabled { opacity: .45; cursor: default; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: var(--panel-2); color: var(--text); }
.button.secondary:hover:not(:disabled) { border-color: #3b4049; background: #20242a; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); text-align: left; }
.text-button:hover { color: var(--text); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 16px;
  display: flex; flex-direction: column; border-right: 1px solid var(--line-soft);
  background: rgba(16,18,21,.96);
}
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 30px; }
.sidebar-brand strong { display: block; font-size: 14px; }
.sidebar-brand span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
nav { display: grid; gap: 4px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  text-align: left; font-weight: 650;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); }
.nav-icon { width: 17px; font-size: 17px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 18px 10px 2px; border-top: 1px solid var(--line-soft); display: grid; gap: 14px; }
.status-row { color: #b8bdc5; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(216,255,95,.09); }

.workspace { min-width: 0; padding: 32px clamp(20px, 4vw, 52px) 60px; }
.topbar { min-height: 66px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.topbar h1 { margin: 0; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.updated-at { color: var(--muted); font-size: 11px; }
.banner-error { margin: -10px 0 22px; padding: 12px 15px; border-radius: 10px; }
.loading-line { height: 2px; margin: -12px 0 26px; overflow: hidden; background: var(--line-soft); }
.loading-line span { display: block; width: 35%; height: 100%; background: var(--accent); animation: loading 1s infinite ease-in-out; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(390%); } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px,1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.metric-card .label { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-card .value { margin-top: 20px; font-size: 29px; font-weight: 760; letter-spacing: -.035em; }
.metric-card .sub { margin-top: 8px; color: #717782; font-size: 11px; }
.metric-card.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.metric-card.accent .label, .metric-card.accent .sub { color: rgba(21,26,5,.62); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(250px,1fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.chart-panel { grid-row: span 2; min-height: 430px; }
.panel-heading { padding: 21px 22px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line-soft); }
.panel-stat { color: var(--accent); font-weight: 750; }
.cost-chart { height: 335px; display: flex; align-items: end; gap: 6px; padding: 28px 22px 35px; }
.chart-column { flex: 1; min-width: 3px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; position: relative; }
.chart-bar { width: 100%; min-height: 2px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--accent), #8fab36); opacity: .84; }
.chart-column:hover .chart-bar { opacity: 1; }
.chart-tip { position: absolute; bottom: calc(var(--bar-height) + 28px); display: none; white-space: nowrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #08090b; font-size: 10px; z-index: 2; }
.chart-column:hover .chart-tip { display: block; }
.chart-label { position: absolute; bottom: -21px; color: #646a73; font-size: 9px; }
.breakdown-list { padding: 8px 20px 14px; }
.breakdown-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--line-soft); }
.breakdown-row:last-child { border: 0; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 99px; background: #23272d; color: #cdd1d7; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.badge.high, .badge.pro { background: rgba(216,255,95,.13); color: var(--accent); }
.badge.mid, .badge.regular { background: rgba(113,167,255,.13); color: var(--blue); }
.breakdown-track { height: 4px; border-radius: 99px; background: #22262c; overflow: hidden; }
.breakdown-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.breakdown-value { color: #cfd2d8; font-variant-numeric: tabular-nums; font-size: 12px; }

.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.search-field { width: min(430px, 100%); }
.select-field { width: 180px; }
.table-panel { overflow: visible; }
.table-wrap { overflow: auto; border-radius: var(--radius) var(--radius) 0 0; }
table { width: 100%; border-collapse: collapse; min-width: 1040px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; background: #16191d; color: #7f858f; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
td { color: #d7d9dd; font-size: 12px; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.user-cell strong { display: block; color: var(--text); font-size: 12px; }
.user-cell span, .cell-sub { display: block; margin-top: 4px; color: #737983; font-size: 10px; }
.cost { color: var(--accent); font-weight: 750; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; color: var(--muted); font-size: 11px; }
.pagination .button { min-height: 34px; margin-left: 7px; font-size: 11px; }

.activity-panel { padding: 2px 22px; }
.activity-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border: 0; }
.activity-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #22262c; color: var(--accent); font-weight: 800; }
.activity-copy strong { font-size: 12px; }
.activity-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.activity-meta { color: #777d87; font-size: 10px; text-align: right; }
.empty-state { padding: 60px 20px; color: var(--muted); text-align: center; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-panel { grid-row: auto; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding-bottom: 14px; }
  nav { display: flex; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .workspace { padding: 24px 14px 50px; }
  .topbar { align-items: end; }
  .updated-at { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; padding: 16px; }
  .metric-card .value { font-size: 23px; margin-top: 15px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field, .select-field { width: 100%; }
}
@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
  .login-card { padding: 30px 24px; }
  .activity-item { grid-template-columns: 34px minmax(0,1fr); }
  .activity-meta { grid-column: 2; text-align: left; }
}
