/* ==========================================================================
   SiAdkat — Design System (tema modern)
   Ditulis ulang 2026-10-02. Menggantikan gaya monospace lama.
   Semua nama kelas lama tetap dipertahankan agar tidak ada halaman yang rusak.
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* --- Palet utama --- */
  --brand-50:  #eef1ff;
  --brand-100: #e0e5ff;
  --brand-200: #c7cfff;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;

  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --cyan-500:   #06b6d4;

  --success: #10b981;
  --success-600: #059669;
  --warning: #f59e0b;
  --warning-600: #d97706;
  --danger:  #ef4444;
  --danger-600: #dc2626;
  --info:    #3b82f6;

  /* --- Netral --- */
  --ink:      #0f172a;
  --ink-2:    #1e293b;
  --muted:    #64748b;
  --muted-2:  #94a3b8;
  --line:     #e6eaf2;
  --line-2:   #eef2f7;
  --surface:  #ffffff;
  --surface-2:#f8fafc;
  --bg:       #f4f6fb;

  /* --- Bentuk & bayangan --- */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow:    0 10px 30px -12px rgba(15, 23, 42, .18);
  --shadow-md: 0 18px 40px -18px rgba(15, 23, 42, .24);
  --shadow-lg: 0 30px 60px -30px rgba(15, 23, 42, .35);
  --ring:      0 0 0 4px rgba(99, 102, 241, .16);

  /* --- Tipografi --- */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
               Arial, "Noto Sans", "Liberation Sans", sans-serif;

  /* --- Layout --- */
  --sidebar-width: 280px;
  --navbar-height: 64px;

  /* --- Nama variabel lama (dipertahankan untuk kompatibilitas) --- */
  --primary: var(--brand-600);
  --primary-dark: var(--brand-700);
  --navy: var(--brand-600);
  --navy-soft: var(--brand-500);
  --gold: var(--cyan-500);
  --gold-soft: #7dd3fc;
  --gold-dim: var(--brand-500);
  --sidebar-bg: #ffffff;
  --body-bg: var(--bg);
  --border: var(--line);
  --text: var(--ink-2);
  --text-muted: var(--muted);

  /* --- Selaraskan variabel Bootstrap dengan palet baru --- */
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-body-font-family: var(--font-sans);
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(99, 102, 241, .07), transparent 60%),
    var(--bg);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: .925rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--ink);
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

::selection { background: rgba(99, 102, 241, .22); color: var(--ink); }

/* Scrollbar halus */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

.page-wrapper { min-height: 100vh; }

/* ==========================================================================
   3. NAVBAR
   ========================================================================== */
.navbar.app-header-premium,
.app-header-premium {
  min-height: var(--navbar-height);
  padding: 0 !important;
  background:
    linear-gradient(115deg, #4f46e5 0%, #5b4bd8 45%, #7c3aed 100%);
  box-shadow: 0 10px 30px -14px rgba(79, 70, 229, .65);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  z-index: 1040;
  backdrop-filter: saturate(140%) blur(6px);
}

.app-header-premium .container-fluid { padding: 0 20px; }

.brand-divider {
  width: 1px; height: 24px;
  background: rgba(255, 255, 255, .22);
}

.brand-title {
  color: #fff; font-weight: 700; font-size: 17px;
  letter-spacing: .01em;
}

.header-divider {
  width: 1px; height: 26px;
  background: rgba(255, 255, 255, .18);
}

.btn-icon {
  border: none;
  color: #fff;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .10);
  transition: background .2s ease, transform .2s ease;
}
.btn-icon:hover { background: rgba(255, 255, 255, .20); color: #fff; transform: translateY(-1px); }

.notif-dot {
  position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px;
  background: #fbbf24;
  border: 2px solid #5b4bd8;
  border-radius: 50%;
}

.user-menu-btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 6px;
  background: rgba(255, 255, 255, .10);
  transition: background .2s ease;
}
.user-menu-btn:hover { background: rgba(255, 255, 255, .20); }

.avatar-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #e9e7ff);
  color: var(--brand-600);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}

