:root {
  --bg-dark: #04142d;
  --surface-dark: #08264a;
  --surface-elevated: #0d325e;
  --primary: #087cfa;
  --cyan: #00e5f5;
  --teal: #00d9bc;
  --text-primary: #ffffff;
  --text-secondary: #9fb5cc;
  --border: #174578;
  --danger: #ff5c77;
  --danger-bg: #3a1222;
  --warning: #ffb84d;
  --warning-bg: #38280e;
  --success-bg: #073536;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(8, 124, 250, 0.22), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 229, 245, 0.16), transparent 40%),
    var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(8, 38, 74, 0.94);
  border: 1px solid rgba(0, 229, 245, 0.28);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.brand-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 10px;
}

.brand-logo {
  height: 32px;
  width: auto;
  margin-bottom: 10px;
}

.badge-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid rgba(0, 229, 245, 0.4);
  color: var(--cyan);
}

h1 {
  font-size: 22px;
  margin: 12px 0 6px;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
  font-weight: 700;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='url'] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus {
  border-color: var(--cyan);
}

.hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-gradient {
  background: linear-gradient(90deg, var(--primary), var(--cyan), var(--teal));
  color: var(--bg-dark);
}

.btn-outline {
  background: var(--surface-elevated);
  border: 1px solid rgba(0, 229, 245, 0.45);
  color: var(--cyan);
}

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(255, 92, 119, 0.5);
  color: #ffb3c0;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid rgba(255, 92, 119, 0.55);
  color: #ffb3c0;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(255, 184, 77, 0.55);
  color: #ffdfa6;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(0, 217, 188, 0.55);
  color: var(--teal);
}

.hidden {
  display: none !important;
}

.footer-links {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links a {
  color: var(--cyan);
  text-decoration: none;
}

/* ======================== ADMIN DASHBOARD ======================== */
.admin-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.admin-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(8, 38, 74, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand img {
  height: 28px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--cyan);
  margin-top: 4px;
}

.panel-card {
  background: rgba(8, 38, 74, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(23, 69, 120, 0.6);
}

.toggle-row:last-child {
  border-bottom: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #123156;
  border: 1px solid var(--border);
  border-radius: 34px;
  transition: 0.2s;
}

.slider:before {
  position: absolute;
  content: '';
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-color: var(--cyan);
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
  background-color: var(--bg-dark);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.inline-form > div {
  flex: 1 1 180px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(23, 69, 120, 0.55);
  vertical-align: middle;
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-active {
  background: var(--success-bg);
  color: var(--teal);
  border: 1px solid rgba(0, 217, 188, 0.4);
}

.status-disabled {
  background: var(--danger-bg);
  color: #ffb3c0;
  border: 1px solid rgba(255, 92, 119, 0.4);
}

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

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-dark);
  border: 1px dashed var(--cyan);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 24, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-dark);
  border: 1px solid rgba(0, 229, 245, 0.4);
  border-radius: 18px;
  padding: 22px;
}
