/* =====================================================================
   Aplikasi Ekstrakurikuler — gaya tampilan (terinspirasi Apple HIG)
   Warna utama berasal dari Pengaturan → Tampilan (variabel --accent*, disisipkan di <head>).
   Tema: [data-theme="light"|"dark"] di <html>, atau "auto" mengikuti perangkat.
   ===================================================================== */

/* ---------- 1. Token warna & ukuran ---------- */
:root {
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-elev-2: #fbfbfd;
  --bg-sunken: #ececf0;
  --field: #ffffff;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .07);
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .14);
  --glass: rgba(250, 250, 252, .78);
  --glass-strong: rgba(255, 255, 255, .9);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 24px rgba(0, 0, 0, .05);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .05);
  --accent-ink: var(--accent-l);
  --accent-soft: rgb(var(--accent-rgb) / .12);
  --accent-soft-2: rgb(var(--accent-rgb) / .06);
  --green: #1f9d47; --green-soft: rgba(52, 199, 89, .14);
  --orange: #c45500; --orange-soft: rgba(255, 149, 0, .16);
  --red: #d70015; --red-soft: rgba(255, 59, 48, .12);
  --blue: #0066cc; --blue-soft: rgba(0, 122, 255, .12);
  --purple: #8944ab; --purple-soft: rgba(175, 82, 222, .13);
  --gray-soft: rgba(118, 118, 128, .14);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 264px;
  --topbar: 56px;
  --tabbar: 62px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elev: #1c1c1e;
  --bg-elev-2: #242426;
  --bg-sunken: #0c0c0d;
  --field: #2c2c2e;
  --fill: rgba(118, 118, 128, .24);
  --fill-2: rgba(118, 118, 128, .14);
  --ink: #f5f5f7;
  --ink-2: #e5e5ea;
  --muted: #a1a1a6;
  --faint: #8e8e93;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --glass: rgba(22, 22, 24, .76);
  --glass-strong: rgba(28, 28, 30, .92);
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  --accent-ink: var(--accent-d);
  --accent-soft: rgb(var(--accent-rgb) / .22);
  --accent-soft-2: rgb(var(--accent-rgb) / .12);
  --green: #30d158; --green-soft: rgba(48, 209, 88, .18);
  --orange: #ff9f0a; --orange-soft: rgba(255, 159, 10, .18);
  --red: #ff453a; --red-soft: rgba(255, 69, 58, .18);
  --blue: #409cff; --blue-soft: rgba(10, 132, 255, .2);
  --purple: #bf5af2; --purple-soft: rgba(191, 90, 242, .2);
  --gray-soft: rgba(118, 118, 128, .26);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #000000;
    --bg-elev: #1c1c1e;
    --bg-elev-2: #242426;
    --bg-sunken: #0c0c0d;
    --field: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .14);
    --ink: #f5f5f7;
    --ink-2: #e5e5ea;
    --muted: #a1a1a6;
    --faint: #8e8e93;
    --line: rgba(255, 255, 255, .1);
    --line-strong: rgba(255, 255, 255, .18);
    --glass: rgba(22, 22, 24, .76);
    --glass-strong: rgba(28, 28, 30, .92);
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .04);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
    --accent-ink: var(--accent-d);
    --accent-soft: rgb(var(--accent-rgb) / .22);
    --accent-soft-2: rgb(var(--accent-rgb) / .12);
    --green: #30d158; --green-soft: rgba(48, 209, 88, .18);
    --orange: #ff9f0a; --orange-soft: rgba(255, 159, 10, .18);
    --red: #ff453a; --red-soft: rgba(255, 69, 58, .18);
    --blue: #409cff; --blue-soft: rgba(10, 132, 255, .2);
    --purple: #bf5af2; --purple-soft: rgba(191, 90, 242, .2);
    --gray-soft: rgba(118, 118, 128, .26);
    color-scheme: dark;
  }
}

/* ---------- 2. Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(28px, 6vw, 40px); }
h2 { font-size: clamp(22px, 4vw, 28px); }
h3 { font-size: 19px; letter-spacing: -.01em; }
h4 { font-size: 16px; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
small { font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 3px solid rgb(var(--accent-rgb) / .55); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgb(var(--accent-rgb) / .25); }
button { font: inherit; color: inherit; }
.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 24px; height: 24px; }
.icon.xl { width: 32px; height: 32px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.center { text-align: center; }
.right { text-align: right; }
.strong { font-weight: 600; }
.accent { color: var(--accent-ink); }
.green { color: var(--green); }
.red { color: var(--red); }
.orange { color: var(--orange); }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
/* Utilitas jarak selalu menang atas margin bawaan komponen (mis. .card__title { margin: 0 }) */
.mt-1 { margin-top: 8px !important; } .mt-2 { margin-top: 16px !important; } .mt-3 { margin-top: 24px !important; } .mt-4 { margin-top: 32px !important; }
.mb-1 { margin-bottom: 8px !important; } .mb-2 { margin-bottom: 16px !important; } .mb-3 { margin-bottom: 24px !important; }
[hidden] { display: none !important; }