.app-header-premium .dropdown-menu {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: .4rem;
}
.app-header-premium .dropdown-item { border-radius: 10px; padding: .5rem .7rem; font-size: .875rem; }
.app-header-premium .dropdown-item:hover { background: var(--brand-50); color: var(--brand-700); }

/* ==========================================================================
   4. SIDEBAR
   ========================================================================== */
.left-sidebar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background: var(--surface) !important;
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition: left .28s cubic-bezier(.4, 0, .2, 1);
  z-index: 1030;
}

.sidebar-scroll {
  display: flex; flex-direction: column;
  height: 100%; overflow-y: auto;
  padding: 14px 10px 24px;
}

.sidebar-nav { display: flex; flex-direction: column; min-height: 100%; }
.sidebar-nav ul { padding-left: 0; margin-bottom: 0; }

.sidebar-item { list-style: none; margin-bottom: 2px; }

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: #5a6478;
  text-decoration: none;
  font-weight: 550;
  font-size: .895rem;
  position: relative;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sidebar-link i,
.sidebar-link .ti {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 1.05rem;
  color: var(--muted-2);
  background: transparent;
  transition: all .18s ease;
  flex: 0 0 auto;
}

.sidebar-link:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}
.sidebar-link:hover i { color: var(--brand-600); background: #fff; }

.sidebar-link.active {
  background: linear-gradient(115deg, var(--brand-600) 0%, var(--violet-600) 100%);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 12px 24px -12px rgba(79, 70, 229, .75);
}
.sidebar-link.active i { color: #fff; background: rgba(255, 255, 255, .18); }

.sidebar-link.text-danger { color: var(--danger) !important; }
.sidebar-link.text-danger:hover { background: #fef2f2; color: var(--danger-600) !important; }

/* Sidebar yang daftarnya langsung dimulai tanpa label grup (mis. halaman admin
   dan guru) perlu ruang atas sendiri. Selama ini jarak itu hanya datang dari
   margin label .nav-small-cap, jadi begitu labelnya dihapus daftarnya menempel
   ke navbar. Sidebar yang memang diawali label tidak terpengaruh. */
.sidebar-nav ul > li:first-child:not(.nav-small-cap) { margin-top: 18px; }

.nav-small-cap {
  margin: 20px 14px 8px;
  color: var(--muted-2);
  text-transform: uppercase;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .11em;
  list-style: none;
}

/* ==========================================================================
   5. CONTENT WRAPPER
   ========================================================================== */
.body-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  padding: 26px 28px 48px;
}

/* Judul halaman sederhana (dipakai beberapa halaman) */
.title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.content-wrapper { padding-top: 8px; }

/* ==========================================================================
   6. CARD
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: 22px; }

.card-header,
.card-header-modern {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.01em;
}
.card-header:first-child,
.card-header-modern:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

.card-header-modern .eyebrow {
  display: block;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 2px;
}

.card-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  padding: 14px 22px;
}

/* ==========================================================================
   6b. HEADER HALAMAN (pola seragam untuk semua halaman isi)
   ========================================================================== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-eyebrow {
  display: block;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 3px;
}
.page-title {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}
.page-sub {
  color: var(--muted);
  font-size: .86rem;
  margin: 5px 0 0;
}
.page-head .aksi-group .btn { padding: .5rem .9rem; font-size: .84rem; }

@media (max-width: 575.98px) {
  .page-head { align-items: flex-start; }
  .page-title { font-size: 1.22rem; }
}

/* ==========================================================================
   7. HERO WELCOME
   ========================================================================== */
.hero-welcome {
  position: relative;
  background:
    radial-gradient(600px 220px at 88% 0%, rgba(255, 255, 255, .22), transparent 65%),
    linear-gradient(115deg, #4f46e5 0%, #6d5ae8 48%, #8b5cf6 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 30px 34px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 26px 50px -26px rgba(79, 70, 229, .75);
}
.hero-welcome::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .35;
  z-index: -1;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #e0e7ff;
  font-weight: 700;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.hero-title {
  font-weight: 800;
  font-size: 1.85rem;
  line-height: 1.22;
  margin-bottom: 6px;
  color: #fff;
  letter-spacing: -0.025em;
}
.hero-sub { color: rgba(255, 255, 255, .82); font-size: .885rem; margin: 0; }

.hero-date { text-align: right; }
.hero-date .day { font-size: 1.15rem; font-weight: 700; }
.hero-date .clock { color: #dbeafe; font-size: .82rem; letter-spacing: .02em; margin-top: 2px; }
.hero-divider { width: 1px; background: rgba(255, 255, 255, .2); align-self: stretch; }

/* ==========================================================================
   8. STAT STRIP
   ========================================================================== */
.stat-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

.stat-chip {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.stat-chip::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--violet-500));
  opacity: .9;
}
.stat-chip:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-200);
}

