/* ==========================================================================
   SantriPay — dompet digital pesantren/sekolah
   Gaya: e-wallet modern, mobile-first, kartu saldo gradien indigo→violet
   ========================================================================== */

:root {
    --primary: #4F46E5;
    --primary-2: #8B5CF6;
    --primary-deep: #3730A3;
    --primary-soft: #EEEAFF;
    --ink: #1F1B3A;
    --muted: #635F82;
    --line: #ECE7FA;
    --bg: #F3F0FF;
    --card: #FFFFFF;
    --green: #0E9F6E;
    --green-soft: #E3F8EF;
    --amber: #B45309;
    --amber-soft: #FDF2DE;
    --red: #D92D20;
    --red-soft: #FEECEB;
    --blue: #2563EB;
    --blue-soft: #E7EFFF;
    --radius: 20px;
    --shadow: 0 2px 14px rgba(49, 37, 108, .06);
    --shadow-lg: 0 16px 40px rgba(49, 37, 108, .16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #EDE8FF;
    background-image: radial-gradient(900px 520px at 8% -8%, #DCD4FF 0%, transparent 60%),
                      radial-gradient(720px 520px at 104% 4%, #FBE4FF 0%, transparent 58%),
                      radial-gradient(600px 500px at 50% 110%, #E2F2FF 0%, transparent 60%);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
svg { flex: 0 0 auto; }

.app {
    position: relative;
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    padding-bottom: 104px;
    box-shadow: 0 0 70px rgba(49, 37, 108, .12);
}

/* ---------------- topbar ---------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px) saturate(170%);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    border-bottom: 1px solid rgba(236, 231, 250, .9);
}

.topbar-titles { flex: 1; min-width: 0; }

.topbar-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 1.25;
    /* nama lengkap bisa panjang ("Ust. H. M. Mahbubi, S.Pd.I") → izinkan 2 baris */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.topbar-sub {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1px;
    line-height: 1.3;
    /* nama unit + keterangan bisa panjang: bungkus maksimal 2 baris */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
}

.topbar-brand { display: inline-flex; }

.icon-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: #F2EFFF;
    color: var(--ink);
    border: 0;
    transition: background .16s ease, transform .16s ease;
}

.icon-btn:active { transform: scale(.95); }
.icon-btn.ghost { background: transparent; color: var(--muted); }

.icon-btn.bell { position: relative; }
.bell-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 99px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.school-logo { border-radius: 12px; object-fit: cover; background: #fff; }

.school-mono {
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--primary-deep), var(--primary-2));
    color: #fff;
    font-weight: 800;
    letter-spacing: -.5px;
    flex: 0 0 auto;
}

/* ---------------- avatar ---------------- */

.avatar, .avatar-sm, .avatar-xs, .avatar-lg {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(140deg, #4F46E5, #A855F7);
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex: 0 0 auto;
    letter-spacing: .2px;
    object-fit: cover;
}

.avatar { width: 38px; height: 38px; font-size: 13px; }
.avatar-sm { width: 38px; height: 38px; font-size: 12.5px; }
.avatar-xs { width: 30px; height: 30px; font-size: 10.5px; }
.avatar-lg { width: 66px; height: 66px; font-size: 21px; }
.avatar-xl { width: 96px; height: 96px; font-size: 30px; border-radius: 26px; }
.avatar img, .avatar-sm img, .avatar-xs img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- halaman & kartu ---------------- */

.page { padding: 16px 14px 8px; }
.page-tight { padding: 12px 14px 8px; }

.card {
    background: var(--card);
    border: 1px solid rgba(236, 231, 250, .9);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }
.card-flush { padding: 0; overflow: hidden; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 22px 2px 10px;
}

.section-head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; }

.section-head a {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    min-height: 34px;
    padding: 3px 0 3px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.section-sub { font-size: 11.5px; color: var(--muted); margin: -2px 2px 10px; }

/* ---------------- kartu saldo ---------------- */

.wallet {
    position: relative;
    margin: 0;
    padding: 20px 18px 16px;
    border-radius: 26px;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, #4F46E5 0%, #6D28D9 58%, #9333EA 100%);
    box-shadow: 0 18px 34px rgba(79, 70, 229, .34);
}

.wallet-glow {
    position: absolute;
    inset: -45% -12% auto auto;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .34) 0%, transparent 66%);
    pointer-events: none;
}

.wallet::after {
    content: '';
    position: absolute;
    left: -50px;
    bottom: -110px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, .3) 0%, transparent 68%);
    pointer-events: none;
}

.wallet-top {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wallet-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .68);
    margin-bottom: 3px;
}

.wallet-amount {
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(30, 12, 80, .22);
}

