/* ============================================================
   MAYELE ACADEMY — panel.css
   CodeRoot Technologies — Deep Blue & Gold Design System
   ============================================================ */

:root {
  --primary:      #0A1F44;
  --primary-light:#1a3a6e;
  --gold:         #D4AF37;
  --gold-light:   #f0d060;
  --bg:           #f4f6fb;
  --card-bg:      #ffffff;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --sidebar-w:    260px;
  --radius:       12px;
  --shadow:       0 2px 16px rgba(10,31,68,.08);
  --shadow-lg:    0 8px 40px rgba(10,31,68,.14);
  --transition:   0.22s ease;
}

/* ── Dark Mode ─────────────────────────────────────────── */
.dark-mode {
  --bg:       #0d1117;
  --card-bg:  #161b27;
  --text:     #e6edf3;
  --text-muted: #8b949e;
  --border:   #30363d;
  --shadow:   0 2px 16px rgba(0,0,0,.4);
}
.dark-mode body { background: var(--bg) !important; color: var(--text) !important; }
.dark-mode .card, .dark-mode .sidebar { background: var(--card-bg) !important; border-color: var(--border) !important; }
.dark-mode .table { color: var(--text); }
.dark-mode .table-striped>tbody>tr:nth-of-type(odd)>* { background-color: rgba(255,255,255,.03); }
.dark-mode input,.dark-mode select,.dark-mode textarea {
  background: #1e2430 !important; color: var(--text) !important; border-color: var(--border) !important;
}
.dark-mode .form-control,.dark-mode .form-select { background: #1e2430; color: var(--text); border-color: var(--border); }
.dark-mode .modal-content { background: var(--card-bg); color: var(--text); }
.dark-mode .dropdown-menu { background: var(--card-bg); border-color: var(--border); }
.dark-mode .dropdown-item { color: var(--text); }
.dark-mode .dropdown-item:hover { background: rgba(212,175,55,.1); }
.dark-mode .text-muted { color: var(--text-muted) !important; }

/* ── Global ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); padding: 0; display: flex; flex-direction: column; min-height: 100vh; }
.page-body { padding: 28px 30px; flex: 1; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 1000; overflow-y: auto;
  transition: transform var(--transition);
  box-shadow: 4px 0 24px rgba(0,0,0,.2);
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
  background: rgba(0,0,0,.1);
}
.sidebar-brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; }
.sidebar-brand-text .site-name {
  font-family: 'Playfair Display', serif;
  font-size: 19px; color: #fff; font-weight: 700; line-height: 1.1;
}
.sidebar-brand-text .site-role { font-size: 10px; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; opacity: 0.9; }
.sidebar-nav { padding: 20px 0; flex: 1; }
.nav-section-label {
  padding: 12px 20px 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255,255,255,.25);
}
.sidebar .nav-link {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 20px; color: rgba(255,255,255,.65);
  font-size: 14px; font-weight: 500; border-radius: 0;
  transition: all 0.2s ease; position: relative;
}
.sidebar .nav-link i, .sidebar .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar .nav-link:hover i, .sidebar .nav-link:hover svg { opacity: 1; }
.sidebar .nav-link.active {
  color: #fff; background: rgba(212,175,55,.12);
  border-left: 4px solid var(--gold);
}
.sidebar .nav-link.active i, .sidebar .nav-link.active svg { color: var(--gold); opacity: 1; }
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
}
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-user img { width: 38px; height: 38px; border-radius: 10px; border: 2px solid rgba(212,175,55,.3); object-fit: cover; }
.sidebar-user .u-name { font-size: 13px; color: #fff; font-weight: 600; }
.sidebar-user .u-role { font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 14px 30px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 900;
  box-shadow: var(--shadow);
}
.topbar-title { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--primary); font-weight: 700; }
.dark-mode .topbar-title { color: var(--gold); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  background: transparent; font-weight: 600; font-size: 15px; color: var(--text);
}
.card-body { padding: 22px; }

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: center; gap: 18px;
  color: #fff; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: -30%; right: -10%;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.stat-card .stat-icon { width: 52px; height: 52px; border-radius: 12px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .stat-icon svg { width: 26px; height: 26px; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; opacity: .85; letter-spacing: .5px; margin-top: 3px; }
.stat-primary  { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.stat-gold     { background: linear-gradient(135deg, #b8860b, var(--gold)); }
.stat-success  { background: linear-gradient(135deg, #1a7c4f, #22c55e); }
.stat-info     { background: linear-gradient(135deg, #1a5fb4, #3b82f6); }

/* ── Custom Gradients ───────────────────────────────────── */
.bg-grad-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important; color: #fff !important; }
.bg-grad-gold    { background: linear-gradient(135deg, #b8860b, var(--gold)) !important; color: #fff !important; }
.bg-grad-danger  { background: linear-gradient(135deg, #dc3545, #c82333) !important; color: #fff !important; }
.bg-grad-success { background: linear-gradient(135deg, #1a7c4f, #22c55e) !important; color: #fff !important; }

/* ── Transitions & Effects ──────────────────────────────── */
.hover-lift { transition: transform var(--transition), box-shadow var(--transition); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg) !important; }

/* ── Panel Components ───────────────────────────────────── */
.panel-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-title  { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary-custom {
  background: var(--primary); color: #fff; border: none;
  padding: 9px 22px; border-radius: 8px; font-weight: 500;
  transition: all var(--transition); cursor: pointer;
}
.btn-primary-custom:hover { background: var(--primary-light); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,31,68,.3); }
.btn-gold {
  background: var(--gold); color: var(--primary); border: none;
  padding: 9px 22px; border-radius: 8px; font-weight: 600;
  transition: all var(--transition); cursor: pointer;
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(212,175,55,.4); }
.btn { border-radius: 8px !important; font-weight: 500 !important; }

/* ── Tables ─────────────────────────────────────────────── */
.table { color: var(--text); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border); padding: 10px 14px; }
.table td { padding: 12px 14px; vertical-align: middle; border-color: var(--border); }
.table-hover tbody tr:hover { background: rgba(10,31,68,.03); }
.dark-mode .table-hover tbody tr:hover { background: rgba(255,255,255,.04); }

/* ── Badges ─────────────────────────────────────────────── */
.badge-pill { border-radius: 100px !important; font-size: 11px !important; padding: 4px 10px !important; font-weight: 600 !important; }
.status-active   { background: #dcfce7 !important; color: #166534 !important; }
.status-pending  { background: #fef9c3 !important; color: #854d0e !important; }
.status-inactive { background: #f1f5f9 !important; color: #64748b !important; }
.status-failed   { background: #fee2e2 !important; color: #991b1b !important; }
.dark-mode .status-active   { background: rgba(22,163,74,.2) !important; color: #4ade80 !important; }
.dark-mode .status-pending  { background: rgba(202,138,4,.2) !important; color: #fbbf24 !important; }
.dark-mode .status-failed   { background: rgba(220,38,38,.2) !important; color: #f87171 !important; }

/* ── Progress ───────────────────────────────────────────── */
.progress { height: 8px; border-radius: 100px; background: var(--border); }
.progress-bar { background: linear-gradient(90deg, var(--primary), var(--gold)); border-radius: 100px; }

/* ── Forms ──────────────────────────────────────────────── */
.form-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-control, .form-select {
  border-radius: 8px; border: 1px solid var(--border);
  padding: 9px 14px; font-size: 14px; background: var(--card-bg); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,31,68,.1); outline: none;
}
.dark-mode .form-control:focus, .dark-mode .form-select:focus { box-shadow: 0 0 0 3px rgba(212,175,55,.15); }

/* ── Avatar ─────────────────────────────────────────────── */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; }

/* ── Mobile ─────────────────────────────────────────────── */
.sidebar-toggle { display: none; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }
  .sidebar-overlay.show { display: block; }
  .sidebar-toggle { display: flex; background: none; border: none; color: var(--primary); cursor: pointer; }
  .topbar { padding: 12px 16px; }
  .page-body { padding: 18px 16px; }
}

/* ── Notification badge ─────────────────────────────────── */
.notif-badge { position: relative; }
.notif-badge .badge { position: absolute; top: -4px; right: -4px; font-size: 10px; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; padding: 0; }

/* ── Gold divider ───────────────────────────────────────── */
.gold-divider { height: 3px; background: linear-gradient(90deg, var(--gold), transparent); border: none; margin: 0; }

/* ── Page header ────────────────────────────────────────── */
.page-header { margin-bottom: 26px; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 26px; color: var(--text); margin: 0; }
.page-header p  { font-size: 14px; color: var(--text-muted); margin: 4px 0 0; }

/* ── Module type badges ─────────────────────────────────── */
.type-video { background: #dbeafe; color: #1e40af; }
.type-pdf   { background: #fee2e2; color: #991b1b; }
.type-text  { background: #f0fdf4; color: #166534; }
.dark-mode .type-video { background: rgba(30,64,175,.2); color: #93c5fd; }
.dark-mode .type-pdf   { background: rgba(153,27,27,.2); color: #fca5a5; }
.dark-mode .type-text  { background: rgba(22,101,52,.2);  color: #86efac; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state svg { width: 64px; height: 64px; color: var(--border); margin-bottom: 16px; }
.empty-state h5 { color: var(--text-muted); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; color: var(--text-muted); }
