/* =====================================================================
   BUKU TAMU DIGITAL - Kantor Kementerian Agama Kabupaten Empat Lawang
   Tema: hijau Kemenag, putih, aksen emas. Di atas Bootstrap 5.3.
   ===================================================================== */
:root {
    --green-950: #073a21;
    --green-900: #0b4a2a;
    --green-800: #0d5c34;
    --green-700: #0d6a3c;
    --green-600: #168049;
    --green-200: #bfe0cd;
    --green-100: #e2f1e8;
    --green-50: #f1f8f4;
    --gold-700: #8f6f1c;
    --gold-600: #b8902a;
    --gold-500: #cfa840;
    --gold-100: #f7efd6;
    --ink: #14231b;
    --muted: #5b6b62;
    --line: #dde6e0;
    --paper: #f4f7f5;
    --card: #ffffff;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(11, 74, 42, .06), 0 6px 18px rgba(11, 74, 42, .06);
    --topbar-h: 66px;
    --sidebar-w: 258px;
    --font-ui: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
    --bs-body-font-family: var(--font-ui);
    --bs-body-color: var(--ink);
    --bs-link-color: var(--green-700);
    --bs-link-hover-color: var(--green-900);
    --bs-border-color: var(--line);
    --bs-primary: var(--green-700);
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-ui); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { color: var(--green-950); }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }

