:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --ink: #17262b;
  --muted: #64757a;
  --line: #e4e9e4;

  --emerald: #0b6b52;
  --emerald-2: #14a07a;
  --emerald-soft: #e0f5ec;
  --teal: #0e7c86;
  --sky: #2b7bd8;
  --sky-2: #4ea3f5;
  --sky-soft: #e5f1fd;
  --gold: #e0a526;
  --gold-2: #f6c453;
  --gold-soft: #fff4d9;
  --rose: #e04e78;
  --rose-2: #f77fa0;
  --rose-soft: #fde8ef;
  --violet: #7b5cd6;
  --violet-soft: #efeafc;
  --danger: #c93c3c;

  --grad-hero: linear-gradient(135deg, #0a5b46 0%, #0e7c6a 45%, #12707f 100%);
  --grad-rainbow: linear-gradient(90deg, var(--emerald-2), var(--sky-2), var(--gold-2), var(--rose-2));
  --grad-btn: linear-gradient(135deg, #17b384 0%, #0b6b52 100%);

  --radius: 20px;
  --shadow: 0 1px 2px rgba(15, 40, 35, .05), 0 10px 30px rgba(15, 40, 35, .08);
  --shadow-lg: 0 20px 50px rgba(11, 107, 82, .25);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(600px 400px at 0% 0%, rgba(20, 160, 122, .16), transparent 70%),
    radial-gradient(500px 380px at 100% 10%, rgba(78, 163, 245, .16), transparent 70%),
    radial-gradient(520px 420px at 100% 100%, rgba(247, 127, 160, .14), transparent 70%),
    radial-gradient(520px 420px at 0% 100%, rgba(246, 196, 83, .16), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }
.wrap-wide { max-width: 1120px; }

/* ---------- Hero banner ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero);
  color: #fff; text-align: center;
  border-radius: 26px;
  padding: 26px 20px 24px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 2l7 12 12 7-12 7-7 12-7-12-12-7 12-7z' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Ccircle cx='28' cy='28' r='3' fill='%23fff'/%3E%3C/svg%3E");
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: var(--grad-rainbow);
}
.hero > * { position: relative; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #fff; background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 6px 12px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(32px, 9vw, 44px); line-height: 1.05;
  margin: 14px 0 10px; letter-spacing: -.01em;
}
.hero h1 span { color: var(--gold-2); }
.hero .date {
  display: inline-block; font-weight: 700; font-size: 14.5px;
  color: #3d2c00; background: linear-gradient(135deg, var(--gold-2), var(--gold));
  padding: 6px 16px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(224, 165, 38, .35);
}
.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; font-size: 13.5px; }
.meta span {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
  padding: 6px 12px; border-radius: 12px;
}
.meta svg { width: 15px; height: 15px; color: var(--gold-2); flex: none; }

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(228, 233, 228, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 14px; }
.card.accent { overflow: hidden; }
.card.accent::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad-rainbow); }

.label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald); margin-bottom: 12px; }
.label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-2); box-shadow: 0 0 0 4px var(--emerald-soft); }

/* ---------- Search ---------- */
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--emerald-2); pointer-events: none; }
.input {
  width: 100%; height: 56px; padding: 0 16px 0 48px;
  border: 2px solid var(--line); border-radius: 16px;
  background: var(--surface-2); font-size: 17px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus { border-color: var(--emerald-2); background: #fff; box-shadow: 0 0 0 5px rgba(20, 160, 122, .14); }
.input.no-icon { padding-left: 16px; }

.results { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.results:empty { display: none; }
.result {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; transition: background .12s, border-color .12s, transform .12s, box-shadow .12s;
  animation: fadeUp .2s ease both;
}
.result:hover, .result.active { border-color: var(--emerald-2); background: linear-gradient(90deg, var(--emerald-soft), #fff); box-shadow: 0 6px 16px rgba(20, 160, 122, .12); }
.result:active { transform: scale(.99); }
.result .name { flex: 1; font-weight: 700; font-size: 16px; }
.result .name mark { background: var(--gold-soft); color: #8a5a00; border-radius: 3px; padding: 0; box-shadow: 0 0 0 2px var(--gold-soft); }
.result .arrow { color: var(--emerald-2); width: 18px; height: 18px; flex: none; }
.result .tag { font-size: 11px; font-weight: 800; color: #fff; background: var(--emerald-2); padding: 3px 9px; border-radius: 999px; }
.empty-hint { color: var(--muted); font-size: 14px; text-align: center; padding: 14px 0 2px; }

.avatar {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, var(--emerald-2), var(--emerald));
  box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
}
.avatar.c1 { background: linear-gradient(135deg, #22c493, #0b6b52); }
.avatar.c2 { background: linear-gradient(135deg, #5fb0ff, #2463c4); }
.avatar.c3 { background: linear-gradient(135deg, #f8cf5c, #d98a0f); }
.avatar.c4 { background: linear-gradient(135deg, #ff8fb0, #d43a68); }
.avatar.c5 { background: linear-gradient(135deg, #a28bf0, #6243c4); }
.avatar.c6 { background: linear-gradient(135deg, #3fd0d8, #0e7c86); }

/* ---------- Selected & form ---------- */
.selected { display: flex; align-items: center; gap: 14px; }
.selected .avatar { width: 56px; height: 56px; font-size: 21px; border-radius: 16px; }
.selected .info { flex: 1; min-width: 0; }
.selected .info small { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.selected .info strong { display: block; font-size: 22px; font-family: var(--display); color: var(--emerald); line-height: 1.2; overflow-wrap: anywhere; }
.link-btn { border: 1.5px solid var(--emerald-soft); background: var(--emerald-soft); color: var(--emerald); font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 10px; }
.link-btn:hover { border-color: var(--emerald-2); }

.notice { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); color: #7a5205; font-size: 13.5px; border-left: 4px solid var(--gold); }

.field { padding: 16px 0; border-top: 1px dashed var(--line); }
.field:first-of-type { border-top: 0; padding-top: 2px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.field-title .fi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--gold-soft); }
.field-sub { color: var(--muted); font-size: 13px; margin-left: 44px; }

.stepper { display: flex; align-items: center; border-radius: 16px; overflow: hidden; background: var(--gold-soft); border: 2px solid #f5dd9c; }
.stepper button { width: 48px; height: 48px; border: 0; background: transparent; font-size: 26px; font-weight: 600; color: #b67a00; display: grid; place-items: center; transition: background .12s; }
.stepper button:hover { background: rgba(246, 196, 83, .35); }
.stepper button:disabled { color: #e3cf9a; background: transparent; cursor: default; }
.stepper output { min-width: 44px; text-align: center; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: #6b4700; }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { position: relative; --c: var(--sky); --c2: var(--sky-2); --soft: var(--sky-soft); }
.toggle.bunda { --c: var(--rose); --c2: var(--rose-2); --soft: var(--rose-soft); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle label {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px 16px; border: 2px solid var(--line); border-radius: 18px;
  background: #fff; cursor: pointer; text-align: center;
  transition: all .18s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.toggle label:hover { border-color: var(--c2); }
.toggle .ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 28px; transition: transform .2s; }
.toggle .t { font-weight: 800; font-size: 15.5px; }
.toggle .s { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: -6px; }
.toggle .check {
  position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid #cfd8d5; background: #fff; display: grid; place-items: center; transition: all .15s;
}
.toggle .check svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.5); transition: all .15s; }
.toggle input:checked + label { border-color: var(--c); background: linear-gradient(160deg, var(--soft), #fff 80%); box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 22%, transparent); }
.toggle input:checked + label .ico { transform: scale(1.08); background: #fff; box-shadow: 0 0 0 4px var(--soft); }
.toggle input:checked + label .t { color: var(--c); }
.toggle input:checked + label .s { color: var(--c); }
.toggle input:checked + label .check { background: var(--c); border-color: var(--c); }
.toggle input:checked + label .check svg { opacity: 1; transform: none; }
.toggle input:focus-visible + label { box-shadow: 0 0 0 4px var(--soft); }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 18px; }
.summary div { text-align: center; padding: 12px 6px; border-radius: 14px; }
.summary div:nth-child(1) { background: var(--sky-soft); color: #1d5ea8; }
.summary div:nth-child(2) { background: var(--gold-soft); color: #946100; }
.summary div:nth-child(3) { background: var(--rose-soft); color: #b8325a; }
.summary b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; opacity: .85; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 22px; border-radius: 16px; border: 0;
  font-weight: 800; font-size: 16px; letter-spacing: .01em;
  transition: transform .1s, box-shadow .15s, background .15s, opacity .15s, filter .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-btn); color: #fff; box-shadow: 0 8px 22px rgba(11, 107, 82, .32); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(11, 107, 82, .4); }
.btn-primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; filter: grayscale(.3); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--emerald-2); color: var(--emerald); }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #3d2c00; box-shadow: 0 6px 18px rgba(224, 165, 38, .35); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-danger { background: linear-gradient(135deg, #f0646a, #c93c3c); color: #fff; box-shadow: 0 6px 18px rgba(201, 60, 60, .3); }
.btn-danger:hover { filter: brightness(1.06); }
.btn-glass { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.btn-glass:hover { background: rgba(255, 255, 255, .24); }
.btn-block { width: 100%; }
.btn-sm { height: 42px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; flex: none; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error { color: var(--danger); font-size: 14px; font-weight: 600; margin-top: 10px; text-align: center; min-height: 1em; }

/* ---------- Thank you ---------- */
.thanks { text-align: center; padding: 36px 22px 26px; overflow: hidden; }
.thanks::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 120px; background: linear-gradient(180deg, var(--emerald-soft), transparent); }
.thanks > * { position: relative; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; opacity: 0; animation: fall 2.4s ease-in forwards; }
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(420px) rotate(540deg); }
}
.check-anim { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%; background: var(--grad-btn); display: grid; place-items: center; box-shadow: 0 0 0 10px var(--emerald-soft), 0 14px 30px rgba(11, 107, 82, .35); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.check-anim svg { width: 50px; height: 50px; color: #fff; }
.check-anim path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .3s ease forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks h2 { font-family: var(--display); color: var(--emerald); font-size: clamp(25px, 7vw, 32px); margin: 0 0 6px; line-height: 1.2; }
.thanks p { color: var(--muted); margin: 0 0 20px; }
.thanks .arabic { font-size: 24px; color: var(--gold); margin: 6px 0 4px; font-family: 'Amiri', serif; }

.fade-in { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.footer { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 24px; }
.hidden { display: none !important; }

/* ---------- Admin ---------- */
.topbar {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--grad-hero); color: #fff;
  border-radius: 24px; padding: 22px 24px 26px; margin-bottom: 18px;
  box-shadow: var(--shadow-lg);
}
.topbar::before { content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 2l7 12 12 7-12 7-7 12-7-12-12-7 12-7z' fill='none' stroke='%23fff'/%3E%3C/svg%3E"); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--grad-rainbow); }
.topbar > * { position: relative; }
.topbar .eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); }
.topbar h1 { font-family: var(--display); margin: 4px 0 0; font-size: clamp(22px, 5vw, 30px); line-height: 1.15; }
.topbar p { margin: 6px 0 0; color: rgba(255, 255, 255, .8); font-size: 13.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 20px; color: #fff; box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.stat .ic { position: absolute; right: 16px; bottom: 12px; font-size: 30px; opacity: .9; }
.stat span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .92; }
.stat b { display: block; font-size: 36px; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat small { font-size: 13px; opacity: .88; }
.stat.s1 { background: linear-gradient(135deg, #22c493, #0b6b52); }
.stat.s2 { background: linear-gradient(135deg, #5fb0ff, #2463c4); }
.stat.s3 { background: linear-gradient(135deg, #f8c946, #e08a0b); color: #3d2600; }
.stat.s4 { background: linear-gradient(135deg, #ff8fb0, #d43a68); }

.progress { height: 6px; background: rgba(255, 255, 255, .3); border-radius: 999px; margin-top: 10px; overflow: hidden; width: 70%; }
.progress i { display: block; height: 100%; background: #fff; border-radius: 999px; transition: width .4s; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 200px; }
.toolbar .input { height: 48px; font-size: 15px; background: #fff; }
.chips { display: flex; gap: 6px; background: #fff; padding: 4px; border-radius: 14px; border: 1.5px solid var(--line); }
.chip { height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); transition: all .15s; }
.chip.on { background: var(--grad-btn); color: #fff; box-shadow: 0 4px 12px rgba(11, 107, 82, .25); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { background: var(--emerald); color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
thead th.th-d { background: #2463c4; }
thead th.th-a { background: #d98a0f; }
thead th.th-t { background: #d43a68; }
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
tbody tr:nth-child(even) { background: #fafcfa; }
tbody tr:hover { background: var(--emerald-soft); }
tbody tr.absent td { color: #a6b1ae; }
td .rn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--emerald-soft); color: var(--emerald); font-weight: 800; font-size: 13px; }
tr.absent td .rn { background: #f0f2f0; color: #a6b1ae; }
td.cd { color: #2463c4; font-weight: 700; }
td.ca { color: #c17800; font-weight: 700; }
td.ct { color: #d43a68; font-weight: 800; }
tr.absent td.cd, tr.absent td.ca, tr.absent td.ct { color: #c3cbc8; }
tfoot td { font-weight: 800; background: linear-gradient(90deg, var(--emerald-soft), var(--gold-soft)); border-bottom: 0; font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #0b7a5c; background: var(--emerald-soft); }
.pill.no { color: #98a29f; background: #f0f2f0; }
.yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; }
.yes.ay { background: var(--sky); }
.yes.bd { background: var(--rose); }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: #a6b1ae; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--danger); background: #fdeeee; border-color: #f4d2d2; }
.icon-btn svg { width: 16px; height: 16px; }

/* Mobile table → cards */
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 30px; }
  .stat .ic { font-size: 24px; }
  .topbar { padding: 20px 18px 24px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .chips { width: 100%; }
  .chip { flex: 1; }
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table, thead, tbody, tfoot, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr, tbody tr:nth-child(even) { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--emerald-2); border-radius: 14px; margin-bottom: 10px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; box-shadow: var(--shadow); }
  tbody tr.absent { border-left-color: #d6dcda; }
  tbody td { border: 0; padding: 0; white-space: normal; }
  td.c-no { display: none; }
  td.c-nama { font-weight: 800; font-size: 16px; color: var(--ink); grid-column: 1; }
  td.c-status { grid-column: 2; grid-row: 1; text-align: right; width: auto; }
  td.c-detail { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1; grid-row: 2; font-size: 12.5px; }
  td.c-act { grid-column: 2; grid-row: 2; align-self: end; text-align: right; width: auto; }
  td.num.d-hide, td.c-waktu { display: none; }
  tfoot tr { display: flex; justify-content: space-between; align-items: center; background: var(--grad-hero); color: #fff; border-radius: 14px; padding: 14px 16px; }
  tfoot td { background: transparent; padding: 0; width: auto; color: #fff; }
  tfoot td.f-hide { display: none; }
  tfoot td.num::before { content: attr(data-l) " "; font-weight: 600; opacity: .8; }
}
@media (min-width: 721px) { td.c-detail { display: none; } }

.dchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.dchip.ay { background: var(--sky-soft); color: #1d5ea8; }
.dchip.bd { background: var(--rose-soft); color: #b8325a; }
.dchip.an { background: var(--gold-soft); color: #946100; }
.dchip.tt { background: var(--emerald-soft); color: #0b6b52; }
.dchip.tm { background: #f0f2f0; color: var(--muted); }
.dchip.off { opacity: .45; text-decoration: line-through; }

/* Login */
.login { max-width: 400px; margin: 8vh auto 0; padding-top: 30px; }
.login .lock { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 16px; background: var(--grad-hero); color: #fff; box-shadow: var(--shadow-lg); }
.login .lock svg { width: 28px; height: 28px; }
.login h1 { font-family: var(--display); color: var(--emerald); margin: 0 0 4px; font-size: 28px; }
.login p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(12, 30, 26, .5); backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal-box { width: 100%; max-width: 380px; background: #fff; border-radius: 22px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pop .3s cubic-bezier(.2, 1.3, .4, 1) both; text-align: center; }
.modal-box .warn { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: #fdeeee; color: var(--danger); font-size: 28px; box-shadow: 0 0 0 8px #fef6f6; }
.modal-box h3 { margin: 0 0 6px; font-family: var(--display); font-size: 22px; color: var(--ink); }
.modal-box p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.pin-input { text-align: center; letter-spacing: .5em; font-size: 24px; font-weight: 800; padding: 0 16px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.modal-actions .btn { height: 48px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 380px) {
  .card { padding: 18px; }
  .toggle label { padding: 16px 6px 14px; }
  .field-sub { margin-left: 0; }
}

/* Validasi: orang tua wajib dicentang */
.toggles.need .toggle label { border-color: #f1a3a3; background: #fff7f7; }
.error:not(:empty) { background: #fdeeee; border: 1px solid #f4cccc; padding: 10px 12px; border-radius: 12px; }
#errParent:empty { display: none; }

/* Area aman iPhone (notch / home bar) saat dibuka dari layar utama */
.wrap {
  padding-top: max(16px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}

/* ================= Form Pengalaman / Kendala / Usulan ================= */
.intro { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; background: linear-gradient(135deg, #fffaf0, #fff 60%); border-color: #f5e3b5; }
.intro-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--gold-soft); box-shadow: 0 0 0 5px #fffaf0; }
.intro strong { display: block; font-family: var(--display); color: var(--emerald); font-size: 18px; margin-bottom: 4px; }
.intro p { margin: 0; color: #4f5f5b; font-size: 14.5px; line-height: 1.6; }
.intro b { color: var(--ink); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-opt { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; --c: var(--sky); --soft: var(--sky-soft); }
.seg-opt.bd { --c: var(--rose); --soft: var(--rose-soft); }
.seg-opt.kd { --c: var(--emerald-2); --soft: var(--emerald-soft); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px 6px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; font-size: 13.5px; line-height: 1.25; transition: all .15s; }
.seg-opt:hover span { border-color: var(--c); }
.seg-opt input:checked + span { border-color: var(--c); background: var(--soft); color: var(--c); box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 20%, transparent); }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 4px var(--soft); }
.seg.need .seg-opt span { border-color: #f1a3a3; background: #fff7f7; }

.qa { --c: var(--emerald); --soft: var(--emerald-soft); --c2: var(--emerald-2); }
.qa-2 { --c: #b8325a; --soft: var(--rose-soft); --c2: var(--rose); }
.qa-3 { --c: #1d5ea8; --soft: var(--sky-soft); --c2: var(--sky); }
.qa-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; cursor: pointer; }
.qa-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--soft); }
.qa-head b { display: block; font-size: 16.5px; color: var(--c); }
.qa-head small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 1px; }
.textarea {
  width: 100%; min-height: 110px; resize: vertical; display: block;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface-2); font: inherit; font-size: 16px; line-height: 1.55; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea::placeholder { color: #a3aeab; }
.textarea:focus { border-color: var(--c2); background: #fff; box-shadow: 0 0 0 5px var(--soft); }
.textarea.invalid { border-color: #f1a3a3; background: #fff7f7; }
.qa-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 6px; }
.qa-foot .error { margin: 0; text-align: left; flex: 1; }
.qa-foot .error:empty { display: block; background: none; border: 0; padding: 0; }
.qa-foot .error:not(:empty) { padding: 6px 10px; font-size: 13px; }
.count { font-size: 12px; color: #a3aeab; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
#err-pengisi:empty { display: none; }

@media (max-width: 380px) {
  .seg-opt span { font-size: 12.5px; padding: 8px 4px; }
}

/* ================= Admin: status absensi & tab ================= */
.status-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; box-shadow: var(--shadow); transition: all .2s; }
.status-card.on { border-color: #9fdcc6; background: linear-gradient(135deg, var(--emerald-soft), #fff 70%); }
.status-card.off { border-color: #f5dd9c; background: linear-gradient(135deg, var(--gold-soft), #fff 70%); }
.status-dot { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.status-txt { flex: 1; min-width: 0; }
.status-txt small { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.status-txt b { display: block; font-size: 17px; }
.status-card.on .status-txt b { color: var(--emerald); }
.status-card.off .status-txt b { color: #946100; }
.status-txt span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }

.switch { position: relative; flex: none; width: 64px; height: 36px; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d3d9d7; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + i { background: var(--grad-btn); }
.switch input:checked + i::after { transform: translateX(28px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px var(--emerald-soft); }
.switch input:disabled + i { opacity: .6; }

.tabs { display: flex; gap: 6px; padding: 5px; margin-bottom: 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; border-radius: 12px; background: transparent; font-weight: 800; font-size: 14.5px; color: var(--muted); transition: all .15s; }
.tab .cnt { font-size: 12px; min-width: 24px; padding: 2px 8px; border-radius: 999px; background: #eef1ef; color: var(--muted); }
.tab.on { background: var(--grad-hero); color: #fff; box-shadow: 0 6px 16px rgba(11, 107, 82, .25); }
.tab.on .cnt { background: rgba(255,255,255,.22); color: #fff; }

.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.m-list { display: grid; gap: 14px; }
.m-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.m-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px dashed var(--line); }
.m-head .info { flex: 1; min-width: 0; }
.m-head b { display: block; font-size: 16px; }
.m-head small { color: var(--muted); font-size: 12.5px; }
.m-body { display: grid; grid-template-columns: repeat(3, 1fr); }
.m-sec { padding: 14px 16px; border-right: 1px solid var(--line); }
.m-sec:last-child { border-right: 0; }
.m-sec h4 { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.m-sec p { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: #2c3b38; }
.m-sec.s-p { background: linear-gradient(180deg, var(--emerald-soft), #fff 60px); }
.m-sec.s-p h4 { color: var(--emerald); }
.m-sec.s-k { background: linear-gradient(180deg, var(--rose-soft), #fff 60px); }
.m-sec.s-k h4 { color: #b8325a; }
.m-sec.s-u { background: linear-gradient(180deg, var(--sky-soft), #fff 60px); }
.m-sec.s-u h4 { color: #1d5ea8; }
.m-empty { text-align: center; color: var(--muted); padding: 40px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.m-empty div { font-size: 34px; margin-bottom: 6px; }
.dchip.kd { background: var(--emerald-soft); color: #0b6b52; }

@media (max-width: 720px) {
  .status-card { flex-wrap: wrap; padding: 14px 16px; }
  .m-stats { grid-template-columns: 1fr 1fr; }
  .m-stats .stat:last-child { grid-column: 1 / -1; }
  .m-body { grid-template-columns: 1fr; }
  .m-sec { border-right: 0; border-bottom: 1px solid var(--line); }
  .m-sec:last-child { border-bottom: 0; }
}

@media (max-width: 480px) { .hide-sm { display: none; } }
