/* ============================================================
   SIAKAD Kampus — Modern Academic Management System
   Design System v3.0 | PHP 8.4 Upgrade
   Aesthetic: Refined Institutional — Deep navy + warm gold
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Colors */
  --clr-navy:      #0f2544;
  --clr-navy-mid:  #1a3a6b;
  --clr-navy-light:#254e8f;
  --clr-gold:      #c9902d;
  --clr-gold-light:#e8b84b;
  --clr-ivory:     #fdf8f0;
  --clr-white:     #ffffff;
  --clr-surface:   #f5f7fb;
  --clr-border:    #dde3ef;
  --clr-muted:     #7a8aaa;
  --clr-text:      #1a2540;
  --clr-text-soft: #4a5875;

  /* Status */
  --clr-success:   #1e7e34;
  --clr-warning:   #c87a00;
  --clr-danger:    #b91c1c;
  --clr-info:      #0369a1;

  /* Spacing */
  --sp-xs:  0.25rem;
  --sp-sm:  0.5rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 3rem;

  /* Typography */
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 0.9375rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;

  /* Radius */
  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  16px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15,37,68,.08), 0 1px 2px rgba(15,37,68,.06);
  --shadow-md: 0 4px 16px rgba(15,37,68,.10), 0 2px 6px rgba(15,37,68,.07);
  --shadow-lg: 0 8px 32px rgba(15,37,68,.14), 0 4px 12px rgba(15,37,68,.09);
  --shadow-xl: 0 20px 60px rgba(15,37,68,.18);

  /* Transitions */
  --ease: cubic-bezier(.25,.46,.45,.94);
  --dur:  220ms;

  /* Sidebar */
  --sidebar-w: 260px;
  --topbar-h:  64px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--clr-text);
  background: var(--clr-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clr-navy-light);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--clr-gold); }

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── Layout ───────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--clr-navy);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--dur) var(--ease);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(201,144,45,.4), transparent);
}

/* Sidebar Logo */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-lg) var(--sp-lg);
  border-bottom: 1px solid rgba(255,255,255,.07);
  min-height: var(--topbar-h);
}

.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--clr-gold), var(--clr-gold-light));
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(201,144,45,.35);
}

.brand-icon svg { width: 22px; height: 22px; color: var(--clr-navy); }

.brand-text { overflow: hidden; }
.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--clr-white);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.brand-sub {
  font-size: var(--text-xs);
  color: var(--clr-gold-light);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* User Info */
.sidebar-user {
  margin: var(--sp-md) var(--sp-md);
  padding: var(--sp-md);
  background: rgba(255,255,255,.05);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--clr-navy-light), var(--clr-gold));
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 700;
  color: var(--clr-white); flex-shrink: 0;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-white);
  line-height: 1.2;
}
.user-role {
  font-size: var(--text-xs);
  color: var(--clr-muted);
}

/* Navigation */
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--sp-sm) 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: var(--sp-lg) var(--sp-lg) var(--sp-xs);
  display: block;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 10px var(--sp-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,.65);
  border-radius: 0;
  transition: all var(--dur) var(--ease);
  position: relative;
}

.nav-link:hover {
  color: var(--clr-white);
  background: rgba(255,255,255,.06);
}

.nav-link.active {
  color: var(--clr-white);
  background: rgba(201,144,45,.18);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--clr-gold);
  border-radius: 0 3px 3px 0;
}

.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav-link.active svg { opacity: 1; }

/* Sub-menu */
.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s var(--ease);
  background: rgba(0,0,0,.15);
}
.nav-item.open .nav-sub { max-height: 400px; }

.nav-sub .nav-link {
  padding-left: calc(var(--sp-lg) + 17px + var(--sp-sm));
  font-size: var(--text-xs);
  font-weight: 400;
  color: rgba(255,255,255,.5);
}
.nav-sub .nav-link:hover,
.nav-sub .nav-link.active { color: rgba(255,255,255,.9); }

