* { box-sizing: border-box; }
/* Author display rules (flex overlays below) beat the UA [hidden] rule,
   so hidden must win explicitly — otherwise a hidden overlay still
   intercepts taps. */
[hidden] { display: none !important; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #eef1f4; color: #1c2430; }
.app { max-width: 430px; margin: 0 auto; background: #f7f8fa; min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.head { background: #fff; color: #1c2430; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e2e7ec; position: sticky; top: 0; z-index: 20; }
.head-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.head-logo { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.head-title { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-sub { font-size: 12px; color: #5b6b7d; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-actions { display: flex; gap: 6px; }
.icon-btn { background: #eef1f4; color: #1c2430; border: none; border-radius: 11px; font-size: 19px; padding: 9px 12px; cursor: pointer; }
main { padding: 14px; flex: 1; }
h2 { font-size: 20px; margin: 6px 0 10px; }
.muted { color: #5b6b7d; font-size: 14px; margin: 0 0 14px; }
.search { width: 100%; padding: 13px 14px; font-size: 16px; border: 2px solid #d5dce4; border-radius: 12px; margin-bottom: 12px; background: #fff; }
.section { font-size: 14px; font-weight: 800; margin: 18px 0 8px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid #e2e7ec; border-radius: 12px; margin-bottom: 8px; background: #fff; cursor: pointer; }
.row small { color: #5b6b7d; display: block; font-size: 13px; }
.row .rname { font-weight: 700; }
.badge { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.red { background: #fdecec; color: #c0392b; } .green { background: #e6f6ec; color: #1a7a3a; }
.amber { background: #fef3d8; color: #8a5a00; } .blue { background: #e8efff; color: #1d4ed8; }
.btn { display: block; width: 100%; text-align: center; padding: 15px; font-size: 17px; font-weight: 700; border: none; border-radius: 14px; margin: 10px 0; cursor: pointer; }
.btn-dark { background: #14213d; color: #fff; } .btn-green { background: #1a9e4b; color: #fff; }
.btn-blue { background: #2563eb; color: #fff; }
.btn-light { background: #eef1f4; color: #1c2430; }
.btn-danger { background: #fdecec; color: #c0392b; }
.btn.inline { width: auto; display: inline-block; padding: 11px 16px; margin: 0; font-size: 15px; }
.btn:disabled { opacity: .5; }
.btn-outline { background: #fff; color: #2563eb; border: 2px solid #2563eb; padding: 12px; font-size: 15px; }
.btn-red-outline { background: #fff; color: #c0392b; border: 2px solid #e57373; padding: 12px; font-size: 15px; }

/* dashboard tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.tile { border-radius: 16px; padding: 14px 12px; background: #fff; border: 1px solid #e2e7ec; }
.tile b { font-size: 24px; display: block; }
.tile span { font-size: 13px; color: #5b6b7d; font-weight: 600; }
.tile small { display: block; font-size: 12px; color: #8a94a3; margin-top: 2px; }
.tile.warn b { color: #c0392b; }
.tile.alert { background: #fdecec; } .tile.alert b { color: #c0392b; }

/* filter pills */
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.pill { flex-shrink: 0; font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 999px; border: 2px solid #d5dce4; background: #fff; color: #1c2430; cursor: pointer; }
.pill.active { background: #14213d; color: #fff; border-color: #14213d; }

/* spot cards (mockup) */
.spot-card { position: relative; background: #fff; border: 1px solid #e2e7ec; border-radius: 16px; padding: 14px 14px 14px 20px; margin-bottom: 12px; overflow: hidden; cursor: pointer; }
.spot-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: #2563eb; }
.spot-card.avail::before { background: #1a9e4b; }
.spot-card.overdue::before { background: #d64545; }
.spot-card .card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.spot-card .card-code { font-weight: 800; font-size: 17px; }
.spot-card .card-line { color: #5b6b7d; font-size: 14px; margin-top: 3px; }
.spot-card .card-renter { font-weight: 700; font-size: 15px; margin-top: 6px; }
.spot-card .card-money { font-weight: 800; font-size: 17px; margin-top: 4px; }
.spot-card .card-money.red-text { color: #c0392b; }
.spot-card .late-text { color: #c0392b; font-weight: 700; font-size: 14px; }
.card-btns { display: flex; gap: 8px; margin-top: 12px; }
.card-btns .btn { margin: 0; flex: 1; }
.status-pill { font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.status-pill.avail { background: #e6f6ec; color: #1a7a3a; }
.status-pill.occ { background: #e8efff; color: #1d4ed8; }
.status-pill.over { background: #fdecec; color: #c0392b; }

/* FAB */

/* bottom nav */
.nav { display: flex; border-top: 1px solid #e2e7ec; position: sticky; bottom: 0; background: #fff; z-index: 20; }
.nav button { flex: 1; text-align: center; padding: 12px 0 14px; font-size: 12px; font-weight: 700; color: #5b6b7d; background: none; border: none; cursor: pointer; }
.nav button.active { color: #2563eb; }

/* menu drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; }
.drawer { background: #fff; width: 280px; max-width: 80vw; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.drawer-title { font-weight: 800; font-size: 16px; padding: 6px 8px 14px; border-bottom: 1px solid #eef1f4; margin-bottom: 8px; }
.drawer-item { text-align: left; background: none; border: none; font-size: 16px; font-weight: 600; padding: 13px 8px; border-radius: 10px; cursor: pointer; color: #1c2430; }
.drawer-item:active { background: #eef1f4; }
.drawer-item.danger { color: #c0392b; }

/* payment sheet */
.sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 430px; border-radius: 22px 22px 0 0; padding: 20px 16px 26px; max-height: 92vh; overflow-y: auto; }
.sheet-title { font-weight: 800; font-size: 19px; }
.sheet-sub { color: #5b6b7d; font-size: 14px; margin: 4px 0 14px; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1; }
.segmented { display: flex; gap: 0; border: 2px solid #d5dce4; border-radius: 12px; overflow: hidden; }
.seg { flex: 1; padding: 12px 4px; font-size: 15px; font-weight: 700; background: #fff; border: none; color: #5b6b7d; cursor: pointer; }
.seg.active { background: #2563eb; color: #fff; }

/* detail screen */
.back-btn { background: none; border: none; font-size: 22px; padding: 2px 8px 2px 0; cursor: pointer; color: #1c2430; }
.detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-head h2 { margin: 0; flex: 1; }
.photo-area { background: #fff; border: 2px dashed #c3ccd6; border-radius: 16px; padding: 14px; text-align: center; color: #5b6b7d; font-size: 14px; margin-bottom: 14px; cursor: pointer; }
.photo-area img { width: 100%; border-radius: 10px; display: block; }
.detail-card { background: #fff; border: 1px solid #e2e7ec; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.detail-card h3 { font-size: 15px; margin: 0 0 10px; }
.balance-big { text-align: center; padding: 6px 0 2px; }
.balance-big .amt { font-size: 40px; font-weight: 800; color: #2563eb; }
.balance-big .lbl { color: #5b6b7d; font-size: 13px; margin-top: 2px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-grid .btn { margin: 0; padding: 13px 6px; font-size: 14px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #e8efff; color: #1d4ed8; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; flex: none; }
.avatar.red-bg { background: #fdecec; color: #c0392b; }
.activity-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef1f4; font-size: 14px; }
.activity-item:last-child { border-bottom: none; }
.activity-item .when { color: #8a94a3; font-size: 12px; white-space: nowrap; }
.activity-item .what b { font-size: 14px; }

/* carried-over shared pieces */
.overdue-banner { background: #c0392b; color: #fff; border-radius: 12px; padding: 13px; font-size: 15px; margin-bottom: 12px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #eef1f4; font-size: 15px; gap: 12px; }
.kv:last-child { border-bottom: none; }
.kv span:last-child { font-weight: 600; text-align: right; }
.kv a { color: #2563eb; text-decoration: none; }
.grid-zone { margin-bottom: 14px; }
.grid-zone h4 { margin: 0 0 6px; font-size: 14px; }
.spots { display: flex; flex-wrap: wrap; gap: 8px; }
.spot { width: 52px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; border: none; cursor: pointer; }
.spot.avail { background: #1a9e4b; } .spot.taken { background: #d64545; }
.map { position: relative; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.map img { width: 100%; display: block; }
.mapchip { position: absolute; background: rgba(20,33,61,.92); color: #fff; font-weight: 800; font-size: 20px; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; cursor: pointer; }
.field { margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 700; display: block; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 13px; font-size: 16px; border: 2px solid #d5dce4; border-radius: 12px; background: #fff; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 2px solid #d5dce4; border-radius: 12px; margin-bottom: 12px; font-size: 16px; background: #fff; }
.toggle { font-weight: 800; border: none; background: none; font-size: 16px; cursor: pointer; }
.toggle.on { color: #1a7a3a; } .toggle.off { color: #8a94a3; }
.calc { background: #eef4ff; border-radius: 12px; padding: 13px; font-size: 15px; margin-bottom: 12px; }
.calc b { font-size: 19px; }
.sitebar { display: flex; gap: 8px; padding: 10px 14px 0; overflow-x: auto; background: #f7f8fa; align-items: center; }
.sitebtn { flex-shrink: 0; font-weight: 800; font-size: 15px; padding: 10px 16px; border-radius: 999px; border: 2px solid #d5dce4; background: #fff; color: #1c2430; cursor: pointer; }
.sitebtn.active { background: #14213d; color: #fff; border-color: #14213d; }
.sitebtn.add { border-style: dashed; color: #5b6b7d; }
.siteadd { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 4px; }
.siteadd input[type="text"] { flex: 1; min-width: 160px; padding: 12px; font-size: 16px; border: 2px solid #d5dce4; border-radius: 12px; }
.siteadd input[type="file"] { flex-basis: 100%; font-size: 14px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { font-weight: 800; font-size: 16px; width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; background: rgba(20,33,61,.92); color: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.photo-box { background: #fff; border: 2px dashed #c3ccd6; border-radius: 12px; padding: 16px 12px; text-align: center; color: #5b6b7d; font-size: 14px; margin-bottom: 12px; }
.photo-box img { width: 100%; border-radius: 8px; display: block; }
.note { font-size: 13px; color: #5b6b7d; margin-top: 10px; }
.error { background: #fdecec; color: #c0392b; border-radius: 12px; padding: 12px; font-size: 15px; margin-bottom: 12px; font-weight: 600; }
.empty { color: #5b6b7d; font-size: 15px; padding: 8px 0; }
.row-inline { display: flex; gap: 8px; align-items: stretch; }
.row-inline select, .row-inline input { flex: 1; }
.radio-row { display: flex; gap: 16px; margin: 8px 0 12px; font-size: 16px; }
.radio-row label { display: flex; gap: 6px; align-items: center; }
.login-logo { display: block; width: 200px; max-width: 70%; margin: 14px auto 2px; }

/* ---- PDF-2 additions (v4) ---- */
.loading-bar { background: #e8efff; color: #1d4ed8; font-size: 13px; font-weight: 700; text-align: center; padding: 6px; }
.offline-banner { background: #fef3d8; color: #8a5a00; font-size: 13px; font-weight: 700; text-align: center; padding: 8px 14px; }
.warn-banner { background: #fef3d8; color: #8a5a00; border-radius: 12px; padding: 13px; font-size: 15px; margin-bottom: 12px; font-weight: 600; }
.icon-btn { position: relative; }
.icon-btn.has-unread::after { content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #c0392b; }
.seg-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.seg-row .segmented { flex: 1; }
.spot.taken { background: #2563eb; }
.spot.over { background: #c0392b; }
.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-row { text-align: left; background: #fff; border: 1px solid #e2e7ec; font-size: 16px; font-weight: 600; padding: 15px 14px; border-radius: 12px; cursor: pointer; color: #1c2430; }
.menu-row.danger { color: #c0392b; }
.wiz-steps { display: flex; gap: 6px; margin-bottom: 14px; }
.wiz-step { flex: 1; text-align: center; font-size: 13px; font-weight: 700; padding: 8px 4px; border-radius: 999px; background: #eef1f4; color: #5b6b7d; }
.wiz-step.active { background: #2563eb; color: #fff; }
.wiz-step.done { background: #e6f6ec; color: #1a7a3a; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid #d5dce4; border-radius: 12px; margin-bottom: 12px; background: #fff; font-size: 16px; }
.check-row input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.receipt-card { background: #fff; border: 1px solid #e2e7ec; border-radius: 16px; padding: 18px; text-align: center; margin-bottom: 12px; }
.receipt-card .amt { font-size: 36px; font-weight: 800; color: #1a7a3a; }
.doc-preview { background: #fff; border: 1px solid #e2e7ec; border-radius: 16px; padding: 16px; font-size: 15px; margin-bottom: 12px; }
.doc-preview h1 { font-size: 19px; }
.doc-preview h2 { font-size: 15px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.bar-row .bar-label { width: 72px; flex: none; color: #5b6b7d; }
.bar-row .bar { height: 18px; background: #2563eb; border-radius: 6px; }
.bar-row .bar-val { font-weight: 700; white-space: nowrap; }
.field input[type="checkbox"], .row-inline input[type="checkbox"] { width: auto; padding: 0; }
.call-row { display: flex; gap: 8px; margin-bottom: 12px; }
.call-row .btn { margin: 0; flex: 1; }

/* Mock-icon system (PDF mock line icons) + mock-consistent details */
.ic{display:inline-flex;vertical-align:-4px}
.ic svg{width:20px;height:20px}
.ic-svg{width:20px;height:20px;vertical-align:-4px}
.btn .ic-svg,.toggle-row .ic-svg,.call-row .btn .ic-svg,.quick-grid .btn .ic-svg,.overdue-banner .ic-svg{width:18px;height:18px}
.photo-box .ic-svg{width:28px;height:28px}
.act-ic .ic-svg{width:20px;height:20px}
.nav button{display:flex;flex-direction:column;align-items:center;gap:2px;padding:10px 0 12px}
.nav .ic svg{width:24px;height:24px}
.icon-btn .ic svg{width:22px;height:22px}
.btn .ic svg{width:18px;height:18px}
.btn .ic{margin-right:6px}
.menu-row .ic,.drawer-item .ic{margin-right:8px}
.toggle-row .ic svg{width:18px;height:18px}
.photo-box .ic svg{width:28px;height:28px}
.overdue-banner .ic svg{width:18px;height:18px}
.call-row .btn .ic svg{width:18px;height:18px}
.quick-grid .btn .ic svg{width:18px;height:18px}
.search{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235b6b7d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:12px center;padding-left:36px}
.tile-ic{display:block;margin-bottom:2px}
.tile-ic svg{width:22px;height:22px}
.tile span.tile-ic{font-size:inherit;font-weight:400}
.tile .t-green{color:#1a7a3a}.tile .t-blue{color:#2563eb}.tile .t-amber{color:#b45309}.tile .t-red{color:#c0392b}
.trend-up{color:#1a7a3a!important}.trend-down{color:#c0392b!important}
.new-rental-bar{width:100%;margin:10px 0 2px}
.act-ic{color:#1a7a3a;flex-shrink:0}
.act-ic svg{width:20px;height:20px}