.wallet-chip {
    width: 38px;
    height: 29px;
    border-radius: 8px;
    background: linear-gradient(135deg, #FDE68A, #F59E0B);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
    display: grid;
    place-items: center;
    margin-top: 2px;
}

.wallet-chip i {
    width: 20px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(120, 53, 15, .45);
    background: repeating-linear-gradient(90deg, transparent 0 4px, rgba(120, 53, 15, .3) 4px 5px);
}

.wallet-meta {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .16);
}

.wallet-owner { min-width: 0; }
.wallet-owner strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.wallet-owner small { font-size: 11px; color: rgba(255, 255, 255, .68); }

.wallet-qr {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .26);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.wallet-qr:active { background: rgba(255, 255, 255, .3); }

.wallet-limit { position: relative; margin-top: 12px; }
.wallet-limit-text { font-size: 11px; color: rgba(255, 255, 255, .78); }
.wallet-limit-text strong { color: #fff; font-weight: 700; }
.wallet-limit-text span { color: rgba(255, 255, 255, .6); }

.wallet-bar {
    display: block;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .22);
    margin-top: 7px;
    overflow: hidden;
}

.wallet-bar i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #FDE68A, #F59E0B);
}

/* ---------------- aksi cepat ---------------- */

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.quick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 12px 6px 10px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-align: center;
    color: var(--ink);
}

.quick-ico {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.quick-ico.is-green { background: var(--green-soft); color: var(--green); }
.quick-ico.is-amber { background: var(--amber-soft); color: var(--amber); }
.quick-ico.is-blue { background: var(--blue-soft); color: var(--blue); }

.quick-label { font-size: 11px; font-weight: 600; line-height: 1.25; }

/* ---------------- statistik ---------------- */

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px 14px;
    box-shadow: var(--shadow);
}

.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 3px; }
.stat-value { font-size: 17px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; display: block; }
.stat-note { font-size: 11px; color: var(--muted); margin-top: 2px; display: block; }

/* ---------------- daftar transaksi ---------------- */

.tx-list { display: flex; flex-direction: column; }

.tx-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 2px;
    border-bottom: 1px solid #F3EFFC;
}

.tx-row:last-child { border-bottom: 0; }

.tx-ico {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: #F4F0FF;
    color: var(--primary);
    flex: 0 0 auto;
}

.tx-ico.is-in { background: var(--green-soft); color: var(--green); }

.tx-body { flex: 1; min-width: 0; }

.tx-title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.tx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 7px;
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.tx-kind {
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .3px;
    font-size: 10px;
}

.tx-items { font-size: 11px; color: #4A4468; margin-top: 3px; line-height: 1.4; }
.tx-links { margin-top: 2px; font-size: 11px; }
.tx-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 0; font-weight: 600; }
.tx-links a { font-weight: 700; }
.tx-flag { font-size: 10px; font-weight: 700; color: var(--red); margin-top: 3px; }

.tx-void { margin-top: 4px; }
.link-danger {
    background: none;
    border: 0;
    padding: 6px 2px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--red);
    text-decoration: underline;
}

/* tautan kecil di dalam baris (mis. nama santri pada daftar tagihan) */
.row-between a.small,
.bill-list a.small {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    font-size: 11.5px;
    color: var(--primary);
    font-weight: 600;
}

.tx-right { text-align: right; flex: 0 0 auto; padding-top: 1px; }
.tx-right strong { display: block; font-size: 12.5px; font-weight: 800; letter-spacing: -.2px; }
.tx-right strong.is-in { color: var(--green); }
.tx-right strong.is-out { color: var(--ink); }
.tx-right small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }

.tx-row.is-void { opacity: .55; }
.tx-row.is-void .tx-right strong { text-decoration: line-through; }

.tx-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 2px 4px;
}

/* daftar sederhana dengan tautan */

.row-list { display: flex; flex-direction: column; }

.row-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 2px;
    border-bottom: 1px solid #F3EFFC;
    color: var(--ink);
}