/* ---------- 3. Tata letak umum ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { gap: 8px; }
.stack--lg { gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--nowrap { flex-wrap: nowrap; }
.row--between { justify-content: space-between; }
.row--top { align-items: flex-start; }
.row--sm { gap: 8px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.split { display: grid; gap: 20px; }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

/* ---------- 4. Tombol ---------- */
.btn {
  --btn-bg: var(--fill);
  --btn-ink: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 18px;
  border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink);
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s, opacity .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.04); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { --btn-bg: var(--accent); --btn-ink: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); filter: none; }
.btn--tinted { --btn-bg: var(--accent-soft); --btn-ink: var(--accent-ink); }
.btn--plain { --btn-bg: transparent; --btn-ink: var(--accent-ink); padding-inline: 10px; }
.btn--plain:hover { background: var(--accent-soft-2); }
.btn--ghost { --btn-bg: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--danger { --btn-bg: var(--red-soft); --btn-ink: var(--red); }
.btn--danger-solid { --btn-bg: #e5342b; --btn-ink: #fff; }
.btn--success { --btn-bg: #1f9d47; --btn-ink: #fff; }
.btn--sm { min-height: 32px; padding: 6px 13px; font-size: 13px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { min-height: 50px; padding: 12px 26px; font-size: 17px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn.is-loading { pointer-events: none; opacity: .7; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color .2s;
}
.icon-btn:hover { background: var(--fill); text-decoration: none; }
.count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.count:empty, .count[data-value="0"] { display: none; }
.icon-btn .count { position: absolute; top: 2px; right: 0; border: 2px solid var(--glass-strong); height: 20px; min-width: 20px; }

/* ---------- 5. Formulir ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field__label .req { color: var(--red); }
.field__hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.field__error { margin: 0; font-size: 12.5px; color: var(--red); font-weight: 500; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--field); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
:root[data-theme="dark"] .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]),
:root[data-theme="dark"] .field select, :root[data-theme="dark"] .field textarea, :root[data-theme="dark"] .input { border-color: transparent; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]),
  :root[data-theme="auto"] .field select, :root[data-theme="auto"] .field textarea, :root[data-theme="auto"] .input { border-color: transparent; }
}
.field textarea, textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.field select, select.input {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .18); }
.field input[type=file] { font-size: 14px; color: var(--muted); max-width: 100%; }
.field input[type=file]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > input { padding-right: 46px !important; }
.input-group__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.form-actions--end { justify-content: flex-end; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: 8px; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.check--card { padding: 12px 14px; border-radius: 12px; background: var(--fill-2); width: 100%; }
.check--card:has(input:checked) { background: var(--accent-soft); }

/* Saklar gaya iOS: <label class="switch"><input type="checkbox"><span></span> Teks</label> */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--fill); transition: background .25s; flex: none; }
.switch > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s var(--ease); }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgb(var(--accent-rgb) / .5); outline-offset: 2px; }

/* Pilihan berbentuk tombol (segmented) */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--fill);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented__item {
  flex: none; padding: 6px 14px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .2s, box-shadow .2s;
}
.segmented__item.is-active, .segmented__item[aria-selected="true"] { background: var(--bg-elev); color: var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .segmented__item.is-active { background: #636366; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .segmented__item.is-active { background: #636366; } }
.segmented--block { display: flex; width: 100%; }
.segmented--block .segmented__item { flex: 1; text-align: center; }

/* Pilihan kehadiran H/S/I/A */
.att-choice { display: inline-flex; gap: 4px; }
.att-choice input { position: absolute; opacity: 0; pointer-events: none; }
.att-choice label {
  display: grid; place-items: center; width: 36px; height: 34px; border-radius: 9px;
  background: var(--fill-2); color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; transition: all .15s;
}
.att-choice label:hover { background: var(--fill); }
.att-choice input:checked + label.att-H { background: #34c759; color: #fff; }
.att-choice input:checked + label.att-S { background: #ff9f0a; color: #fff; }
.att-choice input:checked + label.att-I { background: #0a84ff; color: #fff; }
.att-choice input:checked + label.att-A { background: #ff3b30; color: #fff; }
.att-choice input:focus-visible + label { outline: 3px solid rgb(var(--accent-rgb) / .5); }

/* ---------- 6. Kartu, daftar, lencana ---------- */
.card { background: var(--bg-elev); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card--pad { padding: 20px; }
@media (min-width: 760px) { .card--pad { padding: 24px; } }
.card__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.card__head + .card__body { padding-top: 12px; }
.card__title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.card__sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.card__body { padding: 20px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card--link { display: block; color: inherit; text-decoration: none !important; transition: transform .25s var(--ease), box-shadow .25s; }
.card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card--accent { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: var(--on-accent); }
.card--accent h2, .card--accent h3, .card--accent .card__title { color: inherit; }
.card--accent .muted { color: inherit; opacity: .8; }
.card--tint { background: var(--accent-soft-2); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.card--warn { background: var(--orange-soft); box-shadow: none; }

.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; position: relative; min-width: 0; }
.list__item + .list__item::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; border-top: 1px solid var(--line); }
.list__item--avatar + .list__item--avatar::before { left: 74px; }
.list__item--link { color: inherit; text-decoration: none !important; transition: background .15s; }
.list__item--link:hover { background: var(--fill-2); }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; }
.list__sub { font-size: 13px; color: var(--muted); display: block; margin-top: 1px; }
.list__end { display: flex; align-items: center; gap: 8px; color: var(--faint); flex: none; }
.list__chev { color: var(--faint); width: 18px; height: 18px; }
.list--inset .list__item { padding-inline: 0; }
.list--inset .list__item + .list__item::before { left: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap; background: var(--gray-soft); color: var(--ink-2);
}
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--orange { background: var(--orange-soft); color: var(--orange); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--purple { background: var(--purple-soft); color: var(--purple); }
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--fill-2); font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip__emoji { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 12px; background: var(--c, var(--accent-soft)); }

.avatar {
  --h: 210;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(145deg, hsl(var(--h) 70% 62%), hsl(calc(var(--h) + 25) 65% 48%));
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.avatar--xl { width: 96px; height: 96px; font-size: 34px; }
.avatar-wrap { position: relative; display: inline-block; flex: none; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #34c759; border: 2px solid var(--bg-elev); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--bg-elev); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.club-tile {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px;
  font-size: 26px; line-height: 1; background: var(--c-soft, var(--accent-soft));
}
.club-tile--sm { width: 36px; height: 36px; border-radius: 10px; font-size: 19px; }
.club-tile--lg { width: 72px; height: 72px; border-radius: 20px; font-size: 40px; }

.stat { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 760px) { .stat { padding: 20px; } }
.stat__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.stat__icon--green { background: var(--green-soft); color: var(--green); }
.stat__icon--orange { background: var(--orange-soft); color: var(--orange); }
.stat__icon--purple { background: var(--purple-soft); color: var(--purple); }
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 13px; color: var(--muted); font-weight: 500; }

.progress { height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.progress__bar { height: 100%; border-radius: inherit; background: var(--accent); width: 0; transition: width .6s var(--ease); }
.progress--green .progress__bar { background: #34c759; }
.progress--lg { height: 10px; }

.ring { --p: 0; --size: 120px; --stroke: 10px; position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--stroke); }
.ring__track { stroke: var(--fill); }
.ring__value { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: var(--off, 326.73); animation: ringIn 1.1s var(--ease) both; }
@keyframes ringIn { from { stroke-dashoffset: 326.73; } }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__num { font-size: calc(var(--size) * .26); font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring__cap { font-size: 12px; color: var(--muted); margin-top: 4px; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--blue-soft); color: var(--ink); font-size: 14.5px; }
.alert .icon { margin-top: 1px; color: var(--blue); }
.alert--success { background: var(--green-soft); } .alert--success .icon { color: var(--green); }
.alert--warning { background: var(--orange-soft); } .alert--warning .icon { color: var(--orange); }
.alert--danger { background: var(--red-soft); } .alert--danger .icon { color: var(--red); }
.alert p:last-child { margin-bottom: 0; }
.alert__body { flex: 1; min-width: 0; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 20px; color: var(--muted); }
.empty__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--fill-2); color: var(--faint); margin-bottom: 8px; font-size: 30px; }
.empty__icon .icon { width: 30px; height: 30px; }
.empty__title { font-size: 17px; font-weight: 600; color: var(--ink); margin: 0; }
.empty p { margin: 0; max-width: 380px; }

.kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--fill); font-family: var(--mono); font-size: 12px; }

/* Tabel: di HP berubah menjadi kartu (setiap sel diberi data-label) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { position: sticky; top: 0; z-index: 1; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--bg-elev); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--fill-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .center { text-align: center; }
.table .check-col { width: 44px; }
.table .check-col input { width: 18px; height: 18px; accent-color: var(--accent); }
.table--compact td { padding: 8px 12px; }
@media (max-width: 759px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
  .table--stack tr:last-child { border-bottom: 0; }
  /* Label di kiri (float), isi rata kanan & bertumpuk rapi — isi dua baris (mis. kelas + NIS) tidak lagi terpencar */
  .table--stack td { border: 0; padding: 5px 0; display: block; text-align: right; justify-content: flex-end; overflow-wrap: anywhere; }
  .table--stack td::before { content: attr(data-label); float: left; margin-right: 16px; color: var(--muted); font-size: 13px; text-align: left; line-height: 1.6; }
  .table--stack td::after { content: ""; display: block; clear: both; }
  .table--stack td:not(.cell-main) > .row { justify-content: flex-end; }
  .table--stack td > ul, .table--stack td > ol { display: flow-root; text-align: left; }
  .table--stack tr:has(> .check-col) > td.cell-main { padding-right: 36px; }
  .table--stack td[data-label=""]::before, .table--stack td:not([data-label])::before { display: none; }
  .table--stack td.cell-main { display: block; text-align: left; padding-bottom: 6px; }
  .table--stack td.check-col { position: absolute; right: 12px; top: 12px; width: auto; padding: 0; }
  .table--stack tbody tr:hover td { background: none; }
}

.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 16px; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--fill-2); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.pagination .is-current { background: var(--accent); color: var(--on-accent); }

/* Menu tarik-turun berbasis <details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 230px; padding: 6px;
  background: var(--glass-strong); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .18s var(--ease);
}
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: 14.5px; text-align: left; cursor: pointer; text-decoration: none !important; }
.menu__item:hover { background: var(--fill); }
.menu__item--danger { color: var(--red); }
.menu__sep { height: 1px; margin: 5px 8px; background: var(--line); }
.menu__head { padding: 10px 12px 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* Dialog (konfirmasi & formulir kecil) */
dialog.modal {
  width: min(92vw, 440px); max-height: 88vh; padding: 0; border: 0; border-radius: 22px;
  background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-lg); overflow: auto;
}
dialog.modal--wide { width: min(94vw, 640px); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .22s var(--ease); }
.modal__body { padding: 22px 22px 10px; }
.modal__title { margin: 0 0 6px; font-size: 18px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; flex-wrap: wrap; }
.modal__foot .btn { min-width: 96px; }
@media (max-width: 520px) {
  dialog.modal { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog.modal[open] { animation: sheet .3s var(--ease); }
  .modal__foot .btn { flex: 1; }
}
@keyframes sheet { from { transform: translateY(100%); } }

/* Notifikasi kecil melayang */
.toast-stack { position: fixed; z-index: 200; left: 50%; top: 12px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; pointer-events: auto;
  background: var(--glass-strong); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-lg); color: var(--ink); font-size: 14px; animation: toastIn .35s var(--ease); cursor: default;
}
.toast.is-leaving { animation: toastOut .3s var(--ease) forwards; }
.toast__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); flex: none; }
.toast--error .toast__icon { background: #ff3b30; color: #fff; }
.toast--success .toast__icon { background: #34c759; color: #fff; }
.toast--warning .toast__icon { background: #ff9f0a; color: #fff; }
.toast__title { font-weight: 600; display: block; }
.toast__text { color: var(--muted); display: block; }
a.toast { text-decoration: none; cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.96); } }

.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

/* ---------- 7. Kerangka aplikasi (setelah login) ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main { min-width: 0; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px); }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px 0; }
.content--narrow { max-width: 760px; }
.content--wide { max-width: 1400px; }

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none !important; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.topbar__brand img, .brand-mark { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; flex: none; }
.brand-mark { display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.brand-mark .icon { width: 18px; height: 18px; }
.topbar__title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.topbar__user { padding: 3px; border-radius: 50%; display: grid; }

.tabbar {
  position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  text-decoration: none !important; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tabbar__item .icon { width: 25px; height: 25px; }
.tabbar__item.is-active { color: var(--accent-ink); }
.tabbar__item .count { position: absolute; top: 5px; left: calc(50% + 6px); }

.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px; background: var(--fill-2); color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; text-decoration: none !important; position: relative; }
.sheet-grid a .icon { width: 24px; height: 24px; color: var(--accent-ink); }
.sheet-grid a .count { position: absolute; top: 8px; right: 10px; }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
    background: var(--glass); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
    border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin;
  }
  .tabbar, .topbar__brand--mobile { display: none; }
  .main { padding-bottom: 48px; }
  .content { padding: 28px 36px 0; }
  .topbar { padding: 0 20px 0 36px; }
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 14px; color: var(--ink); text-decoration: none !important; }
.sidebar__brand img, .sidebar__brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.sidebar__name { font-weight: 700; font-size: 15px; letter-spacing: -.02em; line-height: 1.2; display: block; }
.sidebar__org { font-size: 12px; color: var(--muted); display: block; line-height: 1.3; }
.sidebar__nav { flex: 1; padding: 6px 12px 20px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group__title { padding: 6px 10px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-decoration: none !important; transition: background .15s;
}
.nav-link .icon { width: 19px; height: 19px; color: var(--accent-ink); }
.nav-link:hover { background: var(--fill-2); }
.nav-link.is-active { background: var(--accent); color: var(--on-accent); }
.nav-link.is-active .icon { color: inherit; }
.nav-link .count { margin-left: auto; }
.sidebar__foot { padding: 12px; border-top: 1px solid var(--line); }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.page-head__text { flex: 1; min-width: min(100%, 260px); }
.page-head__eyebrow { font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.page-head__title { margin: 0; font-size: clamp(28px, 5vw, 34px); letter-spacing: -.03em; }
.page-head__sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 8px; font-size: 15px; font-weight: 500; }
.back-link .icon { width: 18px; height: 18px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.section-title a { margin-left: auto; font-size: 14px; font-weight: 500; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; width: auto; }
.toolbar form { display: contents; }
.search-input { position: relative; flex: 1; min-width: 200px; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; }
.search-input input { padding-left: 36px !important; width: 100%; background: var(--fill) !important; border-color: transparent !important; min-height: 38px !important; font-size: 15px !important; }
.bulkbar {
  position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 10px); z-index: 30; margin-top: 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 18px; border-radius: 18px;
  background: var(--glass-strong); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow-lg);
}
@media (min-width: 1024px) { .bulkbar { bottom: 16px; } }

/* Spanduk ujian aktif (muncul otomatis dari /api/pulse) */
.live-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 18px; border-radius: 16px;
  background: linear-gradient(135deg, #ff9f0a, #ff6b00); color: #fff; text-decoration: none !important; box-shadow: 0 10px 30px rgba(255, 120, 0, .25);
}
.live-banner__text { flex: 1; min-width: 0; }
.live-banner strong { display: block; }
.live-banner span { font-size: 13px; opacity: .9; }

/* ---------- 8. Halaman publik ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { max-width: 1120px; margin: 0 auto; height: 60px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -.02em; text-decoration: none !important; min-width: 0; }
.brand img, .brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__text small { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-nav { display: none; gap: 4px; margin-left: 18px; }
.site-nav a { padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.site-nav a:hover { background: var(--fill); }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
@media (min-width: 860px) { .site-nav { display: flex; } }
@media (max-width: 480px) { .site-header__actions .btn--ghost { display: none; } }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hero { position: relative; padding: 56px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1;
  background: radial-gradient(ellipse 50% 40% at 30% 30%, rgb(var(--accent-rgb) / .16), transparent 70%),
              radial-gradient(ellipse 40% 35% at 75% 20%, rgba(255, 159, 10, .12), transparent 70%);
}
.hero__grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 96px 0 72px; } .hero__grid { grid-template-columns: 1.1fr .9fr; } }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--bg-elev); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 20px; }
.hero__eyebrow img, .hero__eyebrow .brand-mark { width: 22px; height: 22px; border-radius: 6px; }
.hero__title { font-size: clamp(38px, 8vw, 68px); line-height: 1.04; letter-spacing: -.045em; margin: 0 0 18px; }
.hero__title em { font-style: normal; background: linear-gradient(120deg, var(--accent), #ff6b00 130%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__text { font-size: clamp(17px, 2.4vw, 20px); color: var(--muted); max-width: 560px; margin: 0 0 28px; line-height: 1.5; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__visual { position: relative; min-height: 360px; display: grid; place-items: center; }
.mock {
  position: relative; width: min(100%, 360px); padding: 18px; border-radius: 30px; background: var(--bg-elev); box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
}
.mock__row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--fill-2); }
.mock__row + .mock__row { margin-top: 10px; }
.mock__float { position: absolute; padding: 12px 14px; border-radius: 18px; background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 10px; align-items: center; }
/* Label melayang diletakkan di tepi luar kartu agar tidak menutupi teks di dalamnya */
.mock { margin-block: 34px; }
.mock__float--a { top: -30px; right: -14px; transform: rotate(3deg); }
.mock__float--b { bottom: -32px; left: -14px; transform: rotate(-3deg); }
@media (max-width: 520px) { .mock__float--a { right: 6px; } .mock__float--b { left: 6px; } }

.stats-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
@media (min-width: 760px) { .stats-strip { grid-template-columns: repeat(4, 1fr); } }
.stats-strip > div { background: var(--bg-elev); padding: 22px 18px; text-align: center; }
.stats-strip strong { display: block; font-size: 32px; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats-strip span { color: var(--muted); font-size: 13.5px; }

.section { padding: 56px 0; }
@media (min-width: 960px) { .section { padding: 88px 0; } }
.section__head { max-width: 680px; margin: 0 0 32px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__eyebrow { color: var(--accent-ink); font-weight: 600; font-size: 14px; margin-bottom: 8px; display: block; }
.section__title { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.04em; line-height: 1.08; margin: 0 0 12px; }
.section__text { color: var(--muted); font-size: 17px; margin: 0; }
.section--alt { background: var(--bg-elev); }
.section--alt .card { background: var(--bg); box-shadow: none; }

.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.feature { padding: 24px; border-radius: var(--radius-lg); background: var(--bg-elev); box-shadow: var(--shadow); }
.feature__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; margin-bottom: 16px; background: var(--accent-soft); color: var(--accent-ink); }
.feature__icon .icon { width: 22px; height: 22px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 14.5px; }

.club-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--radius-lg); background: var(--bg-elev); box-shadow: var(--shadow); color: inherit; text-decoration: none !important; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.club-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--c-soft); opacity: .7; }
.club-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.club-card > * { position: relative; z-index: 1; }
.club-card__name { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 0; color: var(--ink); }
.club-card__tag { color: var(--muted); font-size: 14px; margin: 0; }
.club-card__meta { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); margin-top: auto; }
.club-card__meta span { display: flex; align-items: center; gap: 8px; }
.club-card__meta .icon { width: 16px; height: 16px; color: var(--faint); }

