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

:root {
  --bg: #0b0f19;
  --bg-subtle: #0f1523;
  --surface: #131b2e;
  --surface-card: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --ink: #f8fafc;
  --ink-muted: #94a3b8;
  --ink-dim: #64748b;
  --brand: #0d9488;
  --brand-glow: rgba(13, 148, 136, 0.25);
  --violet: #7c3aed;
  --violet-glow: rgba(124, 58, 237, 0.25);
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --blue: #38bdf8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

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

.hidden {
  display: none !important;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* DASHBOARD LAYOUT */
.dashboard-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

/* SIDEBAR NAVIGATION */
.sidebar-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: #090d16;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 20;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.side-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 6px 18px var(--violet-glow);
}

.side-brand-info strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.side-brand-info span {
  display: block;
  font-size: 11px;
  color: var(--ink-dim);
  font-weight: 700;
}

.sidebar-nav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 750;
  transition: all 0.18s ease;
}

.sidebar-nav nav a .nav-icon {
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  transition: color 0.18s ease;
}

.sidebar-nav nav a:hover {
  color: #ffffff;
  background: var(--surface-hover);
}

.sidebar-nav nav a:hover .nav-icon {
  color: #a78bfa;
}

.sidebar-nav nav a.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.22), rgba(124, 58, 237, 0.28));
  border: 1px solid rgba(124, 58, 237, 0.35);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
}

.sidebar-nav nav a.active .nav-icon {
  color: #a78bfa;
}

.side-footer-box {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.side-status-pill.online {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.08);
}

.side-status-pill.offline {
  color: var(--ink-dim);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.side-links-row {
  display: flex;
  gap: 8px;
}

.side-site-link, .side-logout-btn {
  flex: 1;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.2s ease;
}

.side-site-link {
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.side-site-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-logout-btn {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.side-logout-btn:hover {
  background: #ef4444;
  color: #fff;
}

/* MAIN CONTENT AREA */
.dashboard-main {
  min-width: 0;
  padding: 30px;
  background-color: var(--bg);
}

/* HEADER TOP */
.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

h1 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.subhead {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  min-height: 40px;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  font-size: 13.5px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--violet-glow);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* KPI CARDS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.kpi-card span {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-card strong {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 4px 0;
}

.kpi-card em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-dim);
}

.kpi-card.primary {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.35), rgba(124, 58, 237, 0.35));
  border-color: rgba(124, 58, 237, 0.4);
}
.kpi-card.primary strong { color: #38bdf8; }

.kpi-card.warning {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}
.kpi-card.warning strong { color: #fbbf24; }

/* PANELS */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

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

.panel-head h2 {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.health-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.health-list div {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-list span {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink-muted);
}

.health-list strong {
  font-size: 16px;
  font-weight: 900;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action-grid .btn {
  width: 100%;
  min-height: 38px;
  font-size: 12.5px;
}

.mini-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.mini-strip div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

/* TABLES */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
}

thead {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 14px 16px;
  font-size: 11.5px;
  font-weight: 900;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 750;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

td.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--ink-dim);
  font-weight: 700;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-muted);
}

.badge.active, .badge.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.new {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge.expired, .badge.blocked, .badge.cancelled {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* FORMS */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid label, label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-muted);
}

.form-grid label.full {
  grid-column: 1 / -1;
}

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--violet);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

select option {
  background: #111827;
  color: #ffffff;
}

button:not(.btn):not(.modal-close) {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--violet-glow);
  transition: all 0.2s ease;
}

button:not(.btn):not(.modal-close):hover {
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}

.full {
  grid-column: 1 / -1;
}

/* SWITCHES */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.switch span {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s;
  border-radius: 24px;
}

.switch span:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.switch input:checked + span {
  background-color: var(--emerald);
}

.switch input:checked + span:before {
  transform: translateX(20px);
}

/* NOTICES */
.notice {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 750;
}

.notice.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.notice.danger-note {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

/* HINTS */
.hint {
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 6px;
}

/* MODAL */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-panel {
  width: min(560px, 100%);
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

/* LOGIN PAGE */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.12), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(13, 148, 136, 0.12), transparent 40%),
    #090d16;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 38px 32px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.login-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  margin: 0 auto 6px;
  box-shadow: 0 10px 24px var(--violet-glow);
}

.login-card h1 {
  font-size: 22px;
  font-weight: 900;
}

.login-card .alert {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-nav {
    position: relative;
    height: auto;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

