:root {
  --sidebar-w: 250px;
}

/* ========== ADMIN LAYOUT ========== */
.admin-body { display: flex; min-height: 100vh; background: #f0f4f8; }

/* ========== SIDEBAR ========== */
.admin-sidebar {
  width: var(--sidebar-w); background: #0d1526;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 200;
  transition: transform .25s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,.18);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #1a6ef5, #06b6d4);
  border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(26,110,245,.35);
}
.sidebar-logo-icon svg { width: 22px; height: 22px; }
.sidebar-logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-logo-main { font-size: 14px; font-weight: 700; color: #f1f5f9; }
.sidebar-logo-sub  { font-size: 11px; color: #475569; }
.sidebar-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }
.nav-section-label {
  font-size: 10.5px; font-weight: 600; color: #3d5166;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 14px 20px 5px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px; font-size: 13.5px; color: #7f9ab8;
  transition: all .15s ease; border-left: 3px solid transparent;
  position: relative;
}
.sidebar-link:hover { color: #e2e8f0; background: rgba(255,255,255,.05); }
.sidebar-link.active {
  color: #fff; background: rgba(26,110,245,.18);
  border-left-color: #1a6ef5;
}
.sidebar-link.active::before {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: #1a6ef5; border-radius: 2px;
}
.sidebar-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: inherit; opacity: .7;
}
.sidebar-icon svg { width: 18px; height: 18px; }
.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon { opacity: 1; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.1);
}
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, #1a6ef5, #06b6d4);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info { display: flex; flex-direction: column; line-height: 1.4; overflow: hidden; flex: 1; }
.sidebar-user-info span {
  font-size: 13px; color: #e2e8f0; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-info a { font-size: 12px; color: #475569; transition: color .15s; }
.sidebar-user-info a:hover { color: #ef4444; }

/* ========== ADMIN MAIN ========== */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  height: 58px; background: #fff;
  border-bottom: 1px solid #e8edf3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.sidebar-toggle-btn { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.sidebar-toggle-btn span { display: block; width: 20px; height: 2px; background: #334155; border-radius: 2px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-breadcrumb { font-size: 13px; color: #64748b; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-time { font-size: 13px; color: #94a3b8; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.topbar-time svg { opacity: .5; }
.admin-content { padding: 28px 32px; flex: 1; }

/* ========== WELCOME BANNER ========== */
.welcome-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, #0f172a 0%, #1e3a5f 60%, #0f2460 100%);
  border-radius: 14px; padding: 24px 28px; margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(15,23,42,.18);
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(26,110,245,.3) 0%, transparent 70%);
  border-radius: 50%;
}
.welcome-banner::after {
  content: ''; position: absolute; bottom: -30px; left: 30%;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(6,182,212,.2) 0%, transparent 70%);
  border-radius: 50%;
}
.welcome-left { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.welcome-avatar {
  width: 52px; height: 52px; border-radius: 12px;
  background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.25);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.welcome-info h2 { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.welcome-info p { font-size: 13px; color: #94a3b8; }
.welcome-right { position: relative; z-index: 1; }

/* ========== STATS GRID ========== */
.stats-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 20px 18px;
  display: flex; align-items: center; gap: 16px;
  border: 1px solid #e8edf3; position: relative; overflow: hidden;
  transition: all .2s ease; cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.09); }
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; border-radius: 0 0 12px 12px;
}
.stat-blue::after  { background: linear-gradient(90deg, #1a6ef5, #60a5fa); }
.stat-amber::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-red::after   { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-green::after { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-indigo::after{ background: linear-gradient(90deg, #6366f1, #a5b4fc); }

.stat-card-icon {
  width: 50px; height: 50px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-card-icon svg { width: 24px; height: 24px; }
.stat-blue  .stat-card-icon { background: #eff6ff; color: #1a6ef5; }
.stat-amber .stat-card-icon { background: #fffbeb; color: #d97706; }
.stat-red   .stat-card-icon { background: #fef2f2; color: #ef4444; }
.stat-green .stat-card-icon { background: #f0fdf4; color: #10b981; }
.stat-indigo.stat-card-icon { background: #eef2ff; color: #6366f1; }
.stat-indigo .stat-card-icon { background: #eef2ff; color: #6366f1; }

.stat-card-body { flex: 1; min-width: 0; }
.stat-card-num { font-size: 26px; font-weight: 800; color: #0f172a; line-height: 1; }
.stat-card-label { font-size: 12.5px; color: #94a3b8; margin-top: 5px; }
.stat-card-link {
  font-size: 12px; color: #94a3b8; white-space: nowrap;
  padding: 4px 8px; border-radius: 5px; background: #f8fafc;
  border: 1px solid #e2e8f0; transition: all .15s ease;
}
.stat-card-link:hover { color: #1a6ef5; background: #eff6ff; border-color: #bfdbfe; }

/* ========== QUICK ACTIONS ========== */
.quick-actions {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
  margin-bottom: 24px;
}
.quick-action-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e8edf3; border-radius: 10px;
  padding: 14px 16px; font-size: 13.5px; color: #334155; font-weight: 500;
  transition: all .18s ease; position: relative;
}
.quick-action-item:hover {
  border-color: #1a6ef5; box-shadow: 0 4px 16px rgba(26,110,245,.1);
  color: #1a6ef5; transform: translateY(-1px);
}
.quick-action-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.quick-action-icon svg { width: 18px; height: 18px; }
.qa-amber { background: #fffbeb; color: #d97706; }
.qa-red   { background: #fef2f2; color: #ef4444; }
.qa-blue  { background: #eff6ff; color: #1a6ef5; }
.qa-green { background: #f0fdf4; color: #10b981; }
.quick-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
}

/* ========== CARD ========== */
.card { background: #fff; border: 1px solid #e8edf3; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
}
.card-header-left { display: flex; align-items: center; }
.card-header h3 { font-size: 15px; font-weight: 700; color: #0f172a; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

/* ========== TABLE ========== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  background: #f8fafc; color: #64748b; font-weight: 600;
  padding: 11px 16px; text-align: left; font-size: 12px;
  letter-spacing: .3px; text-transform: uppercase;
  border-bottom: 1px solid #e8edf3;
}
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody td { padding: 11px 16px; color: #334155; vertical-align: middle; }
.table-id { font-family: monospace; font-size: 12px; color: #94a3b8; font-weight: 600; }
.text-muted { color: #94a3b8 !important; }

/* ========== EMPTY STATE ========== */
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; }
.empty-state p { color: #94a3b8; font-size: 14px; }

/* ========== BADGES ========== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success { background: #f0fdf4; color: #10b981; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-danger  { background: #fef2f2; color: #ef4444; }
.badge-pending { background: #f0f9ff; color: #0ea5e9; }
.badge-info    { background: #f5f3ff; color: #6366f1; }

/* ========== BUTTONS ========== */
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 4px; }

/* ========== SEARCH FORM ========== */
.search-form { display: flex; gap: 10px; }
.search-form .form-control { width: 240px; }

/* ========== DETAIL GRID ========== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-card { background: #fff; border: 1px solid #e8edf3; border-radius: 12px; padding: 24px; }
.detail-section-title { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f8fafc; font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: #94a3b8; flex-shrink: 0; margin-right: 16px; }

/* ========== PAGE HEADER ========== */
.admin-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.admin-page-header h2 { font-size: 20px; font-weight: 700; color: #0f172a; }
.admin-page-header p { font-size: 13px; color: #94a3b8; margin-top: 2px; }

/* ========== ADMIN LOGIN PAGE ========== */
.admin-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1526 0%, #0f2460 50%, #0d1e3f 100%);
  padding: 20px; position: relative; overflow: hidden;
}
.admin-login-page::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(26,110,245,.2) 0%, transparent 65%);
  border-radius: 50%;
}
.admin-login-page::after {
  content: ''; position: absolute; bottom: -80px; left: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(6,182,212,.15) 0%, transparent 65%);
  border-radius: 50%;
}
.admin-login-container { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.admin-login-card { background: #fff; border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.35); overflow: hidden; }
.admin-login-header { padding: 36px 36px 24px; text-align: center; border-bottom: 1px solid #f1f5f9; }
.admin-logo { margin-bottom: 18px; }
.admin-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1a6ef5, #06b6d4);
  border-radius: 14px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(26,110,245,.35);
}
.admin-logo-icon svg { width: 32px; height: 32px; }
.admin-login-header h2 { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.admin-login-header p { font-size: 13px; color: #94a3b8; }
.admin-login-card .alert, .admin-login-card form { padding: 0 36px; }
.admin-login-card form { padding-top: 24px; padding-bottom: 8px; }
.admin-login-card .alert { margin-top: 16px; }
.admin-login-footer { text-align: center; padding: 16px 36px 28px; font-size: 13px; color: #94a3b8; }
.admin-login-footer a { color: #1a6ef5; }

/* ========== MT UTILS ========== */
.mt-5 { margin-top: 20px; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3,1fr); }
  .quick-actions { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle-btn { display: flex; }
  .admin-content { padding: 20px 16px; }
}
@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .welcome-banner { flex-direction: column; align-items: flex-start; gap: 16px; }
}
