* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --green-dark:  #0F4A2E;
  --green-mid:   #1A7A4A;
  --green-light: #2BAE6E;
  --green-tint:  #E6F7EE;
  --gold:        #C99A2E;
  --gold-light:  #F5E5B0;
  --gold-tint:   #FDF8EC;
  --cream:       #FAFAF7;
  --white:       #FFFFFF;
  --gray-100:    #F4F3F0;
  --gray-200:    #E2E0DA;
  --gray-400:    #9B9890;
  --gray-600:    #5A5852;
  --gray-800:    #2C2B27;
  --red:         #C0392B;
  --red-tint:    #FDECEA;
  --blue:        #1A5FA8;
  --blue-tint:   #E8F0FB;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.13);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--gray-800);
  min-height: 100vh;
}

a { color: inherit; }

/* ======================== NAV ======================== */
nav {
  background: var(--green-dark);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo {
  width: 38px; height: 38px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--green-dark);
  flex-shrink: 0;
}

.nav-title { line-height: 1.2; }

.nav-title strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.nav-title span {
  font-size: 10.5px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.12); }

.btn-nav-cta {
  background: var(--gold) !important;
  color: var(--green-dark) !important;
  font-weight: 600 !important;
  padding: 7px 16px !important;
}

.btn-nav-cta:hover { background: #E0AC3A !important; }

/* ======================== HERO ======================== */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, #1F9E60 100%);
  padding: 80px 2rem 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 240px; height: 240px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.hero-badge {
  display: inline-block;
  background: var(--gold-light);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  max-width: 680px;
  margin: 0 auto 12px;
  letter-spacing: -0.3px;
}

.hero-subtitle {
  font-size: 14.5px;
  color: rgba(255,255,255,0.72);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ======================== BUTTONS ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary { background: var(--gold); color: var(--green-dark); }
.btn-primary:hover { background: #E0AC3A; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.45);
}
.btn-outline:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.7); }

.btn-green { background: var(--green-mid); color: #fff; }
.btn-green:hover { background: var(--green-dark); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a93226; }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ======================== CARDS ======================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header h2 { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.card-header p { font-size: 13px; color: var(--gray-400); margin-top: 2px; }
.card-body { padding: 24px; }

/* ======================== FORM ======================== */
.form-group { margin-bottom: 18px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.form-group label span.req { color: var(--red); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(43,174,110,0.12);
}

.form-control.is-invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; margin-top: 4px; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ======================== SECTION ======================== */
.section { padding: 60px 2rem; }
.section-sm { padding: 40px 2rem; }

.container { max-width: 1100px; margin: 0 auto; }
.container-sm { max-width: 720px; margin: 0 auto; }

.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 26px; font-weight: 700; color: var(--green-dark); margin-bottom: 8px; }
.section-title p { font-size: 14.5px; color: var(--gray-400); max-width: 500px; margin: 0 auto; }

/* ======================== STATS STRIP ======================== */
.stats-strip { background: var(--green-dark); padding: 28px 2rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.stat-item strong { display: block; font-size: 28px; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-item span {
  font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px;
  display: block; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ======================== FEATURE CARDS ======================== */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.feature-card h3 { font-size: 15px; font-weight: 600; color: var(--green-dark); margin-bottom: 6px; }
.feature-card p { font-size: 13.5px; color: var(--gray-400); line-height: 1.6; }

/* ======================== SIDEBAR LAYOUT ======================== */
.dashboard-layout { display: flex; min-height: calc(100vh - 62px); }

.sidebar {
  width: 230px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 24px 0;
  flex-shrink: 0;
  position: relative;
}

.sidebar-section { padding: 0 16px; margin-bottom: 6px; }

.sidebar-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--gray-400); padding: 8px 10px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
}

.sidebar-item:hover { background: var(--green-tint); color: var(--green-mid); }
.sidebar-item.active { background: var(--green-tint); color: var(--green-dark); font-weight: 600; }
.sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-item.disabled { opacity: 0.45; cursor: default; }

.sidebar-avatar {
  display: flex; align-items: center; gap: 10px; padding: 16px;
  margin-top: 12px; border-top: 1px solid var(--gray-200);
}

.avatar-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-tint); border: 2px solid var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--green-dark); flex-shrink: 0;
}

.avatar-info strong { display: block; font-size: 13px; color: var(--gray-800); }
.avatar-info span { font-size: 11px; color: var(--gray-400); }

.main-content { flex: 1; padding: 32px; background: var(--cream); overflow-y: auto; }

/* ======================== STATUS BADGES ======================== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-review  { background: var(--blue-tint); color: var(--blue); }
.badge-accept  { background: var(--green-tint); color: var(--green-dark); }
.badge-reject  { background: var(--red-tint); color: var(--red); }
.badge-gold    { background: var(--gold-light); color: #7A5C10; }

/* ======================== TABLE ======================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-200); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead { background: var(--gray-100); }

th {
  text-align: left; padding: 11px 16px; font-size: 11.5px; font-weight: 700;
  color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
}

td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-100); }

/* ======================== INFO / WARN / SUCCESS BOX ======================== */
.info-box {
  background: var(--blue-tint); border: 1px solid #BAD0F0; border-radius: var(--radius);
  padding: 14px 18px; font-size: 13.5px; color: var(--blue); display: flex; gap: 10px; margin-bottom: 20px;
}