.row-item:last-child { border-bottom: 0; }
.row-item > svg:last-child { color: #BEB6DA; }

.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.row-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.row-right { text-align: right; flex: 0 0 auto; }
.row-right strong { display: block; font-size: 12.5px; font-weight: 800; }

/* ---------------- tagihan ---------------- */

.bill-list { display: flex; flex-direction: column; gap: 10px; }

.bill-row {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px 14px;
    box-shadow: var(--shadow);
}

.bill-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bill-title-wrap { min-width: 0; }
.bill-title { font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.bill-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.bill-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.bill-bottom strong { font-size: 14px; font-weight: 800; letter-spacing: -.3px; }
.bill-bottom small { display: block; font-size: 10px; }
.bill-done { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--green); }

.bill-extra { margin-top: 10px; padding-top: 9px; border-top: 1px dashed #EFEAFB; }
.bill-extra .small { color: var(--primary); font-weight: 600; }

/* ---------------- kartu QR ---------------- */

.qr-card {
    background: linear-gradient(180deg, #FFFFFF, #FBF9FF);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px 16px 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.qr-frame {
    display: inline-block;
    padding: 10px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #EEE8FB;
}

.qr-frame svg { display: block; width: 100%; height: auto; max-width: 240px; }

.qr-school {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 11px;
}

.qr-name { font-size: 14.5px; font-weight: 800; margin-top: 13px; letter-spacing: -.2px; }
.qr-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.qr-code {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 10.5px;
    letter-spacing: 1px;
    color: var(--muted);
    margin-top: 9px;
    padding: 5px 8px;
    background: #F5F2FF;
    border-radius: 8px;
    display: inline-block;
}

.qr-note { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin-top: 12px; }

/* barcode Code 39 pendamping QR pada kartu digital */
.qr-barcode {
    margin-top: 12px;
    padding: 10px 8px 6px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #EEE8FB;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
}

.qr-barcode svg { display: block; height: 56px; margin: 0 auto; max-width: 100%; }
.qr-barcode span {
    display: block;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #101B3D;
    margin-top: 2px;
}

/* ---------------- pemilih anak (wali) ---------------- */

.child-switch {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 14px 4px;
    margin: 10px -14px 0;
    scrollbar-width: none;
}

.child-switch::-webkit-scrollbar { display: none; }

.child-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 7px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
}

.child-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.child-chip.is-active .avatar-xs { background: linear-gradient(140deg, #A78BFA, #F472B6); }

/* ---------------- pusat notifikasi ---------------- */

.notif-list { display: flex; flex-direction: column; }
.notif-form { margin: 0; }

.notif-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    padding: 12px 2px;
    border: 0;
    border-bottom: 1px solid #F3EFFC;
    background: transparent;
    text-align: left;
    color: var(--ink);
    font-family: inherit;
}

.notif-row:last-child { border-bottom: 0; }
.notif-row.is-unread { background: rgba(79, 70, 229, .05); }
.notif-row > svg { color: #BEB6DA; margin-top: 12px; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.notif-row.is-unread .notif-title { font-weight: 800; }
.notif-text { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.notif-meta { font-size: 10px; color: var(--muted); }

/* ---------------- jejak audit ---------------- */

.audit-list { display: flex; flex-direction: column; }

.audit-row {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 11px 2px 11px 0;
    border-bottom: 1px solid #F3EFFC;
}

.audit-row:last-child { border-bottom: 0; }

.audit-dot {
    position: relative;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--primary), var(--primary-2));
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.audit-dot::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 16px;
    width: 2px;
    height: calc(100% + 14px);
    background: #EFEAFB;
}

.audit-row:last-child .audit-dot::after { display: none; }
.audit-body { flex: 1; min-width: 0; }
.audit-title { font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.audit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* nilai meta bisa panjang (mis. URL berkas) — harus membungkus, bukan melebar */
.install-note a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 2px; font-weight: 700; }

/* tautan di dalam paragraf penjelas (mis. "transaksi dompet" di halaman audit) */
.notice a, .form-hint a, .section-sub a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 2px; font-weight: 700; }

.audit-meta .tag {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    font-size: 10px;
    line-height: 1.45;
    text-align: left;
}

/* ---------------- verifikasi foto kasir ---------------- */

.verify {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(140deg, #F7F4FF, #EFEAFF);
    border: 1px solid #E4DBFF;
}

.verify-photo {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(140deg, #4F46E5, #A855F7);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .24);
    border: 3px solid #fff;
}

.verify-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.verify-info { flex: 1; min-width: 0; }
.verify-name { font-size: 15.5px; font-weight: 800; letter-spacing: -.3px; line-height: 1.25; }
.verify-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.verify-balance { font-size: 18px; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }

.verify-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border-radius: 14px;
    background: #F7F4FF;
    border: 1px solid #E7E0FA;
    font-size: 12px;
    line-height: 1.5;
    color: #3A3466;
    margin-top: 12px;
}

.verify-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary); }
.verify-check strong { font-weight: 700; }

/* ---------------- tag ---------------- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1px;
    background: #F2EFFF;
    color: var(--primary);
    white-space: nowrap;
}

.tag-green { background: var(--green-soft); color: var(--green); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-gray { background: #F2F0F8; color: #7A749B; }

/* ---------------- tombol ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.1px;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .24);
    transition: transform .14s ease, box-shadow .14s ease;
}

.btn:active { transform: translateY(1px) scale(.995); box-shadow: 0 6px 14px rgba(79, 70, 229, .2); }
.btn-soft { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.btn-outline { background: #fff; color: var(--primary); box-shadow: none; border: 1px solid #DCD3FA; }
.btn-danger { background: linear-gradient(135deg, #C81E1E, #E5484D); box-shadow: 0 10px 22px rgba(217, 45, 32, .2); }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: none; }
.btn-sm { height: 38px; border-radius: 12px; font-size: 12px; padding: 0 14px; width: auto; }
.btn-block { width: 100%; }
.btn-lg { height: 54px; font-size: 14.5px; border-radius: 16px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.link-more {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 34px;
    padding: 2px 0;
    font-size: 12px;
    font-weight: 600;
}

/* ---------------- form ---------------- */

.form-group { margin-bottom: 14px; }

.form-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #4A4468;
    margin-bottom: 6px;
}

