/* Manajemen Kelas — gaya meniru referensi portal LSP */
:root {
  --navy: #1a2440; --navy-2: #232f52; --ink: #1c2333; --muted: #8a93a8;
  --bg: #f3f5fa; --card: #ffffff; --line: #e6eaf2;
  --blue: #2f6fed; --blue-soft: #e9f0fe;
  --green: #16a34a; --green-soft: #e6f6ec;
  --amber: #d97706; --amber-soft: #fef3e2;
  --red: #dc2626; --red-soft: #fdeaea;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--blue); text-decoration: none; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 264px; background: var(--navy); color: #dbe2f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; }
.brand-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--navy-2); border: 1px solid #35446e; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.brand-logo.big { width: 64px; height: 64px; font-size: 32px; }
.brand-title { font-weight: 700; font-size: 17px; letter-spacing: .5px; color: #fff; }
.brand-title.big { font-size: 24px; }
.brand-sub { font-size: 10.5px; letter-spacing: 2.2px; color: #9aa6c4; margin-top: 3px; }
.nav-sec { font-size: 10.5px; letter-spacing: 2px; color: #7d89a8; padding: 10px 22px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #c3cde6; font-size: 14px; }
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.nav-ico { width: 22px; text-align: center; }
.side-foot { padding: 14px; border-top: 1px solid #2b3a63; }
.user-card { display: flex; gap: 10px; align-items: center; padding: 8px 6px 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #3b4c7d; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.u-name { font-size: 13.5px; font-weight: 600; color: #fff; }
.u-role { font-size: 11.5px; color: #9aa6c4; }
.logout { width: 100%; background: none; border: none; color: #9aa6c4; text-align: left; padding: 8px 6px; font-size: 13px; cursor: pointer; border-radius: 8px; }
.logout:hover { color: #fff; background: var(--navy-2); }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: rgba(255,255,255,.75); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.crumb { font-size: 13.5px; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 12px; }
.date { font-size: 13px; color: var(--muted); }
.content { padding: 26px 30px 60px; max-width: 1180px; }
.eyebrow { font-size: 11px; letter-spacing: 2.4px; color: var(--muted); font-weight: 600; }
h1 { margin: 6px 0 4px; font-size: 30px; letter-spacing: -.3px; }
.subtitle { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 18px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; }
.card-title { font-size: 14px; font-weight: 700; padding: 16px 20px 0; }
.card-body { padding: 12px 20px 20px; font-size: 14px; }
.card.stat .stat-label { font-size: 12.5px; color: var(--muted); padding: 16px 20px 0; }
.card.stat .stat-value { font-size: 30px; font-weight: 700; padding: 4px 20px 16px; }
.card.stat .stat-sub { font-size: 12.5px; color: var(--muted); padding: 0 20px 16px; margin-top: -10px; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef1f6; color: #5b6478; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.bad { background: var(--red-soft); color: var(--red); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl img.foto { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: #4b5568; margin-bottom: 6px; }
.field input, .field select, .field textarea, input.inline, select.inline {
  width: 100%; padding: 10px 12px; border: 1px solid #d4dae6; border-radius: 9px; font-size: 14px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.btn { display: inline-block; border: 1px solid #d4dae6; background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f6f8fc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #2459c4; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn.block { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 0 0 16px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; align-items: center; }
.toolbar form select { min-width: 220px; }
.toolbar .spacer { flex: 1; }
.class-filter { padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.class-filter::before { content: 'Kelas'; color: var(--muted); font-size: 12px; font-weight: 700; }
.class-filter select { min-width: 240px; border: 0; font-weight: 700; color: var(--ink); background: transparent; }
.class-filter select:focus { outline: 2px solid var(--blue-soft); border-radius: 6px; }

.import-card { border-color: #dce5f7; }
.import-intro { display: flex; align-items: center; gap: 12px; }
.import-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 22px; font-weight: 700; }
.import-intro p { margin: 4px 0 0; }
.import-actions { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.import-form { display: flex; align-items: stretch; gap: 10px; }
.import-drop { position: relative; display: flex; flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 9px 12px; border: 1px dashed #b8c5df; border-radius: 9px; background: #fafcff; cursor: pointer; }
.import-drop:hover { border-color: var(--blue); background: var(--blue-soft); }
.import-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-drop:focus-within { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.import-drop-title { color: var(--blue); font-size: 13.5px; font-weight: 700; }
.import-file-name { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin: 0 0 16px; }
.alert.ok { background: var(--green-soft); color: #166534; }
.alert.bad { background: var(--red-soft); color: #991b1b; }
.alert.info { background: var(--blue-soft); color: #1e40af; }

.pbar { height: 8px; background: #edf0f6; border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.pfill { height: 100%; background: var(--blue); border-radius: 999px; }
.ppct { font-size: 12px; color: var(--muted); }

.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }

.foto-big { width: 100%; max-width: 320px; border-radius: 12px; border: 1px solid var(--line); }
.camera-box video { width: 100%; max-width: 420px; border-radius: 12px; background: #000; }
.camera-box canvas, .camera-box img.cap { width: 100%; max-width: 420px; border-radius: 12px; border: 1px solid var(--line); }
.status-fieldset { border: 0; padding: 0; margin: 0; }
.status-fieldset legend { font-weight: 700; padding: 0; }
.status-pick { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.status-pick label { flex: 1; min-width: 120px; min-height: 72px; border: 2px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; cursor: pointer; font-weight: 700; user-select: none; }
.status-pick label:hover, .status-pick label:focus-within { border-color: var(--blue); background: var(--blue-soft); }
.status-pick label span { display: inline-block; margin-top: 4px; }
.status-pick input { display: block; width: 20px; height: 20px; margin: 0 auto 8px; accent-color: var(--blue); cursor: pointer; }
.status-pick label.sel-hadir { border-color: var(--green); background: var(--green-soft); }
.status-pick label.sel-sakit { border-color: var(--amber); background: var(--amber-soft); }
.status-pick label.sel-izin { border-color: var(--blue); background: var(--blue-soft); }

/* login */
.login-body { background: linear-gradient(rgba(20,29,56,.68), rgba(20,29,56,.78)), url('/assets/home-background.jpeg') center / cover fixed; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-wrap { width: 100%; max-width: 400px; text-align: center; color: #fff; }
.login-brand { margin-bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.login-brand .brand-title.big { order: 2; }
.login-brand .brand-sub { order: 3; font-size: 14px; letter-spacing: 2.8px; color: #fff; }
.login-brand .brand-logo { order: 1; }
.login-logo { order: 1; width: 82px; height: 82px; object-fit: contain; border-radius: 16px; background: rgba(255,255,255,.92); padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.school-logo-preview { display: block; width: 120px; height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 14px; }
.login-card { background: rgba(255,255,255,.96); color: var(--ink); border-radius: 16px; padding: 26px; text-align: left; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card h2 { margin: 0 0 4px; }
.login-foot { margin-top: 18px; font-size: 12px; color: #e2e7f4; }

.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.inline-form { display: inline; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { padding: 18px 16px 60px; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .crumb { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .date { display: none; }
  .content { padding: 16px 12px 40px; }
  h1 { font-size: 25px; }
  .subtitle { font-size: 13px; line-height: 1.45; }
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card.stat .stat-label { padding: 12px 12px 0; font-size: 11px; }
  .card.stat .stat-value { padding: 2px 12px 12px; font-size: 23px; }
  .card-title { padding: 14px 14px 0; }
  .card-body { padding: 10px 14px 14px; overflow-x: auto; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  .toolbar { align-items: stretch; }
  .toolbar > *, .toolbar form, .toolbar form select { width: 100%; }
  .toolbar .btn { width: 100%; text-align: center; }
  .import-actions, .import-form { align-items: stretch; flex-direction: column; }
  .import-actions { gap: 6px; margin-top: 14px; }
  .import-actions .btn, .import-form .btn { width: 100%; text-align: center; }
  .import-drop { min-height: 58px; }
  .tbl { min-width: 680px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.payment-table { min-width: 760px; }
.payment-inline { display: flex; gap: 8px; align-items: center; min-width: 220px; }
.payment-inline input { width: 130px; padding: 9px 10px; border: 1px solid #d4dae6; border-radius: 9px; font-size: 14px; }
.payment-inline .btn { white-space: nowrap; }
  .card-body:has(.tbl) { overflow-x: auto; }
  .receipt-preview { width: 140px; max-width: 100%; height: auto; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
  .foto-big { max-width: 180px; max-height: 180px; object-fit: contain; border-radius: 8px; }
  input[type=file] { max-width: 100%; }
  .inline-form { display: flex; gap: 6px; align-items: center; }
  .toolbar.compact { gap: 6px; margin-top: 8px; }
  .inline-form .field, .inline-form input { min-width: 130px; }
}
