:root {
  --bg: #f7faf9;
  --panel: #ffffff;
  --ink: #222E38;
  --muted: #525B66;
  --line: #D9E8E7;
  --brand: #37A598;
  --brand2: #222E38;
  --mint: #A7CECA;
  --light-mint: #D9E8E7;
  --secondary: #525B66;
  --danger: #a63d40;
  --success: #37A598;
  --warning-bg: #eef3f3;
  --warning-ink: #525B66;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
.app-shell { width: min(1500px, 96%); margin: 0 auto; padding: 26px 0 50px; }
header { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 22px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--brand); }
h1 { margin: 4px 0 4px; font-size: clamp(28px, 4vw, 44px); letter-spacing:-.03em; }
.brand-title .home { color:#222E38; }
.brand-title .store { color:#37A598; }
.brand-title .product { color:#222E38; font-weight:750; }
header p, .panel-title p { margin: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 30px rgba(34,46,56,.06); }
.card { padding: 18px; }
.card.highlight { border-color: #A7CECA; background: #f3f9f8; }
.card span { display:block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card strong { display:block; font-size: 24px; }
.card small { display:block; color:var(--muted); margin-top:6px; }
.negative { color: var(--danger); }
.forms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom:18px; }
.panel { padding: 20px; }
.panel-title { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:16px; }
.panel-title h2 { margin:0; font-size:20px; }
.badge { font-size: 11px; background: #D9E8E7; color: #222E38; padding: 6px 8px; border-radius: 999px; font-weight: 800; }
.badge.cashout { background: #525B66; color: #ffffff; }
label { display:block; font-size:13px; font-weight:700; margin-bottom:12px; }
.optional { color:var(--muted); font-weight:500; }
input, select, textarea { width:100%; margin-top:6px; border:1px solid #A7CECA; border-radius:10px; padding:11px 12px; background:#fff; color:var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(55,165,152,.16); border-color:var(--brand); }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
button { border:0; border-radius:10px; padding:11px 14px; cursor:pointer; font-weight:800; }
.primary { width:100%; background:var(--brand); color:#fff; }
.primary:hover { background:#2e8d82; }
.cashout-button { width:100%; background:#525B66; color:#fff; }
.cashout-button:hover { background:#222E38; }
.secondary { background:#fff; border:1px solid #A7CECA; color:var(--ink); }
.danger { background:var(--danger); color:#fff; }
.message { min-height:20px; margin-top:9px; font-size:13px; }
.message.ok { color:var(--success); }
.message.err { color:var(--danger); }
.wrap { align-items:flex-start; }
.filters { display:grid; grid-template-columns: 190px minmax(250px, 1fr) 150px; gap:8px; width:min(730px, 100%); }
.filters input, .filters select { margin-top:0; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }
table { width:100%; border-collapse:collapse; min-width:980px; }
th, td { padding:12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; font-size:13px; }
th { position:sticky; top:0; background:#f5f9f8; z-index:1; color:#525B66; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
th.amount, td.amount { text-align:right; }
.amount strong { font-size:15px; }
.money-in strong { color:var(--success); }
.money-out strong { color:#525B66; }
.type-pill, .status { display:inline-block; padding:4px 7px; border-radius:999px; font-size:11px; font-weight:800; }
.type-pill.in { background:#D9E8E7; color:#222E38; }
.type-pill.out { background:#eef0f2; color:#525B66; }
.status.active { background:#D9E8E7; color:#222E38; }
.status.void { background:#fdeaea; color:#9a1a1a; }
.row-void td { opacity:.62; background:#fff8f8; }
.mini { padding:5px 8px; font-size:11px; border:1px solid #e6b6b6; background:#fff; color:var(--danger); margin-top:5px; }
.meta { color:var(--muted); font-size:11px; margin-top:3px; }
dialog { width:min(460px, 92vw); border:0; border-radius:16px; padding:20px; box-shadow:0 25px 80px rgba(0,0,0,.25); }
dialog::backdrop { background:rgba(15,23,42,.45); }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
@media (max-width: 1100px) {
  .cards { grid-template-columns:repeat(2, 1fr); }
  .forms-grid { grid-template-columns:1fr; }
  .filters { grid-template-columns:1fr; width:100%; }
  .panel-title.wrap { flex-direction:column; }
}
@media (max-width: 560px) {
  .app-shell { width:94%; padding-top:16px; }
  header { align-items:flex-start; flex-direction:column; }
  .cards { grid-template-columns:1fr 1fr; }
  .card { padding:14px; }
  .card strong { font-size:20px; }
  .two-col { grid-template-columns:1fr; gap:0; }
}

.closeout-panel { margin-bottom: 18px; }
.closeout-badge { background:#A7CECA; color:#222E38; }
.closeout-grid { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:10px 14px; }
.closeout-grid .wide { grid-column:span 2; }
.recon-preview { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin:4px 0 14px; }
.recon-preview > div { border:1px solid var(--line); border-radius:12px; padding:12px; background:#f5f9f8; }
.recon-preview span, .recon-preview small { display:block; color:var(--muted); font-size:11px; }
.recon-preview strong { display:block; font-size:20px; margin:4px 0; }
.subsection-title { display:flex; justify-content:space-between; align-items:end; margin:24px 0 10px; }
.subsection-title h3 { margin:0 0 4px; font-size:16px; }
.subsection-title p { margin:0; color:var(--muted); font-size:12px; }
.closeout-table { min-width:1200px; }
.variance-good { color:var(--success); font-weight:800; }
.variance-bad { color:var(--danger); font-weight:800; }
.variance-neutral { color:var(--muted); font-weight:800; }
@media (max-width: 1250px) {
  .closeout-grid { grid-template-columns:repeat(3, 1fr); }
  .cards { grid-template-columns:repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .closeout-grid { grid-template-columns:1fr 1fr; }
  .closeout-grid .wide { grid-column:span 2; }
  .recon-preview { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .closeout-grid { grid-template-columns:1fr; }
  .closeout-grid .wide { grid-column:span 1; }
}


/* Reports */
.report-panel { margin-bottom:18px; }
.report-badge { background:#222E38; color:#fff; }
.report-controls { display:grid; grid-template-columns:1.2fr 1fr 1fr 1.3fr auto; gap:10px; align-items:end; }
.report-controls label { margin-bottom:0; }
.report-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding-bottom:1px; }
.compact { width:auto; }
.report-heading-line { display:flex; justify-content:space-between; gap:12px; align-items:flex-end; margin:18px 0 10px; padding-top:14px; border-top:1px solid var(--line); }
.report-heading-line strong { display:block; font-size:17px; }
.report-heading-line span { display:block; color:var(--muted); font-size:12px; margin-top:3px; }
.report-heading-line small { color:var(--muted); }
.report-summary { display:grid; grid-template-columns:repeat(6, 1fr); gap:10px; margin-bottom:18px; }
.report-stat { border:1px solid var(--line); border-radius:12px; padding:13px; background:#f9fbfb; }
.report-stat.highlight { background:#f0f8f7; border-color:var(--mint); }
.report-stat span { display:block; color:var(--muted); font-size:11px; min-height:28px; }
.report-stat strong { display:block; font-size:19px; margin-top:4px; }
.report-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.report-block { min-width:0; }
.report-block.full { grid-column:1 / -1; }
.report-table { min-width:760px; }
.cashout-breakdown { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
.cashout-breakdown .breakdown-card { border:1px solid var(--line); border-radius:12px; padding:14px; background:#f9fbfb; }
.breakdown-card span { display:block; color:var(--muted); font-size:12px; }
.breakdown-card strong { display:block; font-size:20px; margin:5px 0; }
.breakdown-card small { color:var(--muted); }
@media (max-width:1200px) {
  .report-controls { grid-template-columns:1fr 1fr 1fr; }
  .report-actions { grid-column:1 / -1; }
  .report-summary { grid-template-columns:repeat(3,1fr); }
}
@media (max-width:760px) {
  .report-controls { grid-template-columns:1fr 1fr; }
  .report-controls label:first-child, .report-controls label:nth-child(4), .report-actions { grid-column:1 / -1; }
  .report-summary { grid-template-columns:1fr 1fr; }
  .report-grid { grid-template-columns:1fr; }
  .report-block.full { grid-column:auto; }
  .cashout-breakdown { grid-template-columns:1fr; }
  .report-heading-line { align-items:flex-start; flex-direction:column; }
}
@media print {
  body { background:#fff; }
  body * { visibility:hidden; }
  #reportsPanel, #reportsPanel * { visibility:visible; }
  #reportsPanel { position:absolute; left:0; top:0; width:100%; border:0; box-shadow:none; }
  .report-controls, .report-actions, #reportMessage { display:none !important; }
  .table-wrap { overflow:visible; }
  table { min-width:0 !important; }
}


/* --- Simplified multi-view layout --- */
.main-nav {
  display:flex; gap:6px; align-items:center; overflow-x:auto; padding:6px;
  margin:0 0 18px; background:#fff; border:1px solid var(--line); border-radius:14px;
  box-shadow:0 6px 22px rgba(34,46,56,.05); scrollbar-width:none;
}
.main-nav::-webkit-scrollbar { display:none; }
.nav-tab { flex:0 0 auto; background:transparent; color:var(--muted); padding:10px 16px; border-radius:10px; white-space:nowrap; }
.nav-tab:hover { background:#f1f7f6; color:var(--ink); }
.nav-tab.active { background:var(--ink); color:#fff; }
.app-view { display:none; }
.app-view.active { display:block; animation:viewIn .14s ease-out; }
@keyframes viewIn { from { opacity:.3; transform:translateY(3px); } to { opacity:1; transform:none; } }
.view-toolbar { display:flex; justify-content:space-between; align-items:flex-end; gap:18px; margin:4px 0 14px; }
.view-toolbar h2 { margin:3px 0 3px; font-size:23px; }
.view-toolbar p { margin:0; color:var(--muted); font-size:13px; }
.view-kicker { font-size:11px; letter-spacing:.12em; font-weight:850; color:var(--brand); }
.scope-control { margin:0; min-width:220px; }
.scope-control select { margin-top:5px; }
.overview-cards { grid-template-columns:repeat(5,1fr); }
.panel-soft { border:1px solid var(--line); border-radius:16px; background:#fff; }
.quick-actions { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:14px 16px; margin-bottom:12px; }
.quick-actions-copy { min-width:145px; }
.quick-actions-copy strong, .quick-actions-copy span { display:block; }
.quick-actions-copy span { color:var(--muted); font-size:12px; margin-top:2px; }
.quick-action-buttons { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.quick-action { background:#f5f9f8; border:1px solid var(--line); color:var(--ink); padding:9px 12px; }
.quick-action:hover { border-color:var(--mint); background:#eef7f5; }
.quick-action.primary-action { background:var(--brand); color:#fff; border-color:var(--brand); }
.more-totals { margin:0 0 18px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.more-totals summary { cursor:pointer; list-style:none; padding:12px 15px; font-weight:800; font-size:13px; color:var(--muted); }
.more-totals summary::-webkit-details-marker { display:none; }
.more-totals summary::after { content:'+'; float:right; color:var(--brand); font-size:18px; line-height:14px; }
.more-totals[open] summary::after { content:'−'; }
.more-totals-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:0 12px 12px; }
.more-totals-grid .card { box-shadow:none; background:#fafcfc; }
#cashView .forms-grid { display:block; max-width:760px; margin:0 auto 18px; }
.cash-form-panel { display:none; }
.cash-form-panel.active { display:block; }
.segmented { display:flex; gap:4px; padding:4px; background:#eef4f3; border-radius:12px; border:1px solid var(--line); }
.segmented-btn { background:transparent; color:var(--muted); padding:8px 12px; border-radius:8px; white-space:nowrap; font-size:13px; }
.segmented-btn.active { background:#fff; color:var(--ink); box-shadow:0 2px 8px rgba(34,46,56,.08); }
#registerView, #reportsPanel, #logView { margin-bottom:18px; }
#registerView { max-width:1050px; margin-left:auto; margin-right:auto; }
.log-switch-row { display:flex; justify-content:space-between; gap:12px; align-items:center; margin:0 0 12px; }
.log-pane { display:none; }
.log-pane.active { display:block; }
#logView .panel-title { margin-bottom:12px; }
#logView .filters { grid-template-columns:190px minmax(220px,1fr) 150px; }
.empty-help { color:var(--muted); font-size:12px; }
@media (max-width:1150px) { .overview-cards { grid-template-columns:repeat(3,1fr); } }
@media (max-width:800px) {
  .view-toolbar { align-items:stretch; flex-direction:column; }
  .scope-control { min-width:0; width:100%; }
  .overview-cards { grid-template-columns:1fr 1fr; }
  .quick-actions { align-items:flex-start; flex-direction:column; }
  .quick-action-buttons { justify-content:flex-start; width:100%; }
  .log-switch-row { align-items:stretch; flex-direction:column; }
  .log-switch-row .secondary { width:100%; }
}
@media (max-width:560px) {
  .main-nav { margin-left:-1%; margin-right:-1%; border-radius:12px; }
  .overview-cards { grid-template-columns:1fr 1fr; gap:10px; }
  .overview-cards .card { min-height:108px; }
  .quick-action { flex:1 1 calc(50% - 8px); }
  .more-totals-grid { grid-template-columns:1fr; }
  .segmented { width:100%; }
  .segmented-btn { flex:1; }
}
@media print {
  #reportsPanel { display:block !important; }
  .main-nav { display:none !important; }
}


/* Location manager */
.location-list { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 16px; }
.location-chip { padding:7px 10px; border:1px solid var(--line); border-radius:999px; background:#f7faf9; color:var(--ink); font-size:12px; font-weight:700; }
.dialog-copy { color:var(--muted); font-size:13px; margin-top:-4px; }
.location-dialog-form { margin-top:12px; }
.location-dialog-form .dialog-actions { align-items:center; }
.location-dialog-form .message { flex:1; margin:0; }

/* Authentication + role-aware team access */
[hidden] { display:none !important; }
.auth-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(180deg,#f7fbfa 0%,#eef6f5 100%); }
.auth-card { width:min(440px,100%); background:#fff; border:1px solid var(--line); border-radius:20px; padding:28px; box-shadow:0 18px 50px rgba(34,46,56,.10); }
.auth-card .brand-title { margin:4px 0 6px; }
.auth-copy { color:var(--muted); margin:0 0 20px; }
.auth-form { border-top:1px solid var(--line); padding-top:18px; }
.auth-form h2 { margin:0 0 14px; }
.user-bar { display:flex; align-items:center; gap:12px; margin-left:auto; }
.user-bar > div { text-align:right; }
.user-bar strong, .user-bar span { display:block; }
.user-bar strong { font-size:13px; }
.user-bar span { margin-top:2px; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.04em; }
.small-button { padding:8px 10px; width:auto; }
input[readonly] { background:#f4f7f7; color:#4c5961; cursor:not-allowed; }
.team-layout { display:grid; grid-template-columns:minmax(280px,360px) minmax(0,1fr); gap:22px; align-items:start; }
.team-form { border:1px solid var(--line); border-radius:14px; padding:16px; background:#fafcfc; }
.team-form h3 { margin:0 0 12px; }
.team-list-wrap { min-width:0; }
.team-table { min-width:760px; }
.role-pill { display:inline-flex; align-items:center; padding:5px 8px; border-radius:999px; background:#eef5f4; color:var(--ink); font-weight:800; font-size:11px; }
.role-pill.owner { background:#222e38; color:#fff; }
.role-pill.manager { background:#d9e8e7; color:#222e38; }
.role-pill.employee { background:#f2f5f5; color:#525b66; }
.user-actions { display:flex; gap:6px; flex-wrap:wrap; }
.user-actions .mini { margin:0; }
.status.inactive { background:#f2f2f2; color:#777; }
@media (max-width:850px) {
  .team-layout { grid-template-columns:1fr; }
  .user-bar { width:100%; justify-content:space-between; margin-left:0; }
  .user-bar > div { text-align:left; }
}


/* Fast PIN login */
.pin-helper { margin:-4px 0 10px; color:var(--muted); font-size:11px; }
.pin-keypad { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:4px 0 12px; }
.pin-keypad button { min-height:50px; padding:10px; border:1px solid var(--line); background:#f8fbfa; color:var(--ink); border-radius:12px; font-size:18px; }
.pin-keypad button:hover, .pin-keypad button:active { background:var(--light-mint); border-color:var(--brand); }
.pin-keypad .key-action { font-size:12px; color:var(--muted); }
.auth-submit { margin-top:2px; }
@media (max-width:430px) { .auth-card { padding:20px; } .pin-keypad button { min-height:52px; } }

/* Finance + Checks modules */
.module-pane { display:none; }
.module-pane.active { display:block; }
.module-form { max-width:820px; margin:0 auto; padding:20px; }
.module-filter-row { display:grid; grid-template-columns:220px 190px minmax(240px,1fr); gap:10px; margin:0 0 14px; }
.module-report-controls { grid-template-columns:repeat(5,minmax(140px,1fr)) auto; }
.four-summary { grid-template-columns:repeat(4,1fr); }
.five-summary { grid-template-columns:repeat(5,1fr); }
.meta-inline { color:var(--muted); font-size:11px; font-weight:700; }
#expenseFields { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
#expenseFields[hidden] { display:none !important; }
#financeView, #checksView { margin-bottom:18px; }
@media (max-width:900px) {
  .module-filter-row { grid-template-columns:1fr 1fr; }
  .module-filter-row input { grid-column:1 / -1; }
  .module-report-controls { grid-template-columns:1fr 1fr; }
  .four-summary, .five-summary { grid-template-columns:1fr 1fr; }
}
@media (max-width:560px) {
  .module-tabs { overflow-x:auto; }
  .module-tabs .segmented-btn { min-width:max-content; }
  .module-filter-row, .module-report-controls, #expenseFields { grid-template-columns:1fr; }
  .module-filter-row input { grid-column:auto; }
}

/* Expanded admin/bookkeeper access */
.access-guide { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0 0 18px; }
.access-guide > div { border:1px solid var(--line); border-radius:12px; padding:12px; background:#fbfdfc; }
.access-guide strong, .access-guide span { display:block; }
.access-guide strong { margin-bottom:4px; font-size:12px; color:var(--ink); }
.access-guide span { font-size:11px; line-height:1.45; color:var(--muted); }
.role-help { margin:-2px 0 10px; padding:9px 10px; border-radius:10px; background:var(--light-mint); color:var(--secondary); font-size:11px; line-height:1.4; }
.role-pill.admin { background:#37a598; color:#fff; }
.role-pill.bookkeeper { background:#a7ceca; color:#222e38; }
.location-manager-list { display:grid; gap:8px; margin:12px 0 16px; max-height:280px; overflow:auto; }
.location-manager-row { display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid var(--line); border-radius:11px; padding:10px 11px; background:#f9fbfb; }
.location-manager-row > div:first-child { min-width:0; }
.location-manager-row strong, .location-manager-row span { display:block; }
.location-manager-row strong { font-size:12px; color:var(--ink); }
.location-manager-row span { margin-top:2px; color:var(--muted); font-size:10px; }
.location-manager-row.inactive-location { opacity:.68; background:#f4f4f4; }
.danger-outline { border-color:#d8b6b6 !important; color:#9b3535 !important; background:#fff !important; }
.danger-outline:hover { background:#fff6f6 !important; }
button[disabled] { opacity:.45; cursor:not-allowed; }
@media (max-width:900px) { .access-guide { grid-template-columns:1fr 1fr; } }
@media (max-width:520px) { .access-guide { grid-template-columns:1fr; } }

/* v1.2 quick-entry layout */
.quick-entry-form { padding:14px; }
.quick-line { display:grid; gap:9px; align-items:end; }
.quick-line label { margin:0; min-width:0; font-size:11px; }
.quick-line input, .quick-line select { margin-top:5px; min-height:42px; }
.quick-line-drop { grid-template-columns:minmax(150px,1.2fr) minmax(120px,.8fr) minmax(150px,1fr) minmax(180px,1.4fr) auto; }
.quick-line-cashout { grid-template-columns:minmax(150px,1.1fr) minmax(115px,.7fr) minmax(120px,.8fr) minmax(160px,1fr) minmax(150px,1fr) auto; }
.quick-line-register { grid-template-columns:minmax(170px,1.1fr) repeat(3,minmax(130px,.9fr)) auto; }
.quick-line-finance { grid-template-columns:minmax(150px,1fr) minmax(170px,1.2fr) minmax(130px,.9fr) minmax(115px,.7fr) minmax(170px,1.1fr) minmax(135px,.9fr) auto; }
.quick-line-check { grid-template-columns:minmax(145px,1fr) minmax(170px,1.2fr) minmax(120px,.8fr) minmax(110px,.7fr) minmax(110px,.7fr) minmax(135px,.9fr) auto; }
.quick-save { width:auto; min-width:82px; min-height:42px; margin:0; padding:10px 15px; }
.quick-more { margin-top:10px; border-top:1px solid var(--line); padding-top:8px; }
.quick-more summary { cursor:pointer; color:var(--muted); font-size:11px; font-weight:800; width:max-content; }
.quick-more-grid { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:9px; padding-top:10px; }
.quick-more-grid .wide { grid-column:span 2; }
.quick-result-strip { display:flex; gap:18px; flex-wrap:wrap; margin-top:9px; padding:8px 10px; background:#f8fbfa; border-radius:10px; color:var(--muted); font-size:11px; }
.quick-result-strip strong { color:var(--ink); margin-left:5px; }
.finance-toolbar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.screen-reader-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
#financeView .module-pane[data-finance-pane="entry"], #checksView .module-pane[data-check-pane="entry"] { max-width:none; }
#financeView .quick-entry-form, #checksView .quick-entry-form { max-width:none; }
@media (max-width:1180px) {
  .quick-line-drop, .quick-line-cashout, .quick-line-register, .quick-line-finance, .quick-line-check { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .quick-save { width:100%; }
}
@media (max-width:720px) {
  .quick-line-drop, .quick-line-cashout, .quick-line-register, .quick-line-finance, .quick-line-check { grid-template-columns:1fr 1fr; }
  .quick-more-grid { grid-template-columns:1fr 1fr; }
  .finance-toolbar-actions { width:100%; justify-content:flex-start; }
}
@media (max-width:500px) {
  .quick-line-drop, .quick-line-cashout, .quick-line-register, .quick-line-finance, .quick-line-check, .quick-more-grid { grid-template-columns:1fr; }
  .quick-more-grid .wide { grid-column:auto; }
}

/* v1.5 mobile browser experience */
html, body { max-width:100%; overflow-x:hidden; }
.mobile-nav-toggle, .mobile-nav-close, .mobile-nav-backdrop { display:none; }

@media (max-width:720px) {
  body { overflow-x:hidden; }
  .app-shell { width:100%; max-width:100%; padding:14px 12px 84px; }
  header { margin-bottom:14px; padding-left:32px; }
  header h1 { font-size:28px; }
  header p { font-size:12px; line-height:1.4; }
  .eyebrow { font-size:10px; letter-spacing:.1em; }

  .mobile-nav-toggle {
    display:flex; position:fixed; left:0; top:50%; transform:translateY(-50%); z-index:1002;
    width:38px; min-height:64px; align-items:center; justify-content:center;
    padding:0; border-radius:0 14px 14px 0; background:var(--ink); color:#fff;
    box-shadow:0 8px 24px rgba(34,46,56,.22); font-size:20px;
  }
  .mobile-nav-close {
    display:flex; width:100%; align-items:center; justify-content:space-between; gap:8px;
    padding:12px 10px; margin:0 0 8px; background:#f3f7f6; color:var(--ink); border:1px solid var(--line);
  }
  .mobile-nav-close span { margin-left:auto; font-size:12px; color:var(--muted); }
  .mobile-nav-backdrop {
    position:fixed; inset:0; z-index:999; background:rgba(34,46,56,.36); backdrop-filter:blur(2px);
  }
  body.mobile-nav-open .mobile-nav-backdrop { display:block; }
  body.mobile-nav-open .mobile-nav-toggle { opacity:0; pointer-events:none; }

  .main-nav {
    position:fixed; left:0; top:0; bottom:0; z-index:1001; width:min(292px,84vw);
    margin:0; padding:14px 12px 24px; border:0; border-right:1px solid var(--line);
    border-radius:0 18px 18px 0; box-shadow:14px 0 34px rgba(34,46,56,.18);
    display:flex; flex-direction:column; align-items:stretch; gap:5px; overflow-y:auto; overflow-x:hidden;
    transform:translateX(-104%); transition:transform .18s ease-out;
    background:#fff;
  }
  body.mobile-nav-open .main-nav { transform:translateX(0); }
  .nav-tab { width:100%; min-height:46px; text-align:left; padding:12px 14px; border-radius:10px; white-space:normal; }
  .nav-tab.active { background:var(--brand); color:#fff; }

  .view-toolbar, .compact-toolbar { gap:10px; margin-top:0; }
  .view-toolbar h2 { font-size:21px; }
  .view-toolbar p { font-size:12px; }
  .panel { padding:14px; border-radius:14px; }
  .panel-title { align-items:flex-start; }
  .quick-entry-form { padding:4px 0 0; }
  .quick-line-drop, .quick-line-cashout, .quick-line-register, .quick-line-finance, .quick-line-check,
  .quick-more-grid { grid-template-columns:1fr !important; }
  .quick-save { width:100%; min-height:48px; }
  .quick-line input, .quick-line select, input, select, textarea { min-height:46px; font-size:16px; }
  textarea { min-height:82px; }
  .quick-more summary { padding:8px 0; }
  .quick-result-strip { display:grid; grid-template-columns:1fr; gap:6px; }

  .segmented, .module-tabs {
    width:100%; display:grid; grid-template-columns:repeat(auto-fit,minmax(88px,1fr));
    gap:4px; overflow:visible;
  }
  .segmented-btn, .module-tabs .segmented-btn { min-width:0; white-space:normal; text-align:center; padding:9px 7px; font-size:12px; }

  .overview-cards, .cards, .report-summary, .four-summary, .five-summary { grid-template-columns:1fr 1fr !important; }
  .overview-cards .card, .card { min-height:auto; padding:12px; }
  .card strong { font-size:19px; }
  .card span { font-size:11px; }
  .quick-action-buttons { display:grid; grid-template-columns:1fr 1fr; width:100%; gap:7px; }
  .quick-action { width:100%; min-height:44px; }

  .filters, #logView .filters, .module-filter-row, .module-report-controls, .report-controls {
    display:grid; grid-template-columns:1fr !important; width:100%; gap:8px;
  }
  .report-controls label, .report-controls label:first-child, .report-controls label:nth-child(4), .report-actions,
  .module-filter-row input { grid-column:auto !important; }
  .report-actions { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .report-actions button { width:100%; }
  .report-grid, .cashout-breakdown { grid-template-columns:1fr !important; }

  /* Turn wide desktop tables into readable mobile record cards. */
  .table-wrap { overflow:visible; border:0; border-radius:0; }
  table, .closeout-table, .report-table, .team-table { display:block; width:100%; min-width:0 !important; }
  table thead { display:none; }
  table tbody { display:grid; gap:10px; width:100%; }
  table tr { display:block; width:100%; border:1px solid var(--line); border-radius:12px; background:#fff; overflow:hidden; box-shadow:0 3px 12px rgba(34,46,56,.04); }
  table td {
    display:grid; grid-template-columns:minmax(92px,36%) minmax(0,1fr); gap:10px;
    width:100%; padding:9px 11px; border-bottom:1px solid var(--line); text-align:right !important;
    overflow-wrap:anywhere;
  }
  table td:last-child { border-bottom:0; }
  table td::before { content:attr(data-label); text-align:left; color:var(--muted); font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.03em; }
  table td[colspan] { display:block; text-align:center !important; padding:16px 12px; }
  table td[colspan]::before { display:none; }
  table td .user-actions { justify-content:flex-end; }
  table td .mini { margin-top:0; }
  .row-void td { background:#fff8f8; }

  .team-layout { gap:12px; }
  .team-form { padding:12px; }
  .access-guide { display:none; }
  .location-manager-row { align-items:flex-start; }

  dialog { width:calc(100vw - 20px); max-width:none; max-height:90vh; overflow:auto; padding:16px; border-radius:16px; }
  .dialog-actions { flex-wrap:wrap; }
  .dialog-actions button { flex:1 1 120px; }

  .auth-shell { padding:12px; align-items:start; }
  .auth-card { margin-top:8px; padding:18px; border-radius:16px; }
  .pin-keypad { gap:7px; }
  .pin-keypad button { min-height:54px; font-size:20px; }
}

@media (max-width:430px) {
  .overview-cards, .cards, .report-summary, .four-summary, .five-summary { grid-template-columns:1fr 1fr !important; }
  .quick-action-buttons { grid-template-columns:1fr 1fr; }
  .user-bar { align-items:flex-start; }
  .user-bar .small-button { white-space:nowrap; }
  table td { grid-template-columns:88px minmax(0,1fr); }
}

/* v1.6 employee privacy + improved mobile navigation */
.mobile-bottom-nav { display:none; }
.employee-today-panel { margin-top:14px; padding:14px; }
.employee-today-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.employee-today-head h3 { margin:2px 0 0; font-size:17px; }
.privacy-note { font-size:11px; color:var(--muted); background:#f2f7f6; border:1px solid var(--line); border-radius:999px; padding:6px 9px; white-space:nowrap; }
.employee-drop-list { display:grid; gap:8px; }
.employee-drop-card { display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px solid var(--line); background:#fff; border-radius:11px; padding:10px 12px; }
.employee-drop-card > div { min-width:0; }
.employee-drop-card > div strong, .employee-drop-card > div span { display:block; }
.employee-drop-card > div span { margin-top:3px; font-size:11px; color:var(--muted); overflow-wrap:anywhere; }
.employee-drop-card > strong { flex:0 0 auto; font-size:15px; }
.employee-drop-empty { padding:14px; color:var(--muted); text-align:center; border:1px dashed var(--line); border-radius:10px; background:#fafcfc; font-size:12px; }

@media (max-width:720px) {
  .app-shell { padding-bottom:104px; }
  header { padding-left:0; }
  .mobile-nav-toggle { display:none !important; }

  .mobile-bottom-nav {
    display:grid; grid-template-columns:repeat(5,1fr); position:fixed; z-index:1003;
    left:10px; right:10px; bottom:max(10px, env(safe-area-inset-bottom));
    background:rgba(255,255,255,.96); backdrop-filter:blur(14px);
    border:1px solid var(--line); border-radius:18px; padding:6px;
    box-shadow:0 12px 34px rgba(34,46,56,.18);
  }
  .mobile-bottom-nav button {
    min-width:0; min-height:54px; padding:6px 4px; border-radius:12px; background:transparent; color:var(--muted);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-weight:800;
  }
  .mobile-bottom-nav button span { font-size:18px; line-height:1; }
  .mobile-bottom-nav button small { font-size:9px; letter-spacing:.01em; }
  .mobile-bottom-nav button.active { background:#edf7f5; color:var(--brand); }
  body.mobile-nav-open .mobile-bottom-nav { opacity:.2; pointer-events:none; }

  .main-nav {
    top:auto; bottom:0; width:100%; max-height:72vh; height:auto;
    border-right:0; border-top:1px solid var(--line); border-radius:20px 20px 0 0;
    box-shadow:0 -14px 34px rgba(34,46,56,.18);
    transform:translateY(104%); transition:transform .18s ease-out;
    padding:12px 12px calc(22px + env(safe-area-inset-bottom));
  }
  body.mobile-nav-open .main-nav { transform:translateY(0); }
  .mobile-nav-close { position:sticky; top:0; z-index:2; background:#fff; }
  .nav-tab { min-height:44px; }

  .employee-today-head { align-items:flex-start; }
  .privacy-note { white-space:normal; text-align:right; }
  .employee-drop-card { align-items:flex-start; }
}