.form-hint { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.input, .select, .textarea {
    display: block;
    width: 100%;
    min-width: 0; /* penting: input[type=date] punya lebar intrinsik besar */
    max-width: 100%;
    height: 47px;
    padding: 0 14px;
    border-radius: 13px;
    border: 1px solid #E3DCF8;
    background: #FBFAFF;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    appearance: none;
}

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .13);
}

.input::placeholder { color: #A9A2C4; }

.textarea { min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.55; height: auto; }

.select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23635F82' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 38px;
}

.input-icon { position: relative; }
.input-icon .input { padding-right: 48px; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9089B0; pointer-events: none; }
.input-icon .input.has-icon { padding-left: 42px; }

.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8C85AC;
}

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

/* ponsel sempit (≤360px): dua kolom isian jadi satu kolom agar tidak meluber */
@media (max-width: 360px) {
    .grid-2 { grid-template-columns: 1fr; gap: 10px; }
    .grid-2 > .form-group { margin-bottom: 0; }
}
.grid-2 > .form-group { margin-bottom: 0; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.form-actions .btn { flex: 1; }

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    color: #4A4468;
    padding: 6px 0;
}

.check-row input { width: 17px; height: 17px; accent-color: var(--primary); }

/* nominal besar untuk kasir */
.amount-box {
    background: linear-gradient(180deg, #FBFAFF, #F6F2FF);
    border: 1px solid #E7E0FA;
    border-radius: 18px;
    padding: 14px 16px;
    text-align: center;
}

.amount-label { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }

.amount-input {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--ink);
    outline: none;
    padding: 6px 0;
    font-variant-numeric: tabular-nums;
}

.amount-input::placeholder { color: #CFC7E8; }

.amount-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 6px; }
.amount-chip {
    border: 1px solid #E3DCF8;
    background: #fff;
    color: var(--primary);
    border-radius: 99px;
    min-height: 34px;
    padding: 8px 13px;
    font-size: 11.5px;
    font-weight: 700;
}

/* ---------------- pemindai QR ---------------- */

.scan-stage {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: #16122B;
    aspect-ratio: 4 / 3.4;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .72);
    box-shadow: var(--shadow-lg);
}

.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }

.scan-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.scan-frame {
    width: 62%;
    max-width: 220px;
    aspect-ratio: 1;
    border-radius: 22px;
    box-shadow: 0 0 0 9999px rgba(15, 12, 32, .45);
    position: relative;
}

.scan-frame::before,
.scan-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    border: 3px solid rgba(255, 255, 255, .85);
    -webkit-mask-image: linear-gradient(#000, #000);
}

.scan-corner {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 4px solid #A78BFA;
    border-radius: 12px;
}

.scan-corner.tl { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.scan-corner.tr { top: -3px; right: -3px; border-left: 0; border-bottom: 0; }
.scan-corner.bl { bottom: -3px; left: -3px; border-right: 0; border-top: 0; }
.scan-corner.br { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }

.scan-hint {
    position: absolute;
    left: 0; right: 0;
    bottom: 14px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, .82);
    padding: 0 18px;
}

.scan-placeholder {
    display: grid;
    place-items: center;
    gap: 10px;
    text-align: center;
    padding: 26px 22px;
    font-size: 11.5px;
    line-height: 1.6;
}

.scan-placeholder svg { color: #A78BFA; }

.scan-status { font-size: 11px; color: var(--muted); text-align: center; margin-top: 8px; }

/* ---------------- segmen & chip filter ---------------- */

.seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #EFEAFC;
    border-radius: 13px;
    overflow-x: auto;
    scrollbar-width: none;
}

.seg::-webkit-scrollbar { display: none; }

