/* ============================================================
   Sistem Akademik Darul Ulum — Global Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:       #3b82f6; /* Modern Royal Blue */
  --primary-dark:  #1d4ed8;
  --primary-light: #60a5fa;
  --accent:        #10b981; /* Vibrant Emerald */
  --accent-dark:   #047857;
  --warning:       #f59e0b;
  --danger:        #f43f5e; /* Rose red */
  --danger-dark:   #e11d48;
  --info:          #06b6d4;

  --sidebar-bg:    #0f172a; /* Slate 900 */
  --sidebar-text:  #94a3b8;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active: #3b82f6;
  --sidebar-width: 260px;

  --bg:            #f8fafc; /* Modern slate light background */
  --bg-card:       #ffffff;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --shadow:        0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md:     0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg:     0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-premium: 0 10px 30px -5px rgba(0, 0, 0, 0.04), 0 1px 3px 0 rgba(0, 0, 0, 0.02);
  --radius:        16px; /* Smooth rounded corners */
  --radius-sm:     10px;
  --transition:    0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
  border: 1px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  animation: pulse 4s ease-in-out infinite alternate;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,.1) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  animation: pulse 5s ease-in-out infinite alternate-reverse;
}

@keyframes pulse {
  from { transform: scale(1); opacity: .6; }
  to   { transform: scale(1.2); opacity: 1; }
}

.login-card {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 10;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6);
  transition: transform var(--transition), box-shadow var(--transition);
}

.login-logo {
  text-align: center;
  margin-bottom: 2.25rem;
}

.login-logo .logo-icon {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.5);
  transform: rotate(-3deg);
  transition: transform var(--transition);
}

.login-logo:hover .logo-icon {
  transform: rotate(3deg) scale(1.05);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.login-logo p {
  font-size: .85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: .35rem;
}

.login-card .form-group { margin-bottom: 1.5rem; }

.login-card label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-card .input-wrap {
  position: relative;
}

.login-card .input-wrap .icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.1rem;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: .9rem 1rem .9rem 3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: .95rem;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  outline: none;
}

.login-card input[type="password"] {
  padding: .9rem 3rem .9rem 3rem;
}

.login-card .input-wrap .toggle-password {
  position: absolute;
  right: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color var(--transition), transform var(--transition);
  z-index: 2;
}

.login-card .input-wrap .toggle-password:hover {
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.login-card .input-wrap .toggle-password svg {
  width: 1.25rem;
  height: 1.25rem;
}

.login-card input::placeholder { color: rgba(255, 255, 255, 0.3); }

.login-card input:focus {
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.btn-login {
  width: 100%;
  padding: .95rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: .75rem;
  letter-spacing: .02em;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-login:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
}

.btn-login:active { transform: translateY(0); }

.login-alert {
  padding: .85rem 1.125rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: .875rem;
  font-weight: 600;
}

.login-alert.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fca5a5;
}

.login-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  box-shadow: 4px 0 20px rgba(0,0,0,.3);
  overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: .875rem;
}

.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-brand .brand-text h2 {
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand .brand-text span {
  font-size: .7rem;
  color: var(--sidebar-text);
}

.sidebar-user {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: .875rem;
  flex-shrink: 0;
}

.sidebar-user .user-info small {
  display: block;
  font-size: .65rem;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.sidebar-user .user-info strong {
  font-size: .8rem;
  color: rgba(255,255,255,.85);
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-label {
  font-size: .65rem;
  font-weight: 700;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .75rem 1.25rem .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  margin: 0.15rem 0.75rem;
  color: var(--sidebar-text);
  font-size: .85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
  cursor: grab;
  text-decoration: none;
}
.nav-item:active {
  cursor: grabbing;
}
.nav-item.dragging {
  opacity: 0.4;
  background: var(--sidebar-hover);
  border: 1px dashed var(--primary-light) !important;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,.95);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.02) 100%);
  color: var(--primary-light);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.nav-item.active::before {
  display: none;
}

.nav-item .nav-icon {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--sidebar-text);
  font-size: .85rem;
  padding: .65rem 1rem;
  margin: 0 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: #fff;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.btn-sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: .25rem;
  border-radius: 6px;
  transition: all var(--transition);
  display: none;
}

.btn-sidebar-toggle:hover {
  background: var(--bg);
  color: var(--text);
}

.page-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.breadcrumb {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
}

