:root {
  --bg: #0b1020;
  --bg-soft: #121a31;
  --card: #ffffff;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}

body {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: #e2e8f0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(2,6,23,.28);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin-bottom: 2rem;
  padding: .75rem;
  border-radius: 1rem;
  background: rgba(255,255,255,.04);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: white;
}

.sidebar .nav-section-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  margin: 1.2rem .75rem .5rem;
}

.sidebar .nav-link {
  color: #cbd5e1;
  border-radius: .85rem;
  padding: .8rem .9rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .35rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: white;
  background: linear-gradient(135deg, rgba(79,70,229,.35), rgba(6,182,212,.18));
}

.content-wrap {
  margin-left: 270px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248,250,252,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148,163,184,.15);
}

.page-container {
  padding: 2rem;
}

.hero-card {
  background: radial-gradient(circle at top right, rgba(124,58,237,.22), transparent 36%), linear-gradient(135deg, #111827 0%, #312e81 55%, #0f766e 100%);
  color: white;
  border: 0;
  border-radius: 1.5rem;
  box-shadow: 0 18px 50px rgba(30,41,59,.16);
}

.card,
.table-card,
.form-card {
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 12px 34px rgba(15,23,42,.06);
}

.stat-card {
  background: white;
  border: 1px solid rgba(226,232,240,.85);
}

.stat-label {
  font-size: .82rem;
  letter-spacing: .02em;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.kicker {
  color: #c7d2fe;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  margin-bottom: .4rem;
}

.soft-badge {
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.badge-online, .badge-active { background: rgba(16,185,129,.12); color: #047857; }
.badge-offline, .badge-inactive { background: rgba(239,68,68,.12); color: #b91c1c; }
.badge-pending { background: rgba(245,158,11,.12); color: #b45309; }
.badge-error, .badge-blocked { background: rgba(239,68,68,.12); color: #b91c1c; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.35rem;
  margin: 0;
}

.section-header p {
  margin: .25rem 0 0;
  color: var(--muted);
}

.table thead th {
  color: #475569;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #e2e8f0;
}

.table td {
  vertical-align: middle;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(79,70,229,.3), transparent 28%),
    radial-gradient(circle at bottom right, rgba(6,182,212,.28), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0f766e 100%);
  color: white;
}

.login-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px rgba(2,6,23,.3);
  backdrop-filter: blur(18px);
}

.login-visual {
  border-radius: 1.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.12);
}

.login-input .form-control {
  background: rgba(255,255,255,.95);
  border-radius: .9rem;
  padding: .8rem .95rem;
  border: 0;
}

.btn-primary {
  border: 0;
  border-radius: .95rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 20px rgba(79,70,229,.22);
}

.btn-outline-light, .btn-outline-secondary {
  border-radius: .9rem;
}

.form-card .form-label {
  font-weight: 600;
  color: #334155;
}

.form-card .form-control,
.form-card .form-select,
.form-card textarea {
  border-radius: .9rem;
  padding: .8rem .9rem;
  border-color: #dbe3ef;
}

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

.quick-link {
  display: block;
  padding: 1rem;
  border-radius: 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
}

.quick-link:hover {
  transform: translateY(-2px);
  transition: .2s ease;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }
  .content-wrap {
    margin-left: 0;
  }
}