.stat-chip .stat-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.stat-chip .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-chip .stat-label {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  margin-top: 6px;
}

/* ==========================================================================
   9. RADIAL PROGRESS (SEAL)
   ========================================================================== */
.progress-seal {
  width: 172px; height: 172px;
  border-radius: 50%;
  margin: 4px auto 20px;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--brand-600) calc(var(--pct) * 1%), #eef1f7 0);
  position: relative;
  filter: drop-shadow(0 10px 22px rgba(79, 70, 229, .22));
}
.progress-seal::before {
  content: "";
  position: absolute; inset: 12px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04);
}
.progress-seal .seal-inner { position: relative; text-align: center; z-index: 1; }
.progress-seal .seal-value {
  font-size: 2.1rem; font-weight: 800;
  color: var(--ink); line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.progress-seal .seal-label {
  font-size: .66rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); font-weight: 800; margin-top: 5px;
}

/* ==========================================================================
   10. BREAKDOWN ROWS
   ========================================================================== */
.breakdown-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line-2);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .label {
  display: flex; align-items: center; gap: 11px;
  font-weight: 600; color: var(--ink-2); font-size: .88rem;
}
.breakdown-row .label i {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600); font-size: .95rem;
}
.breakdown-row .count {
  font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 12px;
  border-radius: var(--radius-pill);
  font-size: .85rem;
}

/* ==========================================================================
   11. SUBJECT LIST
   ========================================================================== */
.subject-list {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 480px; overflow-y: auto; padding-right: 4px;
}
.subject-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.subject-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-200);
  box-shadow: var(--shadow-sm);
}
.subject-card .subject-name { font-weight: 700; color: var(--ink); margin-bottom: 2px; font-size: .95rem; }
.subject-card .subject-kelas { color: var(--muted); font-size: .78rem; }

.subject-badge {
  font-weight: 800; font-size: .9rem; color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--violet-600));
  border-radius: var(--radius-pill);
  padding: .32rem .9rem;
  min-width: 58px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.subject-badge.complete { background: linear-gradient(135deg, var(--success), var(--success-600)); }

.subject-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.subject-meta span {
  font-size: .74rem; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.subject-meta span::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-500); display: inline-block;
}
.subject-meta span.is-empty::before { background: #cbd5e1; }
.subject-meta span.is-empty { color: #a9b1bf; }

/* ==========================================================================
   12. TABEL
   ========================================================================== */
.table-responsive { overflow: auto; border-radius: var(--radius); }

.table {
  margin-bottom: 0;
  color: var(--ink-2);
  --bs-table-bg: transparent;
  border-color: var(--line-2);
}

.table > :not(caption) > * > * { padding: .72rem .7rem; }

.table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: .715rem;
  font-weight: 800;
  letter-spacing: .085em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}

.table tbody td {
  vertical-align: middle;
  line-height: 1.55;
  /* overflow-wrap hanya memotong kata bila benar-benar tidak muat,
     berbeda dengan word-break yang memotong di mana saja */
  overflow-wrap: break-word;
  border-color: var(--line-2);
}

.table.table-striped > tbody > tr:nth-of-type(odd) > * {
  background: #fbfcfe;
  --bs-table-accent-bg: #fbfcfe;
}
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover > * { background: var(--brand-50); }

.table-bordered > :not(caption) > * { border-color: var(--line-2); }
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }

