/* ===== Tokens ===== */
:root {
  --bg: #0B1220;
  --bg-raise: #0E1626;
  --panel: #121B2E;
  --panel-hover: #16213652;
  --border: #223047;
  --border-soft: #1A2438;
  --text: #DCE6F5;
  --text-dim: #7C8CA6;
  --text-faint: #4C5C78;

  --accent: #4FD1C5;
  --accent-dim: #2C7A72;
  --accent-glow: rgba(79, 209, 197, 0.18);
  --accent-ink: #06201D;

  --warn: #E8A33D;
  --warn-glow: rgba(232, 163, 61, 0.16);

  --danger: #E2574C;
  --danger-glow: rgba(226, 87, 76, 0.16);

  --text-muted: var(--text-dim);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
  --info: #60a5fa;
  --info-glow: rgba(96, 165, 250, 0.16);

  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 3px;
}

/* ===== Themes ===== */
.theme-catppuccin {
  --bg: #1e1e2e;
  --bg-raise: #181825;
  --panel: #24243a;
  --panel-hover: #31324452;
  --border: #45475a;
  --border-soft: #313244;
  --text: #cdd6f4;
  --text-dim: #a6adc8;
  --text-faint: #585b70;

  --accent: #cba6f7;
  --accent-dim: #7c6f9e;
  --accent-glow: rgba(203, 166, 247, 0.18);
  --accent-ink: #1e1e2e;

  --warn: #fab387;
  --warn-glow: rgba(250, 179, 135, 0.16);

  --danger: #f38ba8;
  --danger-glow: rgba(243, 139, 168, 0.16);
}

.theme-dracula {
  --bg: #282a36;
  --bg-raise: #21222c;
  --panel: #2e303e;
  --panel-hover: #383a4e52;
  --border: #44475a;
  --border-soft: #383a4e;
  --text: #f8f8f2;
  --text-dim: #bfbfbf;
  --text-faint: #6272a4;

  --accent: #50fa7b;
  --accent-dim: #2d7a42;
  --accent-glow: rgba(80, 250, 123, 0.18);
  --accent-ink: #1e2a1e;

  --warn: #ffb86c;
  --warn-glow: rgba(255, 184, 108, 0.16);

  --danger: #ff5555;
  --danger-glow: rgba(255, 85, 85, 0.16);
}

.theme-nord {
  --bg: #2e3440;
  --bg-raise: #272c36;
  --panel: #3b4252;
  --panel-hover: #434c5e52;
  --border: #4c566a;
  --border-soft: #434c5e;
  --text: #eceff4;
  --text-dim: #d8dee9;
  --text-faint: #616e88;

  --accent: #88c0d0;
  --accent-dim: #5e81a0;
  --accent-glow: rgba(136, 192, 208, 0.18);
  --accent-ink: #2e3440;

  --warn: #ebcb8b;
  --warn-glow: rgba(235, 203, 139, 0.16);

  --danger: #bf616a;
  --danger-glow: rgba(191, 97, 106, 0.16);
}

.theme-gruvbox {
  --bg: #282828;
  --bg-raise: #1d2021;
  --panel: #32302f;
  --panel-hover: #3c383652;
  --border: #504945;
  --border-soft: #3c3836;
  --text: #ebdbb2;
  --text-dim: #a89984;
  --text-faint: #665c54;

  --accent: #b8bb26;
  --accent-dim: #79740e;
  --accent-glow: rgba(184, 187, 38, 0.18);
  --accent-ink: #1d2021;

  --warn: #fabd2f;
  --warn-glow: rgba(250, 189, 47, 0.16);

  --danger: #fb4934;
  --danger-glow: rgba(251, 73, 52, 0.16);
}

.theme-tokyonight {
  --bg: #1a1b26;
  --bg-raise: #16161e;
  --panel: #1f2335;
  --panel-hover: #24283b52;
  --border: #3b4261;
  --border-soft: #292e42;
  --text: #c0caf5;
  --text-dim: #737aa2;
  --text-faint: #414868;

  --accent: #7aa2f7;
  --accent-dim: #3d59a1;
  --accent-glow: rgba(122, 162, 247, 0.18);
  --accent-ink: #1a1b26;

  --warn: #e0af68;
  --warn-glow: rgba(224, 175, 104, 0.16);

  --danger: #f7768e;
  --danger-glow: rgba(247, 118, 142, 0.16);
}