.breadcrumb a { color: var(--primary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.topbar-date {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: .4rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ---- Page Content ---- */
.content {
  padding: 1.5rem;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-body {
  padding: 1.25rem;
}

/* ---- Stats Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 90px; height: 90px;
  border-radius: 50%;
  opacity: .05;
  transform: translate(25px, -25px);
  background: currentColor;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card.blue:hover { border-color: rgba(59,130,246,.4); box-shadow: 0 15px 30px -10px rgba(59,130,246,.25); }
.stat-card.green:hover { border-color: rgba(16,185,129,.4); box-shadow: 0 15px 30px -10px rgba(16,185,129,.25); }
.stat-card.amber:hover { border-color: rgba(245,158,11,.4); box-shadow: 0 15px 30px -10px rgba(245,158,11,.25); }
.stat-card.red:hover { border-color: rgba(244,63,94,.4); box-shadow: 0 15px 30px -10px rgba(244,63,94,.25); }
.stat-card.purple:hover { border-color: rgba(139,92,246,.4); box-shadow: 0 15px 30px -10px rgba(139,92,246,.25); }
.stat-card.cyan:hover { border-color: rgba(6,182,212,.4); box-shadow: 0 15px 30px -10px rgba(6,182,212,.25); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.stat-card:hover .stat-icon {
  transform: scale(1.08);
}

.stat-icon.blue   { background: rgba(59,130,246,.12);  color: #3b82f6; }
.stat-icon.green  { background: rgba(16,185,129,.12);  color: #10b981; }
.stat-icon.amber  { background: rgba(245,158,11,.12);  color: #f59e0b; }
.stat-icon.red    { background: rgba(244,63,94,.12);   color: #f43f5e; }
.stat-icon.purple { background: rgba(139,92,246,.12);  color: #8b5cf6; }
.stat-icon.cyan   { background: rgba(6,182,212,.12);   color: #06b6d4; }

.stat-info { flex: 1; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: .25rem;
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---- Card with colored top border ---- */
.stat-card.blue   { border-top: 3.5px solid #3b82f6; }
.stat-card.green  { border-top: 3.5px solid #10b981; }
.stat-card.amber  { border-top: 3.5px solid #f59e0b; }
.stat-card.red    { border-top: 3.5px solid #f43f5e; }
.stat-card.purple { border-top: 3.5px solid #8b5cf6; }
.stat-card.cyan   { border-top: 3.5px solid #06b6d4; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .825rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,64,175,.3);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(30,64,175,.4); color: #fff; }

.btn-success {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.btn-success:hover { background: var(--accent-dark); box-shadow: 0 4px 12px rgba(16,185,129,.4); color: #fff; }

.btn-warning {
  background: var(--warning);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.btn-danger:hover { background: var(--danger-dark); color: #fff; }

.btn-info {
  background: var(--info);
  color: #fff;
}
.btn-info:hover { background: #0891b2; color: #fff; }

.btn-secondary {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: .35rem .75rem; font-size: .775rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.table thead {
  background: #f1f5f9;
  color: var(--text);
  border-bottom: 2px solid var(--border);
}

.table thead th {
  padding: 1rem;
  font-size: .725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border: none;
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.table tbody tr:hover { background: rgba(59, 130, 246, 0.04); }
.table tbody tr:last-child { border-bottom: none; }

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  color: var(--text);
}

.table .actions { white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center; }

/* ---- Table search & filter bar ---- */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-box .search-icon {
  position: absolute;
  left: .875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: .65rem .875rem .65rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}

.search-box input:focus {
  border-color: var(--primary-light);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}

.form-label .req { color: var(--danger); margin-left: .15rem; }

.form-control {
  width: 100%;
  padding: .7rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: all var(--transition);
  appearance: auto;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .35rem;
}

.form-error {
  font-size: .75rem;
  color: var(--danger);
  margin-top: .35rem;
}

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
}

.badge-success { background: rgba(16,185,129,.12);  color: #059669; }
.badge-danger  { background: rgba(239,68,68,.12);   color: #dc2626; }
.badge-warning { background: rgba(245,158,11,.12);  color: #d97706; }
.badge-info    { background: rgba(6,182,212,.12);   color: #0891b2; }
.badge-primary { background: rgba(59,130,246,.12);  color: #1d4ed8; }
.badge-gray    { background: rgba(100,116,139,.12); color: #475569; }
.badge-purple  { background: rgba(139,92,246,.12);  color: #7c3aed; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: .875rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  border: 1px solid transparent;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }

.alert-success {
  background: rgba(16,185,129,.08);
  border-color: rgba(16,185,129,.25);
  color: #065f46;
}

.alert-danger {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
  color: #991b1b;
}

.alert-warning {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.25);
  color: #92400e;
}

.alert-info {
  background: rgba(6,182,212,.08);
  border-color: rgba(6,182,212,.25);
  color: #164e63;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: .25rem;
  border-radius: 6px;
  transition: all var(--transition);
  line-height: 1;
}

.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.page-link {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
  text-decoration: none;
}

.page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.d-flex      { display: flex; }
.align-items-center { align-items: center; }
.justify-between    { justify-content: space-between; }
.gap-1       { gap: .25rem; }
.gap-2       { gap: .5rem; }
.gap-3       { gap: .75rem; }
.gap-4       { gap: 1rem; }
.flex-wrap   { flex-wrap: wrap; }
.flex-1      { flex: 1; }
.mt-1        { margin-top: .25rem; }
.mt-2        { margin-top: .5rem; }
.mt-3        { margin-top: .75rem; }
.mt-4        { margin-top: 1rem; }
.mb-3        { margin-bottom: .75rem; }
.mb-4        { margin-bottom: 1rem; }
.mb-5        { margin-bottom: 1.25rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: .8rem; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.w-100       { width: 100%; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ---- Avatar ---- */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: .8rem;
  flex-shrink: 0;
}

/* ---- Toast notification ---- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: .875rem 1.125rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  min-width: 280px;
  animation: slideIn .3s ease;
}

.toast.error { border-color: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---- Loading spinner ---- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* ---- Info row ---- */
.info-list { display: grid; gap: .75rem; }

.info-item {
  display: flex;
  gap: .75rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child { border-bottom: none; }

.info-item .info-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 150px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.info-item .info-value {
  font-size: .875rem;
  color: var(--text);
  font-weight: 500;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: .625rem 1.125rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============================================================
   DASHBOARD CHARTS AREA
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.quick-list { list-style: none; }

.quick-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

.quick-list li:last-child { border-bottom: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .btn-sidebar-toggle { display: block; }

  .stats-grid { grid-template-columns: 1fr; }

  .content { padding: 1rem; }

  .topbar { padding: .75rem 1rem; }

  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }

  .form-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar, .topbar, .btn, .table-toolbar { display: none !important; }
  .main-content { margin-left: 0; }
  .content { padding: 0; }
}
