/* ==========================================================
   SIAB MIN 6 KUNINGAN - Theme Kemenag (Emerald Green & White)
   ========================================================== */

:root {
    --emerald-50:  #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-300: #6ee7b7;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-800: #065f46;
    --emerald-900: #064e3b;
    --emerald-950: #022c22;

    --kemenag-green:      #047857;
    --kemenag-green-dark: #065f46;
    --kemenag-gold:       #d4a017;

    --soft-gray-50:  #f8fafc;
    --soft-gray-100: #f1f5f9;
    --soft-gray-200: #e2e8f0;
    --soft-gray-300: #cbd5e1;
    --soft-gray-400: #94a3b8;
    --soft-gray-500: #64748b;
    --soft-gray-700: #334155;
    --soft-gray-900: #0f172a;

    --bg-app:    #f7fafb;
    --bg-card:   #ffffff;
    --text-main: #0f172a;
    --text-soft: #475569;
    --border:    #e6ebec;
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
    --shadow:    0 4px 16px -4px rgb(6 95 70 / 0.08), 0 2px 6px -1px rgb(15 23 42 / 0.04);
    --shadow-lg: 0 12px 36px -8px rgb(6 95 70 / 0.18), 0 4px 12px -2px rgb(15 23 42 / 0.06);

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 20px;

    --sidebar-w: 260px;
    --navbar-h: 64px;
}

/* ============== DARK MODE ==============
   Diaktifkan lewat atribut data-bs-theme="dark" di <html> (dipasang JS,
   lihat assets/js/app.js + templates/header.php) — sama dgn mekanisme
   dark mode bawaan Bootstrap 5.3, jadi komponen Bootstrap native (modal,
   dropdown, alert, form-control bawaan, dll) otomatis ikut menyesuaikan.
   Variabel di bawah ini meng-override palet warna kustom aplikasi ini;
   kelas kustom yg masih pakai warna hardcoded (bukan var(--...)) di-timpa
   manual lewat selector [data-bs-theme="dark"] di bagian2 terkait di bawah. */
:root[data-bs-theme="dark"] {
    --bg-app:    #0f172a;
    --bg-card:   #1e293b;
    --text-main: #e8edf3;
    --text-soft: #94a3b8;
    --border:    #334155;
    --soft-gray-50:  #1e293b;
    --soft-gray-100: #263449;
    --soft-gray-200: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
    --shadow:    0 4px 16px -4px rgb(0 0 0 / 0.45), 0 2px 6px -1px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 12px 36px -8px rgb(0 0 0 / 0.55), 0 4px 12px -2px rgb(0 0 0 / 0.4);
}

* { box-sizing: border-box; }

html, body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--emerald-700); text-decoration: none; }
a:hover { color: var(--emerald-900); }

