/* ============================================================
   SIAKAD TERPADU - SMP Islam Al-Muflihun
   Tema: Charcoal / Dark + Gold + Pearl (Selaras dengan Website)
   Typography: Inter (UI) & Playfair Display (Branding/Heading)
   ============================================================ */

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

:root {
  --charcoal-900:   #0f0f0f;
  --charcoal-800:   #1a1a1a;
  --charcoal-700:   #262626;
  --charcoal-600:   #383838;
  --primary:        #1a1a1a;
  --primary-light:  #2d2d2d;
  --primary-dark:   #0f0f0f;
  --gold:           #d4af37;
  --gold-light:     #f0d89e;
  --gold-dark:      #96741e;
  --pearl:          #fafaf8;
  --pearl-bg:       #f5f3ef;
  --success:        #16a34a;
  --warning:        #d97706;
  --danger:         #dc2626;
  --info:           #2563eb;
  --bg:             #f5f3ef;
  --bg-card:        #ffffff;
  --sidebar-w:      264px;
  --sidebar-bg:     #111111;
  --sidebar-text:   #cbd5e1;
  --sidebar-active: #d4af37;
  --topbar-h:       66px;
  --radius:         14px;
  --radius-sm:      9px;
  --shadow:         0 2px 16px rgba(15,15,15,0.06);
  --shadow-lg:      0 10px 30px rgba(15,15,15,0.12);
  --transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main:      'Inter', system-ui, sans-serif;
  --font-heading:   'Playfair Display', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: #1f2937;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--gold-dark); text-decoration: none; }
a:hover { color: var(--gold); }
h1,h2,h3,h4 { font-family: var(--font-heading); font-weight: 700; color: var(--charcoal-800); }
h5,h6 { font-family: var(--font-main); font-weight: 700; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #ede9e0; }
::-webkit-scrollbar-thumb { background: #c4b58b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

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

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #faf8f3 100%);
  border-right: 1px solid #e6dfd1;
  box-shadow: 4px 0 24px rgba(15, 15, 15, 0.04);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid #ebe5d8;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
}
.sidebar-brand .brand-logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #0f0f0f;
  font-family: var(--font-heading);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(212,175,55,0.28);
}
.sidebar-brand .brand-text h6 {
  color: #1a1a1a; font-family: var(--font-heading); font-size: 15px; font-weight: 700; margin: 0; line-height: 1.2;
}
.sidebar-brand .brand-text small {
  color: var(--gold-dark); font-size: 10px; font-weight: 700; letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(184,147,40,0.28) transparent;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--gold-dark);
  padding: 16px 20px 6px;
  text-transform: uppercase;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 16px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin: 2px 10px;
  border-radius: 9px;
}
.nav-item a i { font-size: 15px; width: 20px; text-align: center; color: #78716c; transition: var(--transition); }
.nav-item a:hover {
  background: rgba(212,175,55,0.12);
  color: #111111;
}
.nav-item a:hover i { color: var(--gold-dark); }
.nav-item a.active {
  background: linear-gradient(90deg, rgba(212,175,55,0.22), rgba(212,175,55,0.06));
  color: #111111;
  font-weight: 700;
  border-left: 3px solid var(--gold);
}
.nav-item a.active i { color: var(--gold-dark); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #ebe5d8;
  background: #f5f3ef;
}
.sidebar-footer .user-mini { display: flex; align-items: center; gap: 10px; }
.sidebar-footer .user-mini .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--charcoal-800);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-weight: 700; font-size: 14px; overflow: hidden;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.sidebar-footer .user-mini .avatar img { width:100%; height:100%; object-fit:cover; }
.sidebar-footer .user-mini .user-info h6 { color: #1a1a1a; font-size: 12px; font-weight: 700; margin: 0; }
.btn-logout {
  margin-left: auto;
  color: #64748b;
  font-size: 18px;
  transition: var(--transition);
  background: none; border: none; cursor: pointer;
}
.btn-logout:hover { color: #dc2626; }

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

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 998;
}
.sidebar-backdrop.show { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e7e2d8;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
}
.topbar .topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.btn-toggle-sidebar {
  background: none; border: none; font-size: 20px;
  color: #4b5563; cursor: pointer; padding: 6px; border-radius: 8px;
  transition: var(--transition); flex-shrink: 0;
}
.btn-toggle-sidebar:hover { background: var(--pearl-bg); color: var(--charcoal-900); }
.topbar-title { min-width: 0; }
.topbar-title h5 { font-family: var(--font-heading); font-size: 17px; font-weight: 700; color: var(--charcoal-800); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { font-size: 11px; color: #78716c; display: block; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--pearl-bg); border: 1px solid #e7e2d8; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #57534e; font-size: 16px; transition: var(--transition);
}
.topbar-icon-btn:hover { background: #ede9e0; color: var(--gold-dark); border-color: var(--gold); }
.topbar-icon-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px; border-radius: 10px;
  background: var(--pearl-bg); cursor: pointer; transition: var(--transition);
  border: 1px solid #e7e2d8;
}
.topbar-user:hover { background: #ede9e0; border-color: var(--gold); }
.topbar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; background: var(--charcoal-800);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-weight: 700; font-size: 13px;
  border: 2px solid var(--gold); flex-shrink: 0;
}
.topbar-user .avatar img { width:100%; height:100%; object-fit:cover; }
.topbar-user .user-name { font-size: 13px; font-weight: 600; color: var(--charcoal-800); }
.topbar-user .user-role { font-size: 11px; color: #78716c; }

.page-content { padding: 24px; flex: 1; min-width: 0; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 16px;
  margin-bottom: 22px;
}
.page-header > :first-child { min-width: 240px; flex: 1 1 280px; }
.page-header > div:last-child:not(:first-child),
.page-header > form {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 8px !important;
  flex: 0 1 auto;
  max-width: 100%;
}
.page-header > div:last-child:not(:first-child):has(form) {
  background: var(--bg-card);
  border: 1px solid #e6e1d6;
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 2px 10px rgba(15, 15, 15, 0.04);
}
.page-header form.d-flex {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0;
}
.page-header .form-control-custom,
.page-header .form-select-custom,
.page-header .form-control,
.page-header .form-select,
form.d-flex > .form-control-custom,
form.d-flex > .form-select-custom,
.d-flex > .form-control-custom {
  width: auto !important;
  min-width: 140px;
  max-width: 220px;
  height: 36px !important;
  padding: 5px 11px !important;
  font-size: 13px !important;
  flex: 0 1 auto !important;
}
.page-header .btn,
.page-header .btn-primary-custom,
.page-header .btn-gold,
form.d-flex > .btn,
form.d-flex > .btn-primary-custom {
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  padding: 0 14px !important;
  font-size: 13px !important;
  white-space: nowrap;
  align-self: center !important;
  flex: 0 0 auto !important;
  line-height: 1.2;
}
.page-header h4 { font-size: 21px; font-weight: 700; color: var(--charcoal-900); margin: 0 0 2px; line-height: 1.3; }
.page-header .breadcrumb { font-size: 12px; margin-bottom: 0; }

/* ============================================================
   STAT CARDS & CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid #ebe6dc;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  height: 100%;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(212,175,55,0.4); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--clr1), var(--clr2));
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
  background: rgba(var(--clr-rgb), 0.12);
  color: var(--clr1);
}
.stat-card .stat-value {
  font-size: 26px; font-weight: 800;
  font-family: var(--font-heading);
  color: var(--charcoal-900); margin-bottom: 2px; line-height: 1.2;
}
.stat-card .stat-label { font-size: 12.5px; color: #78716c; font-weight: 500; }
.stat-card .stat-change { font-size: 11px; font-weight: 600; margin-top: 8px; }
.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }

.sc-blue   { --clr1:#1a1a1a; --clr2:#d4af37; --clr-rgb:26,26,26; }
.sc-gold   { --clr1:#b89328; --clr2:#f0d89e; --clr-rgb:212,175,55; }
.sc-green  { --clr1:#16a34a; --clr2:#4ade80; --clr-rgb:22,163,74; }
.sc-red    { --clr1:#dc2626; --clr2:#f87171; --clr-rgb:220,38,38; }
.sc-purple { --clr1:#7c3aed; --clr2:#a78bfa; --clr-rgb:124,58,237; }
.sc-teal   { --clr1:#0d9488; --clr2:#2dd4bf; --clr-rgb:13,148,136; }

.card-custom {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #ebe6dc;
  overflow: hidden;
}
.card-custom > h5,
.card-custom > h6 {
  padding: 16px 20px 0;
}
.card-custom > .d-flex.justify-content-between {
  padding: 16px 20px 8px;
}
.card-header-custom {
  padding: 14px 20px;
  border-bottom: 1px solid #f1ede4;
  background: #faf9f6;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.card-header-custom h6 {
  font-size: 14px; font-weight: 700; color: var(--charcoal-800); margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.card-header-custom h6 i { color: var(--gold-dark); }
.card-body-custom { padding: 20px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-custom { width: 100%; border-collapse: collapse; }
.table-custom thead th {
  background: #1a1a1a;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 2px solid var(--gold);
  white-space: nowrap;
}
.table-custom tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1ede4;
  font-size: 13.5px;
  color: #374151;
  vertical-align: middle;
}
.table-custom tbody tr:hover { background: #faf8f3; }
.table-custom tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BUTTONS & BADGES
   ============================================================ */
.badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }

.btn-primary-custom {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  color: var(--gold-light); border: 1px solid rgba(212,175,55,0.4); border-radius: 9px;
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary-custom:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(15,15,15,0.25);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0f0f0f; border: none; border-radius: 9px;
  padding: 8px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-gold:hover { transform: translateY(-1px); color: #000; box-shadow: 0 4px 14px rgba(212,175,55,0.38); }

/* ============================================================
   COMPONENTS (AVATAR, PROGRESS, HEATMAP, AI, QUICK ACCESS)
   ============================================================ */
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #e7e2d8; }
.avatar-md { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }

.progress-custom { height: 8px; border-radius: 4px; background: #ede9e0; overflow: hidden; }
.progress-custom .progress-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

.heatmap-cell { padding: 8px 12px !important; text-align: center; font-weight: 700; font-size: 12.5px; border-radius: 6px; }
.hm-high   { background: #dcfce7; color: #15803d; }
.hm-medium { background: #fef3c7; color: #b45309; }
.hm-low    { background: #fee2e2; color: #b91c1c; }
.hm-empty  { background: #f3f4f6; color: #9ca3af; }

.form-control-custom,
.form-select-custom {
  width: 100%;
  height: 40px;
  padding: 8px 13px;
  border: 1.5px solid #e5e0d5; border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: var(--font-main);
  transition: var(--transition); background: #fff; color: #1f2937;
}
textarea.form-control-custom { height: auto; min-height: 80px; }
.form-control-custom:focus,
.form-select-custom:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }

/* Executive Laporan Tab Navigation */
.lap-nav-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  background: var(--pearl-bg);
  border: 1px solid #e5e0d5;
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 18px;
}
.lap-nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: #57534e;
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lap-nav-pill i { font-size: 14px; color: var(--gold-dark); flex-shrink: 0; }
.lap-nav-pill:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--charcoal-900);
  border-color: rgba(212, 175, 55, 0.35);
}
.lap-nav-pill.active {
  background: linear-gradient(135deg, #161616, #262626);
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 4px 12px rgba(15, 15, 15, 0.16);
}
.lap-nav-pill.active i { color: var(--gold); }
@media (max-width: 1199.98px) {
  .lap-nav-track { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

.att-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1ede4; gap: 12px; }
.att-row:last-child { border-bottom: none; }
.att-row .kelas-name { font-weight: 600; font-size: 13px; min-width: 70px; }

.ai-card {
  background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  height: 100%;
}
.ai-card h6 { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 12px; }
.ai-insight { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.ai-insight:last-child { border-bottom: none; }
.ai-insight .ai-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.ai-insight p { font-size: 12px; color: rgba(255,255,255,0.88); margin: 0; }
.ai-insight span { font-size: 10px; color: rgba(212,175,55,0.75); }

.quick-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 10px; border-radius: var(--radius);
  background: #faf9f6; border: 1px solid #ebe6dc;
  cursor: pointer; transition: var(--transition);
  text-align: center; min-height: 88px;
  color: var(--charcoal-800); text-decoration: none;
}
.quick-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: #fff; border-color: var(--gold); color: var(--charcoal-900); }
.quick-btn i { font-size: 22px; }
.quick-btn span { font-size: 11.5px; font-weight: 600; }

/* ============================================================
   LOGIN PAGE (Charcoal & Gold)
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 55%, #0f0f0f 100%);
  position: relative;
  overflow: hidden;
}
.login-left {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; padding: 60px; position: relative;
}
.login-brand { text-align: center; margin-bottom: 42px; }
.login-brand .logo-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 800; color: #0f0f0f;
  margin: 0 auto 18px;
  box-shadow: 0 8px 32px rgba(212,175,55,0.35);
  font-family: var(--font-heading);
}
.login-brand h2 { color: #fff; font-size: 30px; font-weight: 700; margin-bottom: 4px; }
.login-brand p { color: var(--gold); font-size: 14px; font-weight: 500; letter-spacing: 0.8px; }
.login-features { width: 100%; max-width: 410px; }
.feature-item {
  display: flex; align-items: center; gap: 16px;
  padding: 15px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,55,0.16);
  margin-bottom: 12px;
}
.feature-item .fi-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(212,175,55,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--gold); flex-shrink: 0;
}
.feature-item h6 { color: #fff; font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.feature-item p { color: rgba(255,255,255,0.55); font-size: 11px; margin: 0; }

.login-right {
  width: 470px;
  background: #fafaf8;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
}
.login-box { width: 100%; max-width: 370px; }
.login-box h3 { font-size: 26px; font-weight: 700; color: var(--charcoal-900); margin-bottom: 4px; }
.login-box p { color: #78716c; font-size: 13px; margin-bottom: 28px; }
.input-group-custom { position: relative; margin-bottom: 16px; }
.input-group-custom label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.input-group-custom .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 16px; margin-top: 11px; }
.input-group-custom input {
  width: 100%; padding: 11px 14px 11px 42px;
  border: 1.5px solid #e5e0d5; border-radius: 10px;
  font-size: 14px; transition: var(--transition); background: #fff;
}
.input-group-custom input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  color: var(--gold-light); border: 1px solid var(--gold); border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: var(--transition); margin-top: 8px;
}
.btn-login:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 8px 20px rgba(15,15,15,0.25); }
.login-info-box {
  background: #f5f3ef; border: 1px solid #e5e0d5;
  border-radius: 10px; padding: 13px 16px; margin-top: 20px;
  font-size: 12px; color: #57534e;
}

.alert-custom { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.alert-custom-danger { background: #fef2f2; border-left: 3px solid var(--danger); color: #991b1b; }

@media (min-width: 1025px) {
  .sidebar.collapsed { transform: translateX(-100%); }
  .sidebar.collapsed ~ .main-content { margin-left: 0; width: 100%; }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 12px 0 36px rgba(0,0,0,0.4); }
  .main-content { margin-left: 0; width: 100%; }
  .login-left { display: none; }
  .login-right { width: 100%; }
}

@media (max-width: 767.98px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-title h5 { font-size: 15px; }
  .page-content { padding: 14px; }
  .page-header { gap: 10px; margin-bottom: 16px; }
  .page-header h4 { font-size: 18px; }
  .page-header > div:last-child:not(:first-child),
  .page-header > form { width: 100%; justify-content: flex-start; }
  .page-header .form-control-custom,
  .page-header .form-control,
  .page-header .form-select { flex: 1 1 140px; max-width: none; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 21px; }
  .card-header-custom { padding: 12px 14px; }
  .card-body-custom { padding: 14px; }
  .table-custom thead th, .table-custom tbody td { padding: 10px 12px; font-size: 12.5px; }
}

@media print {
  .sidebar, .sidebar-backdrop, .topbar, .btn, .breadcrumb, .page-header .btn, .page-header a, .page-header button { display: none !important; }
  .main-content { margin-left: 0; width: 100%; }
  .page-content { padding: 0; }
}

/* ============================================================
   PROFESSIONAL DARK MODE (Obsidian Charcoal & Warm Gold)
   ============================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg:             #0b0e14;
  --bg-card:        #141923;
  --pearl:          #141923;
  --pearl-bg:       #1b2230;
  --charcoal-900:   #f8fafc;
  --charcoal-800:   #f1f5f9;
  --shadow:         0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg:      0 12px 34px rgba(0, 0, 0, 0.52);
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: #e2e8f0;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 { color: #f8fafc; }

html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f131b; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--gold); }

html[data-theme="dark"] .topbar {
  background: rgba(15, 19, 28, 0.90);
  border-bottom-color: rgba(212, 175, 55, 0.2);
}
html[data-theme="dark"] .btn-toggle-sidebar { color: #cbd5e1; }
html[data-theme="dark"] .btn-toggle-sidebar:hover { background: #1e2636; color: var(--gold); }
html[data-theme="dark"] .topbar-title h5 { color: #f8fafc; }
html[data-theme="dark"] .topbar-title small { color: #94a3b8; }

html[data-theme="dark"] .topbar-icon-btn,
html[data-theme="dark"] .topbar-user {
  background: #1a2130;
  border-color: #2a3447;
  color: #e2e8f0;
}
html[data-theme="dark"] .topbar-icon-btn:hover,
html[data-theme="dark"] .topbar-user:hover {
  background: #222b3d;
  border-color: var(--gold);
  color: var(--gold-light);
}
html[data-theme="dark"] .topbar-user .user-name { color: #f8fafc; }
html[data-theme="dark"] .topbar-user .user-role { color: #94a3b8; }

html[data-theme="dark"] .breadcrumb-item,
html[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }
html[data-theme="dark"] .breadcrumb-item.active { color: var(--gold-light); }

html[data-theme="dark"] .stat-card {
  background: var(--bg-card);
  border-color: #242e40;
}
html[data-theme="dark"] .stat-card:hover { border-color: rgba(212,175,55,0.45); }
html[data-theme="dark"] .stat-card .stat-value { color: #f8fafc; }
html[data-theme="dark"] .stat-card .stat-label { color: #94a3b8; }
html[data-theme="dark"] .sc-blue { --clr1:#d4af37; --clr2:#f0d89e; --clr-rgb:212,175,55; }

html[data-theme="dark"] .card-custom {
  background: var(--bg-card);
  border-color: #242e40;
}
html[data-theme="dark"] .card-header-custom {
  background: #181f2c;
  border-bottom-color: #242e40;
}
html[data-theme="dark"] .card-header-custom h6 { color: #f1f5f9; }
html[data-theme="dark"] .card-header-custom h6 i { color: var(--gold); }

html[data-theme="dark"] .table-custom thead th {
  background: #0d1118;
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}
html[data-theme="dark"] .table-custom tbody td {
  color: #e2e8f0;
  border-bottom-color: #202838;
}
html[data-theme="dark"] .table-custom tbody tr:hover { background: #1a2232; }
html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-border-color: #242e40;
  --bs-table-hover-bg: #1a2232;
  --bs-table-hover-color: #f8fafc;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-control-custom,
html[data-theme="dark"] .form-select-custom,
html[data-theme="dark"] .input-group-text {
  background-color: #0f141d !important;
  border-color: #2a3548 !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .form-control-custom::placeholder { color: #64748b; }
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .form-control-custom:focus,
html[data-theme="dark"] .form-select-custom:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(212,175,55,0.2) !important;
}
html[data-theme="dark"] .page-header > div:last-child:not(:first-child):has(form) {
  background: var(--bg-card);
  border-color: #263042;
}
html[data-theme="dark"] .lap-nav-track {
  background: #0f141d;
  border-color: #263042;
}
html[data-theme="dark"] .lap-nav-pill { color: #94a3b8; }
html[data-theme="dark"] .lap-nav-pill i { color: var(--gold); }
html[data-theme="dark"] .lap-nav-pill:hover {
  background: #1a2232;
  color: #f8fafc;
}
html[data-theme="dark"] .lap-nav-pill.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0f0f0f;
  border-color: var(--gold);
}
html[data-theme="dark"] .lap-nav-pill.active i { color: #0f0f0f; }

html[data-theme="dark"] .nav-tabs { border-bottom-color: #263042; }
html[data-theme="dark"] .nav-tabs .nav-link { color: #94a3b8; }
html[data-theme="dark"] .nav-tabs .nav-link:hover { border-color: #263042; color: #f8fafc; }
html[data-theme="dark"] .nav-tabs .nav-link.active {
  background-color: #141923;
  border-color: #263042 #263042 #141923;
  color: var(--gold-light);
}

html[data-theme="dark"] .quick-btn {
  background: #181f2c;
  border-color: #252f42;
  color: #e2e8f0;
}
html[data-theme="dark"] .quick-btn:hover {
  background: #1f2838;
  border-color: var(--gold);
  color: var(--gold-light);
}
html[data-theme="dark"] .att-row { border-bottom-color: #202838; }
html[data-theme="dark"] .progress-custom { background: #1e2636; }
html[data-theme="dark"] .hm-empty { background: #1c2433; color: #94a3b8; }

html[data-theme="dark"] .bg-white { background-color: #141923 !important; color: #e2e8f0; }
html[data-theme="dark"] .bg-light { background-color: #1a2130 !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .border { border-color: #263042 !important; }
html[data-theme="dark"] .text-dark:not(.badge):not(.btn-warning):not(.bg-warning):not(.btn-gold) { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-muted { color: #94a3b8 !important; }
html[data-theme="dark"] .btn-outline-dark { color: #e2e8f0; border-color: #3a465e; }
html[data-theme="dark"] .btn-outline-dark:hover { background: #273247; color: var(--gold-light); border-color: var(--gold); }
html[data-theme="dark"] .btn-outline-secondary { color: #cbd5e1; border-color: #3a465e; }
html[data-theme="dark"] .btn-outline-secondary:hover { background: #273247; color: #fff; }
html[data-theme="dark"] .alert-light { background-color: #18202e; border-color: #2a3447; color: #cbd5e1; }

html[data-theme="dark"] .dropdown-menu {
  background-color: #161c27;
  border-color: #293347;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
html[data-theme="dark"] .dropdown-item { color: #e2e8f0; }
html[data-theme="dark"] .dropdown-item:hover { background-color: #20293a; color: var(--gold-light); }
html[data-theme="dark"] .dropdown-divider { border-top-color: #293347; }

html[data-theme="dark"] .page-link { background-color: #141923; border-color: #263042; color: #e2e8f0; }
html[data-theme="dark"] .page-item.active .page-link { background-color: var(--gold); border-color: var(--gold); color: #111; }

html[data-theme="dark"] .modal-content { background-color: #141923; color: #e2e8f0; border-color: rgba(212,175,55,0.28); }
html[data-theme="dark"] .modal-body { background-color: #0f141d !important; }
html[data-theme="dark"] .modal-footer { background-color: #141923 !important; border-top-color: #263042 !important; }
html[data-theme="dark"] .kes-panel { background: #161c27; border-color: #263042; }
html[data-theme="dark"] .kes-lbl { color: #94a3b8; }
html[data-theme="dark"] .tpl-pel-btn { background: #1a2130; border-color: #2c374c; color: #e2e8f0; }
html[data-theme="dark"] .tpl-pel-btn:hover { background: #232d40; border-color: var(--gold); color: #fff; }
html[data-theme="dark"] .tpl-pel-btn.active { background: var(--gold); border-color: var(--gold); color: #111111; }
html[data-theme="dark"] .tpl-pel-btn .tpl-kat { background: #0f141d; color: #cbd5e1; }
html[data-theme="dark"] .tpl-pel-btn.active .tpl-kat { background: #111111; color: #f0d89e; }

html[data-theme="dark"] #siswaDetailPopupModal #sdpTabs { background: #141923; border-color: #263042; }
html[data-theme="dark"] #siswaDetailPopupModal #sdpTabs .nav-link { color: #94a3b8; }
html[data-theme="dark"] #siswaDetailPopupModal #sdpTabs .nav-link:hover { background: #1e2636; color: #fff; }
html[data-theme="dark"] #siswaDetailPopupModal #sdpTabs .nav-link.active { background: var(--gold); color: #111111; }
html[data-theme="dark"] #siswaDetailPopupModal .sdp-case-card,
html[data-theme="dark"] #siswaDetailPopupModal .sdp-pres-card { background: #161c27; border-color: #263042; }
html[data-theme="dark"] #siswaDetailPopupModal .sdp-info-box { background: #161c27; border-color: #263042; color: #cbd5e1; }
html[data-theme="dark"] #siswaDetailPopupModal .sdp-err-box { background: rgba(220,38,38,.15); border-color: rgba(220,38,38,.4); color: #fca5a5; }
html[data-theme="dark"] .btn-dark.text-warning { background-color: #1f2838; border-color: var(--gold); color: var(--gold-light) !important; }
html[data-theme="dark"] .badge.bg-light { background-color: #1f2838 !important; color: #cbd5e1 !important; border: 1px solid #2e3b52; }
html[data-theme="dark"] [style*="background:#eff6ff"] { background: rgba(37,99,235,0.16) !important; border-color: rgba(59,130,246,0.35) !important; color: #93c5fd !important; }
html[data-theme="dark"] [style*="background:#f1f5f9"] { background: #1f2838 !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .border-bottom { border-bottom-color: #263042 !important; }
html[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #121620 0%, #0b0e14 100%);
  border-right-color: rgba(212,175,55,0.2);
  box-shadow: 4px 0 28px rgba(0,0,0,0.45);
}
html[data-theme="dark"] .sidebar-brand { border-bottom-color: rgba(212,175,55,0.16); }
html[data-theme="dark"] .sidebar-brand .brand-text h6 { color: #ffffff; }
html[data-theme="dark"] .sidebar-brand .brand-text small { color: var(--gold); }
html[data-theme="dark"] .nav-section-label { color: rgba(212,175,55,0.62); }
html[data-theme="dark"] .nav-item a { color: #b8bec8; }
html[data-theme="dark"] .nav-item a i { color: #8c95a4; }
html[data-theme="dark"] .nav-item a:hover { background: rgba(212,175,55,0.1); color: #ffffff; }
html[data-theme="dark"] .nav-item a:hover i { color: var(--gold-light); }
html[data-theme="dark"] .nav-item a.active {
  background: linear-gradient(90deg, rgba(212,175,55,0.22), rgba(212,175,55,0.06));
  color: var(--gold-light);
  border-left-color: var(--gold);
}
html[data-theme="dark"] .nav-item a.active i { color: var(--gold); }
html[data-theme="dark"] .sidebar-footer { background: rgba(0,0,0,0.28); border-top-color: rgba(212,175,55,0.16); }
html[data-theme="dark"] .sidebar-footer .user-mini .avatar { background: #1e2636; }
html[data-theme="dark"] .sidebar-footer .user-mini .user-info h6 { color: #f8fafc; }
html[data-theme="dark"] .btn-logout { color: rgba(255,255,255,0.5); }
html[data-theme="dark"] .btn-logout:hover { color: #f87171; }
html[data-theme="dark"] .login-right { background: #141923; color: #e2e8f0; }
html[data-theme="dark"] .login-box h3 { color: #f8fafc; }
html[data-theme="dark"] .login-box p { color: #94a3b8; }
html[data-theme="dark"] .input-group-custom label { color: #cbd5e1; }
html[data-theme="dark"] .input-group-custom input { background: #0f141d; border-color: #2a3548; color: #f1f5f9; }
html[data-theme="dark"] .login-info-box { background: #0f141d; border-color: #263042; color: #cbd5e1; }
.card-body-custom canvas, .card-custom canvas { max-width: 100%; }
.dash-trend-bar .form-control-custom,
.dash-trend-bar .form-select-custom {
  height: 34px;
  font-size: 12px;
  padding: 4px 24px 4px 10px;
}
.dash-trend-bar input[type="date"].form-control-custom,
.dash-trend-bar input[type="month"].form-control-custom {
  padding: 4px 8px;
}