.seg a, .seg button {
    flex: 1 0 auto;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.seg .on { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(49, 37, 108, .08); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------------- pencarian ---------------- */

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 0 12px;
    height: 44px;
}

.search svg { color: #8C85AC; }
.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 12.5px;
    color: var(--ink);
}
.search input::placeholder { color: #A9A2C4; }

/* ---------------- tabel ---------------- */

.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 8px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.tbl td { padding: 10px 8px; border-bottom: 1px solid #F5F2FD; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.right, table.tbl th.right { text-align: right; }

/* ---------------- key-value & lain-lain ---------------- */

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #F3EFFC; font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); flex: 0 0 auto; }
.kv strong { font-weight: 600; text-align: right; word-break: break-word; }

.notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: #3C3489;
    font-size: 11.5px;
    line-height: 1.55;
}

.notice.is-amber { background: var(--amber-soft); color: #7C3A0B; }
.notice.is-green { background: var(--green-soft); color: #04543B; }
.notice.is-red { background: var(--red-soft); color: #8A1C15; }
.notice svg { margin-top: 1px; }

.empty {
    text-align: center;
    padding: 28px 20px;
    color: var(--muted);
}

.empty svg { color: #C4BCE0; margin-bottom: 8px; }
.empty h3 { font-size: 13px; font-weight: 700; color: #4A4468; margin-bottom: 3px; }
.empty p { font-size: 11.5px; line-height: 1.55; margin-bottom: 12px; }

.bar {
    display: block;
    height: 6px;
    border-radius: 99px;
    background: #EFEAFC;
    overflow: hidden;
}

.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

.chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-top: 8px;
}

.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.chart-bar {
    width: 100%;
    max-width: 34px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, #8B5CF6, #4F46E5);
    min-height: 3px;
}
.chart-col small { font-size: 8.5px; color: var(--muted); font-weight: 600; white-space: nowrap; letter-spacing: -.2px; }

/* ---------------- flash ---------------- */

.flash-stack {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 10px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px;
    border-radius: 13px;
    background: #fff;
    border-left: 4px solid var(--primary);
    box-shadow: 0 8px 22px rgba(49, 37, 108, .12);
    font-size: 12px;
    line-height: 1.45;
    color: #3A3466;
}

.flash-success { border-left-color: var(--green); }
.flash-error { border-left-color: var(--red); }
.flash-info { border-left-color: var(--blue); }
.flash-ico { margin-top: 1px; }
.flash-success .flash-ico { color: var(--green); }
.flash-error .flash-ico { color: var(--red); }
.flash-info .flash-ico { color: var(--blue); }

/* ---------------- tab bar ---------------- */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-top: 1px solid rgba(236, 231, 250, .9);
    box-shadow: 0 -8px 26px rgba(49, 37, 108, .07);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    /* tabbar 6 tab di 360px: label 10px + ikon 24px masih muat tanpa terpotong */
    padding: 6px 2px 5px;
    border-radius: 12px;
    color: #8C85AC;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
}

.tab-ico { display: grid; place-items: center; height: 24px; }
.tab.is-active { color: var(--primary); }
.tab.is-active .tab-ico { color: var(--primary); }
.tab-label { letter-spacing: -.1px; }

/* ---------------- splash ---------------- */

.splash {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #2E1065 0%, #4F46E5 55%, #7C3AED 100%);
    color: #fff;
}

.splash[hidden] { display: none !important; }

.splash-inner { text-align: center; padding: 24px; }
.splash-mark { position: relative; display: inline-grid; place-items: center; margin-bottom: 18px; }

.splash-ring {
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .34);
    animation: spayPulse 2s ease-out infinite;
}

.splash-ring.delay { animation-delay: .8s; }

@keyframes spayPulse {
    0% { transform: scale(.72); opacity: .85; }
    100% { transform: scale(1.5); opacity: 0; }
}

.splash-logo { border-radius: 22px; box-shadow: 0 16px 34px rgba(0, 0, 0, .3); }
.splash-name { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.splash-sub { font-size: 12px; color: rgba(255, 255, 255, .62); margin-top: 4px; }

.splash-bar {
    width: 92px;
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .22);
    margin: 20px auto 0;
    overflow: hidden;
}

.splash-bar > i { display: block; width: 40%; height: 100%; background: #fff; animation: spaySlide 1.1s ease-in-out infinite; }

@keyframes spaySlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(280%); }
}

html.splash-lock, html.splash-lock body { overflow: hidden; }

/* ---------------- halaman login ---------------- */

.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--bg);
}

.login-hero {
    position: relative;
    padding: 46px 24px 70px;
    color: #fff;
    background: linear-gradient(150deg, #2E1065 0%, #4F46E5 58%, #8B5CF6 100%);
    overflow: hidden;
    border-radius: 0 0 34px 34px;
}

.login-hero::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -70px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .26), transparent 68%);
}

