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

:root {
  --bg: #090c14;
  --surface: #101626;
  --surface-hover: #161e33;
  --surface-raised: #182238;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --text: #f1f5f9;
  --text-muted: #8492a6;
  --text-dim: #556277;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  --accent-cyan: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: #818cf8;
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Header & Top Navigation */
header.top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(16, 22, 38, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

header.top .brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}
header.top .brand span.logo-badge {
  background: var(--primary-gradient);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

header.top nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

header.top nav a {
  color: var(--text-muted);
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
header.top nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}
header.top nav a.on {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

header.top form {
  margin-left: auto;
}

/* Main Container */
main {
  max-width: 1240px;
  margin: 32px auto;
  padding: 0 24px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: #fff;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: #e2e8f0;
}

/* Cards & Surface Paneling */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stat {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 6px 0 2px;
}
.muted {
  color: var(--text-muted);
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.02);
}
th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }

tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background-color 0.15s ease;
}
tbody tr:hover {
  background-color: var(--surface-hover);
}

/* Form Controls & Inputs */
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: #090d16;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
textarea {
  min-height: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
label > input, label > select, label > textarea {
  margin-top: 6px;
  color: var(--text);
  font-size: 14px;
}

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

/* Modern Buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
button:hover, .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
button:active, .btn:active {
  transform: translateY(0);
}

.primary {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.green {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.green:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.inline { display: inline; }
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Badges & Status Indicators */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.b-Active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.b-Expired, .b-Banned {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.b-NotStarted {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  margin-right: 8px;
}

/* Alerts */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert.err {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Code & Pre */
pre.msg {
  white-space: pre-wrap;
  background: #090d16;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}
code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #e2e8f0;
}

/* Login Page Styling */
.login-wrapper {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-card h1 {
  font-size: 22px;
  text-align: center;
  margin-bottom: 6px;
}
.login-card p.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 0;
  margin-bottom: 26px;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -6px;
  margin-bottom: 14px;
}