.nav-chevron {
  margin-left: auto;
  width: 14px; height: 14px;
  transition: transform var(--dur) var(--ease);
  opacity: .5;
}
.nav-item.open .nav-chevron { transform: rotate(90deg); }

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--sp-md);
  border-top: 1px solid rgba(255,255,255,.07);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,.5);
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.08);
  background: transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.btn-logout:hover { color: #fca5a5; background: rgba(185,28,28,.15); border-color: rgba(185,28,28,.3); }
.btn-logout svg { width: 15px; height: 15px; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-xl);
  gap: var(--sp-md);
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-text);
  padding: var(--sp-sm);
  border-radius: var(--r-md);
}
.topbar-toggle svg { width: 22px; height: 22px; }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: var(--text-sm);
  color: var(--clr-muted);
}
.topbar-breadcrumb span { color: var(--clr-text); font-weight: 600; }
.topbar-breadcrumb svg { width: 14px; height: 14px; }

.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: var(--sp-sm); }

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--clr-border);
  background: var(--clr-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--clr-text-soft);
  position: relative;
  transition: all var(--dur) var(--ease);
}
.topbar-btn:hover { background: var(--clr-surface); color: var(--clr-text); }
.topbar-btn svg { width: 18px; height: 18px; }

.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--clr-danger);
  border-radius: var(--r-full);
  border: 2px solid var(--clr-white);
}

.semester-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 6px var(--sp-md);
  background: var(--clr-navy);
  color: var(--clr-gold-light);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .04em;
}
.semester-pill svg { width: 13px; height: 13px; }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: var(--sp-xl);
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  margin-bottom: var(--sp-xl);
}
.page-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--clr-navy);
  line-height: 1.2;
}
.page-subtitle {
  font-size: var(--text-sm);
  color: var(--clr-muted);
  margin-top: var(--sp-xs);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-lg) var(--sp-xl);
  border-bottom: 1px solid var(--clr-border);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--clr-navy);
}

.card-body { padding: var(--sp-xl); }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}

