/* KPNStok — shell mobile ala wsgrosir/apps, palet Mart KPN */
:root {
    --kpn-navy: #1b3a6b;
    --kpn-navy-deep: #12294d;
    --kpn-blue: #2b6cb0;
    --kpn-gold: #f0b429;
    --kpn-gold-dark: #d97706;
    --kpn-bg: #e8eef6;
    --kpn-text: #12294d;
    --kpn-muted: #6b7c93;
    --kpn-card: #ffffff;
    --kpn-radius: 18px;
    --kpn-header: linear-gradient(135deg, #1b3a6b 0%, #2b6cb0 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px; line-height: 1.5; color: var(--kpn-text); background: var(--kpn-bg);
    min-height: 100vh;
}
.app-shell {
    max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--kpn-bg);
    position: relative; padding-bottom: 88px;
}
.screen { display: none; }
.screen.active { display: block; animation: fadeInUp .35s ease; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.app-header {
    background: var(--kpn-header); color: #fff; padding: 16px 20px 18px;
    position: sticky; top: 0; z-index: 40;
    box-shadow: 0 2px 12px rgba(18, 41, 77, .28);
}
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-brand img { width: 40px; height: 40px; border-radius: 12px; background: #fff; }
.header-brand .sub { color: rgba(255,255,255,.75); font-size: 12px; }
.header-brand .title { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-btn {
    width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
    background: rgba(255,255,255,.15); color: #fff; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
}
.ver-chip {
    display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700;
    background: rgba(240,180,41,.2); color: var(--kpn-gold); border: 1px solid rgba(240,180,41,.4);
    border-radius: 999px; padding: 2px 10px;
}

.hero-card {
    margin: 0 16px 14px; margin-top: -6px; padding: 18px 18px 16px;
    border-radius: 20px; color: #fff;
    background: linear-gradient(145deg, #1b3a6b, #2b6cb0);
    box-shadow: 0 14px 32px rgba(27, 58, 107, .28);
}
.hero-card .lbl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.hero-card .val { font-size: 22px; font-weight: 800; margin: 4px 0 8px; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-stat { background: rgba(255,255,255,.12); border-radius: 12px; padding: 10px 12px; }
.hero-stat b { display: block; font-size: 18px; }
.hero-stat span { font-size: 11px; opacity: .85; }

.pad { padding: 0 16px 16px; }
.card {
    background: var(--kpn-card); border-radius: var(--kpn-radius);
    box-shadow: 0 4px 16px rgba(18, 41, 77, .06); margin-bottom: 12px; overflow: hidden;
}
.card-body { padding: 16px; }
.card-h { padding: 12px 16px; font-weight: 700; border-bottom: 1px solid #f0f3f8; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 8px; }
.quick-tile {
    background: #fff; border: 0; border-radius: 16px; padding: 16px; text-align: left; cursor: pointer;
    box-shadow: 0 4px 16px rgba(18, 41, 77, .06);
}
.quick-tile .ico {
    width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 10px; color: #fff;
}
.quick-tile .t { font-weight: 700; }
.quick-tile .d { font-size: 12px; color: var(--kpn-muted); margin-top: 2px; }
.ico-gold { background: linear-gradient(135deg, #f0b429, #d97706); }
.ico-navy { background: linear-gradient(135deg, #2b6cb0, #1b3a6b); }
.ico-teal { background: linear-gradient(135deg, #0f766e, #115e59); }
.ico-red { background: linear-gradient(135deg, #e11d48, #9f1239); }

.input-app, .select-app {
    width: 100%; padding: 12px 14px; border: 2px solid #d7e0ec; border-radius: 12px;
    font-size: 16px; font-family: inherit; background: #fff; color: var(--kpn-text);
}
.input-app:focus, .select-app:focus {
    outline: none; border-color: var(--kpn-blue); box-shadow: 0 0 0 3px rgba(43,108,176,.18);
}
.lbl { display: block; font-size: 12px; font-weight: 700; color: var(--kpn-muted); margin-bottom: 6px; }
.field { margin-bottom: 12px; }

.btn-gold, .btn-navy, .btn-ghost, .btn-danger {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px 16px; border: 0; border-radius: 14px; font-weight: 700;
    font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn-gold { background: linear-gradient(135deg, var(--kpn-gold), var(--kpn-gold-dark)); color: #4a2f00; }
.btn-navy { background: linear-gradient(135deg, var(--kpn-navy), var(--kpn-blue)); color: #fff; }
.btn-ghost { background: #fff; color: var(--kpn-navy); border: 2px solid #d7e0ec; }
.btn-danger { background: #fff; color: #be123c; border: 2px solid #fecdd3; }
.row-btns { display: flex; gap: 8px; }
.row-btns > * { flex: 1; }

.auth-page { min-height: 100vh; padding: 28px 20px 40px;
    background: linear-gradient(160deg, #12294d 0%, #1b3a6b 50%, #2b6cb0 100%); }
.auth-logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 14px; display: block; background: #fff; }
.auth-page h1 { color: #fff; text-align: center; font-size: 26px; font-weight: 800; }
.auth-page .tag { text-align: center; color: var(--kpn-gold); font-weight: 700; font-size: 12px; letter-spacing: .12em; margin-bottom: 6px; }
.auth-page p.lead { text-align: center; color: #dbe6f5; margin-bottom: 22px; }
.auth-card { background: #fff; border-radius: 20px; padding: 20px; }

.item-name { font-size: 18px; font-weight: 800; }
.meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.meta-box { background: #f4f7fb; border-radius: 12px; padding: 10px 12px; }
.meta-box span { display: block; font-size: 11px; color: var(--kpn-muted); }
.meta-box b { font-size: 16px; }
.qty-input { font-size: 28px !important; text-align: center; font-weight: 800; }
.selisih { text-align: center; font-weight: 800; margin: 8px 0 12px; }
.selisih.plus { color: #047857; }
.selisih.minus { color: #be123c; }
.selisih.zero { color: var(--kpn-muted); }

#reader { width: 100%; border-radius: 16px; overflow: hidden; background: #111; min-height: 220px; }
.list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f0f3f8;
    background: #fff; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item .nm { font-weight: 700; }
.list-item .bc { font-size: 12px; color: var(--kpn-muted); }
.badge-qty {
    margin-left: auto; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px;
    background: #e8eef6; color: var(--kpn-navy);
}
.badge-qty.plus { background: #d1fae5; color: #047857; }
.badge-qty.minus { background: #ffe4e6; color: #be123c; }

.empty { text-align: center; padding: 36px 16px; color: var(--kpn-muted); }
.empty i { font-size: 36px; display: block; margin-bottom: 8px; color: #c5d0de; }

.update-bar {
    display: none; margin: 12px 16px 0; padding: 10px 12px; border-radius: 12px;
    background: #fff7ed; border: 1px solid #f0b429; font-size: 13px; cursor: pointer;
}
.update-bar.show { display: block; }

.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; background: #fff; border-top: 1px solid #eef2f7;
    display: flex; justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 50; box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: 0; color: #adb5bd; cursor: pointer; padding: 6px 4px; font-family: inherit;
}
.nav-item i { font-size: 18px; }
.nav-item span { font-size: 10px; font-weight: 700; }
.nav-item.active { color: var(--kpn-gold-dark); }

.hint { font-size: 12px; color: var(--kpn-muted); margin-top: 8px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #94a3b8; }
.status-dot.ok { background: #10b981; }
.status-dot.bad { background: #ef4444; }

.outlet-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 14px; margin-bottom: 8px; border-radius: 14px;
    border: 1px solid #d7e0ec; background: #fff; cursor: pointer; text-align: left;
    font-family: inherit; color: inherit;
}
.outlet-row:disabled { opacity: .55; cursor: not-allowed; }
.outlet-row .nm { font-weight: 800; }
.outlet-row .st { font-size: 12px; color: var(--kpn-muted); }
.ios-hint { display: none; margin-top: 10px; font-size: 12px; color: var(--kpn-muted); }
.ios-hint.show { display: block; }

@media (min-width: 481px) {
    body { background: #d5dde8; }
    .app-shell { box-shadow: 0 0 40px rgba(18, 41, 77, .12); }
}