.table td .form-control,
.table td .form-select { min-height: 36px; padding: .25rem .6rem; font-size: .85rem; }

/* ==========================================================================
   13. FORM
   ========================================================================== */
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-2); margin-bottom: .35rem; }

.form-control,
.form-select {
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .9rem;
  padding: .55rem .85rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control::placeholder { color: var(--muted-2); }

.form-control:focus,
.form-select:focus {
  background: var(--surface);
  border-color: var(--brand-500) !important;
  box-shadow: var(--ring) !important;
  outline: none;
}

textarea.form-control { min-height: 96px; line-height: 1.6; }

.form-check-input:checked {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
}
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand-400); }

.form-text { font-size: .78rem; color: var(--muted); }
.input-group-text {
  background: var(--surface-2);
  border-color: var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .85rem;
}

/* ==========================================================================
   14. BUTTON
   ========================================================================== */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .875rem;
  padding: .52rem 1.05rem;
  letter-spacing: -0.005em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn i { margin-right: 5px; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--violet-600));
  border: none;
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(79, 70, 229, .85);
}
.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-700), var(--violet-600));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -12px rgba(79, 70, 229, .95);
}
.btn-primary:disabled { background: var(--brand-400); box-shadow: none; }

.btn-outline-primary {
  color: var(--brand-600);
  border-color: var(--brand-200);
  background: var(--surface);
}
.btn-outline-primary:hover {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
}