.verify-box { display: grid; gap: 28px; align-items: center; padding: 28px; border-radius: var(--radius-xl); background: linear-gradient(145deg, var(--accent), var(--accent-hover)); color: var(--on-accent); }
@media (min-width: 860px) { .verify-box { grid-template-columns: 1fr 1fr; padding: 48px; } }
.verify-box h2 { color: inherit; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.035em; }
.verify-box p { opacity: .86; }
.verify-form { display: flex; gap: 8px; flex-wrap: wrap; background: rgba(255, 255, 255, .16); padding: 8px; border-radius: 999px; }
.verify-form input { flex: 1; min-width: 160px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px; font: inherit; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; background: #fff; color: #111; }
.verify-form input:focus { outline: 3px solid rgba(255, 255, 255, .6); }
.verify-form .btn { background: #111; color: #fff; min-height: 46px; }

.site-footer { padding: 48px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer__grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { color: var(--ink); font-size: 14px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--fill); color: var(--ink-2); }
.socials a:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }
.socials .icon { width: 18px; height: 18px; }
.site-footer__bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* Halaman masuk & daftar */
.auth { min-height: calc(100vh - 60px); min-height: calc(100dvh - 60px); display: grid; place-items: center; padding: 32px 16px 56px; }
.auth__card { width: 100%; max-width: 420px; }
.auth__card--wide { max-width: 640px; }
.auth__head { text-align: center; margin-bottom: 24px; }
.auth__logo { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: var(--bg-elev); box-shadow: var(--shadow); }
.auth__logo img { width: 44px; height: 44px; object-fit: contain; }
.auth__logo .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
.auth__title { font-size: 28px; margin: 0 0 6px; letter-spacing: -.03em; }
.auth__foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14.5px; }
.club-pick { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.club-pick label { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--fill-2); cursor: pointer; transition: background .15s, box-shadow .15s; }
.club-pick label:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.club-pick input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.club-pick__name { font-weight: 600; display: block; line-height: 1.25; }
.club-pick__sub { font-size: 12.5px; color: var(--muted); display: block; }

