/* ============================================================
   NexusVPS Billing Panel — app.css v2
   Mobile-first, fully responsive hosting panel theme
   Fonts: Outfit (UI) + JetBrains Mono (code/stats)
   ============================================================ */

:root {
  --bg:         #080a0f;
  --bg2:        #0d1017;
  --bg3:        #121620;
  --bg4:        #171c26;
  --border:     #1a2030;
  --border2:    #222840;
  --text:       #dde3f0;
  --text2:      #7e8da4;
  --text3:      #444f66;
  --primary:    #3b7bff;
  --primary-h:  #5591ff;
  --primary-d:  #2860d4;
  --accent:     #00d4aa;
  --accent2:    #ff6b35;
  --warning:    #f5a623;
  --danger:     #f24545;
  --success:    #22c55e;
  --purple:     #a78bfa;
  --gold:       #fbbf24;
  --sidebar-w:  248px;
  --topbar-h:   56px;
  --radius:     8px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --shadow:     0 2px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.6);
  --mono:       'JetBrains Mono', 'Courier New', monospace;
  --sans:       'Outfit', system-ui, sans-serif;
  --ease:       cubic-bezier(.4,0,.2,1);
  --t:          .15s;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: var(--primary); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--primary-h); }
img { max-width: 100%; display: block; }
button { font-family: var(--sans); }
input, select, textarea { font-family: var(--sans); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .25s var(--ease), box-shadow .25s;
  overflow: hidden;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon {
  font-size: 22px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent));
  line-height: 1;
}
.logo-text {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav { padding: 10px 0 12px; }
.nav-section { margin-bottom: 2px; }
.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 10px 20px 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 400;
  transition: all var(--t) var(--ease);
  position: relative;
  white-space: nowrap;
  border-right: 2px solid transparent;
}
.nav-link svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
  transition: color var(--t);
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-link.active {
  color: var(--primary);
  background: rgba(59,123,255,.08);
  border-right-color: var(--primary);
  font-weight: 500;
}

/* Provider balance pill in sidebar */
.sidebar-provider {
  margin: 0 12px 8px;
  background: rgba(0,212,170,.07);
  border: 1px solid rgba(0,212,170,.18);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.sidebar-provider-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .1em; }
.sidebar-provider-val   { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--accent); margin-top: 2px; }

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  flex: 1; padding: 8px; border-radius: var(--radius);
  color: var(--text); min-width: 0;
  transition: background var(--t);
}
.user-card:hover { background: rgba(255,255,255,.05); color: var(--text); }
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.user-name    { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-balance { font-size: 11px; color: var(--accent); font-family: var(--mono); font-weight: 600; }
.logout-btn {
  padding: 8px; border-radius: var(--radius);
  color: var(--text3); display: flex; flex-shrink: 0;
  transition: all var(--t); background: none; border: none; cursor: pointer;
}
.logout-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.logout-btn:hover { background: rgba(242,69,69,.12); color: var(--danger); }

/* ── Overlay (mobile) ────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(13,16,23,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
  gap: 12px;
}
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 7px; border-radius: var(--radius);
  color: var(--text2); transition: all var(--t);
}
.sidebar-toggle:hover { background: rgba(255,255,255,.06); color: var(--text); }
.sidebar-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; display: block; }

.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 6px 12px;
  color: var(--text2); font-size: 13px;
}
.topbar-search svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.notif-btn {
  position: relative; padding: 8px;
  border-radius: var(--radius); color: var(--text2);
  display: flex; transition: all var(--t); background: none; border: none; cursor: pointer;
  text-decoration: none;
}
.notif-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.notif-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 800; min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg2);
}

.page-content { padding: 24px; flex: 1; }

/* ══════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════ */

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--t) var(--ease);
  font-family: var(--sans);
  white-space: nowrap; line-height: 1.2;
  text-decoration: none; vertical-align: middle;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none;
           stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,123,255,.35); }
