/* SMS Gateway Admin — Nuxt-UI-flavored styles, IBM Plex */
:root {
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* brand greens — Pan 7725C #008755 primary, Pan 7729C #005844 deep, Pan 7479C #26D07C bright */
  --accent-50: #e8f5ef; --accent-100: #c9e9da; --accent-400: #26d07c;
  --accent-500: #008755; --accent-600: #006b46; --accent-700: #005844;
  --accent-soft: rgba(0, 135, 85, 0.10);
  --accent-ring: rgba(0, 135, 85, 0.42);

  --bg-page: #f9fafb;
  --bg-card: #ffffff;
  --bg-sunken: #f3f4f6;
  --bg-hover: #f3f4f6;
  --bg-inverted: #111827;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --text-inverted: #ffffff;

  --green-bg: #e8f5ef; --green-fg: #006b46; --green-dot: #008755;
  --amber-bg: #fffbeb; --amber-fg: #b45309; --amber-dot: #f59e0b;
  --red-bg: #fef2f2;   --red-fg: #b91c1c;   --red-dot: #ef4444;
  --gray-bg: #f3f4f6;  --gray-fg: #4b5563;  --gray-dot: #9ca3af;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 32px rgba(0,0,0,0.16);
  --radius: 8px;
  --radius-sm: 6px;

  --pad-cell-y: 9px;
  --pad-cell-x: 12px;
  --fs-table: 13px;
  --fs-body: 14px;
}

.dark {
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-sunken: #0d1320;
  --bg-hover: #1b2436;
  --bg-inverted: #f9fafb;
  --border: #232d40;
  --border-strong: #324059;
  --text: #f3f4f6;
  --text-2: #9aa6b8;
  --text-3: #5d6b80;
  --text-inverted: #111827;

  --accent-soft: rgba(38, 208, 124, 0.14);
  --green-bg: rgba(38,208,124,0.13); --green-fg: #26d07c; --green-dot: #26d07c;
  --amber-bg: rgba(245,158,11,0.13); --amber-fg: #fbbf24;
  --red-bg: rgba(239,68,68,0.13);    --red-fg: #f87171;
  --gray-bg: rgba(156,163,175,0.13); --gray-fg: #9ca3af; --gray-dot: #6b7280;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-lg: 0 10px 36px rgba(0,0,0,0.6);
}