/* Verifikasi sertifikat */
.verify-result { text-align: center; padding: 32px 24px; }
.verify-result__icon { display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.verify-result__icon .icon { width: 40px; height: 40px; }
.verify-result--bad .verify-result__icon { background: var(--red-soft); color: var(--red); }
.verify-result--warn .verify-result__icon { background: var(--orange-soft); color: var(--orange); }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px 16px; text-align: left; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- 9. Dasbor & komponen halaman ---------- */
.greet { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 4px 0 22px; }
/* Salam boleh selebar mungkin; tombol/lencana di sebelahnya turun ke bawah bila layar sempit */
.greet > :first-child { flex: 1 1 280px; min-width: 0; }
.greet__date { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.greet__title { margin: 2px 0 0; font-size: clamp(28px, 6vw, 36px); letter-spacing: -.035em; }
.quote { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-2)); }
.quote__mark { font-size: 32px; line-height: .9; color: var(--accent-ink); font-weight: 700; font-family: Georgia, serif; }
.quote p { margin: 0; font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.quote small { color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; border-radius: 18px; background: var(--bg-elev); box-shadow: var(--shadow); color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; text-decoration: none !important; transition: transform .2s var(--ease); }
.quick a:active { transform: scale(.96); }
.quick__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); }
.quick__icon--green { background: var(--green-soft); color: var(--green); }
.quick__icon--orange { background: var(--orange-soft); color: var(--orange); }
.quick__icon--purple { background: var(--purple-soft); color: var(--purple); }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--orange-soft); color: var(--orange); font-weight: 700; font-size: 13px; }
.streak .icon { width: 16px; height: 16px; }