.btn-light {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.btn-light:hover { background: #eef2f7; color: var(--ink); }

.btn-outline-danger { border-color: #fecaca; color: var(--danger-600); background: var(--surface); }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-outline-secondary { border-color: var(--line); color: var(--muted); background: var(--surface); }
.btn-outline-secondary:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #452c00; }
.btn-danger  { background: var(--danger);  border-color: var(--danger); }

.btn-gold {
  background: linear-gradient(135deg, var(--cyan-500), #3b82f6);
  border: none; color: #fff;
}
.btn-gold:hover { color: #fff; filter: brightness(1.05); }

.btn-sm { border-radius: 10px; padding: .35rem .7rem; font-size: .8rem; }
.btn-lg { border-radius: var(--radius); padding: .7rem 1.3rem; font-size: .95rem; }

.btn-close { filter: grayscale(1); opacity: .55; }
.btn-close:hover { opacity: .9; }

/* ==========================================================================
   15. BADGE / ALERT / MODAL / DROPDOWN / PAGINATION / PROGRESS
   ========================================================================== */
.badge {
  border-radius: var(--radius-pill);
  padding: .42rem .72rem;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .01em;
}
.badge.bg-primary { background: var(--brand-600) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; color: #452c00; }
.badge.bg-danger  { background: var(--danger)  !important; }

.alert {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .85rem 1.05rem;
  font-size: .875rem;
  box-shadow: var(--shadow-xs);
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.modal-content {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--line-2); padding: 18px 22px; }
.modal-title { font-weight: 700; font-size: 1.02rem; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--line-2); padding: 16px 22px; gap: 8px; }
.modal-lg { max-width: 1100px; }
.modal-backdrop.show { opacity: .45; backdrop-filter: blur(2px); }

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: .35rem;
  font-size: .875rem;
}
.dropdown-item { border-radius: 10px; padding: .5rem .7rem; }
.dropdown-item:hover { background: var(--brand-50); color: var(--brand-700); }
.dropdown-divider { border-color: var(--line-2); margin: .35rem 0; }

.pagination { gap: 4px; }
.page-link {
  border: 1px solid var(--line);
  border-radius: 10px !important;
  color: var(--ink-2);
  margin: 0;
  min-width: 38px;
  text-align: center;
  font-weight: 600;
}
.page-link:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.page-item.active .page-link {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9);
}

.progress { height: 12px; border-radius: var(--radius-pill); background: #e9edf5; overflow: hidden; }
.progress-bar { font-weight: 700; font-size: .68rem; background: linear-gradient(90deg, var(--brand-500), var(--violet-500)); }

.list-group-item { border-color: var(--line-2); padding: .85rem 1.1rem; }
.list-group-item:first-child { border-top-left-radius: var(--radius-sm); border-top-right-radius: var(--radius-sm); }
.list-group-item:last-child { border-bottom-left-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }

/* badge di dalam tabel dibuat ringkas agar kolom tidak melebar */
.table .badge { padding: .34rem .55rem; font-size: .69rem; }

/* DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .4rem .7rem;
  background: var(--surface);
  min-height: 38px;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--brand-500); box-shadow: var(--ring); outline: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #fff !important;
  border-radius: 10px;
}
.dataTables_wrapper .dataTables_info { color: var(--muted); font-size: .82rem; padding-top: .6rem; }

/* ==========================================================================
   15b. TOMBOL AKSI TABEL (diseragamkan 2026-10-05)
   Satu pola untuk semua halaman: grup tombol ikon+label yang rapi,
   tinggi & radius sama, dan warna yang punya arti tetap.
   ========================================================================== */
.aksi-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.aksi-group .btn,
.btn-aksi {
  border-radius: 10px;
  padding: .34rem .62rem;
  font-size: .775rem;
  font-weight: 600;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: none;
}
.aksi-group .btn i,
.btn-aksi i { margin-right: 0; font-size: .95rem; }
.aksi-group .btn:hover { transform: none; }

/* warna tombol berkas — segmen unduhan */
.btn-unduh-pdf   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-unduh-pdf:hover   { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-unduh-word  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.btn-unduh-word:hover  { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.btn-unduh-excel { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.btn-unduh-excel:hover { background: #10b981; color: #fff; border-color: #10b981; }

/* segmen unduhan menyatu */
.btn-group-unduh { display: inline-flex; }
.btn-group-unduh .btn {
  border-radius: 0;
  margin-left: -1px;
}
.btn-group-unduh .btn:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  margin-left: 0;
}
.btn-group-unduh .btn:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* tombol aksi utama & netral di tabel */
.btn-aksi-utama  { background: linear-gradient(135deg, var(--brand-600), var(--violet-600)); color: #fff; border: none; }
.btn-aksi-utama:hover { color: #fff; filter: brightness(1.06); }
.btn-aksi-netral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.btn-aksi-netral:hover { background: #eef2f7; color: var(--ink); }
.btn-aksi-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.btn-aksi-warning:hover { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-aksi-hapus { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-aksi-hapus:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* kolom aksi: jangan melebar berlebihan */
.table td .aksi-group { max-width: 330px; }

/* ==========================================================================
   16. HALAMAN LOGIN
   ========================================================================== */
body.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background:
    radial-gradient(900px 500px at 12% 8%,  rgba(99, 102, 241, .55), transparent 60%),
    radial-gradient(800px 520px at 88% 18%, rgba(6, 182, 212, .42), transparent 62%),
    radial-gradient(900px 600px at 60% 105%, rgba(139, 92, 246, .50), transparent 60%),
    linear-gradient(140deg, #131a34 0%, #1c2145 55%, #241f47 100%);
}
body.auth-page .page-wrapper { width: 100%; }

body.auth-page .card {
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 26px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
}
body.auth-page .card-body { padding: 34px 32px; }

body.auth-page .logo-img img { max-height: 62px; }

body.auth-page h5 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.35;
  color: var(--ink);
}
body.auth-page p { color: var(--muted); font-size: .88rem; }

body.auth-page .form-control { background: #fff; }
body.auth-page .btn-primary { padding: .72rem 1rem; font-size: .95rem; }

/* ==========================================================================
   17. UTILITAS & ANIMASI
   ========================================================================== */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.radius    { border-radius: var(--radius) !important; }
.radius-sm { border-radius: var(--radius-sm) !important; }
.cursor-pointer { cursor: pointer; }
.text-muted { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }

.section-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 16px; letter-spacing: -0.02em; }
.section-subtitle { color: var(--muted); font-size: .875rem; }

.bg-soft-primary { background: var(--brand-50) !important; }
.bg-soft-success { background: #ecfdf5 !important; }
.bg-soft-warning { background: #fffbeb !important; }
.bg-soft-danger  { background: #fef2f2 !important; }
.border-soft { border: 1px solid var(--line) !important; }

.text-primary { color: var(--brand-600) !important; }
.bg-primary   { background: var(--brand-600) !important; }
.border-primary { border-color: var(--brand-600) !important; }

hr { border-color: var(--line-2); opacity: 1; margin: 1.1rem 0; }

.spinner-border-sm { width: 1rem; height: 1rem; }

/* animasi masuk halus */
@keyframes siadkat-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .hero-welcome, .stat-chip, .subject-card {
  animation: siadkat-rise .45s cubic-bezier(.22, .61, .36, 1) both;
}
.stat-chip:nth-child(2) { animation-delay: .04s; }
.stat-chip:nth-child(3) { animation-delay: .08s; }
.stat-chip:nth-child(4) { animation-delay: .12s; }
.stat-chip:nth-child(5) { animation-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ==========================================================================
   18. RESPONSIF
   ========================================================================== */
@media (max-width: 1199.98px) {
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
  .left-sidebar { left: calc(var(--sidebar-width) * -1); box-shadow: var(--shadow-md); }
  .left-sidebar.active { left: 0; }
  .body-wrapper { margin-left: 0; padding: 18px 16px 40px; }

  .sidebar-overlay {
    position: fixed; inset: 0; display: none;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    z-index: 1029;
  }
  .sidebar-overlay.show { display: block; }

  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .hero-welcome { padding: 24px; }
  .hero-date { text-align: left; margin-top: 16px; }
  .hero-divider { display: none; }
}

@media (max-width: 767.98px) {
  .app-header-premium { min-height: 56px; }
  .app-header-premium .container-fluid { padding: 0 12px; }
  .brand-logo-img { height: 20px !important; }
  .btn-icon { width: 38px; height: 38px; }
  .btn-icon i { font-size: 18px !important; }
  .user-menu-btn { padding: 4px; border-radius: 50%; }
  .user-menu-btn .avatar-circle { width: 26px; height: 26px; font-size: 13px; }
  .user-menu-btn .bi-chevron-down { display: none; }
  .app-header-premium .d-flex.gap-3 { gap: 8px !important; }
  .app-header-premium .dropdown-menu { min-width: 220px !important; margin-top: 10px; }
  .card-body { padding: 18px; }
  .hero-title { font-size: 1.5rem; }
}

@media (max-width: 575.98px) {
  .stat-strip { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-chip .stat-value { font-size: 1.5rem; }
  .hero-welcome { padding: 20px; border-radius: var(--radius); }
  .brand-title, .brand-divider, .header-divider { display: none !important; }
}

/* ==========================================================================
   19. CETAK
   ========================================================================== */
@media print {
  body { background: #fff !important; }
  .navbar, .left-sidebar, .btn, .no-print, .sidebar-overlay { display: none !important; }
  .body-wrapper { margin: 0 !important; padding: 0 !important; }
  .card, .hero-welcome, .stat-chip, .subject-card {
    box-shadow: none !important;
    border-color: #ddd !important;
    animation: none !important;
  }
  .hero-welcome { background: #fff !important; color: #000 !important; }
}

/* ==========================================================================
   LEBAR KARTU STATISTIK PER HALAMAN
   Sebelumnya ditulis sebagai style inline (grid-template-columns:repeat(4,1fr))
   yang mengalahkan aturan media query, sehingga di ponsel tetap 4 kolom sempit.
   Dipindah ke kelas agar ikut menyesuaikan ukuran layar.
   ========================================================================== */
.stat-strip.k4 { grid-template-columns: repeat(4, 1fr); }
.stat-strip.k3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1199.98px) {
  .stat-strip.k4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991.98px) {
  .stat-strip.k4,
  .stat-strip.k3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .stat-strip.k4,
  .stat-strip.k3 { grid-template-columns: 1fr; gap: 12px; }
}
/* Jarak atas halaman dirapatkan pada layar kecil (kelas pt-5 dari Bootstrap
   memberi 3rem yang terasa berongga di ponsel). */
@media (max-width: 991.98px) {
  .body-wrapper .row.pt-5 { padding-top: 1.1rem !important; }
}