/* ============== LOGIN PAGE ============== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 50%, #ffffff 100%);
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}
.login-wrapper::before {
    content:''; position:absolute; top:-200px; right:-200px;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, var(--emerald-200), transparent 60%);
    filter: blur(40px); opacity: 0.7;
}
.login-wrapper::after {
    content:''; position:absolute; bottom:-200px; left:-200px;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, var(--emerald-300), transparent 60%);
    filter: blur(40px); opacity: 0.5;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    min-width: 0;
    margin: auto;
    position: relative;
    z-index: 2;
    border: 1px solid var(--border);
}
@media (max-width: 480px) {
    .login-card { padding: 1.75rem 1.25rem; }
}
.login-brand {
    text-align: center;
    margin-bottom: 1.8rem;
}
.login-brand img { height: 64px; margin-bottom: 1rem; }
.login-brand h3 { color: var(--kemenag-green-dark); font-weight: 700; margin: 0; font-size: 1.3rem; }
.login-brand p { color: var(--text-soft); margin: 0.25rem 0 0; font-size: 0.875rem; }

.login-side {
    flex: 1;
    background: linear-gradient(160deg, var(--emerald-700) 0%, var(--emerald-900) 100%);
    color: #fff;
    padding: 4rem;
    display: none;
    position: relative;
    overflow: hidden;
}
@media (min-width: 992px) {
    .login-side { display: flex; flex-direction: column; justify-content: center; }
}
.login-side::before {
    content:''; position:absolute; inset:0;
    background-image: radial-gradient(circle at 10% 20%, rgba(255,255,255,0.08), transparent 40%),
                      radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06), transparent 40%);
}
.login-side .content { position: relative; z-index: 2; max-width: 480px; }
.login-side h1 { font-size: 2.25rem; font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.login-side p { font-size: 1rem; line-height: 1.7; opacity: 0.92; }
.login-side .feature { display:flex; gap:.75rem; margin-top:1rem; }
.login-side .feature i { color: var(--emerald-300); font-size: 1.25rem; }

.login-form-side {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.input-icon { position: relative; }
.input-icon .form-control { padding-left: 2.6rem; height: 48px; border-radius: 12px; }
.input-icon i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--soft-gray-400); }
.input-icon .toggle-pwd {
    position: absolute; right: 0.95rem; top: 50%; transform: translateY(-50%);
    cursor: pointer; color: var(--soft-gray-400); background: none; border: 0;
}

.btn-emerald {
    background: var(--kemenag-green);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-emerald:hover { background: var(--kemenag-green-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(6,95,70,.35); }
.btn-emerald:active { transform: translateY(0); }
.btn-emerald-outline {
    background: transparent; color: var(--kemenag-green); border: 1.5px solid var(--kemenag-green);
    padding: 0.55rem 1.2rem; border-radius: 12px; font-weight: 600;
}
.btn-emerald-outline:hover { background: var(--emerald-50); color: var(--kemenag-green-dark); }

/* ============== LAYOUT ============== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--emerald-800) 0%, var(--emerald-900) 100%);
    color: rgba(255,255,255,0.85);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.sidebar-brand {
    padding: 1.25rem 1.25rem;
    display: flex; align-items: center; gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img { height: 38px; width: 38px; object-fit: contain; border-radius: 8px; background: rgba(255,255,255,0.1); padding: 4px; }
.sidebar-brand .brand-text { color: #fff; font-weight: 700; line-height: 1.15; }
.sidebar-brand .brand-text small { color: var(--emerald-300); font-weight: 500; font-size: 0.75rem; }

.sidebar-nav { padding: 1rem 0.75rem; }
.sidebar-nav .nav-group { color: var(--emerald-300); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.75rem 0.75rem 0.35rem; font-weight: 700; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.78);
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.18s ease;
    font-size: 0.92rem;
}
.sidebar-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: var(--emerald-600); color: #fff; box-shadow: 0 4px 12px -2px rgba(0,0,0,0.2); }
.sidebar-nav a.active i { color: #fff; }
.sidebar-footer {
    padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.78rem; color: rgba(255,255,255,0.55);
}

.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.navbar-top {
    height: var(--navbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 1030;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.92);
}
.navbar-top .page-title { font-weight: 700; color: var(--text-main); margin: 0; font-size: 1.05rem; }
.navbar-top .nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.btn-icon {
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff; color: var(--text-soft);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
    cursor: pointer; position: relative;
}
.btn-icon:hover { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-200); }
.btn-icon .badge-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; background: #ef4444; border: 2px solid #fff; border-radius: 50%; }

.user-chip {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.3rem 0.8rem 0.3rem 0.3rem;
    border: 1px solid var(--border); border-radius: 12px;
    background: #fff; cursor: pointer;
}
.user-chip:hover { background: var(--emerald-50); border-color: var(--emerald-200); }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--emerald-100); color: var(--emerald-800); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .meta { line-height: 1.1; }
.user-chip .meta b { font-size: 0.875rem; color: var(--text-main); }
.user-chip .meta small { color: var(--text-soft); font-size: 0.72rem; }

.content-wrap { padding: 1.5rem; max-width: 100%; }

/* ============== CARDS ============== */
.card-app {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    transition: box-shadow 0.2s ease;
}
.card-app:hover { box-shadow: var(--shadow); }
.card-app .card-title { font-weight: 700; color: var(--text-main); margin-bottom: 1rem; }

