@font-face { font-family: Outfit; font-weight: 400; font-display: swap; src: url(/fonts/outfit-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Outfit; font-weight: 500; font-display: swap; src: url(/fonts/outfit-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Outfit; font-weight: 600; font-display: swap; src: url(/fonts/outfit-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Outfit; font-weight: 700; font-display: swap; src: url(/fonts/outfit-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #EEF1F0;
  --surface: #F7F8F7;
  --card: #FFFFFF;
  --ink: #16171B;
  --muted: #555B66;
  --line: #DFE3E1;
  --mint: #CFE3DC;
  --mint-ink: #1F5446;
  --pink: #F6D5E3;
  --yellow: #F7E4A3;
  --lilac: #DCD3EE;
  --danger: #A3271F;
  --danger-bg: #FBE4E1;
  --ok: #1F6B47;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --tap: 48px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 Outfit, system-ui, -apple-system, 'Segoe UI', sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 600; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 84px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 0; }
.rail .brand { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.rail a, .rail button { width: 68px; min-height: 60px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; text-align: center; line-height: 1.1; background: none; border: 0; cursor: pointer; padding: 6px 2px; }
.rail a:hover, .rail button:hover { background: var(--card); color: var(--ink); }
.rail a[aria-current="page"] { background: var(--ink); color: #fff; }
.rail svg { width: 22px; height: 22px; }
.rail .spacer { flex: 1; }
.main { padding: 24px 32px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--lilac); display: grid; place-items: center; font-weight: 600; font-size: 15px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 20; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); overflow-x: auto; justify-content: flex-start; gap: 2px; }
  .rail .brand, .rail .spacer { display: none; }
  .rail a, .rail button { flex: 1 0 64px; min-height: 54px; }
  .main { padding: 16px 16px 110px; }
  h1 { font-size: 25px; }
  .topbar { margin-bottom: 14px; }
  .topbar .who .name { display: none; }
}

/* ---------- Cards & tiles ---------- */
.card { background: var(--card); border-radius: var(--r-lg); padding: 22px; }
.card + .card { margin-top: 16px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.count { color: #8B909A; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.session { border-radius: var(--r-lg); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 168px; position: relative; }
.session .kelas { font-size: 22px; font-weight: 600; }
.session .meta { font-size: 14px; color: #3A3E46; }
.session .guru { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; background: rgba(255,255,255,.75); white-space: nowrap; }
.chip.dark { background: var(--ink); color: #fff; }
.chip.ok { background: #DDEFE5; color: var(--ok); }
.chip.warn { background: #FCEBC4; color: #6B4A00; }
.chip.line { background: transparent; border: 1px solid var(--line); }
.el-Penyayang { background: var(--pink); }
.el-Berdaya { background: var(--yellow); }
.el-Warganegara { background: var(--mint); }
.el-Berupaya { background: var(--lilac); }
.chip.el-Penyayang, .chip.el-Berdaya, .chip.el-Warganegara, .chip.el-Berupaya { font-weight: 500; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; }
.round-btn svg { width: 18px; height: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat { border-radius: var(--r-md); padding: 14px 14px 12px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; }
.stat .n { font-size: 34px; font-weight: 600; line-height: 1; }
.stat .l { font-size: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--card); border-radius: var(--r-md); padding: 12px 14px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.row .grow { flex: 1; min-width: 0; }
.row .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); }
.row .ic.el-Penyayang { background: var(--pink); } .row .ic.el-Berdaya { background: var(--yellow); } .row .ic.el-Warganegara { background: var(--mint); } .row .ic.el-Berupaya { background: var(--lilac); }
.row .ic svg { width: 18px; height: 18px; }
.empty { padding: 18px; border-radius: var(--r-md); border: 1.5px dashed #C9CECC; color: var(--muted); text-align: center; }

/* ---------- Calendar ---------- */
.cal { background: var(--card); border-radius: var(--r-lg); padding: 20px 18px 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h3 { font-size: 21px; font-weight: 500; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.cal-nav button:hover { background: var(--surface); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 2px; text-align: center; }
.cal-grid .dow { font-size: 12px; color: var(--muted); padding: 4px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.cal-grid button { aspect-ratio: 1; width: 100%; max-width: 46px; margin: 0 auto; border-radius: 50%; border: 0; background: none; font-size: 16px; cursor: pointer; position: relative; }
.cal-grid button.out { color: #A6AAB2; }
.cal-grid button.has { background: var(--mint); }
.cal-grid button.done::after { content: ''; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--mint-ink); }
.cal-grid button.today { outline: 1.5px dashed #8B909A; outline-offset: -2px; }
.cal-grid button.sel { background: var(--ink); color: #fff; }
.cal-grid button.sel::after { background: #fff; }
.cal-grid button:disabled { cursor: default; }
.cal-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.cal-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: var(--mint); }
.cal-legend span.d::before { width: 6px; height: 6px; background: var(--mint-ink); vertical-align: 1px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 14px; font-weight: 500; color: #3A3E46; }
.hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=month], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 11px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: #fff; outline: none;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
input[readonly] { background: var(--surface); }
.btn { min-height: var(--tap); padding: 0 20px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 16px; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.soft { background: var(--surface); color: var(--ink); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.err { background: var(--danger-bg); color: var(--danger); padding: 10px 14px; border-radius: var(--r-sm); font-size: 15px; margin-bottom: 14px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; }
.seg input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=month], .toolbar input[type=date] { width: auto; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--card); border-radius: var(--r-lg); padding: 6px 4px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 12px 14px 8px; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
td.wrap { min-width: 240px; max-width: 420px; }
td select { min-width: 160px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(22,23,27,.35); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--card); border-radius: var(--r-lg); width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
@media (max-width: 600px) {
  .overlay { padding: 0; align-items: end; }
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
}

/* ---------- Pengisian Modul (DG9) ---------- */
.narrow { max-width: 640px; margin: 0 auto; }
.pin { font-size: 30px; letter-spacing: .5em; text-align: center; font-weight: 600; padding-left: .5em; }
.ro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ro { background: rgba(255,255,255,.7); border-radius: var(--r-sm); padding: 8px 12px; }
.ro .k { font-size: 12px; color: #3A3E46; text-transform: uppercase; letter-spacing: .04em; }
.ro .v { font-size: 16px; font-weight: 600; line-height: 1.3; }
.photos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.photo { min-width: 0; }
@media (max-width: 480px) { .photos { gap: 8px; } .photos .photo { padding: 8px; } .photos .photo .btns { grid-template-columns: 1fr; } }
.photo { border: 1.5px dashed #BFC5C2; border-radius: var(--r-md); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.photo.filled { border-style: solid; border-color: var(--line); }
.photo .pv { aspect-ratio: 4/3; border-radius: 12px; background: var(--surface); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 14px; text-align: center; padding: 6px; }
.photo .pv img { width: 100%; height: 100%; object-fit: cover; }
.photo .pv svg { width: 30px; height: 30px; }
.photo .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.photo .btns .btn { padding: 0 8px; font-size: 14px; }
.photo .fn { font-size: 12px; color: var(--muted); word-break: break-all; }
.submit-bar { position: sticky; bottom: 0; z-index: 5; padding: 12px 0 10px; background: var(--bg); }
@media (max-width: 860px) { .submit-bar { bottom: 66px; } }
.success { text-align: center; padding: 34px 22px; }
.success .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; margin: 0 auto 16px; }
.success .tick svg { width: 38px; height: 38px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs a { display: block; width: 160px; }
.thumbs img { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; display: block; background: var(--surface); }
.thumbs span { font-size: 11px; color: var(--muted); word-break: break-all; }
.diff { font-size: 14px; background: var(--surface); padding: 8px 10px; border-radius: 10px; margin-top: 6px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(420px, 100%); padding: 30px 26px; }
.login .brand-row { display: flex; gap: 6px; margin-bottom: 18px; }
.login .brand-row i { width: 26px; height: 26px; border-radius: 50%; display: block; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--danger); }
@media (max-width: 860px) { #toast { bottom: 90px; } }
