/* ---------- Design tokens ---------- */

:root {
  /* Neutrals — Linear-style */
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f7f7f8;
  --surface-2: #f4f4f5;
  --border: #ececef;
  --border-strong: #d4d4d8;

  --fg: #18181b;
  --fg-secondary: #52525b;
  --fg-tertiary: #a1a1aa;
  --fg-disabled: #d4d4d8;

  --accent: #18181b;       /* near-black; used sparingly */
  --accent-fg: #ffffff;

  --positive: #16794c;
  --positive-bg: #ecfdf3;
  --negative: #b42318;
  --negative-bg: #fef3f2;
  --warning: #b54708;
  --warning-bg: #fffaeb;
  --info: #175cd3;
  --info-bg: #eff8ff;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.08), 0 4px 8px rgba(16, 24, 40, 0.04);

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 52px;
  --radius-sm: 5px;
  --radius: 7px;
  --radius-md: 9px;
  --radius-lg: 12px;
}

:root[data-theme="dark"] {
  --bg: #08090a;
  --bg-subtle: #0a0b0c;
  --surface: #0f1011;
  --surface-hover: #161618;
  --surface-2: #161618;
  --border: #1f1f23;
  --border-strong: #2a2a30;

  --fg: #f4f4f5;
  --fg-secondary: #a1a1a3;
  --fg-tertiary: #6e6e74;
  --fg-disabled: #3f3f46;

  --accent: #f4f4f5;
  --accent-fg: #0a0a0a;

  --positive: #4ade80;
  --positive-bg: rgba(34, 197, 94, 0.12);
  --negative: #f87171;
  --negative-bg: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  color: inherit;
}

::placeholder {
  color: var(--fg-tertiary);
}

/* Selection */
::selection {
  background: var(--fg);
  color: var(--bg);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--fg-tertiary);
}

/* ---------- Layout ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 14px 8px;
  margin-bottom: 6px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--fg);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  background: var(--bg);
  border-top-left-radius: 4px;
}
.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.brand-name .muted {
  color: var(--fg-tertiary);
  font-weight: 400;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 6px;
}

.nav-group-label {
  font-size: 11px;
  color: var(--fg-tertiary);
  font-weight: 500;
  padding: 10px 8px 4px;
  letter-spacing: 0.02em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--fg-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.08s, color 0.08s;
  user-select: none;
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--fg);
}
.nav-item.active {
  background: var(--surface-hover);
  color: var(--fg);
}
.nav-item .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-tertiary);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 14px;
}
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a1a1aa, #52525b);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sidebar-user .who {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}
.sidebar-user .role {
  font-size: 11px;
  color: var(--fg-tertiary);
  line-height: 1.2;
}

/* ---------- Main ---------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-secondary);
}
.crumbs .sep {
  color: var(--fg-disabled);
}
.crumbs .current {
  color: var(--fg);
  font-weight: 500;
}

.topbar-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--fg-secondary);
  transition: background 0.08s, color 0.08s;
}
.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--fg);
}
.icon-btn svg {
  width: 15px;
  height: 15px;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--fg-tertiary);
  background: var(--bg);
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-tertiary);
  font-size: 13px;
  background: var(--bg);
  width: 280px;
  transition: border-color 0.1s;
}
.search-trigger:hover {
  border-color: var(--border-strong);
}
.search-trigger svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.search-trigger .placeholder {
  flex: 1;
  text-align: left;
}

/* ---------- Page container ---------- */

.page {
  padding: 24px 32px 64px;
  max-width: 1320px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0;
}
.page-subtitle {
  font-size: 13px;
  color: var(--fg-secondary);
  margin-top: 4px;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: background 0.08s, border-color 0.08s, color 0.08s;
  white-space: nowrap;
}
.btn svg {
  width: 13px;
  height: 13px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover {
  background: var(--fg-secondary);
}

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--fg);
}

.btn-sm {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 5px;
}
.btn-sm svg {
  width: 12px;
  height: 12px;
}

