@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #08111f;
  --surface: #0f1c2e;
  --surface2: #172336;
  --surface3: #1e2d42;
  --border: #1f3050;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --cyan: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #e2e8f0;
  --muted: #64748b;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.nav {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  background: rgba(8,17,31,0.97);
  backdrop-filter: blur(12px);
  z-index: 200;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-light);
}
.nav-logo span { color: var(--cyan); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-balance {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--green);
}
.nav-user { color: var(--muted); font-size: 0.85rem; }
.nav-link {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface2); }

/* LAYOUT */
.layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  flex-shrink: 0;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.sidebar-item.active { background: var(--surface2); color: var(--accent-light); }
.sidebar-item .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 16px 14px 6px;
  font-weight: 600;
}

.content { flex: 1; padding: 28px; overflow-x: hidden; }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
}
.card-body { padding: 20px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; }
.stat-value.green { color: var(--green); }
.stat-value.blue  { color: var(--accent-light); }
.stat-value.cyan  { color: var(--cyan); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-ghost {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: 7px; }
.btn-full { width: 100%; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
}
.form-control:focus { border-color: var(--accent-light); }
.form-control option { background: var(--surface2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 12px 16px; vertical-align: middle; }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-green  { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--red); }
.badge-blue   { background: rgba(59,130,246,0.15); color: var(--accent-light); }

/* NUMBER DISPLAY */
.number-big {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text);
}

/* CODE */
.sms-code-big {
  font-family: var(--mono);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 10px;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* ALERT */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* TIMER */
.timer-wrap { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.timer-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width 1s linear; border-radius: 2px; }

/* AUTH PAGE */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 8px;
}
.auth-logo span { color: var(--cyan); }
.auth-subtitle { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 32px; }
.auth-tabs { display: flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 24px; }
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
}
.auth-tab.active { background: var(--accent); color: #fff; }

/* TABS inside content */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}
.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent-light); }

/* PAGE TITLE */
.page-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.page-title span { color: var(--muted); font-size: 0.85rem; font-weight: 400; margin-left: 8px; }

/* MODAL */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  margin: 20px;
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
</style>