.density-compact {
  --pad-cell-y: 5px;
  --pad-cell-x: 10px;
  --fs-table: 12.5px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  background: var(--bg-page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
#root { height: 100%; }
a { color: inherit; }
.mono { font-family: var(--font-mono); }

::selection { background: var(--accent-soft); }

/* ---------- layout shell ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 232px; flex: none; display: flex; flex-direction: column;
  background: var(--bg-card); border-right: 1px solid var(--border);
  transition: margin-left 0.2s ease;
}
.shell.sidebar-collapsed .sidebar { margin-left: -232px; }
.sidebar-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  background: var(--accent-600); color: #fff;
  display: grid; place-items: center; font: 600 12px var(--font-mono);
}
.sidebar-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.sidebar-sub { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.sidebar nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: var(--radius-sm); border: none; background: none;
  font: 500 13.5px var(--font-sans); color: var(--text-2);
  cursor: pointer; text-align: left; text-decoration: none;
  position: relative; transition: background 0.15s, color 0.15s;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -8px; top: 22%; bottom: 22%; width: 3px;
  border-radius: 0 2px 2px 0; background: var(--accent-500);
  animation: growY 0.35s cubic-bezier(0.22, 1, 0.36, 1); transform-origin: center;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-600); }
.dark .nav-item.active { color: var(--accent-400); }
.nav-item .icon { flex: none; }
.sidebar-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 53px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.content { flex: 1; overflow-y: auto; padding: 24px; }
.content-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.env-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--amber-bg); color: var(--amber-fg);
  font: 600 11.5px var(--font-mono); letter-spacing: 0.02em;
}
.env-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber-dot); }

/* ---------- page headers ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.page-desc { color: var(--text-2); font-size: 13.5px; margin: 4px 0 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.breadcrumb button { background: none; border: none; padding: 0; font: inherit; color: var(--text-2); cursor: pointer; }
.breadcrumb button:hover { color: var(--accent-600); text-decoration: underline; }

/* ---------- cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13.5px; font-weight: 600; margin: 0; }
.card-body { padding: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 13.5px var(--font-sans); border-radius: var(--radius-sm);
  padding: 7px 12px; border: 1px solid transparent; cursor: pointer;
  white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 1px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-xs { padding: 3px 8px; font-size: 12px; gap: 4px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-solid { background: var(--accent-600); color: #fff; }
.btn-solid:hover:not(:disabled) { background: var(--accent-700); }
.btn-outline { background: var(--bg-card); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-soft { background: var(--accent-soft); color: var(--accent-600); }
.dark .btn-soft { color: var(--accent-400); }
.btn-soft:hover:not(:disabled) { background: var(--accent-100); }
.dark .btn-soft:hover:not(:disabled) { background: rgba(16,185,129,0.22); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger-soft { background: var(--red-bg); color: var(--red-fg); }
.btn-danger-soft:hover:not(:disabled) { background: rgba(239,68,68,0.18); }
.btn-icon { padding: 6px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font: 500 11.5px var(--font-sans);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.badge-green { background: var(--green-bg); color: var(--green-fg); } .badge-green .dot { background: var(--green-dot); }
.badge-amber { background: var(--amber-bg); color: var(--amber-fg); } .badge-amber .dot { background: var(--amber-dot); }
.badge-red   { background: var(--red-bg);   color: var(--red-fg); }   .badge-red .dot { background: var(--red-dot); }
.badge-gray  { background: var(--gray-bg);  color: var(--gray-fg); }  .badge-gray .dot { background: var(--gray-dot); }
.badge-primary { background: var(--accent-soft); color: var(--accent-600); }
.dark .badge-primary { color: var(--accent-400); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field-hint { font-size: 11.5px; color: var(--text-3); }
.field-error { font-size: 11.5px; color: var(--red-fg); }
.input, .select, textarea.input {
  font: 400 13.5px var(--font-sans); color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 10px; width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent-500); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input.invalid { border-color: #ef4444; }
.input::placeholder { color: var(--text-3); }
.input-wrap { position: relative; }
.input-wrap .icon-left { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-wrap .input.has-icon { padding-left: 30px; }
.select { appearance: none; padding-right: 28px; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 10px; top: 50%;
  width: 7px; height: 7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-table); }
.tbl th {
  text-align: left; font: 600 11px var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); padding: var(--pad-cell-y) var(--pad-cell-x);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td {
  padding: var(--pad-cell-y) var(--pad-cell-x); border-bottom: 1px solid var(--border);
  vertical-align: middle; white-space: nowrap;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--bg-hover); }
.tbl tbody tr.clickable:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: -2px; }
.tbl .num { font-family: var(--font-mono); font-size: calc(var(--fs-table) - 0.5px); text-align: right; }
.tbl .dim { color: var(--text-3); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 980px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-family: var(--font-mono); line-height: 1.1; }
.kpi-delta { font-size: 11.5px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); }
.kpi-delta.up { color: var(--green-fg); }
.kpi-delta.down { color: var(--red-fg); }
.kpi-delta.flat { color: var(--text-3); }

/* ---------- modal / slideover ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 20, 30, 0.45); z-index: 60;
  display: grid; place-items: center; padding: 24px;
  animation: fadeIn 0.15s ease;
}
.dark .overlay { background: rgba(0,0,0,0.6); }
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 440px;
  animation: popIn 0.16s ease; max-height: 90vh; display: flex; flex-direction: column;
}
.modal.wide { max-width: 540px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.modal-title { font-size: 15px; font-weight: 600; margin: 0; }
.modal-desc { font-size: 13px; color: var(--text-2); margin: 4px 0 0; line-height: 1.5; }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 16px; }

.slideover-overlay {
  position: fixed; inset: 0; background: rgba(15, 20, 30, 0.35); z-index: 60;
  animation: fadeIn 0.15s ease;
}
.slideover {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw; z-index: 61;
  background: var(--bg-card); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slideIn 0.2s ease;
}
.slideover-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.slideover-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.slideover-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.92) translateY(12px); }
  60% { opacity: 1; transform: scale(1.012) translateY(-2px); }
  100% { opacity: 1; transform: none; }
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.modal { animation: popIn 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
.slideover { animation: slideIn 0.38s cubic-bezier(0.22, 1, 0.36, 1); }
@media (prefers-reduced-motion: reduce) { html:not(.motion-full) :is(.overlay, .modal, .slideover, .slideover-overlay) { animation: none; } }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; cursor: pointer;
  font: 500 13.5px var(--font-sans); color: var(--text-2);
  padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-600); border-bottom-color: var(--accent-600); }
.dark .tab.active { color: var(--accent-400); border-bottom-color: var(--accent-400); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: 330px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 11px 13px; display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.96); }
  65% { opacity: 1; transform: translateY(-2px) scale(1.005); }
  100% { opacity: 1; transform: none; }
}
.toast { animation: toastIn 0.34s cubic-bezier(0.22, 1, 0.36, 1); }
.toast-icon { flex: none; margin-top: 1px; }
.toast-title { font-size: 13px; font-weight: 600; }
.toast-desc { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }

/* ---------- misc ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 50%, var(--bg-sunken) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 5px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.progress { height: 4px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; min-width: 64px; }
.progress > div { height: 100%; border-radius: 999px; background: var(--accent-500); transition: width 0.3s; }
.progress.warn > div { background: var(--amber-dot); }
.progress.crit > div { background: var(--red-dot); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 24px; text-align: center; color: var(--text-3);
}
.empty-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-sunken); display: grid; place-items: center; color: var(--text-3); }
.empty-title { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.empty-desc { font-size: 12.5px; max-width: 300px; line-height: 1.5; }

.code-block {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6;
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; overflow-x: auto; white-space: pre; color: var(--text-2);
}

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; }

.dropdown {
  position: absolute; z-index: 70; min-width: 168px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 4px; animation: popIn 0.12s ease;
}
.dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 9px; border: none; background: none; border-radius: var(--radius-sm);
  font: 400 13px var(--font-sans); color: var(--text); cursor: pointer; text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--red-fg); }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 2px; }

.copy-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-2);
}
.copy-btn { border: none; background: none; padding: 2px; cursor: pointer; color: var(--text-3); border-radius: 4px; display: inline-flex; }
.copy-btn:hover { color: var(--accent-600); background: var(--bg-hover); }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 0 10px; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 4px; background: var(--gray-dot); }
.timeline-dot.green { background: var(--green-dot); } .timeline-dot.amber { background: var(--amber-dot); }
.timeline-dot.red { background: var(--red-dot); } .timeline-dot.accent { background: var(--accent-500); }
.timeline-line { width: 1.5px; flex: 1; background: var(--border); min-height: 14px; }
.timeline-body { padding-bottom: 14px; }
.timeline-item:last-child .timeline-body { padding-bottom: 0; }
.timeline-label { font-size: 13px; font-weight: 500; }
.timeline-time { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); margin-top: 1px; }

.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-500); position: relative; flex: none; }
.pulse-dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid var(--accent-500); opacity: 0; animation: pulse 2.4s infinite;
}
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.8; } 70% { transform: scale(1.4); opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html:not(.motion-full) .pulse-dot::after { animation: none; } }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
@media (max-width: 980px) { .grid-2, .grid-3-2 { grid-template-columns: 1fr; } }

.reveal-panel {
  background: var(--bg-sunken); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 12px; display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.reveal-key { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; }

.warn-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--amber-bg); color: var(--amber-fg);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; line-height: 1.5;
}
.danger-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--red-bg); color: var(--red-fg);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; line-height: 1.5;
}

.updated-ago { display: inline-flex; align-items: center; gap: 7px; font: 400 11.5px var(--font-mono); color: var(--text-3); }

/* ---------- motion / wow ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.anim-rise { animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.view-enter { animation: riseIn 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
tr.row-in { animation: rowIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
@keyframes growY { from { transform: scaleY(0.04); } }
.bar-grow { transform-box: fill-box; transform-origin: bottom; animation: growY 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
@keyframes drawStroke { to { stroke-dashoffset: 0; } }
.line-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawStroke 1.3s cubic-bezier(0.45, 0, 0.2, 1) forwards; }
.line-draw.late { animation-delay: 0.25s; }
@keyframes fadeLate { to { opacity: 1; } }
.area-fade { opacity: 0; animation: fadeLate 0.9s ease 0.5s forwards; }
.spark-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawStroke 0.9s ease forwards; animation-delay: calc(var(--i, 0) * 60ms); }

.card.kpi { transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s; }
.card.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.btn { transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.1s; }
.btn:active:not(:disabled) { transform: scale(0.96); }
@keyframes fillX { from { width: 0; } }
.progress > div { animation: fillX 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.timeline-item { animation: rowIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--i, 0) * 120ms); }

.success-burst { display: flex; justify-content: center; padding: 4px 0 2px; }
.draw-c { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawStroke 0.55s cubic-bezier(0.45, 0, 0.2, 1) forwards; }
.draw-k { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawStroke 0.32s cubic-bezier(0.45, 0, 0.2, 1) 0.5s forwards; }
@keyframes burstPop { 0% { transform: scale(0.7); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: none; opacity: 1; } }
.success-burst svg { animation: burstPop 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

/* motion levels */
html.motion-subtle .anim-rise, html.motion-subtle tr.row-in, html.motion-subtle .view-enter,
html.motion-subtle .bar-grow, html.motion-subtle .timeline-item,
html.motion-subtle .progress > div { animation: none; }
html.motion-subtle .line-draw, html.motion-subtle .spark-draw, html.motion-subtle .draw-c, html.motion-subtle .draw-k { animation: none; stroke-dashoffset: 0; }
html.motion-subtle .area-fade { animation: none; opacity: 1; }
html.motion-off *, html.motion-off *::before, html.motion-off *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition-duration: 0s !important; }
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-full) :is(.anim-rise, tr.row-in, .view-enter, .bar-grow, .timeline-item, .progress > div, .success-burst svg) { animation: none; }
  html:not(.motion-full) :is(.line-draw, .spark-draw, .draw-c, .draw-k) { animation: none; stroke-dashoffset: 0; }
  html:not(.motion-full) .area-fade { animation: none; opacity: 1; }
  html:not(.motion-full) .card.kpi:hover { transform: none; }
}