.warn-box {
  background: #FEF3C7; border: 1px solid #FCD34D; border-radius: var(--radius);
  padding: 14px 18px; font-size: 13.5px; color: #92400E; display: flex; gap: 10px; margin-bottom: 20px;
}

.error-box {
  background: var(--red-tint); border: 1px solid #F1B3AC; border-radius: var(--radius);
  padding: 14px 18px; font-size: 13.5px; color: var(--red); margin-bottom: 20px;
}
.error-box ul { padding-left: 18px; margin-top: 4px; }

.success-box {
  background: var(--green-tint); border: 1px solid #A7D9BE; border-radius: var(--radius);
  padding: 18px 20px; font-size: 14px; color: var(--green-dark); display: flex; gap: 12px; align-items: flex-start;
}

/* ======================== STEP INDICATOR ======================== */
.steps { display: flex; align-items: center; margin-bottom: 32px; gap: 0; }
.step { display: flex; align-items: center; flex: 1; }

.step-circle {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--gray-200); color: var(--gray-400); background: var(--white);
}

.step.done .step-circle { background: var(--green-light); border-color: var(--green-light); color: #fff; }
.step.active .step-circle { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }

.step-label { font-size: 11px; color: var(--gray-400); margin-left: 8px; white-space: nowrap; }
.step.active .step-label { color: var(--green-dark); font-weight: 600; }
.step.done .step-label { color: var(--green-mid); }

.step-line { flex: 1; height: 2px; background: var(--gray-200); margin: 0 8px; }
.step-line.done { background: var(--green-light); }

/* ======================== PAGE TOP BAR ======================== */
.page-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.page-topbar h1 { font-size: 22px; font-weight: 700; color: var(--green-dark); }
.page-topbar p { font-size: 13.5px; color: var(--gray-400); margin-top: 2px; }

/* ======================== METRIC CARDS ======================== */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }

.metric-card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 18px 20px; position: relative; overflow: hidden;
}

.metric-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--green-light); }
.metric-card.gold::before { background: var(--gold); }
.metric-card.blue::before { background: var(--blue); }
.metric-card.red::before  { background: var(--red); }

.metric-label {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gray-400); margin-bottom: 6px;
}

.metric-value { font-size: 28px; font-weight: 700; color: var(--green-dark); line-height: 1; }
.metric-card.gold .metric-value { color: #7A5C10; }
.metric-card.blue .metric-value { color: var(--blue); }
.metric-card.red  .metric-value { color: var(--red); }
.metric-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ======================== LOGIN PAGE ======================== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%); padding: 2rem;
}

.login-card {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px; overflow: hidden;
}

.login-header { background: var(--green-dark); padding: 28px 28px 24px; text-align: center; }

.login-logo {
  width: 58px; height: 58px; background: var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--green-dark); margin: 0 auto 12px;
}

.login-header h2 { font-size: 16px; font-weight: 700; color: #fff; }
.login-header p { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 3px; }

.login-body { padding: 28px; }

.login-tab { display: flex; gap: 4px; background: var(--gray-100); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 24px; }

.login-tab button {
  flex: 1; padding: 8px; border: none; border-radius: 5px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: transparent; color: var(--gray-400); transition: all 0.15s; font-family: inherit;
}

.login-tab button.active { background: var(--white); color: var(--green-dark); box-shadow: var(--shadow-sm); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ======================== FOOTER ======================== */
footer {
  background: var(--green-dark); color: rgba(255,255,255,0.7); text-align: center;
  padding: 24px 2rem; font-size: 12.5px; margin-top: auto;
}
footer strong { color: var(--gold); }

/* ======================== PROGRESS BAR ======================== */
.progress-bar-wrap { background: var(--gray-200); border-radius: 99px; height: 8px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--green-light); transition: width 0.4s; }

/* ======================== DETAIL ROW ======================== */
.detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 180px; flex-shrink: 0; color: var(--gray-400); font-size: 13px; }
.detail-value { color: var(--gray-800); font-weight: 500; }

/* ======================== KELAS CARD ======================== */
.kelas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }

.kelas-card {
  border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 18px;
  cursor: pointer; transition: all 0.15s; position: relative; background: var(--white);
}

.kelas-card:hover { border-color: var(--green-light); }
.kelas-card.selected { border-color: var(--green-mid); background: var(--green-tint); }

.kelas-card h4 { font-size: 14px; font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
.kelas-card p { font-size: 12px; color: var(--gray-400); line-height: 1.5; }

.kelas-cap {
  font-size: 11px; font-weight: 600; color: var(--gray-600); margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ======================== TIMELINE ======================== */
.timeline { position: relative; padding-left: 28px; }

.timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--gray-200); }

.timeline-item { position: relative; margin-bottom: 20px; }

.timeline-dot {
  position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--green-light); border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--green-light);
}