.btn-accent   { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { opacity: .85; color: #000; transform: translateY(-1px); }
.btn-success  { background: rgba(34,197,94,.12); color: var(--success); border-color: rgba(34,197,94,.3); }
.btn-success:hover { background: rgba(34,197,94,.2); }
.btn-ghost    { background: transparent; color: var(--text2); border-color: var(--border2); }
.btn-ghost:hover  { background: rgba(255,255,255,.06); color: var(--text); border-color: var(--border2); }
.btn-danger   { background: transparent; color: var(--danger); border-color: rgba(242,69,69,.3); }
.btn-danger:hover { background: rgba(242,69,69,.1); }
.btn-warning  { background: transparent; color: var(--warning); border-color: rgba(245,166,35,.3); }
.btn-warning:hover { background: rgba(245,166,35,.1); }
.btn-sm  { padding: 6px 13px; font-size: 12.5px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; }
.btn-xl  { padding: 16px 36px; font-size: 16px; font-weight: 600; }
.btn-icon { padding: 8px; border-radius: var(--radius); }
.btn[disabled], .btn:disabled { opacity: .4; pointer-events: none; }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  /* border-radius: var(--radius-lg); */
  padding: 22px;
}
.card-sm { padding: 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.card-title    { font-size: 15px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 12.5px; color: var(--text3); margin-top: 2px; }

/* ── Stat cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t);
}
.stat-card:hover { border-color: var(--border2); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--stat-color, var(--primary));
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--stat-color, var(--primary)) 15%, transparent), transparent 70%);
  pointer-events: none;
}
.stat-icon {
  width: 36px; height: 36px;
  background: color-mix(in srgb, var(--stat-color, var(--primary)) 12%, transparent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--stat-color, var(--primary));
}
.stat-icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.stat-value { font-size: 22px; font-weight: 800; font-family: var(--mono); line-height: 1; margin-bottom: 3px; }
.stat-label { font-size: 11.5px; color: var(--text2); }
.stat-trend { font-size: 11px; color: var(--success); margin-top: 4px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group  { margin-bottom: 18px; }
.form-label  {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text2); margin-bottom: 7px; letter-spacing: .02em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--sans);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,123,255,.14);
  background: var(--bg4);
}
.form-input::placeholder { color: var(--text3); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-select option { background: var(--bg3); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-hint  { font-size: 11.5px; color: var(--text3); margin-top: 5px; line-height: 1.5; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 5px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13.5px;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
}

/* ── Input with icon ─────────────────────────────────────── */
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-input { padding-left: 38px; }
.input-icon-wrap .input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; stroke: var(--text3); fill: none; stroke-width: 2; stroke-linecap: round;
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius);
  font-size: 13.5px; margin-bottom: 18px;
  border: 1px solid; line-height: 1.5;
}
.alert::before { font-size: 16px; flex-shrink: 0; margin-top: -1px; }
.alert-error   { background: rgba(242,69,69,.08);  border-color: rgba(242,69,69,.25);  color: #ff8080; }
.alert-error::before { content: '⚠'; }
.alert-success { background: rgba(34,197,94,.08);  border-color: rgba(34,197,94,.25);  color: #6ee7a0; }
.alert-success::before { content: '✓'; }
.alert-info    { background: rgba(59,123,255,.08); border-color: rgba(59,123,255,.25); color: #91b8ff; }
.alert-info::before { content: 'ℹ'; }
.alert-warning { background: rgba(245,166,35,.08); border-color: rgba(245,166,35,.25); color: #fbd17a; }
.alert-warning::before { content: '⚡'; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
thead th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--bg2);
  position: sticky; top: 0;
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(26,32,48,.8);
  font-size: 13.5px; color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.022); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-active     { background: rgba(34,197,94,.1);  color: var(--success); }
.badge-installing { background: rgba(59,123,255,.1); color: var(--primary); }
.badge-suspended  { background: rgba(245,166,35,.1); color: var(--warning); }
.badge-cancelled  { background: rgba(242,69,69,.1);  color: var(--danger); }
.badge-deleted    { background: rgba(84,95,117,.12); color: var(--text3); }
.badge-open       { background: rgba(59,123,255,.1); color: var(--primary); }
.badge-progress   { background: rgba(167,139,250,.1); color: var(--purple); }
.badge-waiting    { background: rgba(245,166,35,.1); color: var(--warning); }
.badge-closed     { background: rgba(84,95,117,.12); color: var(--text3); }
.badge-default    { background: rgba(84,95,117,.12); color: var(--text3); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--text2); background: none; border: none;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all var(--t); font-family: var(--sans);
  white-space: nowrap; flex-shrink: 0;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Progress bars ───────────────────────────────────────── */
.progress-bar { height: 5px; background: var(--border2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .5s var(--ease); background: var(--primary); }
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-wrap .progress-bar { flex: 1; }
.progress-wrap .progress-pct { font-family: var(--mono); font-size: 11px; color: var(--text2); width: 36px; text-align: right; flex-shrink: 0; }

/* ── Page header ─────────────────────────────────────────── */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title    { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 3px; }

/* ══════════════════════════════════════════════════════════
   SERVER LIST
   ══════════════════════════════════════════════════════════ */
.server-list { display: flex; flex-direction: column; gap: 10px; }
.server-row {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: border-color var(--t), transform var(--t);
  cursor: pointer; text-decoration: none; color: inherit;
}
.server-row:hover { border-color: var(--border2); transform: translateY(-1px); }
.server-row-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, rgba(59,123,255,.15), rgba(0,212,170,.1));
  border: 1px solid rgba(59,123,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.server-row-icon svg { width: 18px; height: 18px; stroke: var(--primary); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.server-row-info { flex: 1; min-width: 0; }
.server-row-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-row-ip   { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-top: 2px; }
.server-row-meta { display: flex; gap: 20px; flex-shrink: 0; }
.server-stat     { text-align: right; }
.server-stat-val { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.server-stat-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
.server-row-actions { display: flex; gap: 7px; flex-shrink: 0; }

/* ── Server detail ───────────────────────────────────────── */
.server-header {
  display: flex; align-items: flex-start; gap: 18px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.server-icon {
  width: 56px; height: 56px; border-radius: 15px;
  background: linear-gradient(135deg, rgba(59,123,255,.18), rgba(0,212,170,.12));
  border: 1px solid rgba(59,123,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.server-icon svg { width: 26px; height: 26px; stroke: var(--primary); fill: none; stroke-width: 1.6; stroke-linecap: round; }
.server-meta  { flex: 1; min-width: 200px; }
.server-name  { font-size: 20px; font-weight: 800; line-height: 1.2; }
.server-ip    { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-top: 4px; }
.server-tags  { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.server-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

/* Resource cards */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.resource-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.resource-label { font-size: 10.5px; color: var(--text3); text-transform: uppercase;
                  letter-spacing: .09em; margin-bottom: 8px; font-weight: 700; }
.resource-value { font-family: var(--mono); font-size: 18px; font-weight: 700;
                  margin-bottom: 8px; line-height: 1; }

/* Graphs */
.graphs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.graph-card  { background: var(--bg3); border: 1px solid var(--border);
               border-radius: var(--radius); padding: 16px; }
.graph-card img { width: 100%; height: auto; border-radius: 4px;
                  filter: brightness(.9) saturate(1.15) contrast(1.05); }
.graph-title { font-size: 11px; color: var(--text3); text-transform: uppercase;
               letter-spacing: .08em; margin-bottom: 10px; font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 20% 15%, rgba(59,123,255,.08) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(0,212,170,.06) 0%, transparent 100%);
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 36px 32px;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon { font-size: 38px; display: block; margin-bottom: 8px;
                  filter: drop-shadow(0 0 20px var(--accent)); }
.auth-logo-text { font-size: 22px; font-weight: 800; }
.auth-title    { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { font-size: 13.5px; color: var(--text2); margin-bottom: 26px; line-height: 1.5; }
.auth-footer   { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text2); }
.auth-divider  { display: flex; align-items: center; gap: 12px; margin: 18px 0;
                 color: var(--text3); font-size: 12px; }
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ══════════════════════════════════════════════════════════
   PLANS / ORDER
   ══════════════════════════════════════════════════════════ */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.plan-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  cursor: pointer; transition: all .2s var(--ease); position: relative;
}
.plan-card:hover   { border-color: rgba(59,123,255,.5); background: rgba(59,123,255,.04); transform: translateY(-2px); }
.plan-card.selected { border-color: var(--primary); background: rgba(59,123,255,.07); }
.plan-card.featured::before {
  content: 'Popular';
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 10px; border-radius: 10px; letter-spacing: .06em;
}
.plan-card.selected .plan-check { display: flex; }
.plan-check {
  display: none; position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px; background: var(--primary); border-radius: 50%;
  align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 800;
}
.plan-price { font-size: 26px; font-weight: 800; font-family: var(--mono); line-height: 1; }
.plan-price-sub { font-size: 13px; font-weight: 400; color: var(--text2); }
.plan-original  { font-size: 12px; color: var(--text3); text-decoration: line-through; margin-top: 2px; }
.plan-specs { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.plan-spec  {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text2);
}
.plan-spec svg { width: 13px; height: 13px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }

/* OS grid */
.os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.os-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 13px 14px;
  cursor: pointer; transition: all .15s; display: flex; gap: 10px; align-items: center;
}
.os-card:hover   { border-color: rgba(59,123,255,.4); }
.os-card.selected { border-color: var(--primary); background: rgba(59,123,255,.06); }
.os-icon { font-size: 22px; flex-shrink: 0; }
.os-name { font-size: 12.5px; font-weight: 600; }
.os-group { font-size: 10.5px; color: var(--text3); }

/* Payment cards */
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.payment-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 16px;
  cursor: pointer; transition: all .15s; text-align: center;
}
.payment-card:hover  { border-color: rgba(59,123,255,.4); }
.payment-card.selected { border-color: var(--primary); background: rgba(59,123,255,.07); }
.payment-logo { font-size: 32px; margin-bottom: 8px; display: block; line-height: 1; }
.payment-name { font-size: 14px; font-weight: 700; }
.payment-sub  { font-size: 11.5px; color: var(--text3); margin-top: 3px; }

/* Amount presets */
.amount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.amount-preset {
  padding: 9px 4px; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer;
  text-align: center; transition: all .15s; color: var(--text2);
  font-family: var(--sans);
}
.amount-preset:hover  { border-color: var(--primary); color: var(--primary); }
.amount-preset.active { border-color: var(--primary); background: rgba(59,123,255,.08); color: var(--primary); }

/* ══════════════════════════════════════════════════════════
   SUPPORT / TICKETS
   ══════════════════════════════════════════════════════════ */
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--t); text-decoration: none; color: inherit;
}
.ticket-row:hover { border-color: var(--border2); transform: translateX(3px); }
.ticket-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ticket-subject { flex: 1; font-weight: 600; font-size: 14px; min-width: 0;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta    { font-size: 12px; color: var(--text3); white-space: nowrap; }

/* Messages */
.messages { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.message  { display: flex; gap: 12px; }
.message.is-admin { flex-direction: row-reverse; }
.message-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
  background: var(--bg3); color: var(--text2); border: 1px solid var(--border);
}
.message.is-admin .message-avatar {
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none;
}
.message-content { flex: 1; max-width: 78%; }
.message.is-admin .message-content { display: flex; flex-direction: column; align-items: flex-end; }
.message-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 11.5px; color: var(--text3); }
.message.is-admin .message-meta { flex-direction: row-reverse; }
.message-author { font-weight: 600; color: var(--text2); font-size: 12.5px; }
.message-body {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 13.5px; line-height: 1.7;
}
.message.is-admin .message-body {
  background: rgba(59,123,255,.07); border-color: rgba(59,123,255,.2);
}

/* ══════════════════════════════════════════════════════════
   ADMIN
   ══════════════════════════════════════════════════════════ */
.admin-provider-box {
  background: linear-gradient(135deg, rgba(0,212,170,.08), rgba(59,123,255,.06));
  border: 1px solid rgba(0,212,170,.2);
  border-radius: var(--radius-lg); padding: 20px 22px;
  margin-bottom: 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.provider-balance-val { font-family: var(--mono); font-size: 32px; font-weight: 800; color: var(--accent); }
.provider-balance-lbl { font-size: 12px; color: var(--text2); margin-top: 3px; }

/* Plan edit table */
.plan-markup-row { display: flex; align-items: center; gap: 10px; }
.markup-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
  background: rgba(34,197,94,.1); color: var(--success);
}

/* ══════════════════════════════════════════════════════════
   REFERRAL
   ══════════════════════════════════════════════════════════ */
.referral-box {
  background: linear-gradient(135deg, rgba(167,139,250,.08), rgba(59,123,255,.06));
  border: 1px solid rgba(167,139,250,.2);
  border-radius: var(--radius-lg); padding: 22px;
}
.referral-link-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 10px 14px; margin-top: 12px;
}
.referral-link { font-family: var(--mono); font-size: 12.5px; flex: 1; color: var(--accent);
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════════════════════════════════════════════
   NOTIFICATIONS
   ══════════════════════════════════════════════════════════ */
.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all var(--t);
}
.notif-item.unread { border-left: 3px solid var(--primary); }
.notif-item:hover { border-color: var(--border2); }
.notif-emoji { font-size: 22px; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.notif-body  { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 14px; }
.notif-msg   { font-size: 12.5px; color: var(--text2); margin-top: 3px; line-height: 1.5; }
.notif-time  { font-size: 11px; color: var(--text3); margin-top: 5px; }

/* ══════════════════════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════════════════════ */
.d-flex    { display: flex; align-items: center; gap: 10px; }
.d-grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.d-grid-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.flex-1    { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-2     { gap: 8px; }
.gap-3     { gap: 16px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text2); }
.text-sm     { font-size: 12.5px; }
.text-xs     { font-size: 11px; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-accent  { color: var(--accent)  !important; }
.text-purple  { color: var(--purple)  !important; }
.text-gold    { color: var(--gold)    !important; }
.fw-bold { font-weight: 700; }
.separator { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.empty-state { padding: 52px 24px; text-align: center; }
.empty-state-icon { font-size: 48px; margin-bottom: 14px; line-height: 1; }
.empty-state-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.empty-state-text  { color: var(--text2); font-size: 13.5px; margin-bottom: 20px; }

/* Password reveal */
.pw-field { position: relative; }
.pw-field .form-input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
             background: none; border: none; cursor: pointer; color: var(--text3);
             padding: 4px; transition: color var(--t); }
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Copy button */
.copy-btn { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono);
            font-size: 12px; color: var(--text3); background: none; border: none; cursor: pointer;
            padding: 3px 6px; border-radius: 4px; transition: all var(--t); }
.copy-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }
.copy-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Toast notifications */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999;
                   display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.toast {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s var(--ease);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.status-dot.running  { background: var(--success); box-shadow: 0 0 6px var(--success); animation: pulse 2s infinite; }
.status-dot.stopped  { background: var(--danger); }
.status-dot.unknown  { background: var(--text3); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* Loading spinner */
.spinner { display: inline-block; width: 18px; height: 18px;
           border: 2px solid var(--border2); border-top-color: var(--primary);
           border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .d-grid-3 { grid-template-columns: 1fr 1fr; }
  .server-row-meta { gap: 12px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 272px; }

  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }

  .page-content { padding: 16px; }
  .topbar { padding: 0 14px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 18px; }

  .d-grid-2, .d-grid-3, .form-row { grid-template-columns: 1fr; gap: 14px; }

  .plans-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .plan-price { font-size: 20px; }

  .payment-grid { grid-template-columns: 1fr 1fr; }

  .amount-presets { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .amount-preset  { font-size: 12px; padding: 8px 4px; }

  .server-header  { gap: 14px; }
  .server-actions { width: 100%; }
  .server-row-meta { display: none; }

  .graphs-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr 1fr; }

  .auth-box { padding: 28px 20px; }

  .tabs { margin-left: -16px; margin-right: -16px; padding: 0 16px; }

  .card { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; }

  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  .admin-provider-box { flex-direction: column; gap: 12px; }

  .message-content { max-width: 90%; }

  .toast-container { bottom: 16px; right: 16px; left: 16px; max-width: none; }

  table { min-width: 560px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
  .payment-grid { grid-template-columns: 1fr; }
  .amount-presets { grid-template-columns: repeat(4, 1fr); }
  .resource-grid  { grid-template-columns: 1fr 1fr; }
  .btn-lg, .btn-xl { padding: 12px 20px; font-size: 14px; }
  .server-icon { width: 44px; height: 44px; }
  .server-name { font-size: 16px; }
  .os-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
  .amount-presets { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  form > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
/* Mobile responsive grid stacking */
@media (max-width: 640px) {
  .mobile-stack {
    grid-template-columns: 1fr !important;
  }
}