/* ============ premium refinement layer ============ */
:root { --radius: 10px; --bg-page: #f6f7f9; }
.dark { --bg-page: #0a0e15; --bg-card: #101725; --border: #1f2940; }

body { text-rendering: optimizeLegibility; }
.num, .kpi-value, .mono, .updated-ago, .pagination { font-variant-numeric: tabular-nums; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 42%, transparent); border: 3px solid transparent; background-clip: padding-box; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text-3) 70%, transparent); }

/* content atmosphere */
.content { background: radial-gradient(900px 300px at 60% -140px, var(--accent-soft), transparent 70%); }

/* ink sidebar (both modes) */
.sidebar { background: linear-gradient(180deg, #111726, #0b101b); border-right: 1px solid rgba(255,255,255,0.06); }
.sidebar-head { border-bottom: 1px solid rgba(255,255,255,0.07); }
.sidebar-title { color: #f2f4f8; }
.sidebar-sub { color: rgba(255,255,255,0.38); }
.sidebar nav .nav-item { color: rgba(255,255,255,0.6); }
.sidebar nav .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav .nav-item.active,
.dark .sidebar nav .nav-item.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-500) 24%, transparent), color-mix(in srgb, var(--accent-500) 9%, transparent));
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-400) 28%, transparent);
}
.nav-item.active::before { background: var(--accent-400); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.35); }
.logo-mark {
  background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent-500) 45%, transparent), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* typography */