.theme-solarized {
  --bg: #002b36;
  --bg-raise: #001f27;
  --panel: #073642;
  --panel-hover: #0a4a5a52;
  --border: #2aa198;
  --border-soft: #094953;
  --text: #839496;
  --text-dim: #657b83;
  --text-faint: #586e75;

  --accent: #2aa198;
  --accent-dim: #1a6b63;
  --accent-glow: rgba(42, 161, 152, 0.18);
  --accent-ink: #002b36;

  --warn: #b58900;
  --warn-glow: rgba(181, 137, 0, 0.16);

  --danger: #dc322f;
  --danger-glow: rgba(220, 50, 47, 0.16);
}

:root {
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 3px;
}

* { box-sizing: border-box; }

/* ===== Theme Dropdown ===== */
.theme-dropdown {
    position: relative;
}
.theme-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.theme-dropdown-btn:hover { color: var(--text); background: var(--panel-hover); border-color: var(--accent-dim); }
.theme-dropdown-btn.active { color: var(--accent); background: var(--accent-glow); }
.theme-dropdown-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: transform 0.15s;
}
.theme-dropdown-btn:hover .theme-dropdown-dot {
    transform: scale(1.15);
}
.theme-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    width: max-content;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.theme-dropdown-menu.is-open {
    display: block;
    animation: dropdown-fade-in 0.15s ease both;
}

@keyframes dropdown-fade-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.theme-dropdown-item {
    all: unset;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    transition: background 0.1s, color 0.1s;
}
.theme-dropdown-item:hover {
    background: var(--bg-raise);
    color: var(--text);
}
.theme-dropdown-item.active {
    color: var(--accent);
    background: var(--accent-glow);
}
.theme-dropdown-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    flex-shrink: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}

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

::selection { background: var(--accent-glow); color: var(--text); }

/* subtle subnet dot-grid backdrop */
.grid-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -10px -10px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 75%);
  opacity: 0.7;
}

/* ===== Topbar ===== */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-mark {
  color: var(--accent);
  font-size: 15px;
  transform: translateY(-1px);
  transition: transform 0.2s ease;
  display: inline-block;
}

.brand:hover .brand-mark {
  transform: translateY(-1px) rotate(90deg) scale(1.15);
}

.brand-name { color: var(--text); }
.brand-accent { color: var(--accent); }

.topnav { display: flex; align-items: center; gap: 4px; }

.nav-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-left:not(:empty) + .nav-right:not(:empty)::before {
  content: '';
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 8px;
  flex-shrink: 0;
}

/* ===== Admin Sidebar ===== */
.sidebar-toggle {
    display: none;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: var(--bg-raise);
    border-right: 1px solid var(--border);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.page.has-sidebar {
    margin-left: 240px;
    max-width: 1080px;
}

.sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.sidebar-close:hover { color: var(--text); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 2px;
}

.sidebar-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
    padding: 12px 16px;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s, transform 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-link:hover {
    transform: translateX(3px);
}

.sidebar-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--panel) 72%, transparent);
    color: var(--text-dim);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.sidebar-icon svg,
.sidebar-icon i {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    color: currentColor;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: var(--accent-glow);
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--panel);
}

.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 8px 0;
}

.topnav a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color 0.15s ease, background 0.15s ease;
}

.topnav a:hover { color: var(--text); background: var(--panel); }
.topnav a.active { color: var(--accent); background: var(--accent-glow); }

/* Normalize all topnav buttons (links + dropdown triggers) to one size */
.topnav a.btn,
.topnav button.btn,
.topnav .theme-dropdown-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

/* Match the Utilities dropdown trigger to the other nav buttons */
.topnav .theme-dropdown-btn {
  color: var(--text-dim);
}
.topnav .theme-dropdown-btn:hover {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}
.topnav .theme-dropdown-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ===== Layout ===== */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 40px 80px;
  animation: page-fade-in 0.4s ease both;
}

.footer {
  text-align: center;
  padding: 28px 40px 40px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

.footer-dot { margin: 0 8px; }

/* ===== Flash messages ===== */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.flash-stack .flash:nth-child(1) { animation-delay: 0s; }
.flash-stack .flash:nth-child(2) { animation-delay: 0.06s; }
.flash-stack .flash:nth-child(3) { animation-delay: 0.12s; }
.flash-stack .flash:nth-child(4) { animation-delay: 0.18s; }

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  background: var(--panel);
  animation: flash-slide-in 0.3s ease both;
}

.flash-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.flash-success { border-color: var(--accent-dim); }
.flash-success .flash-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.flash-error { border-color: #7a3530; }
.flash-error .flash-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.flash-warn { border-color: var(--warn); background: var(--warn-glow); }
.flash-warn .flash-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

/* ===== Hero (landing) ===== */
.hero {
  margin-bottom: 40px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.hero p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0;
  max-width: 560px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.hero-stat .num {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
}

.hero-stat .num.accent { color: var(--accent); }

.hero-stat .label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ===== API warning banner ===== */
.api-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid #6b4a20;
  background: var(--warn-glow);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--warn);
  margin-bottom: 24px;
}