/* ---------- Tombol & formulir (penyesuaian Bootstrap) ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-brand { --bs-btn-color: #fff; --bs-btn-bg: var(--green-700); --bs-btn-border-color: var(--green-700);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--green-900); --bs-btn-hover-border-color: var(--green-900);
    --bs-btn-active-bg: var(--green-950); --bs-btn-active-border-color: var(--green-950); --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--green-700); --bs-btn-disabled-border-color: var(--green-700); --bs-btn-disabled-color: #fff; }
.btn-outline-brand { --bs-btn-color: var(--green-800); --bs-btn-border-color: var(--green-700);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--green-700); --bs-btn-hover-border-color: var(--green-700);
    --bs-btn-active-bg: var(--green-900); --bs-btn-active-border-color: var(--green-900); --bs-btn-active-color: #fff; }
.btn-xl { padding: 1rem 1.5rem; font-size: 1.1rem; border-radius: 12px; }
.form-label, .sub-label { font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .35rem; }
.sub-label { font-weight: 500; color: var(--muted); display: block; }
.req { color: #b42318; }
.form-control, .form-select { border-color: #c9d6ce; border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--green-600); box-shadow: 0 0 0 .22rem rgba(13, 106, 60, .18); }
.form-control-lg, .form-select-lg { min-height: 54px; font-size: 1.02rem; }
.form-text { color: var(--muted); }
.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table thead th { background: var(--green-50); color: var(--green-900); font-weight: 600; font-size: .85rem; border-bottom: 1px solid var(--green-200); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--green-50); }
.table tfoot th { border-top: 2px solid var(--green-200); }
.page-link { color: var(--green-800); }
.page-item.active .page-link { background: var(--green-700); border-color: var(--green-700); }
.dropdown-menu { border-radius: 12px; border-color: var(--line); }
.modal-content { border-radius: 16px; border: 0; }
.modal-header, .modal-footer { border-color: var(--line); }
.empty-row { text-align: center; color: var(--muted); padding: 2.2rem 1rem !important; }
.row-muted { opacity: .62; }
.scroll-y { max-height: 380px; overflow-y: auto; }
.detail-list dt { color: var(--muted); font-weight: 500; }
.detail-list dd { margin-bottom: .75rem; }

/* ---------- Logo ---------- */
.brand-logo { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.brand-logo-lg { width: 56px; height: 56px; }
.brand-logo-xl { width: 96px; height: 96px; }
.brand-logo-empty { display: inline-grid; place-items: center; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-size: 1.3em; border: 2px dashed var(--green-200); }
.brand-logo-xl.brand-logo-empty { font-size: 2.4rem; }
.logo-preview { width: 120px; height: 120px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; }

/* ---------- Jam ---------- */
.clock { text-align: right; line-height: 1.15; color: #fff; }
.clock-time { display: block; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock-date { display: block; font-size: .78rem; opacity: .85; }
.clock-on-light { color: var(--green-900); }

/* =====================================================================
   ADMIN
   ===================================================================== */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 1030; display: flex; align-items: center; gap: 14px;
    padding: 0 18px; background: var(--green-900); border-bottom: 3px solid var(--gold-600); color: #fff; }
.topbar-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.topbar-brand .brand-logo { background: #fff; border-radius: 50%; padding: 3px; }
.topbar-brand .brand-logo-empty { background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 1.05rem; font-weight: 700; }
.brand-text small { font-size: .74rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.btn-burger { display: none; background: transparent; border: 0; color: #fff; font-size: 1.35rem; padding: 6px 8px; border-radius: 8px; }
.btn-burger:hover { background: rgba(255, 255, 255, .12); }
.profile-btn { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); color: #fff; padding: 5px 12px 5px 6px; border-radius: 999px; }
.profile-btn:hover { background: rgba(255, 255, 255, .16); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-500); color: var(--green-950); font-weight: 700; display: grid; place-items: center; }
.profile-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.profile-meta strong { font-size: .85rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-meta small { font-size: .72rem; opacity: .8; }
.btn-logout { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); padding: 7px 14px; }
.btn-logout:hover { background: #fff; color: var(--green-900); }

.app-shell { padding-top: var(--topbar-h); min-height: 100vh; }
.sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line);
    padding: 18px 12px; overflow-y: auto; z-index: 1020; }
.nav-list { list-style: none; margin: 0 0 8px; padding: 0; }
.nav-group-title { margin: 18px 12px 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 10px; color: var(--ink); font-weight: 500; position: relative; }
.sidebar .nav-link i { width: 20px; text-align: center; color: var(--green-700); }
.sidebar .nav-link:hover { background: var(--green-50); color: var(--green-900); }
.sidebar .nav-link.active { background: var(--green-100); color: var(--green-950); font-weight: 600; }
.sidebar .nav-link.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold-600); }
.sidebar-backdrop { display: none; }

.content { margin-left: var(--sidebar-w); padding: 26px 28px 0; min-height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; }
.content > .app-footer { margin-top: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 1.55rem; font-weight: 700; margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 0 22px; margin-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.app-footer strong { color: var(--green-900); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.row.g-3 > [class*="col"] > .panel { margin-bottom: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.panel-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.filter-panel { padding: 16px 20px; }
.chart-box { position: relative; height: 320px; }
.chart-box-sm { height: 300px; }

/* ---------- Kartu statistik ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { --c: var(--green-700); --t: var(--green-100); display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; border-top: 4px solid var(--c); min-width: 0; }
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--t); color: var(--c); flex: 0 0 auto; }
.stat-body { min-width: 0; }
.stat-label { font-size: .84rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 1.95rem; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-value-sm { font-size: 1.05rem; line-height: 1.25; margin: 4px 0; }
.stat-note { font-size: .76rem; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-total { --c: #0d6a3c; --t: #e2f1e8; }
.stat-today { --c: #b8902a; --t: #f7efd6; }
.stat-week { --c: #1f7a7a; --t: #dff0ef; }
.stat-month { --c: #6b7d2a; --t: #eaf0d6; }
.stat-year { --c: #8a5a2b; --t: #f3e6d9; }

.period-toggle .btn.active { background: var(--green-700); color: #fff; }

/* ---------- Tabel menjadi kartu di layar kecil ---------- */
.btn-text-sm { display: none; }
@media (max-width: 767.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; background: #fff; }
    .table-stack td { display: flex; justify-content: space-between; gap: 14px; padding: .4rem 0 !important; border: 0; text-align: right; }
    .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; flex: 0 0 38%; font-size: .82rem; }
    .table-stack td[colspan] { display: block; text-align: center; }
    .table-stack td[colspan]::before { display: none; }
    .table-stack td:last-child { justify-content: flex-end; padding-top: .7rem !important; flex-wrap: wrap; }
    .table-stack td:last-child::before { display: none; }
    .btn-text-sm { display: inline; }
}

/* =====================================================================
   HALAMAN PENGUNJUNG
   ===================================================================== */
.public-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 4vw, 40px); background: #fff; }
.pub-brand { display: flex; align-items: center; gap: 14px; color: var(--green-950); text-decoration: none; min-width: 0; }
.pub-brand .brand-text strong { font-size: 1.15rem; color: var(--green-900); }
.pub-brand .brand-text small { font-size: .82rem; opacity: 1; color: var(--muted); white-space: normal; }
.pub-rule { height: 4px; background: linear-gradient(90deg, var(--green-800), var(--gold-600) 55%, var(--green-800)); }
.pub-main {
    flex: 1; padding: 34px 16px 48px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1'%3E%3Crect x='14' y='14' width='32' height='32'/%3E%3Crect x='14' y='14' width='32' height='32' transform='rotate(45 30 30)'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(180deg, var(--green-900) 0, var(--green-800) 190px, transparent 190px),
        var(--paper);
}
.container-narrow { width: 100%; max-width: 760px; margin: 0 auto; }
.back-link { display: inline-block; color: #fff; text-decoration: none; margin-bottom: 14px; font-weight: 500; }
.back-link:hover { color: var(--gold-100); text-decoration: underline; }
.form-card, .home-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 40px rgba(7, 58, 33, .14); padding: clamp(20px, 4vw, 36px); }
.welcome-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 3.4vw, 1.85rem); line-height: 1.25; color: var(--green-900); margin: 0 0 8px; }
.welcome-sub { color: var(--muted); font-size: 1.02rem; margin-bottom: 20px; }
.visit-time { display: flex; gap: 12px; align-items: center; background: var(--green-50); border: 1px solid var(--green-200); border-left: 4px solid var(--gold-600); border-radius: 12px; padding: 12px 16px; margin-bottom: 24px; }
.visit-time > i { font-size: 1.5rem; color: var(--green-700); }
.visit-time-label { display: block; font-size: .78rem; color: var(--muted); }
.visit-time strong { color: var(--green-950); font-variant-numeric: tabular-nums; }
.field { margin-bottom: 22px; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.address-field legend { float: none; width: auto; padding: 0; font-size: .9rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.is-invalid ~ .invalid-feedback, .field .invalid-feedback:not(:empty) { display: block; }
.btn-xl .btn-label, .btn-xl .btn-wait { letter-spacing: .03em; }

.success-panel { text-align: center; padding: 20px 6px 8px; }
.success-panel h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 3.4vw, 1.9rem); margin: 10px 0 10px; color: var(--green-900); }
.success-icon { font-size: 4.2rem; color: var(--green-600); line-height: 1; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.home-card { text-align: center; padding: clamp(28px, 6vw, 56px) clamp(20px, 5vw, 48px); }
.home-card .welcome-title { font-size: clamp(1.5rem, 4.2vw, 2.3rem); }
.home-card .welcome-sub { max-width: 560px; margin: 8px auto 28px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.home-admin { margin: 26px 0 0; font-size: .88rem; }
.home-admin a { color: var(--muted); text-decoration: none; }
.home-admin a:hover { color: var(--green-800); text-decoration: underline; }

.pub-footer { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 20px 16px 26px; background: #fff; border-top: 3px solid var(--gold-600); color: var(--muted); font-size: .86rem; }
.pub-footer strong { color: var(--green-900); }
.pub-footer-sub { font-size: .78rem; }

/* Tanda tangan */
.sig-wrap { position: relative; background: #fff; border: 2px dashed #9db8a8; border-radius: 12px; overflow: hidden; }
.sig-wrap canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; -webkit-user-select: none; user-select: none; }
.sig-wrap:focus-within, .sig-wrap:hover { border-color: var(--green-600); }
.sig-wrap.is-invalid { border-color: #dc3545; background: #fff8f8; }
.sig-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #98a9a0; font-size: 1.05rem; pointer-events: none; }
.sig-line { position: absolute; left: 6%; right: 6%; bottom: 26%; border-bottom: 1px solid #c9d6ce; pointer-events: none; }
.sig-thumb { height: 32px; width: auto; max-width: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 1px; }
.sig-img { max-width: 100%; width: 300px; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sig-print { width: 78px; height: auto; max-height: 34px; object-fit: contain; }
@media (max-width: 767.98px) { .table-stack td .sig-thumb { height: 40px; } }
.is-kiosk .sig-hint { font-size: 1.3rem; }

/* Mode kiosk */
.is-kiosk { font-size: 1.08rem; user-select: none; -webkit-user-select: none; }
.is-kiosk input, .is-kiosk textarea { user-select: text; -webkit-user-select: text; }
.is-kiosk .container-narrow { max-width: 920px; }
.is-kiosk .form-control-lg, .is-kiosk .form-select-lg { min-height: 62px; font-size: 1.15rem; }
.is-kiosk .btn-xl { padding: 1.15rem 1.6rem; font-size: 1.25rem; }
.is-kiosk .pub-brand .brand-text strong { font-size: 1.4rem; }
.is-kiosk .clock-time { font-size: 1.7rem; }
.is-kiosk .clock-date { font-size: .95rem; }
.kiosk-bar { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.kiosk-bar .btn-outline-brand { background: rgba(255, 255, 255, .95); }

/* =====================================================================
   LOGIN
   ===================================================================== */
.login-body { min-height: 100vh; background: var(--paper); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-aside { display: grid; place-items: center; text-align: center; color: #fff; padding: 40px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.1' stroke-width='1'%3E%3Crect x='14' y='14' width='32' height='32'/%3E%3Crect x='14' y='14' width='32' height='32' transform='rotate(45 30 30)'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(160deg, var(--green-900), var(--green-950)); border-right: 4px solid var(--gold-600); }
.login-aside h2 { color: #fff; font-family: var(--font-display); font-size: 2.2rem; margin: 22px 0 6px; }
.login-aside p { color: var(--gold-100); font-size: 1.05rem; margin: 0; max-width: 360px; }
.login-aside .brand-logo { background: #fff; border-radius: 50%; padding: 6px; }
.login-card { align-self: center; width: 100%; max-width: 440px; margin: 0 auto; padding: 40px 28px; }
.login-head h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.login-head { margin-bottom: 26px; }
.login-foot { margin-top: 26px; text-align: center; font-size: .9rem; }

/* =====================================================================
   POSTER QR
   ===================================================================== */
.poster { background: #fff; border: 2px solid var(--green-800); outline: 2px solid var(--gold-500); outline-offset: -8px; border-radius: 18px; padding: 34px 28px 28px; text-align: center; box-shadow: var(--shadow); }
.poster-head { display: flex; align-items: center; justify-content: center; gap: 16px; text-align: left; margin-bottom: 10px; }
.poster-office { font-weight: 700; color: var(--green-900); font-size: 1.02rem; line-height: 1.25; }
.poster-app { color: var(--muted); }
.poster-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 16px 0 18px; }
.poster-qr { display: inline-block; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
#qrBox img, #qrBox canvas { display: block; max-width: 100%; height: auto; }
.poster-steps { max-width: 420px; margin: 18px auto 8px; color: var(--ink); }
.poster-url { font-size: .85rem; color: var(--muted); word-break: break-all; margin: 0; }

/* =====================================================================
   CETAK / LAPORAN
   ===================================================================== */
.print-body { background: #e9eeeb; }
.print-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.print-sheet { background: #fff; max-width: 210mm; margin: 18px auto; padding: 14mm 14mm 16mm; box-shadow: var(--shadow); color: #000; font-size: 11px; }
.print-landscape { max-width: 297mm; }
.kop { display: flex; align-items: center; gap: 14px; }
.kop-logo { width: 70px; height: 70px; object-fit: contain; }
.kop-text { flex: 1; text-align: center; line-height: 1.25; }
.kop-1 { font-weight: 700; font-size: 14px; }
.kop-2 { font-weight: 700; font-size: 15px; color: var(--green-800); }
.kop-3 { font-size: 10.5px; color: #333; }
.kop-rule { border-top: 3px solid var(--green-800); border-bottom: 1px solid var(--gold-600); height: 4px; margin: 8px 0 14px; }
.print-title { font-size: 15px; text-align: center; margin: 0 0 4px; color: #000; font-weight: 700; }
.print-sub { text-align: center; margin-bottom: 14px; color: #333; }
.print-h { font-size: 12.5px; margin: 18px 0 6px; color: var(--green-800); border-bottom: 1px solid var(--gold-600); padding-bottom: 3px; font-weight: 700; }
.print-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.print-table th, .print-table td { border: 1px solid #b9c5be; padding: 4px 6px; vertical-align: top; }
.print-table thead th { background: var(--green-700); color: #fff; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-table tbody tr:nth-child(even) td { background: #f1f6f3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-table-kv th { background: #f1f6f3; width: 38%; text-align: left; }
.print-foot { margin-top: 18px; text-align: right; color: #444; font-size: 10px; }
.print-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 0 4px; border-bottom: 1px solid #333; border-left: 1px solid #333; }
.pbar { flex: 1; height: 100%; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.pbar-val { font-size: 8px; line-height: 1.2; color: #222; }
.pbar-fill { width: 100%; max-width: 28px; background: var(--green-700); display: block; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

@media print {
    .no-print, .topbar, .sidebar, .sidebar-backdrop, .page-head, .app-footer, .alert, .print-toolbar { display: none !important; }
    body { background: #fff !important; }
    .app-shell { padding: 0; }
    .content { margin: 0; padding: 0; min-height: 0; }
    .print-sheet { box-shadow: none; margin: 0; max-width: none; padding: 0; }
    .print-table { page-break-inside: auto; }
    .print-table tr { page-break-inside: avoid; }
    .print-table thead { display: table-header-group; }
    .print-h, .print-title { page-break-after: avoid; }
    .poster { box-shadow: none; border-radius: 0; margin: 0 auto; max-width: 150mm; page-break-inside: avoid; }
    .panel { box-shadow: none; border: 0; }
}

/* =====================================================================
   RESPONSIF
   ===================================================================== */
@media (max-width: 1399.98px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1199.98px) { .profile-meta { display: none; } .profile-btn { padding: 5px; } }
@media (max-width: 991.98px) {
    :root { --sidebar-w: 280px; }
    .btn-burger { display: inline-block; }
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
    body.sidebar-open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, .18); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(7, 58, 33, .45); z-index: 1015; }
    .content { margin-left: 0; padding: 20px 14px 0; }
    .brand-text small { display: none; }
    .clock-date { display: none; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-aside { display: none; }
}
@media (max-width: 767.98px) {
    .stat-grid, .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .stat-value { font-size: 1.6rem; }
    .stat-grid > .stat:first-child { grid-column: 1 / -1; flex-direction: row; align-items: center; }
    .page-title { font-size: 1.3rem; }
    .chart-box { height: 260px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-right { gap: 8px; }
    .clock-time { font-size: 1rem; }
    .pub-top { flex-wrap: wrap; }
    .pub-top .clock { text-align: left; }
    .home-actions .btn { width: 100%; }
}
@media (max-width: 420px) { .stat-grid, .stat-grid-4 { grid-template-columns: 1fr; } .topbar-brand .brand-text strong { font-size: .92rem; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