.page-title { font-size: 20px; letter-spacing: -0.02em; }
.kpi-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.kpi-value { font-size: 26px; }

/* surfaces */
.card { box-shadow: 0 1px 2px rgba(16,24,40,0.05), 0 2px 6px -2px rgba(16,24,40,0.04); }
.dark .card { box-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 4px 16px -8px rgba(0,0,0,0.5); }
.card.kpi { position: relative; overflow: hidden; }
.card.kpi::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-400), var(--accent-600));
  opacity: 0; transition: opacity 0.25s;
}
.card.kpi:hover::after { opacity: 1; }

/* buttons */
.btn-solid {
  background: linear-gradient(180deg, var(--accent-500), var(--accent-600));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(16,24,40,0.2);
}
.btn-solid:hover:not(:disabled) { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-400) 45%, var(--accent-500)), var(--accent-600)); }
.btn-danger { background: linear-gradient(180deg, #ef4444, #dc2626); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 2px rgba(16,24,40,0.2); }
.btn-danger:hover:not(:disabled) { background: linear-gradient(180deg, #f05252, #c92a2a); }
.btn-outline { box-shadow: 0 1px 2px rgba(16,24,40,0.05), inset 0 1px 0 rgba(255,255,255,0.7); }
.dark .btn-outline { box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05); }

/* inputs */
.input, .select, textarea.input { box-shadow: inset 0 1px 2px rgba(16,24,40,0.04); }
.dark .input, .dark .select, .dark textarea.input { box-shadow: inset 0 1px 2px rgba(0,0,0,0.35); }
.input:focus, .select:focus, textarea.input:focus { box-shadow: inset 0 1px 2px rgba(16,24,40,0.03), 0 0 0 3px var(--accent-soft); }

/* badges — hairline ring */
.badge, .env-badge { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }

/* overlays */
.overlay { backdrop-filter: blur(5px) saturate(1.05); -webkit-backdrop-filter: blur(5px) saturate(1.05); }
.modal { border-radius: 14px; border: none; box-shadow: 0 0 0 1px var(--border), 0 24px 64px -16px rgba(10,15,25,0.45); }
.slideover-overlay { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.slideover { box-shadow: -20px 0 56px -20px rgba(10,15,25,0.4); }
.dropdown { border-radius: 10px; border: none; box-shadow: 0 0 0 1px var(--border), 0 12px 32px -8px rgba(10,15,25,0.28); padding: 5px; }

/* toasts — inverted, high contrast */
.toast { background: var(--bg-inverted); border: none; box-shadow: 0 12px 32px -8px rgba(10,15,25,0.45), inset 0 0 0 1px rgba(255,255,255,0.08); }
.dark .toast { box-shadow: 0 12px 32px -8px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(0,0,0,0.06); }
.toast-title { color: var(--text-inverted); }
.toast-desc { color: color-mix(in srgb, var(--text-inverted) 72%, transparent); }

/* tables */
.tbl th { font-size: 10.5px; letter-spacing: 0.08em; }
.tbl tbody tr { transition: background 0.12s; }

/* misc */
.empty-icon { background: linear-gradient(180deg, var(--bg-sunken), var(--bg-hover)); box-shadow: inset 0 0 0 1px var(--border); }
.timeline-dot { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, var(--bg-card)); }

/* live chart ping */
.svg-ping { transform-box: fill-box; transform-origin: center; animation: svgPing 2.4s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes svgPing { 0% { transform: scale(0.6); opacity: 0.9; } 75%, 100% { transform: scale(2.4); opacity: 0; } }
html.motion-off .svg-ping { display: none; }
@media (prefers-reduced-motion: reduce) { html:not(.motion-full) .svg-ping { display: none; } }

/* ============ v3 — console aesthetic ============ */
:root { --dotgrid: rgba(15, 23, 42, 0.05); --bg-page: #f5f6f8; }
.dark {
  --bg-page: #08090c;
  --bg-card: #0f1218;
  --bg-sunken: #0a0c10;
  --bg-hover: #171b23;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f0f2f5;
  --text-2: #9aa3b2;
  --text-3: #5b6473;
  --dotgrid: rgba(255, 255, 255, 0.035);
}

.content {
  background:
    radial-gradient(1000px 380px at 70% -200px, color-mix(in srgb, var(--accent-500) 8%, transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--dotgrid) 1px, transparent 0);
  background-size: auto, 24px 24px;
}

/* frameless sidebar + topbar */
.sidebar, .dark .sidebar { background: var(--bg-page); border-right: 1px solid var(--border); }
.sidebar-head { border-bottom: none; padding-bottom: 8px; }
.sidebar-title { color: var(--text); }
.sidebar-sub { color: var(--text-3); }
.sidebar nav .nav-item { color: var(--text-2); }
.sidebar nav .nav-item:hover { background: var(--bg-hover); color: var(--text); }
.sidebar nav .nav-item.active, .dark .sidebar nav .nav-item.active {
  background: color-mix(in srgb, var(--accent-500) 13%, transparent);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-500) 32%, transparent),
              0 0 20px -6px color-mix(in srgb, var(--accent-500) 55%, transparent);
}
.sidebar-foot { border-top: 1px solid var(--border); color: var(--text-3); }
.topbar { background: var(--bg-page); border-bottom: 1px solid var(--border); }

/* cards */
.card { border-radius: 14px; }
.dark .card {
  background: linear-gradient(180deg, #12151d, #0e1117);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 28px -18px rgba(0, 0, 0, 0.9);
}

/* KPI — fading display numerals */
.kpi-value {
  font-size: 28px;
  background: linear-gradient(180deg, var(--text) 35%, color-mix(in srgb, var(--text) 55%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* bento dashboard */
.kpi-grid.bento { grid-template-columns: 2fr 1fr 1fr 1fr; }
.kpi.hero { justify-content: flex-start; }
.kpi.hero .kpi-value { font-size: 42px; line-height: 1.05; }
.hero-chart { margin: auto -16px -14px; }
@media (max-width: 980px) {
  .kpi-grid.bento { grid-template-columns: 1fr 1fr; }
  .kpi.hero { grid-column: span 2; }
}

/* segmented tabs */
.tabs { border-bottom: none; background: var(--bg-sunken); padding: 3px; border-radius: 11px; width: fit-content; gap: 2px; box-shadow: inset 0 0 0 1px var(--border); }
.tab { border-bottom: none; margin-bottom: 0; border-radius: 8px; padding: 6px 14px; transition: color 0.15s, background 0.15s; }
.tab.active, .dark .tab.active {
  background: var(--bg-card); color: var(--text); border-bottom: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--border);
}

/* buttons — accent glow */
.btn-solid {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
              0 0 0 1px color-mix(in srgb, var(--accent-600) 55%, transparent),
              0 4px 18px -4px color-mix(in srgb, var(--accent-500) 55%, transparent);
}

/* tables — quieter rules */
.tbl td { border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }

/* topbar widgets */
.cp-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 9px;
  padding: 6px 10px; color: var(--text-3); font: 400 12.5px var(--font-sans);
  cursor: pointer; width: 210px; transition: border-color 0.15s, color 0.15s;
}
.cp-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.cp-trigger kbd { margin-left: auto; }
kbd {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 5px; font: 500 10.5px var(--font-mono); color: var(--text-3);
  box-shadow: 0 1px 0 var(--border);
}
.status-strip { display: flex; align-items: center; gap: 14px; font: 400 11.5px var(--font-mono); color: var(--text-3); }
.status-strip b { color: var(--text-2); font-weight: 500; }
.status-strip .sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-dot); display: inline-block; margin-right: 5px; box-shadow: 0 0 8px var(--green-dot); }
.status-strip > span { display: inline-flex; align-items: center; }
@media (max-width: 1100px) { .status-strip { display: none; } }
@media (max-width: 700px) { .cp-trigger { width: auto; } .cp-trigger .cp-trigger-label { display: none; } }

/* command palette */
.cp-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg-page) 55%, transparent);
  backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1);
  display: flex; justify-content: center; align-items: flex-start; padding: 15vh 20px 20px;
  animation: fadeIn 0.14s ease;
}
.cp {
  width: 580px; max-width: 100%; overflow: hidden;
  background: var(--bg-card); border-radius: 16px;
  box-shadow: 0 0 0 1px var(--border-strong), 0 32px 80px -20px rgba(5, 8, 14, 0.6);
  animation: popIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.cp-input {
  width: 100%; border: none; background: transparent; outline: none;
  font: 400 15px var(--font-sans); color: var(--text);
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.cp-input::placeholder { color: var(--text-3); }
.cp-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.cp-group { font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); padding: 10px 10px 4px; }
.cp-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 9px; border: none; background: none;
  font: 400 13.5px var(--font-sans); color: var(--text-2); cursor: pointer; text-align: left;
}
.cp-item .icon { color: var(--text-3); flex: none; }
.cp-item.sel {
  background: color-mix(in srgb, var(--accent-500) 12%, transparent); color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-500) 26%, transparent);
}
.cp-item.sel .icon { color: var(--accent-500); }
.cp-sub { color: var(--text-3); font: 400 11.5px var(--font-mono); margin-left: 2px; }
.cp-enter { margin-left: auto; opacity: 0; }
.cp-item.sel .cp-enter { opacity: 1; }
.cp-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); font: 400 11px var(--font-mono); color: var(--text-3); }
.cp-empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 13px; }

.menu-btn { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; box-shadow: var(--shadow-lg); }
  .shell.sidebar-collapsed .sidebar { margin-left: 0; transform: translateX(-100%); }
  .sidebar { transition: transform 0.2s ease; margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
}
