/* ============================================================
   Aplikasi Tabungan Siswa SD Mutual Kota Magelang
   Tema: formal sekolah, putih-biru, padat data
   ============================================================ */

:root {
    --blue-900: #0e2f56;
    --blue-800: #123a6b;
    --blue-700: #17497f;
    --blue-600: #1d5da0;
    --blue-500: #2a74c0;
    --blue-300: #a9c5e6;
    --blue-100: #e8f0fa;
    --blue-50:  #f3f7fc;
    --line:     #d7e1ee;
    --ink:      #1b2b41;
    --muted:    #61728a;
    --bg:       #eef2f8;
    --white:    #ffffff;
    --green:    #147a4b;
    --green-bg: #e3f5ec;
    --red:      #b3261e;
    --red-bg:   #fdecea;
    --amber:    #8a5a00;
    --amber-bg: #fff5e0;
    --radius:   8px;
    --shadow:   0 1px 2px rgba(16, 40, 72, .06), 0 6px 18px rgba(16, 40, 72, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================= Layout ================= */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 244px;
    flex: 0 0 244px;
    background: linear-gradient(180deg, var(--blue-800) 0%, var(--blue-900) 100%);
    color: #dbe7f5;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    padding: 16px 16px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    gap: 10px;
    align-items: center;
}
.brand-mark {
    width: 40px; height: 40px; flex: 0 0 40px;
    border-radius: 10px;
    background: #fff;
    color: var(--blue-800);
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px; letter-spacing: -.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    overflow: hidden;
    padding: 2px;
}
.brand-mark img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}
.brand-text { line-height: 1.25; }
.brand-text strong { display: block; font-size: 12.5px; color: #fff; letter-spacing: .1px; line-height: 1.25; }
.brand-text span { font-size: 10.5px; color: #a9c5e6; }

.sidebar nav { padding: 12px 10px 24px; }
.nav-label {
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #8fb0d4;
    padding: 14px 10px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 6px;
    color: #d4e3f4;
    font-size: 13.2px;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); text-decoration: none; color: #fff; }
.nav-item.is-active {
    background: rgba(255, 255, 255, .14);
    border-left-color: #7fb2ea;
    color: #fff;
    font-weight: 600;
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .9; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 58px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--blue-800); }
.topbar-sub { font-size: 11.5px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--blue-100); color: var(--blue-700);
    display: grid; place-items: center;
    font-weight: 700; font-size: 12.5px;
    border: 1px solid var(--blue-300);
}
.user-meta { line-height: 1.2; }
.user-meta strong { display: block; font-size: 12.5px; }
.user-meta span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.content { padding: 22px; max-width: 1360px; width: 100%; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.page-head h1 {
    font-size: 20px;
    margin: 0 0 3px;
    color: var(--blue-800);
    letter-spacing: -.2px;
}
.page-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ================= Cards ================= */

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--blue-50);
    flex-wrap: wrap;
}
.card-head h2 {
    margin: 0;
    font-size: 13.5px;
    color: var(--blue-800);
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-head h2::before {
    content: "";
    width: 3px; height: 15px;
    background: var(--blue-600);
    border-radius: 2px;
}
.card-head .hint { font-size: 11.5px; color: var(--muted); }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat {
    background: var(--white);
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue-600);
    border-radius: var(--radius);
    padding: 15px 16px;
    box-shadow: var(--shadow);
}
.stat.is-in { border-left-color: var(--green); }
.stat.is-out { border-left-color: var(--red); }
.stat.is-neutral { border-left-color: var(--blue-800); }
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
}
.stat-value {
    font-size: 23px;
    font-weight: 700;
    color: var(--blue-900);
    margin-top: 6px;
    letter-spacing: -.5px;
    font-variant-numeric: tabular-nums;
}
.stat-foot { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.grid-2 > * { min-width: 0; }
.stat-grid > * { min-width: 0; }
.main { min-width: 0; }

/* ===== Split screen (Kenaikan Kelas) ===== */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.split-2 > * { min-width: 0; }

.promo-summary {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--blue-50);
    font-size: 13px;
}
.promo-summary > div { display: flex; flex-direction: column; gap: 2px; }
.promo-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    font-weight: 700;
}
.promo-summary strong { font-size: 16px; color: var(--blue-800); }

