/**
 * BizGo Mobile (PWA) — visual skin.
 * Deliberately SEPARATE from assets/stylesheets/app.css + bizgo-custom.css
 * (the desktop Vireo-theme skin) -- mobile/ pages never load those files.
 * Built on top of Bootstrap 5 (CDN) utilities/grid; everything below is
 * BizGo-specific chrome layered on top (cards, bottom-nav, hero, tiles).
 * All custom classes are prefixed "mbz-" so nothing collides with
 * Bootstrap's own class names.
 */

:root {
    --mbz-primary: #2f5bf6;
    --mbz-primary-dark: #16224a;
    --mbz-primary-soft: #eaefff;
    --mbz-bg: #f2f5fb;
    --mbz-surface: #ffffff;
    --mbz-success: #16a34a;
    --mbz-success-soft: #e7f7ec;
    --mbz-info: #0284c7;
    --mbz-info-soft: #e6f4fb;
    --mbz-warning: #f59e0b;
    --mbz-warning-soft: #fef3e2;
    --mbz-danger: #e11d48;
    --mbz-danger-soft: #fde8ed;
    --mbz-violet: #7c3aed;
    --mbz-violet-soft: #f0e9fd;
    --mbz-text: #1b2333;
    --mbz-text-muted: #6b7280;
    --mbz-border: #e7eaf1;
    --mbz-radius-lg: 20px;
    --mbz-radius: 16px;
    --mbz-radius-sm: 12px;
    --mbz-nav-h: 64px;
    --mbz-max-w: 480px;
}

* { box-sizing: border-box; }

