/* ============================================================
   BELOVED KIDS CITO — Enhanced Stylesheet v2
   Mobile-first, warm maroon x gold, highly readable
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Playfair+Display:ital,wght@0,700;0,800;1,700&display=swap');

:root {
  --maroon:       #7B1120;
  --maroon-deep:  #4A0A13;
  --maroon-light: #C0394A;
  --maroon-pale:  #FAE8EB;
  --gold:         #D4A017;
  --gold-light:   #F0C842;
  --gold-pale:    #FDF3D0;
  --cream:        #F5EDE6;   /* lebih warm & muted, gak seputih dulu */
  --white:        #FBF6F3;   /* off-white hangat, bukan pure white */

  --text:         #2C1810;
  --text-mid:     #6B3A2A;
  --text-muted:   #A07060;
  --border:       rgba(123,17,32,0.10);

  --radius:       20px;
  --radius-sm:    14px;
  --radius-xs:    10px;
  --shadow:       0 4px 24px rgba(74,10,19,0.08);
  --shadow-lg:    0 8px 40px rgba(74,10,19,0.16);
  --shadow-card:  0 2px 16px rgba(74,10,19,0.07);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', sans-serif;
  --touch-target: 52px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---- BG BUBBLES ---- */
.bg-bubbles {
  position: fixed; inset:0;
  pointer-events:none; z-index:0; overflow:hidden;
}
.bg-bubbles span {
  position:absolute; border-radius:50%; opacity:0.04;
  animation: float 14s infinite ease-in-out;
}
.bg-bubbles span:nth-child(1){width:300px;height:300px;background:var(--maroon);top:-80px;left:-80px;animation-delay:0s}
.bg-bubbles span:nth-child(2){width:200px;height:200px;background:var(--gold);top:30%;right:-60px;animation-delay:2.5s}
.bg-bubbles span:nth-child(3){width:150px;height:150px;background:var(--maroon-light);bottom:25%;left:5%;animation-delay:5s}
.bg-bubbles span:nth-child(4){width:240px;height:240px;background:var(--gold);bottom:-60px;right:15%;animation-delay:1.2s}
.bg-bubbles span:nth-child(5){width:100px;height:100px;background:var(--maroon);top:55%;left:45%;animation-delay:3.5s}

@keyframes float {
  0%,100%{transform:translateY(0) scale(1)}
  50%{transform:translateY(-28px) scale(1.05)}
}