.club-head { display: flex; gap: 16px; align-items: center; padding: 20px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--c-soft), var(--bg-elev) 85%); box-shadow: var(--shadow); }
.club-head__name { font-size: 22px; margin: 0; letter-spacing: -.025em; }

.module-item { display: flex; gap: 14px; align-items: center; padding: 14px 18px; color: inherit; text-decoration: none !important; }
.module-item__icon { display: grid; place-items: center; width: 46px; height: 56px; border-radius: 9px; background: linear-gradient(160deg, #ff453a, #d70015); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; flex: none; position: relative; box-shadow: 0 4px 10px rgba(215, 0, 21, .2); }
.module-item__icon.is-done { background: linear-gradient(160deg, #34c759, #1f9d47); box-shadow: 0 4px 10px rgba(31, 157, 71, .2); }
.module-item__main { flex: 1; min-width: 0; }
.module-item + .module-item { border-top: 1px solid var(--line); }

.code-display { font-family: var(--mono); font-size: clamp(40px, 10vw, 64px); font-weight: 700; letter-spacing: .14em; text-align: center; padding: 10px 0; color: var(--ink); }
.qr-box { display: grid; place-items: center; padding: 14px; border-radius: 18px; background: #fff; width: fit-content; margin-inline: auto; }
.qr-box svg, .qr-box img { width: 180px; height: 180px; }

.sigpad { position: relative; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); touch-action: none; overflow: hidden; }
.sigpad canvas { width: 100%; height: 180px; cursor: crosshair; }
.sigpad__hint { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: #aeaeb2; font-size: 13px; pointer-events: none; border-top: 1px dashed #d1d1d6; margin: 0 24px; padding-top: 6px; }
.sig-preview { display: grid; place-items: center; min-height: 100px; padding: 12px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.sig-preview img { max-height: 90px; }

.image-preview { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; background: var(--fill-2); }
.setting-image { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.setting-image img { max-height: 64px; border-radius: 10px; background: var(--fill-2); padding: 6px; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.color-row input[type=color] { width: 48px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08); transition: transform .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--ink); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick input { position: absolute; opacity: 0; pointer-events: none; }
.emoji-pick label { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--fill-2); font-size: 20px; cursor: pointer; }
.emoji-pick input:checked + label { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

.weights { display: grid; gap: 14px; }
.weights__row { display: grid; grid-template-columns: 1fr 90px; gap: 12px; align-items: center; }
.weights__total { font-weight: 700; }
.weights__total.is-bad { color: var(--red); }

.score-big { font-size: 56px; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.meter { display: grid; gap: 12px; }
.meter__row { display: grid; grid-template-columns: 96px 1fr 52px; gap: 12px; align-items: center; font-size: 14px; }
.meter__row strong { text-align: right; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.timeline li + li { border-top: 1px solid var(--line); }
.att-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.att-dot--H { background: #34c759; } .att-dot--S { background: #ff9f0a; } .att-dot--I { background: #0a84ff; } .att-dot--A { background: #ff3b30; } .att-dot--x { background: var(--fill); color: var(--muted); }
.att-strip { display: flex; gap: 4px; flex-wrap: wrap; }
.att-strip .att-dot { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }

/* ---------- 10. Pembaca modul PDF ---------- */
.reader { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: var(--bg-sunken); }
.reader__bar {
  display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 8px; flex: none;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line);
}
.reader__title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.reader__title small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.reader__pages { flex: 1; overflow: auto; padding: 16px 8px 120px; -webkit-overflow-scrolling: touch; }
.reader__page { position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .12); border-radius: 4px; overflow: hidden; }
.reader__page canvas { width: 100%; height: 100%; }
.reader__page-no { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 600; }
.reader__dock {
  position: fixed; z-index: 81; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px;
  background: var(--glass-strong); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow-lg);
}
.reader__dock .pageinfo { min-width: 76px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.reader__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.reader__progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.reader__loading { display: grid; place-items: center; gap: 12px; padding: 80px 20px; color: var(--muted); text-align: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ---------- 11. Quiz & ujian ---------- */
.exam-body { background: var(--bg); }
.exam-body, .exam-body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.exam-body textarea, .exam-body input[type=text] { -webkit-user-select: text; user-select: text; }
.exam { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.exam__bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line);
}
.exam__info { flex: 1; min-width: 0; }
.exam__title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.exam__meta { font-size: 12px; color: var(--muted); }
.exam__timer { display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--fill); font-family: var(--mono); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.exam__timer.is-warning { background: var(--orange-soft); color: var(--orange); }
.exam__timer.is-danger { background: #ff3b30; color: #fff; animation: blink 1s infinite; }
.exam__progress { height: 3px; background: var(--fill); }
.exam__progress span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.exam__main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 140px; display: grid; gap: 20px; align-items: start; }
@media (min-width: 960px) { .exam__main { grid-template-columns: minmax(0, 1fr) 300px; padding-bottom: 40px; } }
.question { padding: 22px; }
@media (min-width: 760px) { .question { padding: 30px; } }
.question__top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.question__no { font-weight: 700; color: var(--accent-ink); font-size: 14px; }
.question__text { font-size: 18px; line-height: 1.6; font-weight: 500; letter-spacing: -.01em; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 20px; }
.question__img { max-height: 320px; border-radius: 14px; margin: 0 0 20px; object-fit: contain; background: var(--fill-2); pointer-events: none; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--fill-2); box-shadow: inset 0 0 0 1.5px transparent; cursor: pointer; transition: background .15s, box-shadow .15s, transform .1s; font-size: 16px; line-height: 1.45; }
.option:hover { background: var(--fill); }
.option:active { transform: scale(.99); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__key { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-elev); box-shadow: inset 0 0 0 1.5px var(--line-strong); font-weight: 700; font-size: 14px; flex: none; transition: all .15s; }
.option__text { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.option:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.option:has(input:checked) .option__key { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.option:has(input:focus-visible) { outline: 3px solid rgb(var(--accent-rgb) / .5); }
.exam textarea, .exam .answer-input { width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--field); border: 1px solid var(--line-strong); border-radius: 14px; }
.exam textarea { min-height: 160px; resize: vertical; }
.exam textarea:focus, .exam .answer-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .18); }
.exam__actions {
  position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line);
}
@media (min-width: 960px) { .exam__actions { position: static; padding: 18px 0 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; } }
.exam__actions .btn { flex: 1; }
@media (min-width: 960px) { .exam__actions .btn { flex: none; } .exam__actions .spacer { display: block; } }
.flag-btn.is-on { --btn-bg: var(--orange-soft); --btn-ink: var(--orange); }
.qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px; }
.qnav__btn { height: 42px; border-radius: 11px; border: 0; background: var(--fill-2); color: var(--ink-2); font-weight: 700; font-size: 14px; cursor: pointer; position: relative; font-variant-numeric: tabular-nums; }
.qnav__btn.is-answered { background: var(--accent); color: var(--on-accent); }
.qnav__btn.is-flagged { background: #ff9f0a; color: #fff; }
.qnav__btn.is-current { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--ink); }
.qnav-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 14px; }
.qnav-legend span { display: inline-flex; align-items: center; gap: 6px; }
.qnav-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--fill); display: inline-block; }
.qnav-legend i.a { background: var(--accent); } .qnav-legend i.f { background: #ff9f0a; }
.exam__side { display: none; }
@media (min-width: 960px) { .exam__side { display: block; position: sticky; top: 80px; } .exam__navbtn { display: none !important; } }
.save-state { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.save-state.is-error { color: var(--red); }
.watermark { position: fixed; inset: 0; z-index: 10; pointer-events: none; background-repeat: repeat; opacity: .07; }
:root[data-theme="dark"] .watermark { opacity: .1; filter: invert(1); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .watermark { opacity: .1; filter: invert(1); } }
.violation-flash { position: fixed; inset: 0; z-index: 300; pointer-events: none; box-shadow: inset 0 0 0 6px #ff3b30; animation: vflash 1s ease-out forwards; }
@keyframes vflash { to { opacity: 0; } }
@media print { .exam-body { display: none !important; } }

.lobby { max-width: 560px; margin: 0 auto; padding: 32px 16px 80px; text-align: center; }
.lobby__pulse { position: relative; width: 120px; height: 120px; margin: 10px auto 26px; display: grid; place-items: center; }
.lobby__pulse::before, .lobby__pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: .18; animation: ripple 2.4s var(--ease) infinite; }
.lobby__pulse::after { animation-delay: 1.2s; }
.lobby__core { position: relative; z-index: 1; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 30px rgb(var(--accent-rgb) / .35); }
.lobby__core .icon { width: 38px; height: 38px; }
@keyframes ripple { 0% { transform: scale(.7); opacity: .35; } 100% { transform: scale(1.6); opacity: 0; } }
.lobby__title { font-size: 26px; letter-spacing: -.03em; margin: 0 0 6px; }
.lobby__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 22px 0; border-radius: 18px; overflow: hidden; background: var(--line); box-shadow: var(--shadow); }
.lobby__facts div { background: var(--bg-elev); padding: 14px 6px; }
.lobby__facts strong { display: block; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lobby__facts span { font-size: 12px; color: var(--muted); }
.rules { text-align: left; margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.rules .icon { color: var(--accent-ink); margin-top: 1px; width: 18px; height: 18px; }
.lobby__people { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 14px; }

.result { text-align: center; padding: 40px 20px; }
.result__emoji { font-size: 64px; line-height: 1; margin-bottom: 12px; }

/* Pantauan guru */
.monitor-head { display: grid; gap: 16px; }
@media (min-width: 900px) { .monitor-head { grid-template-columns: 1fr auto; align-items: center; } }
.big-timer { font-family: var(--mono); font-size: clamp(40px, 9vw, 64px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--fill-2); min-width: 0; }
.person__main { flex: 1; min-width: 0; }
.person__name { font-weight: 600; font-size: 14px; display: block; }
.person__sub { font-size: 12px; color: var(--muted); display: block; }
.person.is-away { opacity: .5; }

/* ---------- 12. Komunitas (obrolan) ---------- */
.chat-page { display: flex; flex-direction: column; height: calc(100vh - var(--topbar) - var(--tabbar) - env(safe-area-inset-bottom)); height: calc(100dvh - var(--topbar) - var(--tabbar) - env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .chat-page { height: calc(100dvh - var(--topbar)); max-width: 980px; margin: 0 auto; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.chat-head__name { font-weight: 700; font-size: 16px; letter-spacing: -.015em; }
.chat-head__sub { font-size: 12.5px; color: var(--muted); }
.chat-list { flex: 1; overflow-y: auto; padding: 16px 12px 8px; display: flex; flex-direction: column; gap: 2px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.chat-note { align-self: center; margin: 4px 0 12px; padding: 6px 12px; border-radius: 999px; background: var(--fill-2); color: var(--muted); font-size: 12px; text-align: center; max-width: 90%; }
.day-sep { align-self: center; margin: 12px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; padding: 1px 0; }
.msg + .msg:not(.msg--cont) { margin-top: 8px; }
.msg__avatar { width: 30px; flex: none; }
.msg--cont .msg__avatar .avatar { visibility: hidden; }
.msg__col { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 560px); min-width: 0; }
.msg__name { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 3px 12px; display: flex; gap: 6px; align-items: center; }
.msg--cont .msg__name { display: none; }
.msg__bubble { position: relative; padding: 8px 13px; border-radius: 19px; background: var(--bg-elev); box-shadow: var(--shadow-sm); font-size: 15px; line-height: 1.42; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--ink); }
:root[data-theme="dark"] .msg__bubble { background: #262628; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .msg__bubble { background: #262628; } }
.msg__bubble a { color: inherit; text-decoration: underline; }
.msg__time { font-size: 11px; color: var(--faint); margin: 3px 10px 0; }
.msg--mine { flex-direction: row-reverse; }
.msg--mine .msg__avatar { display: none; }
.msg--mine .msg__col { align-items: flex-end; }
.msg--mine .msg__bubble { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.msg--mine .mention { background: rgba(255, 255, 255, .22); color: inherit; }
.msg--mentioned .msg__bubble { box-shadow: inset 0 0 0 2px #ff9f0a; }
.msg--deleted .msg__bubble { background: transparent !important; box-shadow: inset 0 0 0 1px var(--line-strong) !important; color: var(--muted) !important; font-style: italic; }
.msg--staff .msg__name::after { content: "Pengajar"; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10px; }
.msg__reply { display: block; margin: 0 0 4px; padding: 5px 10px; border-left: 3px solid var(--accent); border-radius: 8px; background: var(--fill-2); font-size: 12.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.msg--mine .msg__reply { border-left-color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .16); color: inherit; opacity: .9; }
.msg__reply b { color: var(--ink-2); }
.msg--mine .msg__reply b { color: inherit; }
.msg__tools { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; align-self: center; }
.msg:hover .msg__tools, .msg:focus-within .msg__tools, .msg.show-tools .msg__tools { opacity: 1; }
.msg__tools button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--fill-2); color: var(--muted); cursor: pointer; }
.msg__tools button:hover { background: var(--fill); color: var(--ink); }
.msg__tools .icon { width: 15px; height: 15px; }
.msg.is-flash .msg__bubble { animation: flashmsg 1.4s; }
@keyframes flashmsg { 30% { box-shadow: 0 0 0 4px #ff9f0a; } }
.mention { display: inline; padding: 0 3px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.chat-composer { position: relative; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
@media (max-width: 1023px) { .chat-composer { padding-bottom: 8px; } }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 8px 12px; font-size: 13px; color: var(--muted); }
.reply-bar__text { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { display: flex; align-items: flex-end; gap: 6px; }
.composer__input { flex: 1; min-width: 0; max-height: 140px; min-height: 40px; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.35; resize: none; }
.composer__input:focus { outline: none; border-color: var(--accent); }
.composer__send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .15s, opacity .2s; }
.composer__send:disabled { opacity: .35; cursor: default; }
.composer__send .icon { width: 18px; height: 18px; margin-left: -2px; }
.composer__cooldown { font-size: 12px; color: var(--orange); padding: 4px 12px 0; }
.emoji-panel, .mention-list {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); z-index: 30; max-height: 280px; overflow-y: auto;
  padding: 10px; border-radius: 18px; background: var(--glass-strong); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .emoji-panel { right: auto; width: 360px; } .mention-list { right: auto; width: 320px; } }
.emoji-panel__cat { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 6px 4px; }
.emoji-panel__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-panel__grid button { height: 38px; border: 0; border-radius: 10px; background: none; font-size: 22px; cursor: pointer; padding: 0; }
.emoji-panel__grid button:hover { background: var(--fill); }
.mention-list { padding: 6px; }
.mention-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 14px; }
.mention-list button.is-active, .mention-list button:hover { background: var(--fill); }
.mention-list small { color: var(--muted); }
.room-list .club-tile { width: 46px; height: 46px; }

/* ---------- 13. Animasi masuk & aksesibilitas ---------- */
.fade-in { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.6s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .tabbar, .no-print, .site-header, .site-footer, .toast-stack, .bulkbar { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}

/* ---------- 14. Utilitas tambahan ---------- */
@media (max-width: 759px) { .hide-mobile { display: none !important; } }
@media (min-width: 760px) { .hide-desktop { display: none !important; } }
.segmented__item:has(input:checked) { background: var(--bg-elev); color: var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .segmented__item:has(input:checked) { background: #636366; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .segmented__item:has(input:checked) { background: #636366; } }
.reader-body { overflow: hidden; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.card[open] > summary .muted { display: none; }
.chip:link, .chip:visited { text-decoration: none; }
a.chip:hover { background: var(--fill); }
.card--link.row { display: flex; }
.card--link.stack { display: flex; }
@media (max-width: 420px) { .greet__title { font-size: 26px; } }

/* ---------- 15. Pilihan kelas ---------- */
.class-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.class-pick input { position: absolute; opacity: 0; pointer-events: none; }
.class-pick label { padding: 6px 12px; border-radius: 999px; background: var(--fill-2); color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.class-pick label:hover { background: var(--fill); }
.class-pick input:checked + label { background: var(--accent); color: var(--on-accent); }
.class-pick input:focus-visible + label { outline: 3px solid rgb(var(--accent-rgb) / .5); }
.club-pick label.is-blocked { opacity: .5; cursor: not-allowed; }
.club-pick label.is-blocked .club-pick__sub { color: var(--orange); }
.only-class { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--orange); }
.only-class .icon { width: 14px; height: 14px; }
.chat-flash .flash-stack { margin: 8px 12px 0; }
.chat-head .menu__panel { top: calc(100% + 4px); }

/* ---------- 16. Warna khas ekskul yang menyesuaikan tema terang/gelap ----------
   View cukup memberi warna asli ekskul lewat style="--c:#hex". Versi lembutnya dicampur
   dengan warna latar kartu (--bg-elev), jadi otomatis pastel di tema terang dan gelap-redup di tema gelap. */
:root { --tint: 16%; --tint-soft: 13%; }
:root[data-theme="dark"] { --tint: 30%; --tint-soft: 16%; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --tint: 30%; --tint-soft: 16%; } }
.club-tile { --c-soft: color-mix(in srgb, var(--c, var(--accent)) var(--tint), var(--bg-elev)); background: var(--c-soft); }
.club-card { --c-soft: color-mix(in srgb, var(--c, var(--accent)) var(--tint-soft), var(--bg-elev)); }
.club-card::after { background: var(--c-soft); opacity: 1; }
.club-card .club-tile { --c-soft: color-mix(in srgb, var(--c, var(--accent)) var(--tint), var(--bg-elev)); }
.club-head { --c-soft: color-mix(in srgb, var(--c, var(--accent)) var(--tint), var(--bg-elev)); }
.chip__emoji { background: color-mix(in srgb, var(--c, var(--accent)) var(--tint), var(--bg-elev)); }
.club-card.is-dimmed { opacity: .6; }
.club-card .badge { position: relative; z-index: 1; }
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .club-tile, .club-card, .club-head { --c-soft: var(--accent-soft); }
  .chip__emoji { background: var(--accent-soft); }
}
/* Gelembung pesan sendiri tetap berwarna utama di tema gelap (aturan gelembung umum di atas lebih kuat) */
:root[data-theme="dark"] .msg--mine .msg__bubble { background: var(--accent); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .msg--mine .msg__bubble { background: var(--accent); color: var(--on-accent); } }

/* ---------- 17. Impor & ekspor anggota (Excel) ---------- */
.step-no {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; vertical-align: 1px;
}
.bullets { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.blue { color: var(--blue); }
.tabular { font-variant-numeric: tabular-nums; }
.import-notes { margin: 0; padding-left: 16px; display: grid; gap: 2px; }
.import-table td:first-child { width: 1%; white-space: nowrap; }
.import-table tr[hidden] { display: none; }

/* ---------- 18. Kerapian jarak (tombol, teks, lencana) ---------- */
/* Lencana yang menempel pada judul diberi jarak sedikit lebih lega dari satu spasi */
h1 > .badge, h2 > .badge, h3 > .badge, .card__title > .badge, .club-card__name > .badge, .list__title > .badge { margin-left: 6px; vertical-align: 2px; }
/* Baris daftar yang punya tombol aksi di kanan (mis. pendaftar baru): di HP tombol turun ke bawah teks */
@media (max-width: 480px) {
  .list__item--actions { flex-wrap: wrap; row-gap: 10px; }
  .list__item--actions > .list__main { flex-basis: calc(100% - 64px); }
  .list__item--actions > form, .list__item--actions > .list__actions { margin-left: 54px; }
  /* Daftar modul (halaman Belajar): tombol Baca/Lanjut/Ulang turun ke bawah, judul tidak terjepit */
  .module-item { flex-wrap: wrap; align-items: flex-start; row-gap: 10px; }
  .module-item__main { flex-basis: calc(100% - 60px); }
  .module-item > .btn { margin-left: 60px; }
}
/* Foto profil: kolom isian turun ke bawah foto bila layar sempit agar pilihan berkas tidak terpotong */
.profile-photo > .list__main { flex: 1 1 220px; }
.profile-photo input[type=file] { width: 100%; }
/* Kotak cari di toolbar selalu selebar kolomnya; di HP: cari satu baris penuh, saringan + tombol Cari sebaris di bawahnya */
.toolbar .search-input input { width: 100%; }
@media (max-width: 480px) {
  .toolbar .search-input { flex-basis: 100%; }
  .toolbar > select, .toolbar form > select { flex: 1 1 0; min-width: 0; }
}