.stat-card {
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.navy::after  { background: linear-gradient(90deg, var(--clr-navy), var(--clr-navy-light)); }
.stat-card.gold::after  { background: linear-gradient(90deg, var(--clr-gold), var(--clr-gold-light)); }
.stat-card.green::after { background: linear-gradient(90deg, #059669, #34d399); }
.stat-card.red::after   { background: linear-gradient(90deg, var(--clr-danger), #f87171); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-md);
}
.stat-card.navy  .stat-icon { background: rgba(15,37,68,.08); color: var(--clr-navy); }
.stat-card.gold  .stat-icon { background: rgba(201,144,45,.12); color: var(--clr-gold); }
.stat-card.green .stat-icon { background: rgba(5,150,105,.1); color: #059669; }
.stat-card.red   .stat-icon { background: rgba(185,28,28,.1); color: var(--clr-danger); }
.stat-icon svg { width: 22px; height: 22px; }

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--clr-navy);
  line-height: 1;
  margin-bottom: var(--sp-xs);
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--clr-muted);
  font-weight: 500;
}
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--sp-sm);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.stat-change.up   { background: rgba(5,150,105,.1); color: #059669; }
.stat-change.down { background: rgba(185,28,28,.1); color: var(--clr-danger); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table.siakad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.siakad-table thead tr {
  background: var(--clr-surface);
  border-bottom: 2px solid var(--clr-border);
}

.siakad-table th {
  padding: var(--sp-sm) var(--sp-md);
  text-align: left;
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--clr-muted);
  white-space: nowrap;
}

.siakad-table td {
  padding: var(--sp-md);
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text-soft);
  vertical-align: middle;
}

.siakad-table tbody tr {
  transition: background var(--dur) var(--ease);
}
.siakad-table tbody tr:hover { background: rgba(15,37,68,.025); }
.siakad-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-navy    { background: rgba(15,37,68,.1); color: var(--clr-navy); }
.badge-gold    { background: rgba(201,144,45,.15); color: var(--clr-gold); }
.badge-success { background: rgba(5,150,105,.1); color: #059669; }
.badge-danger  { background: rgba(185,28,28,.1); color: var(--clr-danger); }
.badge-warning { background: rgba(200,122,0,.12); color: var(--clr-warning); }
.badge-info    { background: rgba(3,105,161,.1); color: var(--clr-info); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 9px var(--sp-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--clr-navy);
  color: var(--clr-white);
  box-shadow: 0 2px 8px rgba(15,37,68,.25);
}
.btn-primary:hover {
  background: var(--clr-navy-mid);
  box-shadow: 0 4px 12px rgba(15,37,68,.35);
  transform: translateY(-1px);
  color: var(--clr-white);
}

.btn-gold {
  background: var(--clr-gold);
  color: var(--clr-white);
  box-shadow: 0 2px 8px rgba(201,144,45,.3);
}
.btn-gold:hover {
  background: #b07a22;
  box-shadow: 0 4px 12px rgba(201,144,45,.4);
  transform: translateY(-1px);
  color: var(--clr-white);
}

.btn-outline {
  background: transparent;
  color: var(--clr-navy);
  border: 1.5px solid var(--clr-border);
}
.btn-outline:hover { background: var(--clr-surface); border-color: var(--clr-navy); }

.btn-danger {
  background: var(--clr-danger);
  color: var(--clr-white);
}
.btn-danger:hover { background: #991b1b; color: var(--clr-white); }

.btn-sm { padding: 6px var(--sp-md); font-size: var(--text-xs); }
.btn-lg { padding: 13px var(--sp-xl); font-size: var(--text-base); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-lg);
}
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--sp-xs);
}
.form-label .required { color: var(--clr-danger); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 10px var(--sp-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--clr-text);
  background: var(--clr-white);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--clr-navy-light);
  box-shadow: 0 0 0 3px rgba(37,78,143,.15);
}

.form-control::placeholder { color: var(--clr-muted); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.form-hint { font-size: var(--text-xs); color: var(--clr-muted); margin-top: 4px; }
.form-error { font-size: var(--text-xs); color: var(--clr-danger); margin-top: 4px; font-weight: 600; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-lg);
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-lg);
  border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.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; }

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--clr-navy);
  overflow: hidden;
}

.login-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--sp-2xl);
  background: linear-gradient(135deg, var(--clr-navy) 0%, var(--clr-navy-light) 100%);
}

.login-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(201,144,45,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(37,78,143,.3) 0%, transparent 50%);
}

.login-art-content {
  position: relative;
  max-width: 440px;
  text-align: center;
}

.login-logo {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--clr-gold), var(--clr-gold-light));
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-xl);
  box-shadow: 0 8px 32px rgba(201,144,45,.4);
}
.login-logo svg { width: 44px; height: 44px; color: var(--clr-navy); }

.login-headline {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--clr-white);
  line-height: 1.2;
  margin-bottom: var(--sp-md);
}
.login-tagline {
  font-size: var(--text-base);
  color: rgba(255,255,255,.5);
  line-height: 1.6;
}

/* Decorative circles */
.deco-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.07);
}
.deco-c1 { width: 300px; height: 300px; top: -100px; right: -100px; }
.deco-c2 { width: 200px; height: 200px; bottom: -80px; left: -80px; }
.deco-c3 { width: 150px; height: 150px; bottom: 40%; right: -30px; }

/* Login Form Panel */
.login-panel {
  width: 420px;
  flex-shrink: 0;
  background: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2xl);
}

.login-form-wrap { width: 100%; max-width: 340px; }

.login-form-header { margin-bottom: var(--sp-xl); }
.login-form-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--clr-navy);
  font-weight: 600;
  margin-bottom: var(--sp-xs);
}
.login-form-sub { font-size: var(--text-sm); color: var(--clr-muted); }