/* ===== Section headers ===== */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin: 0;
}

/* ===== VPS Cards ===== */
.vps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.vps-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  animation: card-fade-in 0.35s ease both;
  animation-delay: calc(var(--card-i, 0) * 0.06s);
}

.vps-card:nth-child(1)  { --card-i: 1; }
.vps-card:nth-child(2)  { --card-i: 2; }
.vps-card:nth-child(3)  { --card-i: 3; }
.vps-card:nth-child(4)  { --card-i: 4; }
.vps-card:nth-child(5)  { --card-i: 5; }
.vps-card:nth-child(6)  { --card-i: 6; }
.vps-card:nth-child(7)  { --card-i: 7; }
.vps-card:nth-child(8)  { --card-i: 8; }
.vps-card:nth-child(9)  { --card-i: 9; }
.vps-card:nth-child(10) { --card-i: 10; }
.vps-card:nth-child(11) { --card-i: 11; }
.vps-card:nth-child(12) { --card-i: 12; }
.vps-card:nth-child(13) { --card-i: 13; }
.vps-card:nth-child(14) { --card-i: 14; }
.vps-card:nth-child(15) { --card-i: 15; }
.vps-card:nth-child(n+16) { --card-i: 16; }

.vps-card:hover {
  border-color: var(--accent-dim);
  background: var(--panel-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.vps-card-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.vps-hostname {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.vps-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.4;
}

.vps-specs-row {
  display: flex;
  gap: 15px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  margin-top: auto;
}

.spec-group {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }

.status-running { color: var(--accent); border-color: var(--accent-dim); }
.status-running .dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: glow-pulse 2s ease-in-out infinite; }

.status-exited, .status-created { color: var(--text-dim); }
.status-exited .dot, .status-created .dot { background: var(--text-faint); }

.status-unknown { color: var(--warn); border-color: #6b4a20; }
.status-unknown .dot { background: var(--warn); }

.status-stopped { color: var(--danger); border-color: #7a3530; }
.status-stopped .dot { background: var(--danger); }

.status-suspended { color: var(--text-dim); border-color: var(--text-faint); }
.status-suspended .dot { background: var(--text-faint); }

.status-creating { color: var(--warn); border-color: #6b4a20; }
.status-creating .dot { background: var(--warn); animation: pulse 1.5s infinite; }

.status-pendingpayment { color: var(--warn); border-color: #6b4a20; }
.status-pendingpayment .dot { background: var(--warn); animation: pulse 1.5s infinite; }

.status-replied { background: var(--info-glow); color: var(--info); border: 1px solid var(--info); }
.status-replied .dot { background: var(--info); }

.staff-message {
  border-left: 3px solid var(--accent) !important;
  background: rgba(59,130,246,0.05) !important;
}

.vps-id {
  flex: 1;
  min-width: 0;
}

/* ===== User dashboard instance list ===== */
.dash-section-head {
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.dash-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-search {
  display: flex;
  align-items: center;
}
.dash-search .search-input {
  min-width: 200px;
  max-width: 280px;
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px 20px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
  animation: row-pop-in 0.3s ease both;
  animation-delay: calc(var(--row-i, 0) * 0.04s);
}
.dash-row:nth-child(1)  { --row-i: 1; }
.dash-row:nth-child(2)  { --row-i: 2; }
.dash-row:nth-child(3)  { --row-i: 3; }
.dash-row:nth-child(4)  { --row-i: 4; }
.dash-row:nth-child(5)  { --row-i: 5; }
.dash-row:nth-child(6)  { --row-i: 6; }
.dash-row:nth-child(7)  { --row-i: 7; }
.dash-row:nth-child(8)  { --row-i: 8; }
.dash-row:nth-child(9)  { --row-i: 9; }
.dash-row:nth-child(10) { --row-i: 10; }
.dash-row:nth-child(11) { --row-i: 11; }
.dash-row:nth-child(12) { --row-i: 12; }
.dash-row:nth-child(13) { --row-i: 13; }
.dash-row:nth-child(14) { --row-i: 14; }
.dash-row:nth-child(15) { --row-i: 15; }
.dash-row:nth-child(n+16) { --row-i: 16; }
.dash-os-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1;
  vertical-align: middle;
}
.dash-os-badge img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}
.dash-row:hover {
  border-color: var(--accent-dim);
  background: var(--panel-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.dash-row-pay {
  border-color: var(--warn);
  background: var(--warn-glow);
}
.dash-row-billing {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
}
.dash-billing-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--warn);
  font-weight: 600;
}
.dash-billing-tag.overdue {
  color: var(--danger);
}
.billing-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 0 20px;
  border-radius: var(--radius);
  border: 1px solid var(--warn);
  background: var(--warn-glow);
  font-size: 13.5px;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1.45;
}
.billing-banner.overdue {
  border-color: var(--danger);
  background: var(--danger-glow);
}
.billing-banner .billing-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
  margin-top: 5px;
  flex-shrink: 0;
}
.billing-banner.overdue .billing-banner-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}
.billing-banner strong { color: var(--text); }
.dash-row-pay:hover {
  border-color: var(--warn);
}
.dash-row-suspended {
  opacity: 0.85;
}

.dash-row-main {
  min-width: 0;
}
.dash-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.dash-hostname {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.dash-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
}
.dash-ip {
  color: var(--text);
  cursor: copy;
  word-break: break-all;
}
.dash-ip-tag {
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-ip.dim { color: var(--text-faint); cursor: default; }
.dash-ip:hover:not(.dim) { color: var(--accent); }
.dash-sep { color: var(--text-faint); }

.dash-row-specs {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.dash-row-specs strong {
  color: var(--text);
  font-weight: 500;
}

.dash-row-cta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.dash-chevron {
  color: var(--text-faint);
  font-size: 16px;
  transition: color 0.15s, transform 0.15s;
}
.dash-row:hover .dash-chevron {
  color: var(--accent);
  transform: translateX(2px);
}

.dash-pagination {
  margin-top: 28px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.dash-page-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 0 12px;
}

@media (max-width: 720px) {
  .dash-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .dash-row-specs {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
    white-space: normal;
  }
  .dash-row-cta {
    align-self: start;
  }
  .dash-search .search-input {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
  .dash-actions {
    width: 100%;
  }
  .dash-search {
    flex: 1;
  }
}

.vps-specs {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.vps-specs .spec-val { color: var(--text); }

.vps-arrow {
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ===== Empty state ===== */
.empty-state,
.empty-mini {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}

.empty-state .glyph,
.empty-mini .glyph {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 14px;
  width: auto;
  height: auto;
  white-space: nowrap;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 20px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover { border-color: var(--accent-dim); background: var(--panel-hover); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible,
.topnav a:focus-visible,
.sidebar-link:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.08);
  border-color: var(--accent);
  background: var(--accent);
}

/* beat .topnav a color/hover so primary keeps dark ink on accent */
.topnav a.btn-primary,
.topnav a.btn-primary:hover,
.topnav a.btn-primary:focus-visible {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.topnav a.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-glow); }

.btn-small { padding: 7px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.footer-link {
  color: inherit;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}
.footer-link:hover { opacity: 1; color: var(--accent); }

.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--panel);
  border: 1px solid var(--accent-dim);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ban-reason-inline {
  margin-top: 8px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-glow);
  padding: 8px 10px;
  border-radius: var(--radius);
  border-left: 3px solid var(--danger);
}
.user-card-banned {
  opacity: 0.85;
  border-color: var(--danger) !important;
}
.badge-banned {
  color: var(--danger);
  font-size: 11px;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn-success {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent-dim);
}
.btn-success:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

[data-copy] { cursor: pointer; }
[data-copy]:hover { color: var(--accent); }

.search-input {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 12px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  width: 220px;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder { color: var(--text-faint); }

.btn-row { display: flex; gap: 8px; margin-top: 4px; }

/* ===== Forms ===== */
.form-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field .hint {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: normal;
}

.field input, .field select, .field textarea {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

/* ===== Hide number input spinners ===== */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield; appearance: textfield;
}

/* ===== Theme checkbox ===== */
.check-ui {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex: none; margin: 0;
  cursor: pointer; vertical-align: middle;
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 4px; position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check-ui:hover { border-color: var(--accent); }
.check-ui:checked { background: var(--accent); border-color: var(--accent); }
.check-ui:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check-ui:disabled { cursor: not-allowed; opacity: 0.5; }
.check-ui-label {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
}

/* ===== Terminal preview (signature element) ===== */
.terminal {
  background: #070C15;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.terminal-dots { display: flex; gap: 6px; margin-right: 6px; }
.terminal-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}

.terminal-body {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.1;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 132px;
}

.terminal-body .flag { color: var(--accent); }
.terminal-body .val { color: var(--text); }
.terminal-body .prompt { color: var(--text-faint); }
.terminal-body .cursor {
  display: inline-block;
  width: 7px; height: 15px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes flash-slide-in {
  0% { opacity: 0; transform: translateY(-10px); }
  60% { opacity: 1; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes card-fade-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes row-pop-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes stat-pop-in {
  0% { opacity: 0; transform: scale(0.92); }
  70% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes plan-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--accent); }
  50% { box-shadow: 0 0 12px var(--accent), 0 0 24px var(--accent-glow); }
}

/* ===== Detail page ===== */
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-title h1 {
  font-family: var(--font-mono);
  font-size: 24px;
  margin: 0;
  font-weight: 600;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  display: inline-block;
  margin-bottom: 18px;
}

.back-link:hover { color: var(--accent); }

.detail-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.panel h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
  font-weight: 500;
}

.kv-list { display: flex; flex-direction: column; gap: 12px; }

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.kv-row .k { color: var(--text-dim); }
.kv-row .v { font-family: var(--font-mono); color: var(--text); }

.metric { margin-bottom: 16px; }
.metric:last-child { margin-bottom: 0; }

.metric-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.metric-label .metric-val { color: var(--text); }

.metric-track {
  height: 6px;
  background: var(--bg-raise);
  border-radius: 3px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  /* Live-updated widths glide to their new value */
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  /* One-shot grow-in on page load; removed on animationend so it never
     fights the width transition when fresh data arrives early. */
  animation: metric-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

/* Stagger the bars so they cascade in one after another */
.metric:nth-child(1) .metric-fill { animation-delay: 0.05s; }
.metric:nth-child(2) .metric-fill { animation-delay: 0.15s; }
.metric:nth-child(3) .metric-fill { animation-delay: 0.25s; }
.metric:nth-child(4) .metric-fill { animation-delay: 0.35s; }
.metric:nth-child(5) .metric-fill { animation-delay: 0.45s; }
.metric:nth-child(6) .metric-fill { animation-delay: 0.55s; }

@keyframes metric-grow {
  from { width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .metric-fill {
    animation: none;
    transition: none;
  }
}

.metric-fill.warn { background: var(--warn); }
.metric-fill.danger { background: var(--danger); }

.no-stats {
  color: var(--text-faint);
  font-size: 13px;
  font-family: var(--font-mono);
  text-align: center;
  padding: 20px 0;
}

/* ===== Plan cards (create VPS) ===== */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .plan-grid { grid-template-columns: 1fr; }
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  animation: plan-slide-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--plan-i, 0) * 0.08s);
}

.plan-card:nth-child(1)  { --plan-i: 1; }
.plan-card:nth-child(2)  { --plan-i: 2; }
.plan-card:nth-child(3)  { --plan-i: 3; }
.plan-card:nth-child(4)  { --plan-i: 4; }
.plan-card:nth-child(5)  { --plan-i: 5; }
.plan-card:nth-child(6)  { --plan-i: 6; }
.plan-card:nth-child(7)  { --plan-i: 7; }
.plan-card:nth-child(8)  { --plan-i: 8; }
.plan-card:nth-child(n+9) { --plan-i: 9; }

.plan-card:hover,
.plan-card:focus-visible {
  border-color: var(--accent);
  background: var(--panel-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  outline: none;
}

.plan-card.is-popular {
  border-color: var(--accent-dim);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
}

.plan-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-price {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
}

.plan-price span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.plan-specs {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.plan-spec {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-family: var(--font-mono);
}

.plan-spec .k { color: var(--text-dim); }
.plan-spec .v { color: var(--text); text-align: right; min-width: 0; }

.plan-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  transition: color 0.15s ease;
}

.plan-card:hover .plan-cta,
.plan-card:focus-visible .plan-cta {
  color: var(--accent);
}

/* ===== Hostname modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 17, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
  padding: 20px;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transform: translateY(8px);
  transition: transform 0.15s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-panel form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-panel .field {
  gap: 8px;
}

.modal-panel .field input,
.modal-panel .field select,
.modal-panel .field textarea {
  padding: 12px 14px;
}

/* keep theme checkboxes from inheriting the stretched .field input styling */
.field input.check-ui {
  width: 16px;
  height: 16px;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
}
.field input.check-ui:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field input.check-ui:hover { border-color: var(--accent); }
.field input.check-ui:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.modal-panel .modal-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.modal-backdrop.is-open .modal-panel {
  transform: translateY(0);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-head h3 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover { color: var(--text); }

.modal-plan-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 10px 12px;
  background: var(--bg-raise);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.modal-plan-summary .k { color: var(--text-dim); }
.modal-plan-summary .v { color: var(--text); font-weight: 600; }
.modal-plan-summary .modal-plan-price { margin-left: auto; color: var(--accent); font-weight: 600; }

.modal-actions {
  margin-top: 20px;
  justify-content: flex-end;
}

.plan-description {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 40px;
}

.plan-card {
    color: inherit;
    font-family: inherit;
}

.plan-card .plan-description {
    color: var(--text-muted);
}
/* Responsive Nav Toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; }
.nav-toggle .bar { display: block; width: 25px; height: 3px; background: var(--text); margin: 5px 0; border-radius: 2px; }

/* ===== Mobile & Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    
    .topnav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--bg-raise);
        padding: 16px 20px;
        border-bottom: 2px solid var(--border);
        z-index: 1000;
        max-height: 75vh;
        overflow-y: auto;
    }

    .topnav.is-open { display: flex; }

    .nav-left, .nav-right {
        flex-direction: column;
        width: 100%;
        gap: 2px;
    }

    .nav-left:not(:empty) + .nav-right:not(:empty) {
        margin-top: 8px;
        padding-top: 10px;
        border-top: 1px solid var(--border-soft);
    }

    .nav-left:not(:empty) + .nav-right:not(:empty)::before {
        display: none;
    }

    .topnav .btn,
    .topnav .theme-dropdown-btn {
        margin: 0;
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        font-size: 13px;
        border-radius: var(--radius);
    }

    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 6px 0;
    }

    .sidebar-toggle {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 101;
        background: var(--accent);
        border: none;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        cursor: pointer;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    }

    .sidebar-toggle .bar {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--accent-ink);
    }

    .sidebar-scrim:not([hidden]) {
        display: block;
    }

    .admin-sidebar {
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        display: flex;
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .page.has-sidebar {
        margin-left: 0;
        max-width: 100%;
    }
    
    .topbar {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .page {
        padding: 24px 16px 60px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .hero-stat .num {
        font-size: 20px;
    }
    
    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .section-head h2 {
        font-size: 18px;
    }
    
    .detail-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .detail-title h1 {
        font-size: 20px;
    }
    
    .btn-row {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .btn-row .btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    
    .detail-grid {
        grid-template-columns: 1fr !important;
    }
    
    .terminal {
        min-height: 300px !important;
    }
    
    .vps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .vps-card {
        padding: 16px;
    }
    
    .vps-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .vps-specs-row {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .spec-group {
        min-width: 60px;
    }
    
    .plan-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-panel {
        width: 95% !important;
        max-width: none;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-head {
        padding: 16px;
    }
    
    .modal-head h3 {
        font-size: 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .field label {
        font-size: 12px;
    }
    
    .field input, .field select, .field textarea {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .kv-list {
        font-size: 13px;
    }
    
    .kv-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 8px 0;
    }
    
    .metric-label {
        font-size: 12px;
    }
    
    .metric-track {
        height: 6px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pagination .btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    
    .pagination span {
        width: 100%;
        text-align: center;
    }
    
    .flash {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .footer {
        padding: 20px 16px 30px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        gap: 12px;
    }
    
    .hero-stat {
        flex: 1 1 calc(50% - 12px);
        min-width: 0;
    }
    
    .hero-stat .num {
        font-size: 18px;
    }
    
    .hero-stat .label {
        font-size: 11px;
    }
    
    .vps-card {
        padding: 12px;
    }
    
    .vps-hostname {
        font-size: 14px;
    }
    
    .vps-meta {
        font-size: 11px;
    }
    
    .status-pill {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .btn-small {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* ===== Console Button ===== */
.btn-console {
    background: var(--bg-raise);
    color: var(--accent);
    border-color: var(--accent-dim);
}
.btn-console:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

/* ===== Console Modal ===== */
.console-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 9, 17, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 200;
    padding: 16px;
}
.console-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.console-dialog {
    width: 100%;
    max-width: 1100px;
    aspect-ratio: 16 / 10;
    max-height: 80vh;
    min-height: 400px;
    background: #0B1220;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(8px);
    transition: transform 0.2s ease;
}
.console-backdrop.is-open .console-dialog {
    transform: translateY(0);
}

.console-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-raise);
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}
.console-title {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}
.console-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}
.console-close:hover {
    color: var(--danger);
    background: var(--danger-glow);
}

.console-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.console-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.console-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
}
.console-loading.error {
    color: var(--danger);
}

@media (max-width: 768px) {
    .console-backdrop { padding: 8px; }
    .console-dialog { height: 90vh; max-width: 100%; }
    
    /* Tables - horizontal scroll on mobile */
    .sub-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .sub-table thead,
    .sub-table tbody,
    .sub-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .sub-table th,
    .sub-table td {
        min-width: 100px;
    }
    
    /* Stat boxes - stack on mobile */
    .stat-row {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: 10px !important;
    }
    
    .stat-box {
        padding: 12px 14px !important;
    }
    
    .stat-box .num {
        font-size: 18px !important;
    }
    
    .stat-box .lbl {
        font-size: 10px !important;
    }
    
    /* Node tabs - horizontal scroll */
    .node-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .node-tab {
        padding: 8px 14px;
        font-size: 12px;
        flex-shrink: 0;
    }
    
    /* Infrastructure chunk - better mobile spacing */
    .infrastructure-chunk {
        margin-bottom: 32px !important;
    }
    
    .infrastructure-chunk h3 {
        font-size: 0.95rem !important;
    }
}


/* ===== ADMIN-SPECIFIC MOBILE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Sticky first column in admin tables */
    .sub-table th:first-child,
    .sub-table td:first-child {
        position: sticky;
        left: 0;
        background: var(--panel);
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    }
    
    /* Compact admin table cells */
    .sub-table th,
    .sub-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Admin sidebar mobile sizing */
    .admin-sidebar {
        width: 260px;
    }
    
    .sidebar-link {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Compact admin action buttons */
    .inline-form .btn {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    /* Admin page overflow prevention */
    .page.has-sidebar {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    /* Extra small - even more compact admin */
    .admin-sidebar {
        width: 240px;
    }
    
    .sub-table th,
    .sub-table td {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 80px;
    }
    
    .stat-row {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ===== PRIORITY BADGES (TICKETING) ===== */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    line-height: 1.2;
    margin-left: 4px;
}

.priority-badge.priority-low {
    background: rgba(148,163,184,0.12);
    color: #94a3b8;
    border: 1px solid #64748b;
}

.priority-badge.priority-normal {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid #3b82f6;
}

.priority-badge.priority-high {
    background: rgba(234,88,12,0.15);
    color: #f97316;
    border: 1px solid #ea580c;
}

.priority-badge.priority-urgent,
.priority-badge.priority-critical {
    background: rgba(226,87,76,0.15);
    color: #f87171;
    border: 1px solid #e2574c;
}

.plan-card-btn {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.plan-card-btn:hover,
.plan-card-btn:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.plan-card-btn:active {
    transform: scale(0.98);
}

.theme-swatch {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    height: 34px;
    padding: 5px;
    border-radius: var(--radius);
    background: var(--bg-raise);
    border: 1px solid var(--border-soft);
}

.theme-swatch span {
    border-radius: 6px;
    min-width: 0;
}

.connecting {
    color: var(--warn);
}


/* ===== Shared UI Normalization ===== */
.card,
.checkout-card,
.method-card,
.img-card,
.type-card,
.theme-card,
.spec-box,
.vps-info-block {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.card:hover,
.method-card:hover,
.img-card:hover,
.type-card:hover,
.theme-card:hover {
    border-color: var(--accent-dim);
    background: var(--panel-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.actions,
.admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge,
.type-badge,
.tier-badge,
.action-badge,
.node-pill,
.ip-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    background: var(--bg-raise);
}

.tier-free,
.ip-free,
.action-create,
.status-completed {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: var(--accent-glow);
}

.tier-paid,
.ip-assigned,
.action-update {
    color: var(--warn);
    border-color: rgba(232, 163, 61, 0.45);
    background: rgba(232, 163, 61, 0.1);
}

.action-delete,
.status-failed,
.priority-high {
    color: var(--danger);
    border-color: rgba(226, 87, 76, 0.45);
    background: var(--danger-glow);
}

.action-login,
.action-other {
    color: var(--text);
    border-color: var(--border);
    background: rgba(255,255,255,0.04);
}

/* empty-state defined above */

.glyph,
.method-glyph {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent-dim);
    font-size: 22px;
}

.modal-body {
    color: var(--text-dim);
    line-height: 1.6;
}

.select-field,
.field input,
.field select,
.field textarea {
    width: 100%;
}

.remove-btn {
    color: var(--danger);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    cursor: pointer;
}

.remove-btn:hover {
    border-color: var(--danger);
    background: var(--danger-glow);
}

.checkout-header,
.img-card-head,
.method-details,
.checkout-context-row,
.img-spec,
.spec-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.checkout-context,
.checkout-specs,
.img-specs,
.method-meta,
.image-choice-meta {
    display: grid;
    gap: 10px;
}

.method-name,
.img-card-name,
.image-choice-name,
.theme-card-name {
    color: var(--text);
    font-weight: 700;
}

.img-card-desc,
.method-meta,
.image-choice-meta,
.spec-label {
    color: var(--text-dim);
    font-size: 12px;
}

.spec-value {
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 700;
}

.img-grid,
.image-choice-grid,
.theme-grid,
.node-pills {
    display: grid;
    gap: 14px;
}

.img-grid,
.image-choice-grid,
.theme-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.image-choice,
.type-card,
.theme-card {
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.image-choice:hover,
.type-card:hover,
.theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.image-choice.selected,
.type-card.selected,
.theme-card.selected,
.btn-active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.os-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
}

.log-table th,
.log-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
}

.log-table th {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.proxmox-fields,
.add_proxmox_fields {
    display: contents;
}

@media (max-width: 768px) {
    .checkout-header,
    .img-card-head,
    .method-details,
    .checkout-context-row,
    .img-spec,
    .spec-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .actions,
    .admin-actions {
        width: 100%;
    }

    .actions .btn,
    .admin-actions .btn {
        flex: 1;
        justify-content: center;
    }
}


/* ===== Layout Helpers Used Across Templates ===== */
.pagination {
    margin-top: 40px;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.pagination span {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    padding: 0 15px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.sub-table {
    width: 100%;
    border-collapse: collapse;
}

.sub-table th,
.sub-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: middle;
}

.sub-table th {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sub-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.stat-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  animation: stat-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--stat-i, 0) * 0.05s);
}

.stat-box:nth-child(1)  { --stat-i: 1; }
.stat-box:nth-child(2)  { --stat-i: 2; }
.stat-box:nth-child(3)  { --stat-i: 3; }
.stat-box:nth-child(4)  { --stat-i: 4; }
.stat-box:nth-child(5)  { --stat-i: 5; }
.stat-box:nth-child(6)  { --stat-i: 6; }
.stat-box:nth-child(7)  { --stat-i: 7; }
.stat-box:nth-child(8)  { --stat-i: 8; }
.stat-box:nth-child(9)  { --stat-i: 9; }
.stat-box:nth-child(10) { --stat-i: 10; }
.stat-box:nth-child(n+11) { --stat-i: 11; }

.stat-box .num {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 800;
}

.stat-box .lbl {
    margin-top: 4px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.node-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.node-tab {
    color: var(--text-dim);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
}

.node-tab:hover,
.node-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.legal-page {
    max-width: 900px;
    margin: 0 auto;
}

.legal-stack {
    display: flex;
    flex-direction: column;
    gap: 32px;
    line-height: 1.7;
}

.legal-stack h2 {
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.legal-stack ul {
    margin-left: 24px;
    margin-top: 12px;
}

.legal-stack p + p,
.legal-stack p + ul {
    margin-top: 12px;
}

.flag-icon-img {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    flex: 0 0 18px !important;
}

.user-picker {
  position: relative;
}

.user-picker .user-search-input {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.user-picker .user-search-input:focus {
  border-color: var(--accent);
}

.user-results {
  display: none;
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  padding: 6px;
}

.user-results.is-open {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.user-result-item:hover {
  background: var(--panel-hover);
  border-color: var(--border);
}

.user-result-item.is-active {
  background: var(--panel-hover);
  border-color: var(--accent);
}

.user-result-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid rgba(79, 209, 197, 0.4);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-result-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-result-email {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-result-empty {
  padding: 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  text-align: center;
}

.user-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}

.user-selected-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid rgba(79, 209, 197, 0.4);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-selected-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-selected-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-selected-meta {
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-clear-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
}

.user-clear-btn:hover {
  color: var(--danger);
  background: rgba(226, 87, 76, 0.12);
}

/* ===== Mobile hardening (global) ===== */
@media (max-width: 768px) {
  img {
    max-width: 100%;
    height: auto;
  }

  .section-head > div:not(.dash-actions) {
    flex-wrap: wrap;
    width: 100%;
  }

  .section-head form:not(.dash-search) {
    flex-direction: column;
    align-items: stretch !important;
    width: 100%;
  }

  .section-head .search-input {
    width: 100% !important;
    max-width: none !important;
  }

  .dash-search {
    flex: 1;
    min-width: 0;
  }
  .dash-search .search-input {
    min-width: 0;
  }

  .empty-state {
    margin: 40px auto !important;
    padding: 24px 16px;
  }
}

@media (max-width: 480px) {
  .modal-panel [style*="flex"] {
    flex-wrap: wrap;
  }

  .modal-panel [style*="flex"] > .field,
  .modal-panel [style*="flex"] > .field[style*="flex"] {
    flex: 1 1 100% !important;
  }

  .modal-panel [style*="display: grid"],
  .modal-panel [style*="display:grid"] {
    grid-template-columns: 1fr !important;
  }
}

/* ===== Large screens ===== */
@media (min-width: 1440px) {
  .page {
    max-width: 1360px;
  }
  .page.has-sidebar {
    max-width: 1360px;
  }
  .stat-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}
@media (min-width: 1920px) {
  .page {
    max-width: 1600px;
  }
  .page.has-sidebar {
    max-width: 1600px;
  }
  .detail-grid {
    grid-template-columns: 1.5fr 1fr;
  }
  .stat-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* ===== Reduced motion: disable all entrance/interaction animations ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