.stat-card {
    display: flex; align-items: center; gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .icon-box {
    width: 52px; height: 52px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff;
    background: var(--kemenag-green); flex-shrink: 0;
}
.stat-card .icon-box.bg-emerald { background: var(--kemenag-green); }
.stat-card .icon-box.bg-amber   { background: #d97706; }
.stat-card .icon-box.bg-info    { background: #0284c7; }
.stat-card .icon-box.bg-rose    { background: #e11d48; }
.stat-card .icon-box.bg-violet  { background: #7c3aed; }
.stat-card .icon-box.bg-teal    { background: #0d9488; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 800; color: var(--text-main); line-height: 1; margin: 0; }
.stat-card .stat-label { color: var(--text-soft); font-size: 0.82rem; margin: 0.25rem 0 0; }

/* page header */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin: 0; }
.page-header .breadcrumb-min { color: var(--text-soft); font-size: 0.85rem; margin-top: 0.25rem; }

/* tables */
.table-app {
    width: 100%; background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-app table { width: 100%; border-collapse: collapse; }
.table-app th { background: var(--soft-gray-50); color: var(--text-soft); font-weight: 600; font-size: 0.8rem; padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.03em; }
.table-app td { padding: 0.85rem 1rem; border-top: 1px solid var(--border); color: var(--text-main); vertical-align: middle; font-size: 0.9rem; }
.table-app tbody tr:hover { background: var(--emerald-50); }
.table-responsive { overflow-x: auto; }

/* forms */
.form-label { font-weight: 600; color: var(--text-main); font-size: 0.875rem; margin-bottom: 0.4rem; }
.form-control, .form-select {
    border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.9rem;
    background: #fff; color: var(--text-main); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus, .form-select:focus { border-color: var(--emerald-500); box-shadow: 0 0 0 3px rgba(16,185,129,0.12); outline: none; }

/* badges */
.badge { padding: 0.35em 0.7em; border-radius: 8px; font-weight: 600; font-size: 0.75rem; }
.bg-success-subtle { background: #d1fae5 !important; }
.text-success-emphasis { color: #065f46 !important; }
.bg-warning-subtle { background: #fef3c7 !important; }
.text-warning-emphasis { color: #92400e !important; }
.bg-info-subtle { background: #cffafe !important; }
.text-info-emphasis { color: #155e75 !important; }
.bg-danger-subtle { background: #fee2e2 !important; }
.text-danger-emphasis { color: #991b1b !important; }
.bg-secondary-subtle { background: #f1f5f9 !important; }

/* avatar circle */
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--emerald-100); }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--emerald-100); border: 4px solid #fff; box-shadow: var(--shadow); }

/* qr canvas wrapper */
.qr-scan-card { max-width: 520px; margin: 0 auto; background: #000; border-radius: var(--radius-lg); padding: 1rem; }
#qr-reader { border-radius: var(--radius); overflow: hidden; }

/* mobile sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; background: rgba(15,23,42,0.5);
    z-index: 1035;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-wrap { padding: 1rem; }
}

/* absensi/input.php: tombol status per-baris (Hadir/Sakit/Izin/Alfa) melebarkan
   tabel di layar kecil — perkecil padding/font supaya jarak scroll horizontal
   di dalam .table-responsive lebih pendek, tanpa mengubah tampilan desktop. */
@media (max-width: 575.98px) {
    .status-group .btn { padding: 0.25rem 0.4rem; font-size: 0.72rem; }
}

/* footer kemenag */
.app-footer {
    padding: 1.25rem 1.5rem;
    color: var(--text-soft);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    background: #fff;
    text-align: center;
}

/* signature pad */
.signature-wrap {
    border: 2px dashed var(--soft-gray-300);
    border-radius: var(--radius);
    background: #fafdfb;
    padding: 0.5rem;
}
.signature-wrap canvas { width: 100%; height: 200px; display: block; cursor: crosshair; }

/* utility */
.text-emerald { color: var(--kemenag-green) !important; }
.bg-emerald-50 { background: var(--emerald-50) !important; }
.bg-emerald-100 { background: var(--emerald-100) !important; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.kbd { background: var(--soft-gray-100); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.8rem; }

/* print */
@media print {
    .sidebar, .navbar-top, .app-footer, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrap { padding: 0 !important; }
    body { background: #fff !important; }
}

/* ============== ANIMATIONS ============== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-emerald {
    0%   { box-shadow: 0 0 0 0 rgba(5,150,105,0.45); }
    70%  { box-shadow: 0 0 0 12px rgba(5,150,105,0); }
    100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* Page entrance animations */
.content-wrap > .page-header {
    animation: fadeInUp 0.5s ease both;
}
.content-wrap > .row > [class*="col-"] > .stat-card,
.content-wrap > .row > [class*="col-"] > .card-app {
    animation: fadeInUp 0.55s ease both;
}
.content-wrap > .card-app,
.content-wrap > .table-app {
    animation: fadeInUp 0.5s ease 0.05s both;
}

/* Staggered animation for stat cards (using nth-child) */
.row > .col-6:nth-child(1) > .stat-card,
.row > .col-md-3:nth-child(1) > .stat-card { animation-delay: 0.05s; }
.row > .col-6:nth-child(2) > .stat-card,
.row > .col-md-3:nth-child(2) > .stat-card { animation-delay: 0.12s; }
.row > .col-6:nth-child(3) > .stat-card,
.row > .col-md-3:nth-child(3) > .stat-card { animation-delay: 0.19s; }
.row > .col-6:nth-child(4) > .stat-card,
.row > .col-md-3:nth-child(4) > .stat-card { animation-delay: 0.26s; }

/* Sidebar nav items entrance */
.sidebar-nav a {
    animation: slideInLeft 0.4s ease both;
}
.sidebar-nav a:nth-child(2) { animation-delay: 0.05s; }
.sidebar-nav a:nth-child(3) { animation-delay: 0.08s; }
.sidebar-nav a:nth-child(4) { animation-delay: 0.11s; }
.sidebar-nav a:nth-child(5) { animation-delay: 0.14s; }
.sidebar-nav a:nth-child(6) { animation-delay: 0.17s; }
.sidebar-nav a:nth-child(7) { animation-delay: 0.20s; }
.sidebar-nav a:nth-child(8) { animation-delay: 0.23s; }
.sidebar-nav a:nth-child(9) { animation-delay: 0.26s; }
.sidebar-nav a:nth-child(10){ animation-delay: 0.29s; }

/* Table rows entrance */
.table-app tbody tr {
    animation: fadeIn 0.35s ease both;
}
.table-app tbody tr:nth-child(odd)  { animation-delay: 0.05s; }
.table-app tbody tr:nth-child(even) { animation-delay: 0.10s; }

/* Hover effects */
.stat-card .icon-box { transition: transform 0.25s cubic-bezier(.34,1.56,.64,1); }
.stat-card:hover .icon-box { transform: rotate(-8deg) scale(1.08); }

.sidebar-nav a { position: relative; overflow: hidden; }
.sidebar-nav a::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--emerald-300);
    transform: scaleY(0); transform-origin: bottom;
    transition: transform 0.25s ease;
}
.sidebar-nav a:hover::before, .sidebar-nav a.active::before { transform: scaleY(1); }

/* Button ripple-like */
.btn-emerald, .btn-emerald-outline, .btn { transition: all 0.2s ease; }
.btn:active { transform: scale(0.97); }

/* Card-app hover lift */
.card-app { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card-app:hover { transform: translateY(-2px); }

/* Login page entrance */
.login-card { animation: scaleIn 0.6s cubic-bezier(.34,1.56,.64,1) both; }
.login-side .content > * { animation: slideInLeft 0.6s ease both; }
.login-side .content > *:nth-child(2) { animation-delay: 0.12s; }
.login-side .content > *:nth-child(3) { animation-delay: 0.24s; }
.login-side .content > *:nth-child(4) { animation-delay: 0.36s; }

/* Modal entrance */
.modal.show .modal-dialog { animation: scaleIn 0.3s cubic-bezier(.34,1.56,.64,1) both; }

/* Alert entrance */
.alert { animation: fadeInUp 0.35s ease both; }

/* Toast / SweetAlert override */
.swal2-toast { animation: slideInRight 0.4s cubic-bezier(.34,1.56,.64,1) both; }

/* Notification dot pulse */
.btn-icon .badge-dot { animation: pulse-emerald 1.8s infinite; }

/* Loading shimmer (utility class) */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Reduced motion accessibility */
/* Dark mode: kelas kustom yg pakai warna hardcoded (bukan var(--bg-card)
   dkk) — komponen Bootstrap native sendiri sudah otomatis ikut lewat
   data-bs-theme="dark" tanpa perlu override manual. */
[data-bs-theme="dark"] .navbar-top { background: rgba(30,41,59,0.92); }
[data-bs-theme="dark"] .btn-icon { background: var(--bg-card); color: var(--text-soft); }
[data-bs-theme="dark"] .btn-icon .badge-dot { border-color: var(--bg-card); }
[data-bs-theme="dark"] .user-chip { background: var(--bg-card); }
[data-bs-theme="dark"] .table-app { background: var(--bg-card); }
[data-bs-theme="dark"] .table-app tbody tr:hover { background: rgba(16,185,129,0.08); }
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select { background: var(--bg-card); color: var(--text-main); border-color: var(--border); }
[data-bs-theme="dark"] .app-footer { background: var(--bg-card); }
[data-bs-theme="dark"] .avatar-lg { border-color: var(--bg-card); }
[data-bs-theme="dark"] .signature-wrap { background: #0b1220; }
[data-bs-theme="dark"] .kbd { background: var(--soft-gray-100); color: var(--text-main); }
[data-bs-theme="dark"] .login-card,
[data-bs-theme="dark"] .qr-scan-card { background: var(--bg-card); }
[data-bs-theme="dark"] .shimmer { background: linear-gradient(90deg, #1e293b 25%, #263449 50%, #1e293b 75%); background-size: 1000px 100%; }
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg-app); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Tombol aksi tabel (ikon seragam, tidak turun baris) ---------- */
.aksi-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.aksi-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.btn-aksi {
    width: 32px; height: 32px; padding: 0; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text-soft);
    font-size: .95rem; line-height: 1; text-decoration: none; cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-aksi:hover, .btn-aksi:focus-visible { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-200); transform: translateY(-1px); }
.btn-aksi:focus-visible { outline: 2px solid var(--emerald-500); outline-offset: 1px; }
.btn-aksi-edit { color: var(--emerald-700); background: var(--emerald-50); border-color: var(--emerald-100); }
.btn-aksi-edit:hover { background: var(--emerald-100); }
.btn-aksi-hapus { color: #dc2626; background: #fef2f2; border-color: #fee2e2; }
.btn-aksi-hapus:hover, .btn-aksi-hapus:focus-visible { color: #fff; background: #dc2626; border-color: #dc2626; }
.btn-aksi-slot { width: 32px; height: 32px; display: inline-block; }
.tbl-guru .min-w-0 { min-width: 0; }
[data-bs-theme="dark"] .btn-aksi-edit { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); color: var(--emerald-300); }
[data-bs-theme="dark"] .btn-aksi-hapus { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.3); color: #f87171; }
[data-bs-theme="dark"] .btn-aksi:hover { background: rgba(16,185,129,.18); color: var(--emerald-300); border-color: rgba(16,185,129,.35); }
[data-bs-theme="dark"] .btn-aksi-hapus:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ---------- Pilihan "Berlaku Untuk" (Hari Libur) ---------- */
.libur-target { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.libur-target-opt { position: relative; cursor: pointer; margin: 0; }
.libur-target-opt input { position: absolute; opacity: 0; pointer-events: none; }
.libur-target-opt > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg-card); transition: border-color .15s, background .15s, box-shadow .15s; }
.libur-target-opt i { font-size: 1.2rem; color: var(--emerald-600); margin-bottom: 2px; }
.libur-target-opt b { color: var(--text-main); font-size: .92rem; }
.libur-target-opt small { color: var(--text-soft); font-size: .78rem; line-height: 1.3; }
.libur-target-opt:hover > span { border-color: var(--emerald-200); }
.libur-target-opt input:checked + span { border-color: var(--emerald-600); background: var(--emerald-50); box-shadow: 0 0 0 3px rgb(16 185 129 / .15); }
.libur-target-opt input:focus-visible + span { outline: 2px solid var(--emerald-500); outline-offset: 2px; }
[data-bs-theme="dark"] .libur-target-opt input:checked + span { background: rgba(16,185,129,.12); }


/* ---------- Referensi Jam Kerja Guru ---------- */
.jk-timeline { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.jk-seg { flex: 1 1 0; min-width: 58px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px 6px; border-radius: 10px; font-size: .74rem; font-weight: 600; line-height: 1.2; }
.jk-ok { background: var(--emerald-50); color: var(--emerald-800); }
.jk-warn { background: #fef3c7; color: #92400e; }
.jk-ditolak { background: var(--soft-gray-100); color: var(--soft-gray-500); }
.jk-mark { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 2px; border-left: 2px dashed var(--emerald-300); padding-left: 6px; }
.jk-mark b { font-size: .72rem; color: var(--text-main); white-space: nowrap; }
.jk-mark small { font-size: .66rem; color: var(--text-soft); white-space: nowrap; }
.jk-table th { white-space: nowrap; }
.jk-table .jk-head-masuk { background: var(--emerald-50); color: var(--emerald-800); }
.jk-table .jk-head-pulang { background: #eff6ff; color: #1e40af; }
.jk-table .jk-time { min-width: 108px; }
.jk-row.is-today td { background: rgb(16 185 129 / .05); }
.jk-row.is-off td { opacity: .5; }
.jk-row.is-off td:first-child, .jk-row.is-off td:nth-child(2) { opacity: 1; }
[data-bs-theme="dark"] .jk-warn { background: rgba(245,158,11,.15); color: #fcd34d; }
[data-bs-theme="dark"] .jk-ditolak { background: rgba(148,163,184,.12); }
[data-bs-theme="dark"] .jk-table .jk-head-pulang { background: rgba(59,130,246,.12); color: #93c5fd; }

/* ---------- Pratinjau tanda tangan kepala (Pengaturan) ---------- */
.kp-preview { border: 1px dashed var(--emerald-300); border-radius: 12px; padding: 16px 12px; text-align: center; font-family: 'Times New Roman', serif; font-size: .95rem; line-height: 1.45; background: var(--bg-card); color: var(--text-main); }
.kp-preview-ttd { height: 64px; display: flex; align-items: center; justify-content: center; }
.kp-preview-ttd img { max-height: 60px; max-width: 80%; }
.kp-preview-nama { font-weight: 700; text-decoration: underline; }

/* ---------- Pilih foto (form Guru) ---------- */
.foto-pick { position: relative; width: 120px; height: 150px; margin: 0 auto; border-radius: 12px; overflow: hidden; background: var(--emerald-50); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.foto-pick img { width: 100%; height: 100%; object-fit: cover; }
.foto-pick .bi-person-circle { font-size: 4.5rem; color: var(--emerald-300); }
.foto-pick-badge { position: absolute; top: 6px; right: 6px; background: var(--emerald-600); color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
