:root {
  --sidebar-width: 250px;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --bg: #f8fafc;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #4f46e5;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s;
}
.sidebar-brand {
  padding: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand i { color: var(--primary); }
.sidebar-nav { padding: 10px 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-nav a i { width: 20px; text-align: center; }

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

/* ===== TOPBAR ===== */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
}
.topbar-left h4 { font-size: 1.1rem; font-weight: 600; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.topbar-user .avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ===== CONTENT AREA ===== */
.content { padding: 25px 30px; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}
.card-header h5 { font-size: 1rem; font-weight: 600; }
.card-body { }

/* ===== STAT CARDS ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.stat-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}
.stat-card-icon.primary { background: var(--primary); }
.stat-card-icon.success { background: var(--success); }
.stat-card-icon.danger { background: var(--danger); }
.stat-card-icon.warning { background: var(--warning); }
.stat-card-icon.info { background: var(--info); }
.stat-card-info h3 { font-size: 1.5rem; font-weight: 700; }
.stat-card-info p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
table th { font-weight: 600; color: var(--text-muted); background: var(--bg); }
table tr:hover { background: #f1f5f9; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 0.9rem; color: var(--text); }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: auto; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #2563eb; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.bg-success { background: #d1fae5; color: #065f46; }
.bg-danger { background: #fee2e2; color: #991b1b; }
.bg-warning { background: #fef3c7; color: #92400e; }
.bg-info { background: #dbeafe; color: #1e40af; }
.bg-primary { background: #e0e7ff; color: #3730a3; }
.bg-secondary { background: #f1f5f9; color: #475569; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 5px; list-style: none; margin-top: 15px; }
.page-item { }
.page-link {
  display: block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}
.page-item.active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link:hover { background: var(--bg); }

/* ===== QUICK ACTIONS ===== */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

/* ===== SEARCH BAR ===== */
.search-bar { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.search-bar .form-control { max-width: 300px; }

/* ===== AUTH PAGES ===== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.auth-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.auth-box h2 { margin-bottom: 5px; font-size: 1.5rem; }
.auth-box p { color: var(--text-muted); margin-bottom: 25px; font-size: 0.9rem; }
.auth-box .form-group label { font-size: 0.85rem; }
.auth-links { text-align: center; margin-top: 20px; font-size: 0.9rem; }
.auth-links a { color: var(--primary); text-decoration: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .content { padding: 15px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 10px 15px; }
  .hamburger { display: block !important; }
}

.hamburger { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text); }

/* ===== MISC ===== */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-3 { margin-top: 15px; }
.mb-3 { margin-bottom: 15px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 576px) {
  .stat-cards { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