.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--blue-800); cursor: pointer; }
.check-inline input { width: 15px; height: 15px; }
input[type="checkbox"].pilih-siswa, #pilihSemua { width: 15px; height: 15px; cursor: pointer; }

.promo-target {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid #b7e2cc;
    border-radius: 8px;
    background: var(--green-bg);
}
.promo-target.is-lulus { border-color: #b7e2cc; background: #eefaf3; }
.promo-target-icon {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 15px;
}
.promo-target-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #147a4b;
    font-weight: 700;
}
.promo-target-value { font-size: 17px; font-weight: 700; color: #0f5c39; margin: 2px 0 4px; }

.promo-preview { display: grid; gap: 9px; font-size: 13px; }
.promo-preview-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 7px;
    border-bottom: 1px dashed var(--line);
}
.promo-preview-row span { color: var(--muted); font-size: 12px; }
.promo-preview-row strong { text-align: right; color: var(--blue-800); }


/* ================= Table ================= */

.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
table.table th {
    background: var(--blue-100);
    color: var(--blue-800);
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.table td {
    padding: 9px 12px;
    border-bottom: 1px solid #eaf0f7;
    vertical-align: middle;
}
table.table tbody tr:nth-child(even) { background: #fafcfe; }
table.table tbody tr:hover { background: var(--blue-50); }
table.table tfoot td {
    background: var(--blue-50);
    font-weight: 700;
    border-top: 2px solid var(--blue-300);
}
table.table .num { text-align: right; white-space: nowrap; }
table.table .center { text-align: center; }
table.table .nowrap { white-space: nowrap; }
table.table .aksi { display: flex; gap: 6px; }
.empty-row td {
    text-align: center;
    color: var(--muted);
    padding: 26px 12px !important;
    font-size: 12.5px;
}

/* ================= Badge / pill ================= */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-aktif { background: var(--green-bg); color: var(--green); border-color: #b7e2cc; }
.badge-lulus { background: var(--blue-100); color: var(--blue-700); border-color: var(--blue-300); }
.badge-keluar { background: #f1f3f6; color: #55627a; border-color: #d8dee8; }
.badge-setoran { background: var(--green-bg); color: var(--green); border-color: #b7e2cc; }
.badge-penarikan { background: var(--red-bg); color: var(--red); border-color: #f5c6c2; }
.badge-edit { background: var(--amber-bg); color: var(--amber); border-color: #f0dcae; }
.badge-hapus { background: var(--red-bg); color: var(--red); border-color: #f5c6c2; }

.tag-kelas {
    display: inline-block;
    background: var(--blue-50);
    border: 1px solid var(--line);
    color: var(--blue-700);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11.5px;
    white-space: nowrap;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.text-muted { color: var(--muted); }
.text-green { color: var(--green); font-weight: 600; }
.text-red { color: var(--red); font-weight: 600; }
.text-right { text-align: right; }
.small { font-size: 11.5px; }

/* ================= Button ================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--blue-800);
    font-size: 12.8px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.25;
    transition: background .12s, border-color .12s, box-shadow .12s;
    white-space: nowrap;
}
.btn:hover { background: var(--blue-50); text-decoration: none; }
.btn-primary {
    background: var(--blue-600);
    border-color: var(--blue-600);
    color: #fff;
}
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn-danger { background: #fff; border-color: #e6b4b0; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 9px; font-size: 11.8px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Tombol besar proses massal (hijau) */
.btn.btn-proses {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    padding: 14px 20px;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .01em;
    border-radius: 8px;
    justify-content: center;
}
.btn.btn-proses:hover { background: #0f6b41; border-color: #0f6b41; color: #fff; }
.btn.btn-proses[disabled] { background: #9fb4c9; border-color: #9fb4c9; color: #eef2f7; opacity: 1; cursor: not-allowed; }

/* ================= Form ================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 16px;
}
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--blue-800);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.field .req { color: var(--red); }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="tel"],
.field select,
.field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c7d5e6;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(42, 116, 192, .14);
}
.field .help { font-size: 11px; color: var(--muted); }
.form-actions {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
    flex-wrap: wrap;
}
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { min-width: 150px; }

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}
.filter-bar .field label { font-size: 10.5px; }
.filter-bar .field input, .filter-bar .field select { padding: 7px 9px; font-size: 12.5px; }

/* Combobox pencarian siswa */
.picker { display: flex; flex-direction: column; gap: 7px; }
.picker input[type="text"] { max-width: 100%; }
.picker select { min-height: 38px; }

/* ================= Alert ================= */

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 14px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 12.8px;
    margin-bottom: 14px;
}
.alert-success { background: var(--green-bg); border-color: #b7e2cc; color: #0f5c39; }
.alert-error { background: var(--red-bg); border-color: #f3c2bd; color: #8c1d16; }
.alert-info { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-800); }
.alert-warning { background: var(--amber-bg); border-color: #eed6a2; color: #6d4800; }
.alert strong { font-weight: 700; }

/* ================= Chart ================= */

.chart {
    display: flex;
    max-width: 100%;
    align-items: flex-end;
    gap: 18px;
    height: 210px;
    padding: 10px 6px 0;
    border-bottom: 2px solid var(--line);
    overflow-x: auto;
}
.chart-col {
    flex: 1 1 0;
    min-width: 54px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    gap: 6px;
}
.chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 5px; flex: 1; }
.chart-bar {
    width: 16px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    position: relative;
    transition: filter .12s;
}
.chart-bar.in { background: linear-gradient(180deg, #3d8fd4, var(--blue-600)); }
.chart-bar.out { background: linear-gradient(180deg, #e5837c, #c0392b); }
.chart-bar:hover { filter: brightness(1.08); }
.chart-label {
    text-align: center;
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 6px;
}
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-top: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.dot.in { background: var(--blue-600); }
.dot.out { background: #c0392b; }
.chart-empty { color: var(--muted); font-size: 12.5px; padding: 30px 0; text-align: center; }

/* ================= Misc ================= */

.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav a, .subnav span {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    font-size: 12.2px;
    color: var(--blue-800);
}
.subnav a:hover { background: var(--blue-50); text-decoration: none; }
.subnav .is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; font-weight: 600; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
    background: #fbfcfe;
    flex-wrap: wrap;
}
.pagination-info { font-size: 11.5px; color: var(--muted); }
.pagination-links { display: flex; gap: 4px; flex-wrap: wrap; }
.page-btn {
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    font-size: 11.8px;
    color: var(--blue-800);
}
.page-btn.is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.page-btn:hover { text-decoration: none; background: var(--blue-50); }
.page-btn.is-active:hover { background: var(--blue-600); }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; font-weight: 600; }

.divider { height: 1px; background: var(--line); margin: 16px 0; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.quick-action {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--blue-800);
    font-weight: 600;
    font-size: 12.8px;
}
.quick-action:hover { border-color: var(--blue-300); background: var(--blue-50); text-decoration: none; }
.quick-action .qa-icon {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 7px;
    background: var(--blue-100);
    color: var(--blue-700);
    display: grid; place-items: center;
}
.quick-action small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }

.note {
    background: var(--blue-50);
    border: 1px dashed var(--blue-300);
    border-radius: 6px;
    padding: 11px 13px;
    font-size: 12px;
    color: var(--blue-800);
}
.note strong { color: var(--blue-900); }

.saldo-big { font-size: 26px; font-weight: 700; color: var(--blue-800); font-variant-numeric: tabular-nums; }

/* ================= Login ================= */

.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--bg);
}
.login-hero {
    background: linear-gradient(160deg, var(--blue-800) 0%, var(--blue-900) 60%, #0a2445 100%);
    color: #e7f0fa;
    padding: 48px 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.login-hero::after {
    content: "";
    position: absolute;
    width: 460px; height: 460px;
    right: -160px; bottom: -190px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 0 0 60px rgba(255, 255, 255, .04), 0 0 0 130px rgba(255, 255, 255, .03);
}
.login-hero .brand { border: 0; padding: 0; }
.login-hero .brand-mark { background: #fff; }
.login-hero h1 {
    font-size: 30px;
    line-height: 1.22;
    margin: 0 0 14px;
    color: #fff;
    letter-spacing: -.4px;
    max-width: 420px;
}
.login-hero p { margin: 0; font-size: 13.5px; color: #b9cee6; max-width: 400px; line-height: 1.6; }
.login-hero ul { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.login-hero li { display: flex; gap: 9px; align-items: center; font-size: 12.8px; color: #cfdff1; }
.login-hero li::before {
    content: "";
    width: 16px; height: 16px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 4px;
    flex: 0 0 16px;
}
.login-hero .hero-foot { font-size: 11.5px; color: #8fb0d4; z-index: 2; }

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 28px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 14px 40px rgba(16, 40, 72, .1);
}
.login-card-logo { margin-bottom: 12px; }
.login-card-logo img { width: 56px; height: 56px; display: block; }

.login-card h2 { margin: 0 0 4px; font-size: 19px; color: var(--blue-800); }
.login-card .sub { margin: 0 0 20px; font-size: 12.5px; color: var(--muted); }
.login-card .field { margin-bottom: 13px; }
.login-card .btn { margin-top: 6px; }
.demo-box {
    margin-top: 18px;
    border-top: 1px dashed var(--line);
    padding-top: 14px;
    font-size: 11.8px;
    color: var(--muted);
    line-height: 1.7;
}
.demo-box code {
    background: var(--blue-50);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--blue-800);
    font-size: 11.5px;
}

/* ================= Pratinjau buku tabungan ================= */

.pb-preview-wrap {
    overflow: hidden;
    border: 1px dashed var(--blue-300);
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}
.pb-preview-sheet {
    position: relative;
    background: #fff;
    transform-origin: top left;
    box-shadow: inset 0 0 0 0.3mm #b9c6d6;
    overflow: hidden;
}
.pb-preview-cols { position: absolute; inset: 0; }
.pb-preview-col {
    position: absolute;
    top: 0;
    height: 5mm;
    box-sizing: border-box;
    border-right: 0.2mm solid #b9c6d6;
    border-bottom: 0.2mm solid #b9c6d6;
    font-size: 2.6mm;
    line-height: 5mm;
    color: #61728a;
    padding-left: 0.6mm;
    overflow: hidden;
    white-space: nowrap;
}
.pb-preview-row {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 0.2mm solid #dbe3ee;
}
.pb-table-preview td, .pb-table-preview th { font-size: 11.5px; }
.pb-table-preview.table { table-layout: fixed; }

/* ================= Print ================= */

.print-only { display: none; }

@media print {
    @page { margin: 14mm 12mm; }

    body { background: #fff; font-size: 11.5px; }
    .sidebar, .topbar, .page-actions, .filter-bar, .pagination, .no-print, .btn { display: none !important; }
    .content { padding: 0; max-width: none; }
    .login-wrap { display: none; }
    .card { box-shadow: none; border: 1px solid #bbb; page-break-inside: avoid; }

    /* Kartu/daftar panjang boleh terpotong antar halaman, header tabel diulang */
    .card.is-long { page-break-inside: auto; }
    table.table thead { display: table-header-group; }
    table.table tfoot { display: table-footer-group; }
    table.table tr { page-break-inside: avoid; }
    .table-wrap { overflow: visible !important; }
    .stat, .alert { page-break-inside: avoid; }
    a { color: inherit; text-decoration: none; }

    /* Baris cetak: hanya tanggal & petugas cetak */
    .print-only { display: block; }
    .print-meta {
        display: flex;
        gap: 24px;
        flex-wrap: wrap;
        font-size: 10.5px;
        line-height: 1.4;
        color: #61728a;
        padding-bottom: 5px;
        border-bottom: 1px solid #b9c6d6;
        /* jarak satu baris kosong sebelum kartu saldo di bawahnya */
        margin-bottom: 18px;
    }
    .print-meta strong { color: #1b2b41; font-weight: 700; }

    .page-head { display: none; }
}

/* ================= Responsive ================= */

@media (max-width: 1080px) {
    .grid-2 { grid-template-columns: 1fr; }
    .split-2 { grid-template-columns: 1fr; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: static; }
    .sidebar nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
    .nav-label { display: none; }
    .nav-item { white-space: nowrap; margin: 0; border-left: 0; border-bottom: 3px solid transparent; }
    .nav-item.is-active { border-left: 0; border-bottom-color: #7fb2ea; }
    .content { padding: 14px; }
    .topbar { padding: 0 14px; }
    .topbar-title { font-size: 13.5px; }
    .user-meta { display: none; }
    .form-grid .span-2 { grid-column: span 1; }
    .stat-value { font-size: 20px; }
}