.btn-icon {
  padding: 0;
  width: 30px;
}
.btn-sm.btn-icon {
  width: 26px;
}

/* ---------- Inputs ---------- */

.input {
  height: 30px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--fg);
  transition: border-color 0.1s, box-shadow 0.1s;
  outline: none;
  width: 100%;
}
.input:hover {
  border-color: var(--border-strong);
}
.input:focus {
  border-color: var(--fg);
  box-shadow: 0 0 0 3px var(--surface-hover);
}
.input.mono {
  font-family: var(--font-mono);
}

textarea.input {
  height: auto;
  padding: 8px 10px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.input-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-secondary);
  letter-spacing: 0.01em;
}
.input-hint {
  font-size: 11px;
  color: var(--fg-tertiary);
}

.input-wrap {
  position: relative;
}
.input-wrap .input {
  padding-left: 30px;
}
.input-wrap .leading {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-tertiary);
  pointer-events: none;
}
.input-wrap .leading svg {
  width: 13px;
  height: 13px;
  display: block;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card-meta {
  font-size: 12px;
  color: var(--fg-tertiary);
}

.card-body {
  padding: 16px;
}

/* ---------- Stats ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stat {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.stat:last-child {
  border-right: none;
}
.stat-label {
  font-size: 12px;
  color: var(--fg-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-label svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
}
.stat-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.stat-value .unit {
  font-size: 13px;
  color: var(--fg-tertiary);
  font-weight: 500;
  margin-left: 3px;
  letter-spacing: 0;
}
.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.stat-delta.up { color: var(--positive); }
.stat-delta.down { color: var(--negative); }
.stat-delta .since {
  color: var(--fg-tertiary);
  font-weight: 400;
}

/* ---------- Tables ---------- */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.t thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.t tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
table.t tbody tr:last-child td {
  border-bottom: none;
}
table.t tbody tr {
  transition: background 0.08s;
}
table.t tbody tr:hover {
  background: var(--surface-hover);
}
table.t td.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-secondary);
}
table.t td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
table.t th.num {
  text-align: right;
}
table.t .id-cell {
  color: var(--fg-tertiary);
}
table.t td.actions {
  width: 1%;
  text-align: right;
  padding-right: 12px;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 12px;
  color: var(--fg-secondary);
}
.pager {
  display: flex;
  gap: 4px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--fg-secondary);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}
.badge.positive { color: var(--positive); background: var(--positive-bg); }
.badge.negative { color: var(--negative); background: var(--negative-bg); }
.badge.warning  { color: var(--warning);  background: var(--warning-bg);  }
.badge.info     { color: var(--info);     background: var(--info-bg);     }
.badge.outline {
  background: transparent;
  border-color: var(--border);
  color: var(--fg-secondary);
}
.badge.mono { font-family: var(--font-mono); font-size: 11px; }

/* ---------- Filter bar ---------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.filter-bar .input { width: auto; min-width: 140px; }
.filter-bar .sep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin: 0 4px;
}

/* ---------- Inline forms (topup, etc.) ---------- */

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.inline-form .input {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  width: 90px;
}

/* ---------- Disclosure ---------- */

details.expander {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}
details.expander > summary {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 13px;
  list-style: none;
}
details.expander > summary::-webkit-details-marker { display: none; }
details.expander > summary .chev {
  transition: transform 0.15s;
  color: var(--fg-tertiary);
}
details.expander[open] > summary .chev {
  transform: rotate(90deg);
}
details.expander > summary:hover { background: var(--surface-hover); }
details.expander > .expander-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
}

/* ---------- Product editor card ---------- */

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.product-head-left {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.product-thumb {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-tertiary);
}
.product-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.product-meta {
  font-size: 12px;
  color: var(--fg-tertiary);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 1px;
}
.product-meta .sep-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--fg-disabled);
}
.product-price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.product-price .unit {
  font-size: 11px;
  color: var(--fg-tertiary);
  font-weight: 500;
  margin-left: 3px;
}

