/* THEME: hijau (tanpa ubah layout) */
:root{
  --bg0:#060a17;
  --bg1:#0b1430;
  --card: rgba(11,18,32,.78);
  --card2: rgba(11,18,32,.92);
  --line: rgba(148,163,184,.18);
  --ink:#e5e7eb;
  --muted:#a8b3cf;
  --brand:#22c55e;
  --brandInk:#052e16;
  --danger:#ef4444;
  --warn:#f59e0b;
  --radius:18px;
  --shadow: 0 14px 50px rgba(0,0,0,.35);
}

/* ===== Anti "cahaya/glow" pinggir layar (overscroll) + tap highlight ===== */
html, body{
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}
*{
  -webkit-tap-highlight-color: transparent;
}
/* Hapus warna autofill browser agar tidak muncul glow/warna aneh */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-text-fill-color: inherit;
  transition: background-color 9999s ease-out 0s;
  box-shadow: 0 0 0px 1000px rgba(0,0,0,0) inset;
}

*{box-sizing:border-box}
html,body{height:100%}
html{background: var(--bg0); background-color: var(--bg0);}
body{background-color: var(--bg0);}


/* Anti highlight tap (sering terlihat seperti cahaya hijau di beberapa HP) */
*{-webkit-tap-highlight-color: transparent;}

body{
  margin:0;
  color:var(--ink);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: radial-gradient(1100px 700px at 12% -10%, rgba(59,130,246,.22), transparent 60%),
              radial-gradient(900px 600px at 90% 10%, rgba(59,130,246,.20), transparent 55%),
              var(--bg0);
  min-height:100vh;
}

/* Motif overlay (halus, tidak ganggu teks) */
body::before{content:none !important;}

/* App shell */
.app{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:18px;
}

.screen{
  width:min(1120px, 96vw);
  border-radius:calc(var(--radius) + 6px);
  overflow:hidden;
  box-shadow:var(--shadow);
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  backdrop-filter: blur(10px);
}

.appbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background: linear-gradient(180deg, rgba(11,18,32,.92), rgba(11,18,32,.75));
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(10px);
}

.appbar .title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(10,19,38,.55);
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}

.logo{
  width:34px;height:34px;
  border-radius:12px;
  display:grid;place-items:center;
  background: radial-gradient(circle at 30% 30%, rgba(59,130,246,.95), rgba(59,130,246,.25));
  border:1px solid rgba(59,130,246,.35);
  box-shadow: 0 10px 30px rgba(59,130,246,.12);
}

.h1{
  margin:0;
  font-size:clamp(16px, 2.6vw, 22px);
  line-height:1.15;
  letter-spacing:.2px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sub{
  margin:2px 0 0;
  color:var(--muted);
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.content{
  padding:16px;
  padding-bottom:96px;
}

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
}

.card + .card{margin-top:12px}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}


/* Ringkasan angka (Hadir/Izin/Sakit/Alfa/Lain) responsif */
.summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
@media (max-width:860px){.summary-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media (max-width:520px){.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:720px){
  .grid{grid-template-columns:1fr}
  .app{padding:12px}
  .content{padding:12px}
}

label{display:block;margin:10px 0 6px;color:var(--muted);font-size:13px}

input[type=text],input[type=password],input[type=date],input[type=month],select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(10,19,38,.62);
  color:var(--ink);
  outline:none;
}
input:focus,select:focus{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 4px rgba(59,130,246,.14);
}

/* Anti “cahaya hijau/kuning” dari autofill & validasi bawaan browser */
input:valid,
input:invalid,
select:valid,
select:invalid,
textarea:valid,
textarea:invalid{
  border-color: var(--line) !important;
}

/* Chrome/Edge autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0px 1000px rgba(11,18,32,.92) inset !important;
  box-shadow: 0 0 0px 1000px rgba(11,18,32,.92) inset !important;
  border: 1px solid var(--line) !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* Firefox autofill */
