/* ===== Absensi MAN Barito Timur — mengikuti tampilan situs manbaritotimur.sch.id ===== */
:root {
    --hijau: #047857;
    --hijau-tua: #064e3b;
    --teal: #0f706e;
    --biru: #0e3d68;
    --biru-tengah: #0f556c;
    --emas: #fbbf24;
    --emas-tua: #d99a06;
    --latar: #f4f8f7;
    --putih: #ffffff;
    --garis: #d9e6e3;
    --teks: #1f2d2b;
    --redup: #5f716e;
    --grad: linear-gradient(100deg, #047857 0%, #0f556c 55%, #0e3d68 100%);
    --grad-gelap: linear-gradient(100deg, #064e3b 0%, #0b4a55 55%, #0e3d68 100%);
    --font: "Poppins", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    font-family: var(--font);
    background: var(--latar);
    margin: 0;
    color: var(--teks);
    line-height: 1.6;
    display: flex; flex-direction: column; min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font); color: var(--biru); font-weight: 700; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--emas); outline-offset: 2px; }

/* ---- Header situs ---- */
.site-header { background: var(--grad); border-bottom: 3px solid var(--emas); color: #fff; }
.header-inner { max-width: 1240px; margin: 0 auto; padding: 22px 28px; display: flex; align-items: center; gap: 22px; }
.header-inner img.logo { width: 76px; height: auto; border-radius: 6px; flex-shrink: 0; }
.header-title h1 { margin: 0; color: #fff; font-size: 1.75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; line-height: 1.2; }
.header-title p { margin: 4px 0 0; font-size: 1.05rem; color: #fff; font-weight: 400; }
.logo-kanan { margin-left: auto; height: 78px; width: auto; flex-shrink: 0; }
.header-right { margin-left: auto; text-align: right; font-size: .78rem; line-height: 1.3; color: #d6ecea; }
.header-right strong { display: block; color: var(--emas); font-size: .9rem; }

/* ---- Menu ---- */
.site-nav { background: var(--grad); border-bottom: 3px solid var(--emas); }
.nav-inner { max-width: 1240px; margin: 0 auto; padding: 0 28px; display: flex; align-items: stretch; justify-content: flex-end; gap: 4px; flex-wrap: wrap; min-height: 62px; }
.site-nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 0 16px; display: flex; align-items: center; position: relative; transition: background .15s; }
.site-nav a:hover { background: rgba(255,255,255,.12); }
.site-nav a.aktif::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #fff; border-radius: 3px 3px 0 0; }
.site-nav .nav-user { color: #d6ecea; font-size: .85rem; display: flex; align-items: center; padding: 0 12px; margin-right: auto; }
.site-nav a.keluar { color: var(--emas); }

/* ---- Banner judul halaman ---- */
.page-banner { position: relative; background: linear-gradient(rgba(4,60,50,.78), rgba(10,45,70,.82)), repeating-linear-gradient(45deg, #0d6a55 0 18px, #0b5e4c 18px 36px); }
.banner-inner { max-width: 1240px; margin: 0 auto; padding: 38px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.banner-inner h2 { margin: 0; color: #fff; font-size: 2.1rem; font-weight: 800; padding-left: 20px; border-left: 4px solid var(--teal); border-left-color: #2bb3a8; }
.crumb { background: var(--teal); color: #fff; padding: 11px 34px; border-radius: 40px 0 0 40px; font-weight: 500; font-size: .95rem; min-width: 260px; margin-right: -28px; }

/* ---- Footer ---- */
.site-footer { margin-top: auto; background: var(--grad-gelap); border-top: 4px solid var(--emas); color: #fff; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-inner img { width: 48px; border-radius: 4px; }
.footer-inner .copy { font-size: 1rem; }
.footer-inner .tagline { font-size: .8rem; color: #b8d9d4; }

/* ---- Tombol ---- */
.btn { display: inline-block; padding: 9px 20px; border-radius: 30px; text-decoration: none; font-size: .88rem; font-weight: 600; border: 0; cursor: pointer; transition: transform .1s, filter .15s, background .15s; font-family: inherit; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 3px 0 var(--biru); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-danger { background: #c53030; color: #fff; box-shadow: 0 3px 0 #8f2020; }
.btn-secondary { background: #fff; color: var(--biru); border: 1.5px solid var(--teal); }
.btn-secondary:hover { background: #e7f4f2; }

/* ---- Input ---- */
input[type=text], input[type=password], input[type=date], input[type=time], input[type=file], select {
    font: inherit; font-size: .92rem; padding: 9px 13px; border: 1.5px solid #b7cdc9; border-radius: 10px; background: #fff; color: var(--teks);
}
input:focus, select:focus { border-color: var(--teal); outline: 3px solid rgba(251,191,36,.55); outline-offset: 0; }

/* ---- Alert ---- */
.alert-error, .alert-success { padding: 11px 16px; border-radius: 10px; margin-bottom: 14px; font-size: .9rem; border-left: 5px solid; }
.alert-error { background: #fdeaea; color: #9b1c1c; border-color: #c53030; }
.alert-success { background: #e3f6e9; color: #146c3b; border-color: #2f9e5f; }

/* ===== Konten admin ===== */
.admin-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 34px 28px 46px; }
.admin-wrap h2 { margin-top: 0; }

/* Panel selamat datang (dashboard) */
.papan { background: var(--grad); color: #fff; border-radius: 18px; border-bottom: 4px solid var(--emas); padding: 26px 30px; box-shadow: 0 10px 26px rgba(14,61,104,.22); margin-bottom: 28px; }
.papan h2 { color: #fff; margin: 0 0 2px; font-size: 1.5rem; font-weight: 700; }
.papan p { margin: 0; color: #d6ecea; }
.bar { height: 10px; background: rgba(255,255,255,.22); border-radius: 99px; margin-top: 16px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--emas); border-radius: 99px; }
.bar-label { font-size: .85rem; margin-top: 8px; color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.stat { background: #fff; padding: 18px 20px; border-radius: 16px; position: relative; border: 1px solid var(--garis); border-top: 5px solid var(--warna); box-shadow: 0 4px 14px rgba(14,61,104,.07); }
.stat::before { content: attr(data-label); font-size: .8rem; font-weight: 700; color: var(--warna); text-transform: uppercase; letter-spacing: .06em; }
.stat .angka { font-size: 2.6rem; font-weight: 800; color: var(--warna); line-height: 1.15; }
.stat .ket { color: var(--redup); font-size: .82rem; }
.aksi-cepat { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Tabel & form */
.tabel-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--garis); background: #fff; box-shadow: 0 4px 14px rgba(14,61,104,.07); }
table.data-table { width: 100%; border-collapse: collapse; background: #fff; }
table.data-table th, table.data-table td { padding: 12px 16px; border-bottom: 1px solid #e6eeec; text-align: left; font-size: .9rem; }
table.data-table th { background: var(--grad); color: #fff; font-weight: 600; border-bottom: 3px solid var(--emas); white-space: nowrap; }
table.data-table tbody tr:nth-child(even) { background: #f6faf9; }
table.data-table tbody tr:hover { background: #e7f4f2; }
.badge { display: inline-block; padding: 2px 12px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #e8edf0; color: #44525a; }
.badge-hadir { background: #dff3e6; color: #146c3b; }
.badge-terlambat { background: #fff1cc; color: #8a5a00; }
.badge-belum, .badge-alpa { background: #fde4e4; color: #9b1c1c; }
.badge-izin { background: #dbeafe; color: #1e4f9c; }
.badge-sakit { background: #ede1fa; color: #5b2e91; }
.form-box { background: #fff; padding: 26px 28px; border-radius: 16px; max-width: 520px; width: 100%; border: 1px solid var(--garis); border-top: 5px solid var(--emas); box-shadow: 0 4px 14px rgba(14,61,104,.07); }
.form-box h3 { margin-top: 0; }
.form-box label { display: block; margin-top: 12px; font-weight: 600; font-size: .9rem; }
.form-box input, .form-box select { width: 100%; margin-top: 4px; }

/* Izin / Sakit */
.dua-kolom { display: grid; grid-template-columns: minmax(340px, 480px) 1fr; gap: 24px; align-items: start; }
.form-lebar { max-width: none; }
.dua-input { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pilihan-status { display: flex; gap: 10px; margin-top: 4px; }
.pilihan-status label { margin: 0; display: flex; align-items: center; gap: 6px; background: #e7f4f2; padding: 8px 18px; border-radius: 30px; cursor: pointer; font-weight: 600; }
.pilihan-status input { width: auto; margin: 0; }
.form-box input[type=checkbox] { width: auto; margin: 0; }
.daftar-siswa { max-height: 260px; overflow-y: auto; border: 1.5px solid #b7cdc9; border-radius: 10px; margin-top: 8px; background: #fff; }
.item-siswa { display: flex; align-items: center; gap: 10px; margin: 0 !important; padding: 7px 12px; font-weight: 500 !important; cursor: pointer; border-bottom: 1px solid #eef3f2; }
.item-siswa:hover { background: #e7f4f2; }
.item-siswa small { color: #5f716e; margin-left: 6px; }
@media (max-width: 900px) { .dua-kolom { grid-template-columns: 1fr; } }

/* Rekap bulanan */
a.mode-btn { text-decoration: none; text-align: center; }
table.rekap-bulan th, table.rekap-bulan td { padding: 7px 5px; text-align: center; font-size: .78rem; white-space: nowrap; }
table.rekap-bulan th.kiri, table.rekap-bulan td.kiri { text-align: left; padding-left: 12px; padding-right: 12px; min-width: 190px; position: sticky; left: 0; background: inherit; }
table.rekap-bulan tbody tr td.kiri { background: #fff; }
table.rekap-bulan tbody tr:nth-child(even) td.kiri { background: #f6faf9; }
table.rekap-bulan th.kiri { background: #0f6b5c; z-index: 1; }
.kode { display: inline-block; min-width: 20px; padding: 1px 4px; border-radius: 5px; font-weight: 700; font-size: .75rem; text-align: center; }
.kode-H { background: #dff3e6; color: #146c3b; }
.kode-T { background: #fff1cc; color: #8a5a00; }
.kode-I { background: #dbeafe; color: #1e4f9c; }
.kode-S { background: #ede1fa; color: #5b2e91; }
.kode-A { background: #fde4e4; color: #9b1c1c; }
.kode-L { background: #e3e8eb; color: #5b6870; }
.badge-libur { background: #e3e8eb; color: #5b6870; }
table.rekap-bulan td.sel-libur { background: #eef1f3 !important; }

/* ===== Halaman scan & login (tanpa menu) ===== */
.container { width: calc(100% - 32px); max-width: 500px; margin: 34px auto; background: #fff; border-radius: 20px; box-shadow: 0 12px 34px rgba(14,61,104,.18); text-align: center; overflow: hidden; border: 1px solid var(--garis); }
.scan-head { background: var(--grad); color: #fff; padding: 24px 20px 20px; border-bottom: 4px solid var(--emas); }
.scan-head img { width: 62px; }
.scan-head h1 { color: #fff; font-size: 1.35rem; margin: 8px 0 0; }
.sub { color: #d6ecea; margin: 2px 0 0; font-size: .9rem; }
.scan-body { padding: 22px; }
.mode-switch { display: flex; gap: 0; margin-bottom: 16px; background: #e7f4f2; padding: 4px; border-radius: 40px; }
.mode-btn { flex: 1; padding: 11px; border: 0; background: transparent; color: var(--teal); border-radius: 40px; font-weight: 700; font-size: .95rem; cursor: pointer; font-family: inherit; }
.mode-btn.active { background: var(--grad); color: #fff; box-shadow: 0 2px 8px rgba(14,61,104,.35); }
#reader { border-radius: 14px; overflow: hidden; border: 3px dashed var(--teal) !important; background: #fafcfb; }
.hasil-box { margin-top: 16px; padding: 16px; border-radius: 12px; font-weight: 700; font-size: 1.05rem; border-left: 6px solid; text-align: left; }
.hasil-box.hidden { display: none; }
.hasil-box.success { background: #e3f6e9; color: #146c3b; border-color: #2f9e5f; }
.hasil-box.error   { background: #fdeaea; color: #9b1c1c; border-color: #c53030; }
.hasil-box.warning { background: #fff4d6; color: #8a5a00; border-color: var(--emas); }
.jam-live { margin: 16px 0 0; font-size: .85rem; color: var(--redup); }

.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-wrap { width: 100%; max-width: 840px; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 14px 38px rgba(14,61,104,.2); border: 1px solid var(--garis); }
.login-papan { background: var(--grad); color: #fff; padding: 38px 32px; display: flex; flex-direction: column; justify-content: center; border-right: 5px solid var(--emas); }
.login-papan img { width: 84px; }
.login-papan h2 { color: #fff; font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; margin: 16px 0 6px; text-transform: uppercase; }
.login-papan p { margin: 0; color: #d6ecea; font-size: .92rem; }
.login-box { padding: 38px 34px; }
.login-box h2 { margin: 0 0 4px; }
.login-box .redup { color: var(--redup); margin: 0 0 18px; font-size: .9rem; }
.login-box label { display: block; margin-top: 12px; font-weight: 600; font-size: .9rem; }
.login-box input { width: 100%; margin-top: 4px; }
.login-box .catatan { font-size: .8rem; color: var(--redup); margin-top: 16px; text-align: center; }

@media (max-width: 760px) {
    .header-inner { padding: 16px; gap: 14px; }
    .header-inner img.logo { width: 54px; }
    .header-title h1 { font-size: 1.05rem; letter-spacing: .05em; }
    .header-title p { font-size: .82rem; }
    .logo-kanan { height: 40px; }
    .nav-inner { padding: 0 8px; justify-content: flex-start; min-height: 0; }
    .site-nav a { padding: 12px 11px; font-size: .85rem; }
    .site-nav .nav-user { display: none; }
    .banner-inner { padding: 24px 16px; }
    .banner-inner h2 { font-size: 1.5rem; }
    .crumb { min-width: 0; margin-right: -16px; padding: 9px 22px; }
    .admin-wrap { padding: 22px 14px 34px; }
    .footer-inner { justify-content: center; text-align: center; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-papan { border-right: 0; border-bottom: 5px solid var(--emas); padding: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