html, body {
    background: var(--mbz-bg);
    color: var(--mbz-text);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

a { text-decoration: none; }

.mbz-app {
    max-width: var(--mbz-max-w);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--mbz-bg);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ---- Splash / guest screens ---- */
.mbz-splash {
    min-height: 100vh;
    background: radial-gradient(120% 90% at 15% 0%, #24399c 0%, var(--mbz-primary-dark) 60%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 28px 40px;
    text-align: left;
}
.mbz-splash__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.mbz-splash__brand img { width: 40px; height: 40px; border-radius: 10px; }
.mbz-splash__brand span { font-size: 22px; font-weight: 700; }
.mbz-splash__title { font-size: 30px; font-weight: 700; line-height: 1.25; margin-bottom: 10px; }
.mbz-splash__subtitle { color: rgba(255,255,255,.75); font-size: 14.5px; max-width: 300px; }
.mbz-splash__actions { display: flex; flex-direction: column; gap: 14px; margin-top: 40px; }

/* ---- Auth cards (login) ---- */
.mbz-auth-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px; background: var(--mbz-bg); }
.mbz-auth-card { background: var(--mbz-surface); border-radius: var(--mbz-radius-lg); padding: 28px 24px; box-shadow: 0 10px 30px rgba(22,34,74,.08); }

/* ---- Buttons ---- */
.mbz-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: 999px; padding: 13px 22px; font-weight: 600; font-size: 15px;
    cursor: pointer; width: 100%;
}
.mbz-btn-primary { background: var(--mbz-primary); color: #fff; }
.mbz-btn-primary:active { background: #2249d6; }
.mbz-btn-light { background: #fff; color: var(--mbz-primary-dark); }
.mbz-btn-outline-light { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.mbz-btn-soft { background: var(--mbz-primary-soft); color: var(--mbz-primary); }
.mbz-btn-sm { width: auto; padding: 8px 16px; font-size: 13.5px; }

/* ---- Topbar (inner pages) ---- */
.mbz-topbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--mbz-surface); border-bottom: 1px solid var(--mbz-border);
    display: flex; align-items: center; gap: 10px; padding: 14px 16px;
}
.mbz-topbar__back {
    width: 34px; height: 34px; border-radius: 50%; background: var(--mbz-bg);
    display: flex; align-items: center; justify-content: center; color: var(--mbz-text); flex-shrink: 0;
}
.mbz-topbar__title { font-size: 17px; font-weight: 600; margin: 0; flex: 1; }
.mbz-topbar__action { color: var(--mbz-primary); font-size: 14px; font-weight: 600; }

/* ---- Page shell ---- */
.mbz-page { padding: 16px 16px calc(var(--mbz-nav-h) + 28px); flex: 1; }
.mbz-page--no-nav { padding-bottom: 28px; }

/* ---- Hero card (dashboard greeting) ---- */
.mbz-hero {
    background: linear-gradient(135deg, #3b63f0 0%, var(--mbz-primary-dark) 100%);
    color: #fff; border-radius: var(--mbz-radius-lg); padding: 22px 20px; margin-bottom: 16px;
}
.mbz-hero__greeting { font-size: 13.5px; color: rgba(255,255,255,.75); margin: 0 0 2px; }
.mbz-hero__name { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.mbz-hero__sub { font-size: 13px; color: rgba(255,255,255,.75); margin: 0 0 16px; }
.mbz-hero__actions { display: flex; gap: 10px; }
.mbz-hero__actions .mbz-btn { flex: 1; }

/* ---- KPI (Untung Bersih) headline card, Owner/Admin only ---- */
.mbz-kpi-card {
    background: linear-gradient(135deg, #3b63f0 0%, #2249d6 100%);
    color: #fff; border-radius: var(--mbz-radius); padding: 18px 20px; margin-top: 4px;
}
.mbz-kpi-card__label { font-size: 12.5px; color: rgba(255,255,255,.75); margin: 0 0 4px; }
.mbz-kpi-card__value { font-size: 24px; font-weight: 700; margin: 0; }
.mbz-kpi-card__delta { font-size: 12.5px; margin-top: 4px; display: inline-block; }
.mbz-kpi-card__delta--up { color: #bdf3cd; }
.mbz-kpi-card__delta--down { color: #ffd0d9; }

/* ---- Small count/RM tiles (3-across) ---- */
.mbz-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.mbz-tile { background: var(--mbz-surface); border-radius: var(--mbz-radius-sm); padding: 12px 10px; text-align: center; box-shadow: 0 2px 10px rgba(20,30,60,.04); }
.mbz-tile__icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.mbz-tile__label { font-size: 11px; color: var(--mbz-text-muted); margin: 0 0 2px; line-height: 1.25; }
.mbz-tile__value { font-size: 13.5px; font-weight: 700; margin: 0; }
.mbz-tile__delta { font-size: 10.5px; font-weight: 600; }
.mbz-tile__delta--up { color: var(--mbz-success); }
.mbz-tile__delta--down { color: var(--mbz-danger); }

/* tint variants shared by tiles / icon-grid / list icons */
.mbz-tint--success { background: var(--mbz-success-soft); color: var(--mbz-success); }
.mbz-tint--info    { background: var(--mbz-info-soft);    color: var(--mbz-info); }
.mbz-tint--warning  { background: var(--mbz-warning-soft); color: var(--mbz-warning); }
.mbz-tint--danger   { background: var(--mbz-danger-soft);  color: var(--mbz-danger); }
.mbz-tint--violet   { background: var(--mbz-violet-soft);  color: var(--mbz-violet); }
.mbz-tint--primary  { background: var(--mbz-primary-soft); color: var(--mbz-primary); }

/* ---- Quick-action cards (Jualan/Belian/Belanja/Aset picker + dashboard grid) ---- */
.mbz-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mbz-quick-card {
    background: var(--mbz-surface); border-radius: var(--mbz-radius); padding: 16px 14px;
    display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 10px rgba(20,30,60,.04); color: var(--mbz-text);
}
.mbz-quick-card__icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.mbz-quick-card__title { font-size: 14.5px; font-weight: 600; margin: 0; }
.mbz-quick-card__sub { font-size: 11.5px; color: var(--mbz-text-muted); margin: 2px 0 0; }

/* ---- Picker rows (Rekod Baharu full-width list) ---- */
.mbz-picker-row {
    display: flex; align-items: center; gap: 14px; background: var(--mbz-surface);
    border-radius: var(--mbz-radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(20,30,60,.04); color: var(--mbz-text);
}
.mbz-picker-row__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mbz-picker-row__title { font-size: 15px; font-weight: 600; margin: 0; }
.mbz-picker-row__sub { font-size: 12.5px; color: var(--mbz-text-muted); margin: 2px 0 0; }
.mbz-picker-row__chev { margin-inline-start: auto; color: var(--mbz-text-muted); }

/* ---- Icon grid (dashboard secondary links: Belanja/Aset/Duit/Laporan) ---- */
.mbz-icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.mbz-icon-grid__item { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--mbz-text); }
.mbz-icon-grid__icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.mbz-icon-grid__label { font-size: 11px; text-align: center; line-height: 1.2; color: var(--mbz-text); }

/* ---- Section title row ---- */
.mbz-section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 10px; }
.mbz-section-title h2 { font-size: 15px; font-weight: 600; margin: 0; }
.mbz-section-title a { font-size: 12.5px; color: var(--mbz-primary); font-weight: 600; }

/* ---- Record list rows ---- */
.mbz-list-row {
    display: flex; align-items: center; gap: 12px; background: var(--mbz-surface);
    border-radius: var(--mbz-radius-sm); padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(20,30,60,.04);
}
.mbz-list-row__icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mbz-list-row__body { min-width: 0; flex: 1; }
.mbz-list-row__title { font-size: 13.5px; font-weight: 600; margin: 0; }
.mbz-list-row__meta { font-size: 11.5px; color: var(--mbz-text-muted); margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbz-list-row__amount { font-size: 13.5px; font-weight: 700; white-space: nowrap; margin-inline-start: 8px; }

/* ---- Filter pills (Rekod Saya tabs) ---- */
.mbz-pill-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.mbz-pill-tabs::-webkit-scrollbar { display: none; }
.mbz-pill-tab {
    flex-shrink: 0; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: var(--mbz-surface); color: var(--mbz-text-muted); border: 1px solid var(--mbz-border);
}
.mbz-pill-tab.active { background: var(--mbz-primary); color: #fff; border-color: var(--mbz-primary); }

/* ---- Cards / fields (forms) ---- */
.mbz-card { background: var(--mbz-surface); border-radius: var(--mbz-radius); padding: 18px 16px; box-shadow: 0 2px 10px rgba(20,30,60,.04); margin-bottom: 14px; }
.mbz-field { margin-bottom: 18px; }
.mbz-field:last-child { margin-bottom: 0; }
.mbz-label { display: block; font-size: 13px; font-weight: 600; color: var(--mbz-text); margin-bottom: 7px; }
.mbz-hint { font-size: 12px; color: var(--mbz-text-muted); margin-top: 5px; }
.mbz-input, .mbz-select, .mbz-textarea, textarea.form-control, select.form-select, input.form-control {
    border-radius: var(--mbz-radius-sm) !important; border: 1.5px solid var(--mbz-border) !important;
    padding: 11px 14px !important; font-size: 14.5px !important; background: var(--mbz-bg) !important; color: var(--mbz-text) !important;
}
.mbz-input:focus, .form-control:focus, .form-select:focus { border-color: var(--mbz-primary) !important; box-shadow: 0 0 0 3px var(--mbz-primary-soft) !important; }
.mbz-input-group-rm { display: flex; align-items: center; background: var(--mbz-bg); border: 1.5px solid var(--mbz-border); border-radius: var(--mbz-radius-sm); padding: 0 4px 0 14px; }
.mbz-input-group-rm span { font-size: 14px; color: var(--mbz-text-muted); font-weight: 600; }
.mbz-input-group-rm input { border: none !important; background: transparent !important; box-shadow: none !important; }

/* ---- Segmented toggle (Kos Barang | Aset) ---- */
.mbz-toggle-group { display: flex; background: var(--mbz-bg); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.mbz-toggle-group button {
    flex: 1; border: none; background: transparent; border-radius: 999px; padding: 9px 0; font-size: 13.5px; font-weight: 600; color: var(--mbz-text-muted);
}
.mbz-toggle-group button.active { background: var(--mbz-primary); color: #fff; }

/* ---- Payment split rows (account checklist w/ amount) ---- */
.mbz-pay-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--mbz-border); }
.mbz-pay-row:last-child { border-bottom: none; }
.mbz-pay-row__icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mbz-pay-row__label { flex: 1; font-size: 14px; font-weight: 500; min-width: 0; }
.mbz-pay-row__amount { width: 108px; }
.mbz-pay-row__amount input { text-align: right; }
.mbz-pay-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--mbz-success); flex-shrink: 0; }

/* ---- Bottom navigation ---- */
.mbz-bottom-nav {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: var(--mbz-max-w);
    background: var(--mbz-surface); border-top: 1px solid var(--mbz-border); height: var(--mbz-nav-h);
    display: flex; z-index: 30; box-shadow: 0 -4px 16px rgba(20,30,60,.05);
}
.mbz-bottom-nav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--mbz-text-muted); font-size: 10.5px; font-weight: 600;
}
.mbz-bottom-nav__item.active { color: var(--mbz-primary); }
.mbz-bottom-nav__item svg { width: 21px; height: 21px; }

/* ---- Menu rows (Lagi page) ---- */
.mbz-menu-row {
    display: flex; align-items: center; gap: 14px; background: var(--mbz-surface); border-radius: var(--mbz-radius-sm);
    padding: 14px 16px; margin-bottom: 10px; color: var(--mbz-text);
}
.mbz-menu-row__icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--mbz-bg); color: var(--mbz-text-muted); }
.mbz-menu-row__label { font-size: 14px; font-weight: 500; flex: 1; }
.mbz-menu-row__chev { color: var(--mbz-text-muted); }
.mbz-profile-card { display: flex; align-items: center; gap: 14px; background: var(--mbz-surface); border-radius: var(--mbz-radius); padding: 18px 16px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(20,30,60,.04); }
.mbz-profile-avatar { width: 50px; height: 50px; border-radius: 50%; background: var(--mbz-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.mbz-profile-name { font-size: 15.5px; font-weight: 700; margin: 0; }
.mbz-profile-role { font-size: 12.5px; color: var(--mbz-text-muted); margin: 1px 0 0; }

/* ---- Alerts / flash / empty state ---- */
.mbz-alert { border-radius: var(--mbz-radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px; }
.mbz-alert--danger { background: var(--mbz-danger-soft); color: #9f1239; }
.mbz-alert--success { background: var(--mbz-success-soft); color: #14532d; }
.mbz-alert--warning { background: var(--mbz-warning-soft); color: #92400e; }
.mbz-empty { text-align: center; color: var(--mbz-text-muted); font-size: 13.5px; padding: 28px 10px; }

/* ---- Install banner ---- */
.mbz-install-banner {
    display: flex; align-items: center; gap: 12px; background: var(--mbz-primary-soft); border-radius: var(--mbz-radius-sm);
    padding: 12px 14px; margin-bottom: 16px;
}
.mbz-install-banner__text { flex: 1; font-size: 12.5px; color: var(--mbz-primary-dark); }
.mbz-install-banner__text b { display: block; font-size: 13.5px; margin-bottom: 1px; }

/* ---- Report grid tile (Laporan hub) ---- */
.mbz-report-tile { position: relative; }
.mbz-report-tile__soon {
    position: absolute; top: 6px; right: 6px; background: var(--mbz-text-muted); color: #fff;
    font-size: 8.5px; font-weight: 700; padding: 2px 6px; border-radius: 999px; letter-spacing: .02em;
}

/* ---- Pakej Saya -- bar penggunaan kuota bulanan per-modul (rujuk
   business_usage_summary() dalam includes/function.php). ---- */
.mbz-quota-row { padding: 12px 0; border-bottom: 1px solid var(--mbz-border); }
.mbz-quota-row:last-child { border-bottom: none; }
.mbz-quota-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.mbz-quota-row__label { font-weight: 600; color: var(--mbz-text); }
.mbz-quota-row__count { color: var(--mbz-text-muted); white-space: nowrap; font-size: 12.5px; }
.mbz-quota-bar { width: 100%; height: 7px; border-radius: 999px; background: var(--mbz-bg); overflow: hidden; }
.mbz-quota-bar__fill { height: 100%; border-radius: 999px; background: var(--mbz-primary); }
.mbz-quota-bar__fill--danger { background: var(--mbz-danger); }
.mbz-quota-row__lifetime { display: block; margin-top: 5px; font-size: 11.5px; color: var(--mbz-text-muted); }

@media (min-width: 480px) {
    .mbz-app { box-shadow: 0 0 40px rgba(20,30,60,.08); min-height: 100vh; }
}
