:root {
  --bg: #071530;
  --surface: #0b1d3f;
  --surface2: #122752;
  --surface3: #18336a;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #0066FF;
  --text: #F6F9FF;
  --muted: #8fa3cc;
  --dim: #5c74a3;
  --accent: #0066FF;
  --cyan: #00C2FF;
  --orange: #FF8A00;
  --green: #10B981;
  --red: #EF4444;
  --purple: #8B5CF6;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-xs { font-size: 11px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

/* Login Screen */
.screen { min-height: 100vh; }
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 20%, rgba(0, 102, 255, 0.15) 0%, transparent 60%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.4);
}
.login-title { font-family: 'Poppins', sans-serif; font-size: 20px; font-weight: 700; color: var(--text); }
.login-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.alert-err {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red);
  color: #ff9999;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* Layout Main */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  color: #fff;
}
.brand-name { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 16px; letter-spacing: 0.5px; }
.brand-sub { color: var(--cyan); }
.server-tag {
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
.topbar-actions { display: flex; gap: 8px; }

.layout-main { display: flex; min-height: calc(100vh - 57px); }
.sidebar-nav {
  width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
  font-family: inherit;
}
.nav-tab:hover { background: var(--surface2); color: var(--text); }
.nav-tab.active { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3); }

.content-view { flex: 1; padding: 24px 32px; overflow-y: auto; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-family: 'Poppins', sans-serif; font-size: 20px; font-weight: 700; color: var(--text); }
.section-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--accent);
}
.stat-card.stat-success::before { background: var(--green); }
.stat-card.stat-warn::before { background: var(--orange); }
.stat-card.stat-cyan::before { background: var(--cyan); }
.stat-card.stat-purple::before { background: var(--purple); }

.stat-lbl { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.5px; }
.stat-val { font-size: 28px; font-weight: 800; font-family: 'Poppins', sans-serif; margin-top: 6px; color: var(--text); }

/* Card & Guide */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.quick-guide { padding-left: 20px; font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.quick-guide strong { color: var(--text); }

/* Forms & Inputs */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-input, .form-select, input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}
.form-input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; color: var(--muted); }
.checkbox-label input { width: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #0052cc; box-shadow: 0 4px 12px rgba(0, 102, 255, 0.35); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: var(--red); color: white; }

/* Filter Toolbar */
.filter-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-box { max-width: 320px; }

/* Tables */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.data-table th {
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge-active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-expired { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-suspended { background: rgba(255, 138, 0, 0.15); color: #fbbf24; }
.badge-plan { background: var(--surface2); border: 1px solid var(--border); color: var(--cyan); }
.key-code { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: #fff; letter-spacing: 0.5px; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}
.modal-wide { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: #fff; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Code Box */
.code-box {
  background: #040d1e;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--cyan);
}

/* Progress bar */
.progress-bar-bg { width: 100%; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width .2s; }

/* HTTP Badges */
.badge-get { background: rgba(16, 185, 129, 0.2); color: #34d399; font-weight: 700; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.badge-post { background: rgba(0, 102, 255, 0.2); color: #60a5fa; font-weight: 700; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.badge-put { background: rgba(255, 138, 0, 0.2); color: #fbbf24; font-weight: 700; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.badge-delete { background: rgba(239, 68, 68, 0.2); color: #f87171; font-weight: 700; padding: 2px 6px; border-radius: 4px; font-size: 11px; }

/* Documentation & API Spec */
.doc-section { margin-bottom: 24px; }
.doc-section h3 { font-family: 'Poppins', sans-serif; font-size: 16px; margin-bottom: 8px; color: var(--text); }
.doc-endpoint-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.doc-endpoint-url { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: #fff; }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.doc-code-block { position: relative; margin: 10px 0; }
.doc-code-block pre { background: #030a17; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #cbd5e1; line-height: 1.6; }
.btn-copy-code { position: absolute; top: 8px; right: 8px; padding: 3px 8px; font-size: 11px; background: rgba(255,255,255,0.08); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.btn-copy-code:hover { background: var(--accent); color: #fff; }

/* Input group */
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group input { flex: 1; }
