:root{
  --green-dark: #1e6b3e;
  --green: #23864b;
  --bg: #eafaf1;
  --border: #d9ece0;
  --text: #1f3b2c;
  --blue: #2f6fe4;
  --pink: #d6336c;
  --purple: #7048c9;
  --orange: #e08a2b;
  --red: #d9534f;
}
*{ box-sizing: border-box; }
body{ margin:0; font-family:'Segoe UI',Roboto,Arial,sans-serif; background: var(--bg); color: var(--text); }

.header{ background: var(--green-dark); color:#fff; text-align:center; padding: 24px 16px 20px; }
.header-logo{ height:70px; width:auto; max-width:25vw; border-radius:50%; display:block; margin:0 auto 10px; border:3px solid #fff; }
.header h1{ margin:6px 0; font-size: 24px; letter-spacing: 0.5px; }
.subheader{ margin:0; color:#cfe9d8; font-size:14px; }

@media (max-width:600px){
  .header-logo{ width:60px; height:auto; max-width:20vw; }
  .header h1{ font-size:18px; }
}

.wrap{ max-width:1200px; margin:0 auto; padding: 20px 16px 60px; }

.admin-row{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.admin-badge{ background:#fff3cd; color:#8a6d00; padding:5px 12px; border-radius:20px; font-size:12px; font-weight:600; }

.btn{ border:none; border-radius:8px; padding:9px 16px; font-weight:600; cursor:pointer; color:#fff; font-size:13px; }
.btn-dark{ background:#1f2933; }
.btn-green2{ background:#159c5b; }
.btn-green{ background: var(--green); }
.btn-gray{ background:#e2e8ea; color:#333; }
.btn-blue{ background: var(--blue); }
.btn-red{ background: var(--red); }
.btn:hover{ filter:brightness(0.95); }

.kelas-tabs, .rombel-tabs{ display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.kelas-btn, .rombel-btn{
  padding:8px 16px; border-radius:8px; border:1px solid var(--border); background:#eef3f0; color:var(--text);
  font-weight:600; cursor:pointer; font-size:13px;
}
.kelas-btn.active{ background: var(--green-dark); color:#fff; border-color: var(--green-dark); }
.rombel-btn.active{ background: var(--blue); color:#fff; border-color: var(--blue); }
.rombel-btn{ background:#e7f6ee; }

.stats-row{ display:grid; grid-template-columns: repeat(6,1fr); gap:12px; margin: 18px 0; }
@media (max-width:900px){ .stats-row{ grid-template-columns: repeat(3,1fr); } }
@media (max-width:560px){ .stats-row{ grid-template-columns: repeat(2,1fr); } }
.stat-box{ border-radius:10px; padding:14px; text-align:center; }
.stat-label{ font-size:12px; margin-bottom:4px; }
.stat-value{ font-size:20px; font-weight:700; }
.stat-blue{ background:#e7f0ff; } .stat-blue .stat-label{ color:#2f6fe4;} .stat-blue .stat-value{ color:#2f6fe4;}
.stat-pink{ background:#fdeef3; } .stat-pink .stat-label{ color:#d6336c;} .stat-pink .stat-value{ color:#d6336c;}
.stat-green{ background:#e8f7ee; } .stat-green .stat-label{ color:var(--green);} .stat-green .stat-value{ color:var(--green);}
.stat-purple{ background:#f1ecfb; } .stat-purple .stat-label{ color:var(--purple);} .stat-purple .stat-value{ color:var(--purple);}
.stat-orange{ background:#fdf1e2; } .stat-orange .stat-label{ color:var(--orange);} .stat-orange .stat-value{ color:var(--orange);}
.stat-red{ background:#fbe9e8; } .stat-red .stat-label{ color:var(--red);} .stat-red .stat-value{ color:var(--red);}

.btn-row{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; }

.card{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:18px; margin-bottom:18px; }
.card h3{ margin-top:0; color: var(--green-dark); }
.hint{ font-size:13px; color:#557; }
.stats-hint{ margin-top:-10px; margin-bottom:18px; font-size:12px; color:#77877e; }

.form-row{ display:flex; gap:16px; flex-wrap:wrap; align-items:flex-end; }
.form-group{ display:flex; flex-direction:column; gap:6px; }
.form-group.grow{ flex:1; min-width:200px; }
.form-group input, .form-group select{ padding:9px; border:1px solid var(--border); border-radius:8px; font-size:14px; }
.form-group label{ font-size:12px; color:#556; font-weight:600; }

textarea{ width:100%; border:1px solid var(--border); border-radius:8px; padding:10px; font-family:monospace; font-size:13px; resize:vertical; }

.table-card{ overflow:hidden; }
.table-scroll{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; min-width:500px; }
thead tr{ background: var(--green-dark); color:#fff; }
th, td{ padding:10px 12px; text-align:center; border-bottom:1px solid var(--border); font-size:14px; }
.th-left{ text-align:left; }
td.nama-col{ text-align:left; font-weight:500; }
tbody tr:hover{ background:#f6fbf8; }
select.status-select{ padding:6px; border-radius:6px; border:1px solid var(--border); }
select.status-select:disabled{ background:#f1f1f1; color:#888; }
.foto-thumb{
  width:44px; height:44px; border-radius:50%; object-fit:cover;
  border:1px solid var(--border); display:block; margin:0 auto;
}
.foto-clickable{ cursor:pointer; transition: transform .15s; }
.foto-clickable:hover{ transform: scale(1.12); border-color: var(--green); }
.foto-placeholder{
  display:flex; align-items:center; justify-content:center;
  background:#eef3f0; color:#9db2a8; font-size:20px;
}

.photo-modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,0.8);
  display:flex; align-items:center; justify-content:center;
  z-index:1200; padding:20px;
}
.photo-modal-img{
  max-width:90vw; max-height:85vh; border-radius:10px;
  box-shadow:0 10px 40px rgba(0,0,0,0.4); object-fit:contain;
}
.photo-modal-close{
  position:fixed; top:18px; right:24px; background:rgba(255,255,255,0.15);
  color:#fff; border:none; border-radius:50%; width:40px; height:40px;
  font-size:20px; cursor:pointer; line-height:1;
}
.photo-modal-close:hover{ background:rgba(255,255,255,0.3); }
.foto-area{ margin-top:6px; }
.foto-btn-row{ display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.btn-foto-cam, .btn-foto-gal, .btn-foto-ulang-cam, .btn-foto-ulang-gal{
  background:#eef3f0; color: var(--green-dark); border:1px solid var(--border); border-radius:6px;
  padding:5px 9px; font-size:11px; cursor:pointer; font-weight:600; white-space:nowrap;
}
.btn-foto-cam:hover, .btn-foto-gal:hover, .btn-foto-ulang-cam:hover, .btn-foto-ulang-gal:hover{ background:#e2ede6; }
.btn-foto-ulang-cam, .btn-foto-ulang-gal{ background:#e7f0ff; color: var(--blue); border-color:#cfe0fb; }
.btn-foto-ulang-cam:hover, .btn-foto-ulang-gal:hover{ background:#dbe8fd; }
.foto-ok{ color:#1e8e3e; font-size:12px; font-weight:600; display:inline-block; }
.foto-admin-actions{ display:flex; gap:6px; margin-top:6px; flex-wrap:wrap; justify-content:center; }
.btn-hapus-foto{
  background:#fbe9e8; color: var(--red); border:1px solid #f3c9c7; border-radius:6px;
  padding:5px 9px; font-size:11px; cursor:pointer; font-weight:600;
}
.btn-hapus-foto:hover{ background:#f7dcda; }
.lock-note{ color:#b8860b; font-size:12px; font-weight:600; display:inline-block; }
.lock-badge{ margin-top:4px; font-size:11px; color:#b8860b; font-weight:600; }
.aksi-col{ display:flex; flex-direction:column; gap:6px; align-items:center; }
.lock-btn{
  background:#fff3cd; color:#8a6d00; border:1px solid #f0d68a; border-radius:6px;
  padding:5px 10px; font-size:12px; cursor:pointer; font-weight:600;
}
.lock-btn.unlock{ background:#e7f6ee; color: var(--green-dark); border-color:#bfe3cd; }
.lock-btn:hover{ filter:brightness(0.97); }
.pindah-rombel-select{
  font-size:11px; padding:5px 6px; border-radius:6px; border:1px solid var(--border);
  color: var(--blue); background:#f5f9ff; cursor:pointer; max-width:150px;
}
.reset-status-btn{
  background:#f1f1f1; color:#555; border:1px solid var(--border); border-radius:6px;
  padding:5px 10px; font-size:12px; cursor:pointer; font-weight:600;
}
.reset-status-btn:hover{ background:#e6e6e6; }
.del-btn{ background: var(--red); border:none; color:#fff; border-radius:6px; padding:5px 10px; cursor:pointer; }

.table-footer{ display:flex; justify-content:space-between; align-items:center; margin-top:14px; flex-wrap:wrap; gap:10px; }

.modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,0.4); display:flex; align-items:center; justify-content:center; z-index:999;
}
.modal-box{ background:#fff; border-radius:12px; padding:24px; width:320px; max-width:90vw; }
.modal-box h3{ margin-top:0; color: var(--green-dark); }
.modal-box input{ width:100%; padding:9px; border:1px solid var(--border); border-radius:8px; margin-bottom:12px; }

.toast{
  position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background: var(--green-dark); color:#fff;
  padding:10px 20px; border-radius:8px; font-size:14px; opacity:0; pointer-events:none; transition:opacity .3s; z-index:1000;
}
.toast.show{ opacity:1; }

.print-area{ display:none; }
@media print{
  body *{ visibility:hidden; }
  .print-area, .print-area *{ visibility:visible; }
  .print-area{ display:block; position:absolute; top:0; left:0; width:100%; padding:20px; }
}
