:root {
  --app-sidebar-width: 220px;
  --app-bg: #f4f6f8;
}

body {
  background: var(--app-bg);
  min-height: 100vh;
}

.min-w-0 {
  min-width: 0;
}

.app-navbar {
  flex-wrap: nowrap;
}

.app-navbar .form-select {
  min-width: 7.5rem;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 16px;
}

@media (min-width: 768px) {
  .app-sidebar {
    width: var(--app-sidebar-width);
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #dee2e6;
    padding: 0.75rem;
  }

  .app-main {
    padding: 1.5rem;
  }
}

.auth-main {
  max-width: 420px;
  margin: 8vh auto 2rem;
  padding: 0 16px;
}

/* Settings tabs scroll sideways on phones without a vertical scrollbar. */
.settings-tabs {
  overflow-x: auto;
  overflow-y: hidden;
}

/* Narrow single-purpose cards (cancel forms). */
.narrow-card {
  max-width: 40rem;
}

/* Sales lines: inputs stay usable on phones. */
/* Keeps absolutely positioned children (visually-hidden labels) inside the scroll box, so wide tables
   scroll on their own instead of widening the whole page on phones. */
.table-responsive {
  position: relative;
}

.sales-lines td {
  min-width: 5.5rem;
}

.sales-lines td:first-child {
  min-width: 14rem;
}

/* Payments: keep the mode / amount boxes usable on phones (the table scrolls inside its card). */
.pay-lines select { min-width: 7.5rem; }
.pay-lines input { min-width: 7rem; }
.alloc-table input { min-width: 6.5rem; }
.alloc-table td { white-space: nowrap; }

/* Inventory line tables (M12) */
.inv-col-item { min-width: 14rem; }
.inv-col-qty { min-width: 6rem; }
.inv-col-cost { min-width: 7rem; }
.inv-col-note { min-width: 10rem; }

/* Reports (M14) */
.report-table td, .report-table th { white-space: nowrap; }
.report-table td.report-wrap { white-space: normal; min-width: 10rem; }
@media print {
  .app-navbar, .app-sidebar, .d-print-none { display: none !important; }
  .app-main { padding: 0 !important; }
  .report-table { font-size: 0.75rem; }
}

/* Dashboard: 7-day sales bars (a <progress> element, so no inline width is needed under the CSP). */
.dash-bar { width: 100%; height: .6rem; accent-color: var(--bs-primary); vertical-align: middle; }

/* Settings → Invoice and branding: logo preview. */
.brand-logo-preview {
  max-width: 100%;
  max-height: 90px;
  border: 1px solid var(--bs-border-color);
  padding: 4px;
  background: #fff;
}