/* ---- LOADING ---- */
.loading-overlay {
  position:fixed;inset:0;
  background:rgba(74,10,19,0.90);
  display:none;align-items:center;justify-content:center;
  flex-direction:column;gap:20px;z-index:1000;
  backdrop-filter:blur(8px);
}
.loading-overlay.show{display:flex}
.loading-spinner {
  width:52px;height:52px;
  border:5px solid rgba(255,255,255,0.15);
  border-top-color:var(--gold-light);
  border-radius:50%;
  animation:spin 0.75s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.loading-overlay p{
  color:var(--gold-pale);
  font-weight:700;font-size:1rem;
  letter-spacing:0.5px;opacity:0.9;
}

/* ---- TOAST ---- */
.toast {
  position:fixed;bottom:28px;left:50%;
  transform:translateX(-50%) translateY(110px);
  background:var(--maroon-deep);
  color:white;padding:14px 26px;
  border-radius:100px;font-size:0.93rem;font-weight:800;
  transition:transform 0.38s cubic-bezier(0.34,1.56,0.64,1);
  z-index:999;box-shadow:0 8px 32px rgba(74,10,19,0.35);
  border:2px solid rgba(212,160,23,0.3);
  white-space:nowrap;max-width:92vw;
  text-align:center;
}
.toast.show{transform:translateX(-50%) translateY(0)}
.toast.success{
  background:linear-gradient(135deg,#1B6B3A,#27AE60);
  border-color:rgba(46,204,113,0.5);
}
.toast.error{
  background:linear-gradient(135deg,#922B21,#E74C3C);
  border-color:rgba(231,76,60,0.5);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position:relative;z-index:1;
  background:linear-gradient(145deg,#5C1018 0%,#7B1120 55%,#8B1A28 100%);
  padding:28px 20px 96px;
  overflow:hidden;
}
/* Decorative rings */
.site-header::before {
  content:'';position:absolute;top:-60px;right:-60px;
  width:240px;height:240px;
  border:2px solid rgba(212,160,23,0.15);border-radius:50%;
}
.site-header::after {
  content:'';position:absolute;bottom:40px;left:-60px;
  width:180px;height:180px;
  border:1.5px solid rgba(212,160,23,0.10);border-radius:50%;
}

/* Second ring on right */
.site-header .header-ring {
  position:absolute;top:20px;right:30px;
  width:120px;height:120px;
  border:1px solid rgba(212,160,23,0.08);border-radius:50%;
  pointer-events:none;
}

.header-inner {
  position:relative;z-index:1;
  max-width:740px;margin:0 auto;
  display:flex;align-items:center;gap:18px;
}

.logo-wrap {
  flex-shrink:0;
  width:84px;height:84px;border-radius:20px;overflow:hidden;
  border:2.5px solid rgba(212,160,23,0.45);
  box-shadow:0 6px 24px rgba(0,0,0,0.35);
  background:black;
}
.site-logo{width:100%;height:100%;object-fit:cover}

.header-text{flex:1}

.header-date {
  display:inline-flex;align-items:center;gap:6px;
  background:rgba(212,160,23,0.18);
  border:1px solid rgba(212,160,23,0.35);
  border-radius:100px;
  padding:5px 14px;
  font-size:0.68rem;color:var(--gold-light);
  letter-spacing:1.2px;text-transform:uppercase;font-weight:800;
  margin-bottom:7px;
}

.header-title {
  font-family:var(--font-display);
  font-size:1.45rem;font-weight:800;
  color:white;line-height:1.1;
  text-shadow:0 2px 8px rgba(0,0,0,0.2);
  letter-spacing:0.2px;
}

.header-tagline{
  color:rgba(255,255,255,0.60);
  font-size:0.8rem;font-weight:600;
  margin-top:4px;
}

/* ============================================================
   MAIN CONTENT LIFT
   ============================================================ */
.main-content {
  position:relative;z-index:1;
  max-width:740px;margin:-60px auto 40px;
  padding:0 12px 80px;
}
.main-content::before {
  content:'';display:block;height:60px;
  background:var(--cream);
  border-radius:28px 28px 0 0;
  margin:0 -4px;
}

/* ---- CONFIG BANNER ---- */
.config-banner {
  display:flex;gap:12px;align-items:flex-start;
  background:#FFF8E1;border:1.5px solid #FFD54F;
  border-radius:var(--radius-sm);padding:14px 16px;
  margin-bottom:16px;font-size:0.84rem;color:#5D4037;line-height:1.5;
}
.config-banner.hidden{display:none}
.config-banner code{background:rgba(0,0,0,0.07);padding:1px 5px;border-radius:4px;font-size:0.78rem}

/* ============================================================
   TABS — big, clear, friendly
   ============================================================ */
.tab-nav {
  display:grid;grid-template-columns:repeat(4,1fr);
  gap:8px;margin-bottom:18px;
}

.tab-btn {
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:4px;
  min-height:76px;
  padding:10px 6px;
  border:2px solid rgba(123,17,32,0.10);
  border-radius:var(--radius-sm);
  background:#F0E8E2;
  color:var(--text-muted);
  font-family:var(--font-body);
  cursor:pointer;
  transition:all 0.22s cubic-bezier(0.34,1.3,0.64,1);
  box-shadow:var(--shadow-card);
  user-select:none;-webkit-user-select:none;
  touch-action:manipulation;
  position:relative;overflow:hidden;
}
.tab-btn:active{transform:scale(0.94);}

.tab-btn.active {
  background:linear-gradient(145deg,var(--maroon-deep),var(--maroon));
  border-color:transparent;color:white;
  box-shadow:0 6px 20px rgba(123,17,32,0.40);
  transform:translateY(-2px);
}
.tab-btn.active .tab-sub{color:rgba(255,255,255,0.65)}
/* Gold accent bar at bottom */
.tab-btn.active::after {
  content:'';
  position:absolute;bottom:0;left:20%;right:20%;
  height:3px;background:var(--gold-light);
  border-radius:2px 2px 0 0;
}

.tab-icon {font-size:1.55rem;line-height:1}
.tab-label{font-size:0.72rem;font-weight:900;line-height:1.2;letter-spacing:0.2px}
.tab-sub{font-size:0.6rem;color:var(--text-muted);line-height:1;font-weight:600}

/* ============================================================
   PANELS
   ============================================================ */
.panel{display:none;animation:fadeUp 0.30s ease}
.panel.active{display:block}

@keyframes fadeUp{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:translateY(0)}
}

.panel-card {
  background:var(--white);
  border-radius:var(--radius);
  padding:22px 18px;
  box-shadow:0 2px 20px rgba(74,10,19,0.06);
  border:1px solid rgba(123,17,32,0.08);
}

/* ---- PANEL HEADER ---- */
.panel-header {
  display:flex;align-items:center;gap:14px;
  margin-bottom:22px;padding-bottom:18px;
  border-bottom:2px dashed rgba(123,17,32,0.08);
}
.panel-badge {
  width:52px;height:52px;border-radius:16px;
  display:flex;align-items:center;justify-content:center;
  font-size:1.6rem;flex-shrink:0;
  box-shadow:0 3px 12px rgba(0,0,0,0.08);
}
.kecil-badge {background:linear-gradient(135deg,#FFE8D0,#FFD0A8)}
.tengah-badge{background:linear-gradient(135deg,#D5F5E3,#A9DFC0)}
.besar-badge {background:linear-gradient(135deg,#D4E8FC,#AACCEE)}
.rekap-badge {background:linear-gradient(135deg,#EAD8F8,#D4B8F0)}

.panel-header h2{
  font-family:var(--font-display);
  font-size:1.45rem;font-weight:800;
  color:var(--maroon-deep);line-height:1;
}
.panel-header p{font-size:0.78rem;color:var(--text-muted);margin-top:5px;font-weight:600}

/* ============================================================
   FORM — big inputs for mobile
   ============================================================ */
.form-grid{
  display:grid;grid-template-columns:1fr 1fr;
  gap:10px;margin-bottom:14px;
}
.form-group{display:flex;flex-direction:column;gap:6px}
.form-group label{
  font-size:0.74rem;font-weight:800;
  color:var(--text-mid);letter-spacing:0.5px;text-transform:uppercase;
}

.form-input {
  width:100%;
  min-height:50px;
  background:#F0E8E2;
  border:2px solid rgba(123,17,32,0.12);
  border-radius:var(--radius-sm);
  padding:12px 14px;
  font-family:var(--font-body);
  font-size:1rem;
  color:var(--text);
  outline:none;
  transition:border-color 0.2s,box-shadow 0.2s,background 0.2s;
  -webkit-appearance:none;appearance:none;
}
.form-input:focus{
  border-color:var(--maroon);
  box-shadow:0 0 0 4px rgba(123,17,32,0.08);
  background:white;
}
.form-input::placeholder{color:var(--text-muted);font-weight:600}

/* Select arrow */
select.form-input {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237B1120' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  padding-right:40px;cursor:pointer;
}

.add-row{display:flex;gap:8px;margin-bottom:16px}
.add-row .form-input{flex:1}

/* ============================================================
   PROGRESS BAR — visual kehadiran
   ============================================================ */
.progress-wrap {
  margin-bottom:14px;
}
.progress-label {
  display:flex;justify-content:space-between;align-items:center;
  margin-bottom:6px;
}
.progress-label span {
  font-size:0.78rem;font-weight:800;color:var(--text-mid);
}
.progress-label strong {
  font-size:0.88rem;color:var(--maroon);
}
.progress-bar-track {
  width:100%;height:10px;
  background:rgba(123,17,32,0.08);
  border-radius:100px;overflow:hidden;
}
.progress-bar-fill {
  height:100%;
  background:linear-gradient(90deg,var(--maroon),var(--maroon-light));
  border-radius:100px;
  transition:width 0.4s cubic-bezier(0.34,1.2,0.64,1);
  min-width:0%;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-height:var(--touch-target);
  padding:12px 22px;
  border:none;border-radius:var(--radius-sm);
  font-family:var(--font-body);
  font-size:0.92rem;font-weight:800;
  cursor:pointer;transition:all 0.18s;
  white-space:nowrap;letter-spacing:0.3px;
  user-select:none;-webkit-user-select:none;
  touch-action:manipulation;
}
.btn:active{transform:scale(0.95);box-shadow:none!important}

.btn-primary{
  background:linear-gradient(145deg,var(--maroon),var(--maroon-light));
  color:white;
  box-shadow:0 5px 18px rgba(123,17,32,0.35);
  width:100%;
  font-size:1rem;min-height:58px;
  border-radius:var(--radius-sm);
  letter-spacing:0.5px;
}
.btn-primary:hover{
  box-shadow:0 8px 24px rgba(123,17,32,0.45);
  transform:translateY(-1px);
}

.btn-add{
  background:linear-gradient(145deg,var(--gold),var(--gold-light));
  color:var(--maroon-deep);
  box-shadow:0 4px 14px rgba(212,160,23,0.35);
  min-height:50px;padding:10px 18px;
  font-size:0.88rem;flex-shrink:0;
  border-radius:var(--radius-sm);
}

.btn-outline{
  background:transparent;
  border:2.5px solid var(--maroon);
  color:var(--maroon);
  font-weight:800;
}

.btn-ghost{
  background:#F8F0EC;color:var(--text-mid);
  border:2px solid rgba(123,17,32,0.10);
  font-size:0.84rem;flex:1;
}
.btn-ghost:hover{background:#F0E4DC;border-color:rgba(123,17,32,0.2)}

.action-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.action-row + .action-row{margin-top:10px}
.action-row .btn-ghost{min-height:48px}

/* Divider antara simpan dan action sekunder */
.action-divider {
  height: 1px;
  background: rgba(123,17,32,0.08);
  margin: 18px 0 14px;
  border: none;
}

/* ============================================================
   STUDENT LIST
   ============================================================ */
.student-list{display:flex;flex-direction:column;gap:10px;min-height:48px}

.student-item {
  display:flex;align-items:center;gap:14px;
  min-height:64px;
  padding:12px 16px;
  border-radius:var(--radius-sm);
  border:2px solid rgba(123,17,32,0.09);
  background:#F8F1ED;
  cursor:pointer;
  transition:all 0.2s cubic-bezier(0.34,1.2,0.64,1);
  user-select:none;-webkit-user-select:none;
  touch-action:manipulation;
  position:relative;
}
.student-item:active{transform:scale(0.97)}

/* HADIR state */
.student-item.hadir{
  border-color:rgba(123,17,32,0.55);
  background:linear-gradient(135deg,#F5E6E9,#EDD5DA);
  box-shadow:0 2px 10px rgba(123,17,32,0.10);
}
.student-item.hadir .student-avatar{
  background:linear-gradient(145deg,var(--maroon-deep),var(--maroon));
  color:white;border-color:transparent;
  font-size:1.2rem;
}
.student-item.hadir .student-status{
  color:white;
  background:var(--maroon);
  border-color:var(--maroon);
}
.student-item.hadir .student-name{color:var(--maroon-deep);font-weight:900}

.student-avatar {
  width:44px;height:44px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  border:2px solid rgba(123,17,32,0.15);
  background:#F0E4DC;color:var(--text-muted);
  font-weight:900;font-size:1.05rem;flex-shrink:0;
  transition:all 0.2s;
}

.student-name{flex:1;font-size:0.98rem;font-weight:700;color:var(--text);line-height:1.3}

.student-status{
  font-size:0.7rem;font-weight:800;
  padding:5px 11px;border-radius:20px;
  border:1.5px solid rgba(123,17,32,0.12);
  background:#F0E4DC;color:var(--text-muted);
  text-transform:uppercase;letter-spacing:0.6px;
  transition:all 0.2s;white-space:nowrap;flex-shrink:0;
}

/* Delete button — always visible, clearly a destructive action */
.del-btn {
  background: rgba(220,53,69,0.08);
  border: 1.5px solid rgba(220,53,69,0.20);
  cursor: pointer;
  font-size: 0.85rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: #C0392B;
  transition: all 0.18s;
  flex-shrink: 0;
  touch-action: manipulation;
  user-select: none;
}
.del-btn:active {
  background: rgba(220,53,69,0.22);
  border-color: rgba(220,53,69,0.50);
  transform: scale(0.88);
}
@media (hover:hover) {
  .del-btn:hover {
    background: rgba(220,53,69,0.15);
    border-color: rgba(220,53,69,0.40);
    transform: scale(1.05);
  }
}

/* Hadir pop animation */
@keyframes pop {
  0%{transform:scale(1)}
  40%{transform:scale(1.04)}
  100%{transform:scale(1)}
}
.student-item.hadir{animation:pop 0.22s ease}

/* ---- SUMMARY BAR ---- */
.summary-bar{
  display:flex;gap:6px;flex-wrap:wrap;
  margin-top:16px;padding-top:14px;
  border-top:2px dashed rgba(123,17,32,0.08);
}
.summary-chip{
  padding:7px 16px;border-radius:100px;
  border:1.5px solid rgba(123,17,32,0.10);
  background:#EEE3DC;
  font-size:0.8rem;color:var(--text-mid);font-weight:700;
}
.summary-chip strong{color:var(--maroon);font-size:0.9rem}

/* ============================================================
   HINT BAR
   ============================================================ */
.hint-bar {
  background:linear-gradient(135deg,rgba(212,160,23,0.10),rgba(212,160,23,0.05));
  border:1.5px solid rgba(212,160,23,0.28);
  border-radius:var(--radius-xs);
  padding:10px 16px;
  font-size:0.79rem;color:var(--text-mid);font-weight:700;
  margin-bottom:14px;text-align:center;
  display:none;
}
.hint-bar.visible{display:block}

/* Live counter */
.attendance-hint {
  font-size:0.82rem;font-weight:900;color:var(--maroon);
  margin-bottom:10px;min-height:20px;
  text-align:right;padding-right:2px;
  letter-spacing:0.3px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state{text-align:center;padding:44px 20px;color:var(--text-muted)}
.empty-icon{font-size:3rem;margin-bottom:12px;opacity:0.45}
.empty-state p{font-size:0.9rem;line-height:1.8}
.empty-state strong{color:var(--maroon)}

/* ============================================================
   REKAP
   ============================================================ */
.rekap-controls{
  display:grid;grid-template-columns:1fr 1fr;
  gap:10px;margin-bottom:20px;
}
.rekap-controls .btn-primary{
  grid-column:span 1;min-height:50px;font-size:0.9rem;
}
.rekap-controls .btn-outline{
  min-height:50px;font-size:0.9rem;
}

.stat-grid{
  display:grid;grid-template-columns:repeat(3,1fr);
  gap:10px;margin-bottom:22px;
}
.stat-card{
  border-radius:16px;padding:18px 12px;text-align:center;
  background:linear-gradient(145deg,#FFF4F5,#FFE8EC);
  border:1px solid rgba(123,17,32,0.08);
  box-shadow:var(--shadow-card);
}
.stat-card .num{
  font-family:var(--font-display);
  font-size:2.4rem;font-weight:800;
  color:var(--maroon);line-height:1;
}
.stat-card .lbl{
  font-size:0.71rem;color:var(--text-muted);
  margin-top:8px;line-height:1.5;font-weight:700;
}

.rekap-section-title{
  font-family:var(--font-display);
  font-size:1.05rem;font-weight:700;
  color:var(--maroon-deep);margin-bottom:12px;
  display:flex;align-items:center;gap:10px;
}
.rekap-section-title::after{
  content:'';flex:1;height:2px;
  background:linear-gradient(90deg,rgba(123,17,32,0.12),transparent);
  border-radius:2px;
}

.rekap-table{width:100%;border-collapse:collapse;font-size:0.84rem}
.rekap-table th{
  text-align:left;padding:11px 12px;
  font-size:0.7rem;font-weight:800;
  color:var(--text-muted);letter-spacing:0.8px;text-transform:uppercase;
  border-bottom:2px solid rgba(123,17,32,0.08);
  background:#FDFAF8;
}
.rekap-table td{
  padding:13px 12px;
  border-bottom:1px solid rgba(123,17,32,0.06);
  color:var(--text-mid);
}
.rekap-table td:first-child{color:var(--text);font-weight:700}
.rekap-table tr:last-child td{border-bottom:none}
.rekap-table tr:hover td{background:#FDF8F5}

.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:var(--radius-xs)}
.demo-banner{
  background:#FFF8E1;border:1.5px solid #FFD54F;
  border-radius:10px;padding:12px 16px;
  font-size:0.83rem;color:#5D4037;margin-bottom:16px;
}

/* Scroll wrapper */
.rekap-table-wrap {
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:var(--radius-xs);
  background:
    linear-gradient(to right,white 30%,rgba(255,255,255,0)),
    linear-gradient(to right,rgba(255,255,255,0),white 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%,rgba(123,17,32,0.08),transparent),
    radial-gradient(farthest-side at 100% 50%,rgba(123,17,32,0.08),transparent) 100% 0;
  background-repeat:no-repeat;
  background-size:40px 100%,40px 100%,14px 100%,14px 100%;
  background-attachment:local,local,scroll,scroll;
}
.rekap-table{min-width:400px}

/* Sesi badge */
.sesi-badge {
  font-size:0.7rem;font-weight:800;
  background:linear-gradient(135deg,#FFF0F2,#FFE4E8);
  color:var(--maroon);
  padding:4px 10px;border-radius:20px;
  border:1px solid rgba(123,17,32,0.14);
  white-space:nowrap;
}

/* ============================================================
   REFRESH BTN
   ============================================================ */
.btn-refresh{
  margin-left:auto;
  background:none;border:1.5px solid rgba(123,17,32,0.12);
  color:var(--text-muted);border-radius:50%;
  width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;
  font-size:1.05rem;cursor:pointer;transition:all 0.2s;
  flex-shrink:0;
}
.btn-refresh:active{transform:rotate(180deg);color:var(--maroon)}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer{
  position:relative;z-index:1;
  text-align:center;padding:20px 20px 44px;
  font-size:0.82rem;color:var(--text-muted);
  border-top:1px solid rgba(123,17,32,0.07);
  font-weight:700;letter-spacing:0.2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:380px){
  .tab-label{font-size:0.62rem}
  .tab-icon{font-size:1.3rem}
  .panel-header h2{font-size:1.2rem}
  .stat-card .num{font-size:1.8rem}
  .btn-primary{font-size:0.94rem}
  .header-title{font-size:1.2rem}
}

@media (max-width:600px){
  .site-header{padding:22px 16px 96px}
  .logo-wrap{width:70px;height:70px}
  .main-content{padding:0 10px 80px}
  .panel-card{padding:18px 14px;border-radius:16px}
  .rekap-controls{grid-template-columns:1fr 1fr}
  .rekap-controls .form-input{grid-column:span 1}
  .rekap-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .rekap-table{min-width:420px}
}

@media (min-width:600px){
  .tab-label{font-size:0.8rem}
  .tab-icon{font-size:1.65rem}
  .panel-card{padding:30px 26px}
  .btn-primary{width:auto;font-size:0.97rem;min-height:54px}
  .form-input{font-size:0.97rem}
  .rekap-controls{display:flex;flex-wrap:wrap;}
  .rekap-controls .form-input{flex:1;min-width:140px}
}

@media (min-width:800px){
  .logo-wrap{width:92px;height:92px}
  .header-inner{gap:22px}
  .header-title{font-size:1.6rem}
}

/* ============================================================
   EXPORT MODAL
   ============================================================ */
.modal-overlay {
  position:fixed;inset:0;
  background:rgba(74,10,19,0.55);
  backdrop-filter:blur(6px);
  z-index:998;
  display:flex;align-items:flex-end;justify-content:center;
  opacity:0;pointer-events:none;
  transition:opacity 0.28s ease;
}
.modal-overlay.show {
  opacity:1;pointer-events:auto;
}
.modal-overlay.show .modal-box {
  transform:translateY(0);
}

.modal-box {
  background:white;
  width:100%;max-width:480px;
  border-radius:24px 24px 0 0;
  padding:28px 20px 40px;
  box-shadow:0 -8px 40px rgba(74,10,19,0.20);
  transform:translateY(100%);
  transition:transform 0.35s cubic-bezier(0.34,1.15,0.64,1);
}

/* Pull handle */
.modal-box::before {
  content:'';display:block;
  width:40px;height:4px;
  background:rgba(123,17,32,0.15);
  border-radius:2px;
  margin:0 auto 24px;
}

.modal-header {
  display:flex;align-items:center;gap:14px;
  margin-bottom:22px;
}
.modal-icon {
  width:48px;height:48px;border-radius:14px;
  background:linear-gradient(145deg,#FFF0F2,#FFE4E8);
  border:1.5px solid rgba(123,17,32,0.12);
  display:flex;align-items:center;justify-content:center;
  font-size:1.4rem;flex-shrink:0;
}
.modal-title {
  font-family:var(--font-display);
  font-size:1.25rem;font-weight:800;
  color:var(--maroon-deep);
}
.modal-sub {
  font-size:0.78rem;color:var(--text-muted);margin-top:3px;font-weight:600;
}
.modal-close {
  margin-left:auto;
  background:rgba(123,17,32,0.07);
  border:none;border-radius:50%;
  width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;font-size:0.9rem;color:var(--text-muted);
  flex-shrink:0;transition:all 0.18s;
}
.modal-close:hover{background:rgba(123,17,32,0.13);color:var(--maroon)}
.modal-close:active{transform:scale(0.9)}

.export-options {
  display:flex;flex-direction:column;gap:10px;
}

.export-opt {
  display:flex;align-items:center;gap:14px;
  width:100%;
  padding:16px 16px;
  border:2px solid rgba(123,17,32,0.10);
  border-radius:var(--radius-sm);
  background:#F8F1ED;
  cursor:pointer;
  transition:all 0.2s cubic-bezier(0.34,1.2,0.64,1);
  font-family:var(--font-body);
  text-align:left;
  touch-action:manipulation;
  user-select:none;
}
.export-opt:active{transform:scale(0.97)}
.export-opt:hover{
  border-color:var(--maroon);
  background:var(--maroon-pale);
  box-shadow:0 3px 12px rgba(123,17,32,0.10);
}

.export-opt-icon {
  width:50px;height:50px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  font-size:0.72rem;font-weight:900;letter-spacing:0.5px;
  flex-shrink:0;
}
.csv-icon  { background:linear-gradient(145deg,#E8F5E9,#C8E6C9); color:#2E7D32; border:1.5px solid rgba(46,125,50,0.2); }
.xlsx-icon { background:linear-gradient(145deg,#E3F2FD,#BBDEFB); color:#1565C0; border:1.5px solid rgba(21,101,192,0.2); }
.pdf-icon  { background:linear-gradient(145deg,#FFF3E0,#FFE0B2); color:#E65100; border:1.5px solid rgba(230,81,0,0.2); }

.export-opt-body {
  flex:1;
}
.export-opt-body strong {
  display:block;font-size:0.97rem;font-weight:800;color:var(--text);
}
.export-opt-body span {
  display:block;font-size:0.75rem;color:var(--text-muted);margin-top:3px;font-weight:600;line-height:1.4;
}

.export-opt-arrow {
  font-size:1.4rem;color:var(--text-muted);font-weight:300;flex-shrink:0;
  transition:transform 0.18s;
}
.export-opt:hover .export-opt-arrow{transform:translateX(3px);color:var(--maroon)}

/* Desktop: center modal */
@media (min-width:600px){
  .modal-overlay{align-items:center}
  .modal-box{border-radius:24px;max-width:440px;width:92%;}
  .modal-box::before{display:none}
}

/* ============================================================
   STUDENT ACTIONS (edit + hapus)
   ============================================================ */
.student-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Edit button — selaras dengan tema maroon */
.edit-btn {
  background: rgba(123, 17, 32, 0.07);
  border: 1.5px solid rgba(123, 17, 32, 0.18);
  cursor: pointer;
  font-size: 0.95rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--maroon);
  transition: all 0.18s;
  flex-shrink: 0;
  touch-action: manipulation;
  user-select: none;
}
.edit-btn:active {
  background: rgba(123, 17, 32, 0.18);
  border-color: rgba(123, 17, 32, 0.40);
  transform: scale(0.88);
}
@media (hover:hover) {
  .edit-btn:hover {
    background: rgba(123, 17, 32, 0.12);
    border-color: rgba(123, 17, 32, 0.32);
    transform: scale(1.05);
  }
}

/* ============================================================
   EDIT MODAL SPECIFICS
   ============================================================ */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.edit-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, #FFF8E1, #FFF3CD);
  border: 1.5px solid rgba(212, 160, 23, 0.35);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  font-size: 0.8rem;
  color: #5D4037;
  font-weight: 600;
  line-height: 1.5;
}
.edit-info-box span:first-child { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

.edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}
.edit-actions .btn-ghost {
  flex: 0;
  padding: 12px 20px;
  min-height: 48px;
  white-space: nowrap;
}
/* ============================================================
   REKAP — EXPANDABLE DETAIL ROWS
   ============================================================ */
.summary-row {
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
/* Subtle stripe biar keliatan ada sesuatu di sana */
.summary-row td {
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.summary-row td:first-child {
  border-left: 3px solid rgba(123,17,32,0.18);
}
.summary-row:hover td { background: rgba(123,17,32,0.05); }
.summary-row:hover td:first-child { border-left-color: var(--maroon); }
.summary-row:active td { background: rgba(123,17,32,0.09); }

/* State open — baris yang sudah terbuka dikasih tanda */
.summary-row.is-open td { background: rgba(123,17,32,0.06); }
.summary-row.is-open td:first-child { border-left-color: var(--maroon); }

/* Chevron — selalu keliatan, rotate saat open */
.expand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(123,17,32,0.08);
  border: 1px solid rgba(123,17,32,0.15);
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--maroon);
  margin-left: 6px;
  transition: transform 0.22s ease, background 0.15s;
  vertical-align: middle;
  flex-shrink: 0;
}
.summary-row.is-open .expand-icon {
  transform: rotate(90deg);
  background: var(--maroon);
  color: white;
  border-color: var(--maroon);
}

/* Hint teks "ketuk" di header tabel */
.rekap-tap-hint {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Detail row — hidden by default */
.detail-row {
  display: none;
}
.detail-row.open {
  display: table-row;
}
.detail-row td {
  padding: 0 !important;
  border-bottom: 2px solid rgba(123,17,32,0.12) !important;
  border-left: 3px solid var(--maroon) !important;
}

.detail-panel {
  padding: 14px 16px 16px;
  background: linear-gradient(135deg, rgba(123,17,32,0.04), rgba(123,17,32,0.02));
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.2s ease;
}

.detail-kelas {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.detail-kelas-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-mid);
  white-space: nowrap;
  padding-top: 4px;
  min-width: 76px;
  letter-spacing: 0.3px;
}

.detail-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-pill {
  display: inline-block;
  background: var(--white);
  border: 1.5px solid rgba(123,17,32,0.14);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ============================================================
   CONFIRM MODAL
   ============================================================ */
.confirm-modal-box {
  text-align: center;
  padding: 32px 24px 28px;
}
.confirm-modal-box::before { display: none; } /* hide pull handle */

.confirm-icon-wrap {
  font-size: 2.4rem;
  margin-bottom: 14px;
  line-height: 1;
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--maroon-deep);
  margin-bottom: 10px;
}

.confirm-body {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 24px;
}
.confirm-body strong { color: var(--text); }
.confirm-body .name-pill {
  font-size: 0.74rem;
  padding: 3px 10px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}
.confirm-actions .btn-ghost {
  flex: 1;
  min-height: 50px;
}
.confirm-actions .confirm-btn-ok {
  flex: 1.6;
  min-height: 50px;
  width: auto;
  font-size: 0.92rem;
}

/* Danger variant — untuk aksi destruktif */
.btn-danger {
  background: linear-gradient(145deg, #922B21, #C0392B);
  color: white;
  box-shadow: 0 4px 14px rgba(192,57,43,0.35);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(192,57,43,0.45);
  transform: translateY(-1px);
}

@media (min-width: 600px) {
  .confirm-modal-box {
    border-radius: 24px;
    max-width: 400px;
    width: 92%;
  }
}

/* ============================================================
   HELP BUTTON (di header)
   ============================================================ */
.help-btn {
  width: 36px; height: 36px;
  flex-shrink: 0;
  margin-left: auto;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  color: white;
  font-size: 1rem;
  font-weight: 900;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
  touch-action: manipulation;
  z-index: 10;
}
.help-btn:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.6);
  transform: scale(1.08);
}
.help-btn:active { transform: scale(0.92); }

/* ============================================================
   HELP MODAL
   ============================================================ */
.help-modal-box {
  padding: 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 480px;
  width: 96%;
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  flex-shrink: 0;
}
.help-header-text {
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-icon { font-size: 1.6rem; line-height: 1; }

/* Tab navigasi */
.help-tabs {
  display: flex;
  gap: 6px;
  padding: 16px 20px 0;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.help-tabs::-webkit-scrollbar { display: none; }

.help-tab {
  padding: 8px 14px;
  border-radius: 100px;
  border: 1.5px solid rgba(123,17,32,0.18);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  touch-action: manipulation;
  flex-shrink: 0;
}
.help-tab.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: white;
  box-shadow: 0 3px 10px rgba(123,17,32,0.28);
}
.help-tab:not(.active):hover {
  background: rgba(123,17,32,0.07);
  border-color: rgba(123,17,32,0.30);
  color: var(--maroon);
}

/* Konten panel */
.help-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 0 20px 24px;
  margin-top: 14px;
}

.help-panel { display: none; }
.help-panel.active { display: block; animation: fadeUp 0.2s ease; }

.help-lead {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Steps (numbered) */
.help-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.help-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--maroon);
  color: white;
  font-size: 0.82rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.help-step-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.help-step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.help-step-desc strong { color: var(--maroon); }

/* Items (icon-based) */
.help-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.help-item-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(123,17,32,0.07);
  border: 1.5px solid rgba(123,17,32,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.help-item-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.help-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.help-item-desc strong { color: var(--maroon); }

/* Note box */
.help-note {
  display: flex;
  gap: 10px;
  background: linear-gradient(135deg, #FFF8E1, #FFF3CD);
  border: 1.5px solid rgba(212,160,23,0.35);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  font-size: 0.8rem;
  color: #5D4037;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 6px;
}
.help-note-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

@media (min-width: 600px) {
  .help-modal-box { border-radius: 24px; }
}