.timeline-item p { font-size: 13.5px; color: var(--gray-800); font-weight: 500; }
.timeline-item span { font-size: 12px; color: var(--gray-400); }

/* ======================== MODAL OVERLAY ======================== */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center; padding: 2rem;
}

.modal-overlay.open { display: flex; }

.modal { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; animation: slideUp 0.2s ease; }

@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--green-dark); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

.close-btn { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 20px; line-height: 1; padding: 2px; }
.close-btn:hover { color: var(--gray-800); }

/* ======================== RULE ENGINE ======================== */
.rule-result { background: var(--green-tint); border: 2px solid var(--green-light); border-radius: var(--radius); padding: 18px 20px; margin-top: 16px; }
.rule-result h4 { font-size: 14px; font-weight: 700; color: var(--green-dark); margin-bottom: 6px; }
.rule-result p { font-size: 13.5px; color: var(--green-mid); }

.rule-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rule-tag { background: var(--white); border: 1px solid var(--green-light); color: var(--green-dark); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }

/* ======================== DIVIDER ======================== */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }

/* ======================== PESANTREN INFO ======================== */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.info-item { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }

.info-item h4 {
  font-size: 13px; font-weight: 700; color: var(--green-dark); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}

.info-item p, .info-item li { font-size: 13.5px; color: var(--gray-600); line-height: 1.7; }
.info-item ul { padding-left: 18px; }

/* ======================== TOAST ======================== */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--green-dark); color: #fff;
  padding: 14px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 999; display: none; gap: 10px; align-items: center;
  max-width: 340px; animation: toastIn 0.25s ease;
}

.toast.show { display: flex; }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ======================== UPLOAD ITEM ======================== */
.upload-item { border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 16px; }

/* ======================== FILTER FORM ======================== */
.filter-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-form .form-control { flex: 1; min-width: 140px; }
.filter-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ======================== HAMBURGER BUTTON ======================== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background 0.15s;
}
.hamburger:hover { background: rgba(255,255,255,0.22); }
.hamburger:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.hamburger span {
  display: block;
  width: 20px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ======================== SIDEBAR OVERLAY ======================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}
.sidebar-overlay.open { display: block; }

.sidebar-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  line-height: 1;
  z-index: 1;
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 768px) {
  /* Grid layouts */
  .form-row { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .kelas-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }

  /* Nav */
  nav {
    padding: 0 1rem;
    gap: 12px;
    z-index: 9997;
    position: relative;
  }
  .nav-links { display: none !important; }
  .hamburger { display: flex !important; z-index: 9997; position: relative; }

  /* Sidebar slide-in */
  .sidebar {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transition: left 0.28s ease !important;
    overflow-y: auto !important;
    padding-top: 50px !important;
  }
  .sidebar.open {
    left: 0 !important;
    box-shadow: 6px 0 32px rgba(0,0,0,0.28) !important;
  }
  .sidebar-close { display: flex !important; }

  /* Main content */
  .main-content { padding: 14px !important; }
  .dashboard-layout { display: block !important; }

  /* Page topbar */
  .page-topbar { flex-direction: column; gap: 8px; padding-bottom: 12px; }
  .page-topbar h1 { font-size: 19px; }
  .page-topbar p { font-size: 12.5px; }

  /* Metrics */
  .metrics-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .metric-card { padding: 12px 14px; }
  .metric-value { font-size: 26px; }
  .metric-label { font-size: 11px; }
  .metric-sub { font-size: 11px; }

  /* Filter form */
  .filter-form { flex-direction: column; align-items: stretch; gap: 8px; }
  .filter-form .form-control { width: 100% !important; min-width: unset; flex: unset; }
  .filter-actions { width: 100%; display: flex; gap: 8px; }
  .filter-actions .btn { flex: 1; justify-content: center; text-align: center; }

  /* Card header */
  .card-header { flex-direction: column; gap: 8px; align-items: flex-start !important; }
  .card-header .btn { width: 100%; text-align: center; justify-content: center; }

  /* Tabel scroll */
  .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 540px; }
  table th, table td { font-size: 12px !important; padding: 8px 10px !important; white-space: nowrap; }

  /* Aksi di tabel — stack vertikal */
  td .btn + form,
  td form { margin-top: 0; }

  /* Grid 2 kolom di laporan & verifikasi → 1 kolom */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1.3fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Grid cara daftar (4 kolom → 2 kolom) */
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Grid 3 kolom (jadwal) → 1 kolom */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Steps */
  .steps { gap: 6px; }
  .step-label { font-size: 10px; }

  /* Kelas grid */
  .kelas-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }

  /* Pagination */
  .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .pagination .page-item .page-link { padding: 6px 10px; font-size: 13px; }

  /* Topbar action button */
  .page-topbar > * { width: 100%; }
  .page-topbar .btn { width: 100%; justify-content: center; text-align: center; }

  /* Hero section */
  .hero { padding: 40px 1rem 32px; }
  .hero h1 { font-size: 22px; }
  .hero-subtitle { font-size: 13.5px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; text-align: center; }

  /* Footer */
  footer { font-size: 12px; padding: 16px 1rem; text-align: center; }
}