.login-input-wrap {
  position: relative;
}
.login-input-wrap .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--clr-muted);
  width: 17px; height: 17px;
}
.login-input-wrap .form-control { padding-left: 40px; }

.login-role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xl);
}

.role-card {
  border: 2px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--dur) var(--ease);
  background: var(--clr-white);
}
.role-card:hover { border-color: var(--clr-navy-light); background: var(--clr-surface); }
.role-card.selected { border-color: var(--clr-navy); background: rgba(15,37,68,.05); }
.role-card svg { width: 28px; height: 28px; color: var(--clr-navy); margin: 0 auto var(--sp-xs); }
.role-card span { font-size: var(--text-xs); font-weight: 700; color: var(--clr-text); display: block; }

.btn-login {
  width: 100%;
  padding: 13px;
  justify-content: center;
  font-size: var(--text-base);
  background: var(--clr-navy);
  color: var(--clr-white);
  border: none;
  border-radius: var(--r-lg);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  box-shadow: 0 4px 16px rgba(15,37,68,.25);
  display: flex; align-items: center; gap: var(--sp-sm);
}
.btn-login:hover {
  background: var(--clr-navy-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,37,68,.35);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-top: var(--sp-lg);
  flex-wrap: wrap;
}
.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  border: 1px solid var(--clr-border);
  background: var(--clr-white);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  color: var(--clr-text-soft);
  transition: all var(--dur) var(--ease);
  text-decoration: none;
}
.page-btn:hover { background: var(--clr-surface); color: var(--clr-text); }
.page-btn.active { background: var(--clr-navy); color: var(--clr-white); border-color: var(--clr-navy); }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--clr-border);
  margin: var(--sp-xl) 0;
}

/* ── Print utility ───────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0; padding: var(--sp-md); }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .topbar { left: 0; }
  .topbar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .login-art { display: none; }
  .login-panel { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  :root { --sp-xl: 1.25rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: var(--sp-md); }
  .card-body { padding: var(--sp-md); }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 var(--sp-md); }
}

/* ── Overlay (mobile sidebar) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Utility ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--clr-muted); }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: var(--sp-xs); }
.mt-2 { margin-top: var(--sp-sm); }
.mt-3 { margin-top: var(--sp-md); }
.mt-4 { margin-top: var(--sp-lg); }
.mb-3 { margin-bottom: var(--sp-md); }
.mb-4 { margin-bottom: var(--sp-lg); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-sm); }
.gap-3 { gap: var(--sp-md); }
.w-full { width: 100%; }

/* ── Backward-compat: CSS kelas lama dari modul PHP ───────
   Modul-modul lama menggunakan class ini (box, inp1, ul, dll)
   Disesuaikan ke design system baru agar tidak tampil kosong */

table.box, table.bsc, table.basic {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-md);
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
table.box tr, table.bsc tr, table.basic tr { border-bottom: 1px solid var(--clr-border); }
table.box tr:last-child, table.bsc tr:last-child { border-bottom: none; }

td.ttl, th.ttl {
  background: var(--clr-navy);
  color: var(--clr-white);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 8px 12px;
}
td.inp1 {
  background: var(--clr-surface);
  color: var(--clr-text-soft);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 7px 12px;
  white-space: nowrap;
  width: 180px;
}
td.inp2, td.ul {
  padding: 7px 12px;
  font-size: var(--text-sm);
  color: var(--clr-text);
}
td.nac {
  background: #fef2f2;
  color: var(--clr-muted);
  padding: 7px 12px;
  font-size: var(--text-sm);
}
td.lst {
  padding: 7px 12px;
  font-size: var(--text-sm);
  color: var(--clr-text-soft);
}
td.cna { background: #fef9c3; padding: 7px 12px; font-size: var(--text-sm); }

/* Input lama */
input[type=text], input[type=password], select, textarea {
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
input.box, select.box, textarea.box {
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  outline: none;
  background: var(--clr-white);
}
input.box:focus, select.box:focus { border-color: var(--clr-navy-light); }

/* Tombol lama */
input[type=submit], input[type=button], input[type=reset] {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--clr-navy);
  color: var(--clr-white);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
  margin: 2px;
}
input[type=submit]:hover { background: var(--clr-navy-mid); }
input[type=reset]  { background: var(--clr-muted); }
input[type=button] { background: var(--clr-surface); color: var(--clr-text); border: 1px solid var(--clr-border); }
input[type=button]:hover { background: var(--clr-border); }

/* Judul modul lama */
.Judul {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--clr-navy);
  font-weight: 600;
  padding: var(--sp-md) 0;
  margin-bottom: var(--sp-md);
  border-bottom: 2px solid var(--clr-gold);
}
.JudulBesar {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--clr-navy);
  text-align: center;
  padding: var(--sp-lg) 0;
}