.login-brand { position: relative; display: flex; align-items: center; gap: 13px; }
.login-brand .school-mono, .login-brand .school-logo { border-radius: 16px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.login-brand h1 { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.login-brand p { font-size: 11.5px; color: rgba(255, 255, 255, .66); margin-top: 2px; }

.login-tagline {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 22px;
    padding: 7px 12px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
}

.login-desc { position: relative; font-size: 12px; color: rgba(255, 255, 255, .68); margin-top: 12px; max-width: 300px; line-height: 1.65; }

.login-sheet {
    position: relative;
    margin: -46px 16px 0;
    background: #fff;
    border-radius: 26px;
    padding: 22px 18px 20px;
    box-shadow: var(--shadow-lg);
}

.login-sheet h2 { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.login-sheet > p { font-size: 12px; color: var(--muted); margin: 3px 0 18px; }
.login-sheet .btn { margin-top: 18px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 10.5px; color: #8C85AC; line-height: 1.65; }

.login-group {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 13px;
    border-radius: 14px;
    border: 1px solid #E3DCF8;
    background: #FBFAFF;
    margin-bottom: 11px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.login-group:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }
.login-group > svg { color: #9089B0; }
.login-group input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    color: var(--ink);
}
.login-group input::placeholder { color: #A9A2C4; }

.demo-box {
    margin-top: 16px;
    border-radius: 14px;
    border: 1px dashed #DCD3FA;
    background: #FAF8FF;
    padding: 11px 13px;
    font-size: 10.5px;
    line-height: 1.75;
    color: var(--muted);
}

.demo-box strong { display: block; color: #4A4468; font-size: 11px; margin-bottom: 3px; }
.demo-box code {
    font-family: ui-monospace, Menlo, monospace;
    background: #EFEAFC;
    border-radius: 5px;
    padding: 1px 5px;
    color: #4C3E9E;
}

/* ---------------- profil ---------------- */

.profile-card { text-align: center; padding: 22px 18px 18px; }
.profile-name { font-size: 17px; font-weight: 800; letter-spacing: -.3px; margin-top: 10px; }
.profile-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.profile-tags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------- utilities ---------------- */

.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 16px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.center { text-align: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.rich-text { font-size: 12.5px; line-height: 1.7; color: #3A3466; white-space: pre-line; }

.file-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 11px;
    background: #F7F4FF;
    border: 1px solid #EDE7FB;
    font-size: 11.5px;
    font-weight: 600;
}
.file-chip svg { color: var(--primary); }
.file-chip .ellipsis { flex: 1; }


/* ---------------- metode pembayaran kasir ---------------- */

.pay-methods { display: flex; flex-direction: column; gap: 8px; }

.pay-method { display: block; cursor: pointer; }
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }

.pay-method-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid #E4DCF9;
    background: #FBFAFF;
    transition: border-color .12s ease, background .12s ease;
}

.pay-method input:checked + .pay-method-body {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, .12);
}

.pay-method-ico {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    border-radius: 11px;
    display: grid; place-items: center;
    background: #fff; color: var(--primary);
    border: 1px solid #E4DCF9;
}

.pay-method-ico.is-amber { color: var(--amber); }
.pay-method-body strong { display: block; font-size: 12.5px; }
.pay-method-body small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ---------------- rekening bank ---------------- */

.bank-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 13px;
    border-radius: 14px;
    background: #F7F4FF;
    border: 1px solid #E7E0FA;
}

.bank-card + .bank-card { margin-top: 8px; }
.bank-card-ico {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center; background: #fff; color: var(--primary); border: 1px solid #E4DCF9;
}
.bank-name { font-size: 12px; font-weight: 700; }
.bank-no {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 14px; font-weight: 800; letter-spacing: .5px; margin-top: 1px;
}
.bank-holder { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ---------------- katalog produk & keranjang kasir ---------------- */

.product-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 14px 2px 8px;
}

.product-cat:first-of-type { margin-top: 4px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.product {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 11px;
    border-radius: 13px;
    border: 1px solid #E4DCF9;
    background: #FBFAFF;
    text-align: left;
    color: var(--ink);
    font-family: inherit;
    transition: transform .12s ease, background .12s ease;
}

.product:active { transform: scale(.98); background: var(--primary-soft); }
.product.is-in-cart { border-color: var(--primary); background: var(--primary-soft); }
.product-name { font-size: 12px; font-weight: 700; line-height: 1.3; }
.product-price { font-size: 11px; font-weight: 600; color: var(--primary); }

.cart {
    margin-top: 14px;
    padding: 12px 13px;
    border-radius: 16px;
    background: #F7F4FF;
    border: 1px solid #E7E0FA;
}

.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cart-head strong { font-size: 12px; }
.cart-list { display: flex; flex-direction: column; gap: 6px; }

.cart-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed #E2D9F7;
    font-size: 11.5px;
}

.cart-line:last-child { border-bottom: 0; }
.cart-line-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; }
.cart-qty { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }

.cart-qty button {
    width: 25px;
    height: 25px;
    border-radius: 8px;
    border: 1px solid #DCD3FA;
    background: #fff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    display: grid;
    place-items: center;
}

.cart-qty span { min-width: 16px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-line-sub { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #E2D9F7;
    font-size: 12px;
}
.cart-total strong { font-size: 16px; font-weight: 800; letter-spacing: -.4px; }
.cart-empty { margin-top: 12px; }

/* ---------------- naik kelas ---------------- */

.promo-row {
    padding: 12px 0;
    border-bottom: 1px solid #F3EFFC;
}

.promo-row:last-of-type { border-bottom: 0; }
.promo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.promo-kelas { font-size: 13px; font-weight: 800; letter-spacing: -.2px; }
.promo-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- struk ---------------- */

.receipt {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: var(--shadow);
}

.receipt-head { text-align: center; padding-bottom: 12px; border-bottom: 1px dashed #DCD4F0; }
.receipt-head h2 { font-size: 14.5px; font-weight: 800; letter-spacing: -.2px; }
.receipt-head p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.receipt-meta { margin: 12px 0; font-size: 11.5px; }
.receipt-meta div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.receipt-meta span { color: var(--muted); }

.receipt-items { border-top: 1px dashed #DCD4F0; border-bottom: 1px dashed #DCD4F0; padding: 10px 0; }
.receipt-item { display: flex; gap: 8px; font-size: 11.5px; padding: 4px 0; }
.receipt-item .ri-name { flex: 1; min-width: 0; }
.receipt-item .ri-qty { flex: 0 0 auto; color: var(--muted); }
.receipt-item .ri-sub { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; }

.receipt-total {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0 0; font-size: 12px;
}
.receipt-total strong { font-size: 17px; font-weight: 800; letter-spacing: -.4px; }
.receipt-foot { text-align: center; font-size: 10px; color: var(--muted); margin-top: 14px; line-height: 1.6; }

/* ---------------- cetak kartu massal (A4) ---------------- */

.card-sheet { display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 4mm; justify-content: center; }

.card-preview { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* pratinjau satu kolom penuh: kartu 85,6 mm tetap terbaca di ponsel */

.card-fit {
    position: relative;
    width: 100%;
    padding-top: 63.1%; /* rasio 1011 x 638 */
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(49, 37, 108, .16);
    border: 1px solid #E6EAF3;
    background: #fff;
}

.card-fit > .card-scale { position: absolute; top: 0; left: 0; transform-origin: top left; }
.card-fit .scard { width: 1011px; height: 638px; }

/* kartu pengenal dirender mandiri; pastikan tidak mewarisi gaya .card aplikasi */
.card-fit .scard { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; }

.sheet-toolbar {
    position: sticky;
    top: 56px;
    z-index: 30;
    display: flex;
    gap: 8px;
    padding: 10px 0;
    background: var(--bg);
}

/* layar sempit: pratinjau satu kolom */


/* ---------------- berita acara / dokumen cetak ---------------- */

.doc-head { display: none; }
.doc h1 { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.doc-title { text-align: center; margin-bottom: 14px; }
.doc-title h1 { font-size: 16px; }
.doc-title p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.doc-sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; font-size: 11px; }
.doc-sign div { flex: 1; text-align: center; }
.doc-sign span { display: block; margin-top: 44px; border-top: 1px solid #999; padding-top: 4px; }

@media print {
    @page { size: A4; margin: 8mm; }

    .card-sheet { grid-template-columns: repeat(2, 85.6mm); gap: 4mm; }
    .card-fit { width: 85.6mm; height: 54mm; padding-top: 0; border: 0; border-radius: 0; box-shadow: none; }

    body.sheet-print { background: #fff !important; }
    body.sheet-print .app { box-shadow: none; max-width: none; padding: 0; background: #fff; }
    body.sheet-print .topbar,
    body.sheet-print .tabbar,
    body.sheet-print .sheet-toolbar,
    body.sheet-print .flash-stack,
    body.sheet-print .no-print { display: none !important; }

    body.doc-print { background: #fff !important; }
    body.doc-print .app { box-shadow: none; max-width: none; padding: 0; background: #fff; }
    body.doc-print .topbar,
    body.doc-print .tabbar,
    body.doc-print .flash-stack,
    body.doc-print .no-print,
    body.doc-print .btn { display: none !important; }
    body.doc-print .page { padding: 0; }
    body.doc-print .doc-head { display: block; margin-bottom: 10px; }
    body.doc-print .card { box-shadow: none; border: 0; padding: 0; }
}

/* ---------------- mode gelap ---------------- */

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #F1EEFB;
        --muted: #A9A2C4;
        --line: #2B2547;
        --bg: #120F22;
        --card: #1B1630;
        --primary-soft: #2A2350;
        --green-soft: #10382C;
        --amber-soft: #3A2A12;
        --red-soft: #3C1B1B;
        --blue-soft: #16294D;
        --shadow: 0 2px 14px rgba(0, 0, 0, .3);
    }

    body { background: #0C0A18; background-image: radial-gradient(800px 500px at 10% -10%, #221A4A 0%, transparent 60%); }
    .app { background: var(--bg); box-shadow: none; }
    .topbar { background: rgba(18, 15, 34, .92); border-bottom-color: #262040; }
    .icon-btn { background: #241E40; color: var(--ink); }
    .wallet { box-shadow: 0 18px 34px rgba(0, 0, 0, .45); }
    .quick, .card, .stat, .bill-row, .qr-card, .child-chip { background: var(--card); border-color: var(--line); }
    .quick { color: var(--ink); }
    .tx-row, .row-item, .kv, .bill-row { border-color: #241E40; }
    .tx-title, .row-title, .bill-title, .empty h3 { color: var(--ink); }
    .tx-ico { background: #241E40; }
    .tx-ico.is-in { background: var(--green-soft); }
    .input, .select, .textarea, .login-group { background: #171230; border-color: #312A52; color: var(--ink); }
    .input:focus, .select:focus, .textarea:focus { background: #1D1738; }
    .search { background: var(--card); border-color: var(--line); }
    .seg { background: #221C3C; }
    .seg .on { background: #2E2750; color: #C4B5FD; box-shadow: none; }
    .chip { background: var(--card); border-color: var(--line); color: var(--muted); }
    .chip.is-on { background: #C4B5FD; border-color: #C4B5FD; color: #1F1B3A; }
    .child-chip.is-active { background: #C4B5FD; border-color: #C4B5FD; color: #1F1B3A; }
    .tabbar { background: rgba(18, 15, 34, .95); border-top-color: #262040; }
    .tab { color: #8A83AB; }
    .tab.is-active { color: #C4B5FD; }
    .flash { background: #1D1833; color: var(--ink); box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
    .login-sheet { background: var(--card); }
    .demo-box { background: #171230; border-color: #332B55; }
    .demo-box code { background: #241E40; color: #C4B5FD; }
    .file-chip { background: #221C3C; border-color: #2C2550; }
    .amount-box { background: linear-gradient(180deg, #1D1738, #221B40); border-color: #322A55; }
    .amount-input { color: var(--ink); }
    .amount-chip { background: #241E40; border-color: #3A3161; color: #C4B5FD; }
    .qr-frame { background: #fff; border-color: #3A3161; }
    .qr-code { background: #221C3C; }
    .notice { background: #241E40; color: #C9C2E8; }
    .notice.is-amber { background: var(--amber-soft); color: #F5C88A; }
    .notice.is-green { background: var(--green-soft); color: #7FE3BF; }
    .notice.is-red { background: var(--red-soft); color: #F7A6A0; }
    .link-danger { color: #F97066; }
    table.tbl th { border-bottom-color: var(--line); }
    table.tbl td { border-bottom-color: #241E40; }
    .bell-dot { box-shadow: 0 0 0 2px #1B1630; }
    .tx-items { color: #C9C2E8; }
    .notif-row { border-bottom-color: #241E40; color: var(--ink); }
    .notif-row.is-unread { background: rgba(196, 181, 253, .1); }
    .audit-row { border-bottom-color: #241E40; }
    .audit-dot::after { background: #2B2547; }
    .verify { background: linear-gradient(140deg, #221C3C, #2A2350); border-color: #3A3161; }
    .verify-photo { border-color: #3A3161; }
    .verify-check { background: #221C3C; border-color: #3A3161; color: #D8D2F0; }
    .pay-method-body { background: #1D1738; border-color: #322A55; }
    .pay-method input:checked + .pay-method-body { background: #2A2350; border-color: #8B7BE8; }
    .pay-method-ico { background: #241E40; border-color: #3A3161; color: #C4B5FD; }
    .bank-card { background: #221C3C; border-color: #3A3161; }
    .bank-card-ico { background: #241E40; border-color: #3A3161; color: #C4B5FD; }
    .product { background: #1D1738; border-color: #322A55; color: var(--ink); }
    .product.is-in-cart { background: #2A2350; border-color: #8B7BE8; }
    .cart { background: #1D1738; border-color: #322A55; }
    .cart-line { border-bottom-color: #322A55; }
    .cart-qty button { background: #241E40; border-color: #3A3161; color: #C4B5FD; }
    .cart-total { border-top-color: #322A55; }
    .promo-row { border-bottom-color: #241E40; }
    .receipt { background: var(--card); }
    .receipt-head { border-bottom-color: #322A55; }
    .receipt-items { border-top-color: #322A55; border-bottom-color: #322A55; }

/* ---------------- cetak ---------------- */

@media print {
    body { background: #fff; }
    .tabbar, .topbar, .btn, .icon-btn, .qr-note, .flash-stack { display: none !important; }
    .app { box-shadow: none; max-width: none; padding-bottom: 0; }
    .qr-card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------------- responsif kecil ---------------- */

@media (max-width: 359px) {
    .wallet-amount { font-size: 25px; }
    .quick-grid { gap: 7px; }
    .quick { padding: 10px 4px 9px; }
    .quick-ico { width: 36px; height: 36px; }
    .stat-value { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