.product-body {
  padding: 14px 16px;
}

.lang-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.lang-tab {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-tertiary);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.lang-tab.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}
.lang-tab .flag {
  font-size: 10px;
  color: var(--fg-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.product-grid .full {
  grid-column: 1 / -1;
}
.product-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.product-foot .hint {
  font-size: 12px;
  color: var(--fg-tertiary);
}

/* ---------- Stock card ---------- */

.stock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}
.stock-head {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.stock-head-left .title {
  font-size: 13.5px;
  font-weight: 600;
}
.stock-head-left .meta {
  font-size: 11.5px;
  color: var(--fg-tertiary);
  margin-top: 2px;
  font-family: var(--font-mono);
}
.stock-count-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 500;
}
.stock-count-bubble .n {
  font-family: var(--font-mono);
  font-weight: 600;
}
.stock-count-bubble.low { color: var(--warning); background: var(--warning-bg); }
.stock-count-bubble.out { color: var(--negative); background: var(--negative-bg); }
.stock-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.stock-foot {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.stock-foot .lines-count {
  font-size: 11.5px;
  color: var(--fg-tertiary);
  font-family: var(--font-mono);
}

/* ---------- Dashboard widgets ---------- */

.row-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.row-2.even { grid-template-columns: 1fr 1fr; }

.activity-list {
  display: flex;
  flex-direction: column;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--fg-secondary);
  flex-shrink: 0;
}
.activity-icon svg { width: 13px; height: 13px; }
.activity-icon.pos { color: var(--positive); background: var(--positive-bg); }
.activity-icon.neg { color: var(--negative); background: var(--negative-bg); }
.activity-text {
  font-size: 13px;
  flex: 1;
  min-width: 0;
}
.activity-text .who {
  font-weight: 500;
}
.activity-text .what {
  color: var(--fg-secondary);
}
.activity-amount {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.activity-time {
  font-size: 11.5px;
  color: var(--fg-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* sparkline chart */
.sparkline {
  display: block;
  width: 100%;
  height: 28px;
  color: var(--fg-tertiary);
}
.sparkline path.line { stroke: currentColor; stroke-width: 1.25; fill: none; }
.sparkline path.fill { fill: currentColor; opacity: 0.08; }

/* Chart big */
.chart-area {
  padding: 8px 16px 16px;
}
.chart-area svg {
  display: block;
  width: 100%;
  height: 200px;
}
.chart-area .line { stroke: var(--fg); stroke-width: 1.5; fill: none; }
.chart-area .fill { fill: var(--fg); opacity: 0.05; }
.chart-area .axis { stroke: var(--border); stroke-width: 1; }
.chart-area .axis-label { fill: var(--fg-tertiary); font-size: 10px; font-family: var(--font-mono); }
.chart-area .grid { stroke: var(--border); stroke-dasharray: 2 4; stroke-width: 1; }

/* ---------- Toast ---------- */

.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--positive-bg);
  color: var(--positive);
  border: 1px solid color-mix(in oklab, var(--positive) 30%, transparent);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
}
.toast svg { width: 13px; height: 13px; }

/* ---------- Login screen ---------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.login-card h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 18px 0 6px;
  letter-spacing: -0.015em;
}
.login-card p {
  font-size: 13px;
  color: var(--fg-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}
.login-card code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--fg);
}
.tg-button {
  width: 100%;
  height: 38px;
  background: #229ed9;
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
}
.tg-button:hover { background: #1e8bbf; }
.tg-button svg { width: 16px; height: 16px; }
.login-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--fg-tertiary);
  text-align: center;
  line-height: 1.6;
}

/* ---------- Misc ---------- */

.divider-h {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-tertiary); }
.right { text-align: right; }

.hidden { display: none !important; }

.tooltip-host { position: relative; }

/* Selection ring on focused inputs in form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }

/* Empty state */
.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--fg-tertiary);
  font-size: 13px;
}
.empty .empty-title {
  color: var(--fg-secondary);
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 13.5px;
}