/* Link lama */
a { color: var(--clr-navy-light); text-decoration: none; }
a:hover { color: var(--clr-gold); text-decoration: underline; }

/* Pagination lama */
.halaman a, .pages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  margin: 2px;
  border: 1px solid var(--clr-border);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-text-soft);
  background: var(--clr-white);
}
.halaman a:hover, .pages a:hover { background: var(--clr-navy); color: #fff; }

/* Alert / error lama */
font[color=red], .err { color: var(--clr-danger); font-weight: 600; }
font[color=green]     { color: #059669; font-weight: 600; }

/* ── Form lama — auto-modernized via JS ───────────────────── */
.form-control-legacy {
  display: inline-block;
  padding: 7px 11px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--clr-text);
  background: var(--clr-white);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  min-width: 120px;
  vertical-align: middle;
}
.form-control-legacy:focus {
  border-color: var(--clr-navy-light);
  box-shadow: 0 0 0 3px rgba(37,78,143,.12);
}
select.form-control-legacy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 30px;
  appearance: none;
  -webkit-appearance: none;
}
textarea.form-control-legacy {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}

.btn-legacy-submit {
  display: inline-flex !important;
  align-items: center;
  padding: 7px 18px !important;
  background: var(--clr-navy) !important;
  color: var(--clr-white) !important;
  border: none !important;
  border-radius: var(--r-md) !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background var(--dur) var(--ease) !important;
  margin: 2px !important;
}
.btn-legacy-submit:hover { background: var(--clr-navy-mid) !important; }

.btn-legacy-reset {
  display: inline-flex !important;
  align-items: center;
  padding: 7px 18px !important;
  background: var(--clr-surface) !important;
  color: var(--clr-text) !important;
  border: 1.5px solid var(--clr-border) !important;
  border-radius: var(--r-md) !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin: 2px !important;
}

.btn-legacy-btn {
  display: inline-flex !important;
  align-items: center;
  padding: 7px 18px !important;
  background: var(--clr-surface) !important;
  color: var(--clr-text-soft) !important;
  border: 1.5px solid var(--clr-border) !important;
  border-radius: var(--r-md) !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin: 2px !important;
}
.btn-legacy-btn:hover { background: var(--clr-border) !important; }

/* Tabel lama — lebih modern */
.siakad-table-old {
  width: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--clr-border) !important;
  border-radius: var(--r-xl) !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-sm) !important;
  margin-bottom: var(--sp-lg) !important;
  background: var(--clr-white) !important;
}
.siakad-table-old td, .siakad-table-old th {
  padding: 9px 14px !important;
  font-size: var(--text-sm) !important;
  border-bottom: 1px solid var(--clr-border) !important;
}
.siakad-table-old tr:last-child td,
.siakad-table-old tr:last-child th { border-bottom: none !important; }
.siakad-table-old tr:hover td { background: rgba(15,37,68,.025) !important; }

/* Wrapper untuk konten modul lama agar ada padding */
#siakad-content > p:first-child { margin-top: 0; }
#siakad-content p { margin-bottom: var(--sp-md); }
#siakad-content > table { margin-bottom: var(--sp-md); }