input:-moz-autofill,
textarea:-moz-autofill,
select:-moz-autofill{
  box-shadow: 0 0 0px 1000px rgba(11,18,32,.92) inset !important;
  border: 1px solid var(--line) !important;
}

.hint{color:var(--muted);font-size:12px;margin-top:6px;opacity:.95}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.actions{display:flex;gap:10px;flex-wrap:wrap}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(10,19,38,.62);
  color:var(--ink);
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
}
.btn:active{transform: translateY(1px)}
.btn-primary{
  background: linear-gradient(180deg, rgba(59,130,246,.98), rgba(59,130,246,.72));
  border-color: rgba(59,130,246,.35);
  color: var(--brandInk);
}
.btn-danger{
  background: rgba(127,29,29,.35);
  border-color: rgba(239,68,68,.38);
  color: #fecaca;
}

.toast{
  display:none;
  margin-top:10px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(10,19,38,.62);
}
.toast.ok{border-color: rgba(59,130,246,.32); background: rgba(8,24,55,.35); color:#dcfce7}
.toast.err{border-color: rgba(239,68,68,.30); background: rgba(42,15,19,.38); color:#fecaca}
/* ===== UI refinements (loading + empty state + consistent actions) ===== */
.btn-secondary{
  background: rgba(10,19,38,.50);
  border-color: rgba(148,163,184,.18);
  color: var(--ink);
  font-weight:800;
}
.btn-ghost{
  background: rgba(10,19,38,.30);
  border-color: rgba(148,163,184,.14);
  color: var(--ink);
}
.btn-icon{
  padding:10px 12px;
  border-radius:14px;
  min-width:auto;
}
.spinner{
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid rgba(148,163,184,.30);
  border-top-color: rgba(59,130,246,.75);
  animation: spin .75s linear infinite;
  flex:0 0 auto;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.toast .row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.toast.warn{
  border-color: rgba(250,204,21,.30);
  background: rgba(40,32,10,.36);
  color:#fde68a;
}

.loadingbar{
  position:sticky;
  top:0;
  z-index:20;
  height:3px;
  background: rgba(148,163,184,.10);
  overflow:hidden;
  border-bottom:1px solid rgba(148,163,184,.10);
}
.loadingbar > i{
  display:block;
  height:100%;
  width:35%;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,.8), transparent);
  animation: loadbar 1s ease-in-out infinite;
}
@keyframes loadbar{
  0%{ transform: translateX(-120%); opacity:.3; }
  50%{ opacity:1; }
  100%{ transform: translateX(320%); opacity:.3; }
}

.empty-state{
  border:1px dashed rgba(148,163,184,.26);
  background: rgba(10,19,38,.40);
  border-radius: var(--radius);
  padding:18px;
  text-align:center;
}
.empty-state .e-ico{
  width:54px;height:54px;
  border-radius:18px;
  margin:0 auto 10px;
  display:grid;place-items:center;
  border:1px solid rgba(59,130,246,.25);
  background: rgba(59,130,246,.10);
}
.empty-state .e-title{
  font-weight:950;
  letter-spacing:.2px;
  margin:0;
  font-size:16px;
}
.empty-state .e-desc{
  margin:6px 0 0;
  color: var(--muted);
  font-size:13px;
  line-height:1.45;
}

/* chips */
.chips{display:flex;flex-wrap:wrap;gap:10px;margin-top:6px}
.chip{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(10,19,38,.62);
  cursor:pointer;
  user-select:none;
}
.chip input{accent-color: var(--brand)}

/* tables */
.table-wrap{overflow:auto;max-height:70vh;border-radius:14px;border:1px solid rgba(148,163,184,.18)}

table{width:100%;border-collapse:collapse}
th,td{border-bottom:1px solid rgba(148,163,184,.18);padding:10px 12px;text-align:left;font-size:14px}
th{position:sticky;top:0;background: rgba(11,18,32,.92);backdrop-filter: blur(10px)}

/* status pill */
.st{
  display:inline-block;
  padding:3px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(10,19,38,.62);
  font-weight:800;
}
.st.H{border-color: rgba(30,58,138,.75); background: rgba(8,24,55,.55); color:#bbf7d0}
.st.I{border-color: rgba(113,63,18,.75); background: rgba(31,21,6,.55); color:#fde68a}
.st.S{border-color: rgba(124,45,18,.75); background: rgba(42,18,8,.55); color:#fdba74}
.st.A{border-color: rgba(127,29,29,.75); background: rgba(42,15,19,.55); color:#fecaca}

/* bottom nav (optional) */
.navbar{
  position:sticky;
  bottom:0;
  z-index:10;
  display:flex;
  gap:8px;
  padding:10px;
  background: linear-gradient(180deg, rgba(11,18,32,.60), rgba(11,18,32,.92));
  border-top:1px solid var(--line);
  backdrop-filter: blur(10px);
}
.navbar a{
  flex:1;
  text-align:center;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.16);
  background: rgba(10,19,38,.50);
  color: var(--ink);
  text-decoration:none;
  font-weight:800;
  font-size:13px;
}
.navbar a:active{transform: translateY(1px)}

.small{font-size:12px;color:var(--muted)}
.center{text-align:center}

.disabled{opacity:.55;pointer-events:none}


/* ===== Auth (Login) layout: responsive desktop vs HP ===== */
.auth-screen{ width:min(980px, 96vw); }
.auth{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap:14px;
  padding:16px;
}
.auth-side{
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(255,255,255,.03));
  padding:18px;
  min-height: 280px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.auth-mark{
  width:62px;height:62px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  display:grid;place-items:center;
  margin-bottom:10px;
}
.auth-title{ font-size:26px; font-weight:950; letter-spacing:.2px; }
.auth-sub{ color: var(--muted); margin-top:4px; font-weight:700; }
.auth-note{ margin-top:14px; color: var(--muted); font-size:13px; line-height:1.5; }
.auth-note .muted{ display:block; margin-top:6px; opacity:.9; }

.auth-form{ display:flex; align-items:stretch; }
.auth-form .card{ width:100%; margin:0; }

@media (max-width:860px){
  .auth{ grid-template-columns:1fr; padding:12px; }
  .auth-side{ min-height:auto; }
}
@media (min-width:980px){
  .content{ padding:18px; }
  .appbar{ padding:16px 18px; }
}

/* Select look on mobile a bit tighter */
@media (max-width:420px){
  input[type=text],input[type=password],input[type=date],input[type=month],select{ padding:11px 11px; }
}


@media (max-width:560px){
  .appbar{flex-wrap:wrap;justify-content:flex-start}
  .badge{white-space:normal;flex-wrap:wrap;max-width:100%}
  .actions{width:100%;justify-content:flex-end}
}


.navbar a{display:flex;align-items:center;justify-content:center;gap:8px;line-height:1}
.navbar a .ico{width:16px;height:16px;flex:0 0 auto;opacity:.95}
.navbar a span{display:inline-block;min-width:0}
@media (max-width:420px){
  .navbar a{padding:10px 8px;font-size:12px}
  .navbar a .ico{width:15px;height:15px}
}

/* ===== Login Sekolah (rapi + jarak enak di HP & laptop) ===== */
/* default spacing (desktop/tablet) */
.auth-form .card{padding:18px}
.auth-form .card h2{margin:0 0 24px; font-size:22px; letter-spacing:.2px}
.auth-form .card .mutedline{color:var(--muted);font-weight:700;font-size:13px;margin:0 0 24px; line-height:1.35}
.auth-form .field{margin-top:22px}
.auth-form .field label{display:block; margin:0 0 8px; font-weight:800; font-size:13px; color:rgba(229,231,235,.92)}
.input-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.22);
  background: rgba(10,19,38,.62);
}
.input-wrap:focus-within{
  border-color: rgba(59,130,246,.45);
  box-shadow: 0 0 0 3px rgba(59,130,246,.10);
}
.input-wrap .ico{
  width:18px;height:18px;
  flex:0 0 18px;
  opacity:.95;
  color:var(--muted);
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.input-wrap input{
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  outline:none;
  color:var(--ink);
  width:100%;
  font-size:14px;
  line-height:1.2;
}
.btn .ico{
  width:18px;height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 18px;
}
.btn .ico svg{width:18px;height:18px;display:block}


/* Utility */
.w100{width:100%}
.tiny{font-size:12px;color:var(--muted)}
.tiny:empty{display:none}

/* Button variants */
.btn-soft{
  background: rgba(148,163,184,.10);
  border: 1px solid rgba(148,163,184,.18);
}
.btn-soft:hover{background: rgba(148,163,184,.14)}
.btn-text{display:flex;flex-direction:column;align-items:flex-start;line-height:1.05}
.btn-title{font-weight:900}
.btn-sub{font-size:12px;color:rgba(168,179,207,.95);font-weight:700;margin-top:4px}

.auth-form .btn{border-radius:16px}
.auth-form .btn + .btn{margin-top:10px}

/* Jarak tombol dari input terakhir (biar "Masuk" tidak mepet dengan password) */
.auth-form .card .btn-primary{margin-top:24px}

/* Mobile: kasih napas sedikit lebih lega */
@media (max-width:520px){
  .auth-form .card{padding:18px}
  .auth-form .card h2{margin-bottom:22px}
  .auth-form .card .mutedline{margin-bottom:22px}
  .auth-form .field{margin-top:22px}
  .auth-form .card .btn-primary{margin-top:22px}
}

/* === Welcome Typing (Pilih Sekolah) === */
/* ===== Welcome Typing (Pilih Sekolah) ===== */
.welcome-area{
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 8px 0 6px;
}

.welcome-typing{
  text-align: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.welcome-typing .typing-line{
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  width: 0;
}

/* Baris 1 */
.welcome-typing .typing1{
  font-size: clamp(14px, 3.6vw, 20px);
  font-weight: 700;
  opacity: .92;
  animation: typing1 1.9s steps(17, end) forwards;
}

/* Baris 2 (brand) */
.welcome-typing .typing2{
  font-size: clamp(22px, 6vw, 36px);
  font-weight: 900;
  letter-spacing: .2px;
  border-right: 2px solid currentColor;
  animation:
    typing2 1.6s steps(13, end) 2.05s forwards,
    caret .65s steps(1, end) 2.05s 6,
    caretOff .01s linear 3.78s forwards;
}

@keyframes typing1{ from{ width:0; } to{ width:17ch; } }
@keyframes typing2{ from{ width:0; } to{ width:13ch; } }
@keyframes caret{ 50%{ border-right-color: transparent; } }
@keyframes caretOff{ to{ border-right-color: transparent; border-right-width: 0; } }


@media (prefers-reduced-motion: reduce){
  .welcome-typing .typing-line{
    animation: none !important;
    width: auto !important;
    border-right: 0 !important;
  }
}


/* ===== Fix tampilan "warna setengah" di halaman Pilih Sekolah (HP) ===== */
.page-pick .screen{
  /* biar area kosong bawah ikut warna background halaman, bukan panel beda */
  background: transparent !important;
}
.page-pick .pick-wrap{
  padding-bottom: 12px !important;
}


/* Fix HP: hilangkan perbedaan warna bawah pada halaman pilih sekolah */
.page-pick .screen{background: transparent !important; backdrop-filter: none !important;}
.page-pick .app{padding-bottom: env(safe-area-inset-bottom);}

/* =========================
   ICON COLORS (tanpa ubah layout)
   ========================= */

/* Accent warna ikon per halaman/role */
.page-pick{ --icon-accent: #34d399; }      /* hijau tosca */
.page-login{ --icon-accent: #60a5fa; }     /* biru */
.page-siswa, body.siswa{ --icon-accent: #22c55e; }  /* hijau */
.page-guru, body.guru{ --icon-accent: #38bdf8; }    /* biru muda */
.page-admin, body.admin{ --icon-accent: #f59e0b; }  /* amber */

/* Target SVG ikon yang dipakai di UI */
.appbar svg, .topbar svg, .iconbtn svg, .btn svg, .tile svg, .school-card svg, .school-btn svg, .auth-mark svg{
  color: var(--icon-accent);
}

/* Untuk ikon model "fill" (path tanpa stroke) */
.appbar svg path, .topbar svg path, .iconbtn svg path, .btn svg path, .tile svg path, .school-card svg path, .school-btn svg path, .auth-mark svg path{
  fill: currentColor;
}

/* Untuk ikon model "stroke" (yang sebelumnya pakai rgba putih) */
.appbar svg *[stroke], .topbar svg *[stroke], .iconbtn svg *[stroke], .btn svg *[stroke], .tile svg *[stroke], .school-card svg *[stroke], .school-btn svg *[stroke], .auth-mark svg *[stroke]{
  stroke: currentColor !important;
}

/* Jaga ketebalan stroke tetap enak */
.appbar svg *[stroke-width], .topbar svg *[stroke-width], .iconbtn svg *[stroke-width], .btn svg *[stroke-width], .tile svg *[stroke-width], .school-card svg *[stroke-width], .school-btn svg *[stroke-width], .auth-mark svg *[stroke-width]{
  stroke-width: inherit;
}

/* Simulasikan 3 tingkat "terang" dari ikon lama (berdasarkan alpha di attribut stroke) */
.appbar svg *[stroke*=".95"], .topbar svg *[stroke*=".95"], .iconbtn svg *[stroke*=".95"], .btn svg *[stroke*=".95"], .tile svg *[stroke*=".95"], .school-card svg *[stroke*=".95"], .school-btn svg *[stroke*=".95"], .auth-mark svg *[stroke*=".95"]{ stroke-opacity: 1 !important; }

.appbar svg *[stroke*=".92"], .topbar svg *[stroke*=".92"], .iconbtn svg *[stroke*=".92"], .btn svg *[stroke*=".92"], .tile svg *[stroke*=".92"], .school-card svg *[stroke*=".92"], .school-btn svg *[stroke*=".92"], .auth-mark svg *[stroke*=".92"]{ stroke-opacity: .95 !important; }

.appbar svg *[stroke*=".85"], .topbar svg *[stroke*=".85"], .iconbtn svg *[stroke*=".85"], .btn svg *[stroke*=".85"], .tile svg *[stroke*=".85"], .school-card svg *[stroke*=".85"], .school-btn svg *[stroke*=".85"], .auth-mark svg *[stroke*=".85"]{ stroke-opacity: .9 !important; }

.appbar svg *[stroke*=".75"], .topbar svg *[stroke*=".75"], .iconbtn svg *[stroke*=".75"], .btn svg *[stroke*=".75"], .tile svg *[stroke*=".75"], .school-card svg *[stroke*=".75"], .school-btn svg *[stroke*=".75"], .auth-mark svg *[stroke*=".75"]{ stroke-opacity: .8 !important; }

.appbar svg *[stroke*=".55"], .topbar svg *[stroke*=".55"], .iconbtn svg *[stroke*=".55"], .btn svg *[stroke*=".55"], .tile svg *[stroke*=".55"], .school-card svg *[stroke*=".55"], .school-btn svg *[stroke*=".55"], .auth-mark svg *[stroke*=".55"]{ stroke-opacity: .65 !important; }

.appbar svg *[stroke*=".35"], .topbar svg *[stroke*=".35"], .iconbtn svg *[stroke*=".35"], .btn svg *[stroke*=".35"], .tile svg *[stroke*=".35"], .school-card svg *[stroke*=".35"], .school-btn svg *[stroke*=".35"], .auth-mark svg *[stroke*=".35"]{ stroke-opacity: .5 !important; }
