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

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22263a;
  --border: #2e3350;
  --accent: #4f6ef7;
  --accent-hover: #3d5ce0;
  --text: #e8eaf6;
  --text2: #8b90b0;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

footer { margin-top: auto; }

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

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.page-center { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }

/* Card */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.card-sm { max-width: 440px; width: 100%; }

/* Nav */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 32px;
}
.nav-brand {
  display: inline-flex; align-items: baseline; gap: 0;
  text-decoration: none !important; line-height: 1;
}
.nav-brand .logo-v {
  font-size: 32px; font-weight: 900; font-style: italic;
  color: #ffffff;
  letter-spacing: -1px; line-height: 1;
}
.nav-brand .logo-domain {
  font-size: 14px; font-weight: 600; color: #e8eaf6; opacity: 0.9;
  letter-spacing: 0.5px;
  text-decoration: overline;
  text-decoration-color: #7c6ef7;
  text-decoration-thickness: 2px;
  padding-bottom: 1px;
}
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  color: var(--text2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg3); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
  transition: border-color 0.15s; outline: none;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text2); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* Alerts */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-info { background: rgba(79,110,247,0.12); border: 1px solid rgba(79,110,247,0.3); color: #a5b4fc; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 14px; color: var(--text2); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Badge */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-blue { background: rgba(79,110,247,0.15); color: var(--accent); }
.badge-gray { background: rgba(139,144,176,0.15); color: var(--text2); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 18px; font-size: 14px; color: var(--text2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-label { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 480px; width: 100%; }
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* Misc */
.text-muted { color: var(--text2); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.hidden { display: none !important; }
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bar */
.progress { background: var(--bg3); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }

/* Pagination */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 20px; }
.page-btn {
  padding: 6px 12px; border-radius: 6px; font-size: 13px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
