:root {
  --brand-primary: #4338ca;
  --brand-primary-dark: #3730a3;
  --brand-accent: #06b6d4;
  --brand-dark: #111827;
  --sidebar-bg: #14163a;
  --sidebar-hover: #1f2158;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --surface: #ffffff;
  --bg-soft: #f4f5fb;
  --text-muted: #6b7280;
}

* { font-family: 'Inter', 'Segoe UI', sans-serif; }

body {
  background-color: var(--bg-soft);
  color: #1f2937;
}

/* ---------- LOGIN PAGE ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4338ca 100%);
  position: relative;
  overflow: hidden;
}

.login-wrapper::before,
.login-wrapper::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.login-wrapper::before { width: 420px; height: 420px; top: -120px; left: -120px; }
.login-wrapper::after { width: 300px; height: 300px; bottom: -80px; right: -60px; }

.login-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(17, 24, 39, 0.35);
  overflow: hidden;
  z-index: 1;
  max-width: 900px;
  width: 100%;
}

.login-brand-side {
  background: linear-gradient(160deg, var(--brand-primary), #1e1b4b);
  color: #fff;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand-side .logo-badge {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}

.login-form-side { padding: 50px 45px; }

.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(67, 56, 202, 0.15);
}

.btn-brand {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.btn-brand:hover { background: var(--brand-primary-dark); border-color: var(--brand-primary-dark); color:#fff; }

/* ---------- APP SHELL ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  min-width: 250px;
  background: var(--sidebar-bg);
  color: #dfe1f5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar .brand .logo-badge {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 18px;
}
.sidebar .brand-name { font-weight: 700; font-size: 0.95rem; color: #fff; line-height: 1.2; }
.sidebar .brand-tag { font-size: 0.72rem; color: #9ca3d8; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-nav .nav-link {
  color: #c7c9ec;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 4px;
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .15s ease;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, var(--brand-primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(67,56,202,0.4);
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
}

.main-content { flex: 1; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h5 { margin: 0; font-weight: 700; }

.page-body { padding: 26px 28px 40px; }

/* ---------- CARDS ---------- */
.stat-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(17,24,39,0.05);
  border: 1px solid #eef0f7;
  height: 100%;
}
.stat-card .stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  margin-bottom: 14px;
}
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; color: var(--brand-dark); }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.83rem; font-weight: 500; }

.bg-icon-indigo { background: linear-gradient(135deg,#6366f1,#4338ca); }
.bg-icon-green { background: linear-gradient(135deg,#22c55e,#15803d); }
.bg-icon-red { background: linear-gradient(135deg,#f87171,#b91c1c); }
.bg-icon-orange { background: linear-gradient(135deg,#fb923c,#c2410c); }
.bg-icon-cyan { background: linear-gradient(135deg,#22d3ee,#0e7490); }
.bg-icon-purple { background: linear-gradient(135deg,#c084fc,#7e22ce); }

.panel {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid #eef0f7;
  box-shadow: 0 2px 10px rgba(17,24,39,0.05);
  padding: 22px;
}
.panel-title { font-weight: 700; font-size: 1rem; margin-bottom: 16px; }

.table-modern thead th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  border-bottom: 2px solid #eef0f7;
  font-weight: 700;
}
.table-modern td { vertical-align: middle; font-size: 0.9rem; }
.table-modern tbody tr:hover { background: #f9fafc; }

.badge-soft-green { background: #dcfce7; color: #15803d; font-weight: 600; }
.badge-soft-red { background: #fee2e2; color: #b91c1c; font-weight: 600; }
.badge-soft-orange { background: #ffedd5; color: #c2410c; font-weight: 600; }
.badge-soft-indigo { background: #e0e7ff; color: #4338ca; font-weight: 600; }
.badge-soft-cyan { background: #cffafe; color: #0e7490; font-weight: 600; }

.btn-add {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 10px;
}
.btn-add:hover { background: var(--brand-primary-dark); color:#fff; }

.form-label { font-weight: 600; font-size: 0.85rem; color: #374151; }

.progress-thin { height: 8px; border-radius: 6px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 999; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .page-body { padding: 18px; }
}
