/* Readable sizing and shared appearance tokens. Print output stays on white paper. */
:root {
  --surface: #ffffff;
  --surface-soft: #f0f4e9;
  --text: #25372c;
  --text-secondary: #586953;
  --text-muted: #697664;
  --border: #dce4d5;
  --muted: #697664;
  --focus: #517b60;
  --accent-text: #315c3e;
}
body { font-size: 17px; }
input::placeholder { color: var(--text-muted); opacity: 1; }
input, select, textarea { font-size: 16px; }
.btn { min-height: 46px; font-size: 15px; }
.icon-btn { min-width: 40px; min-height: 40px; }
.panel-heading h2 { font-size: 20px; }
.panel-heading p, .page-heading p { font-size: 15px; color: var(--text-muted); }
.page-heading h1 { font-size: 34px; }
.eyebrow, .nav-label { color: var(--text-muted); }
.brand small { font-size: 9px; letter-spacing: .6px; }
.brand { font-size: 19px; }
.sidebar { width: 272px; }
.main-shell { margin-left: 272px; width: calc(100% - 272px); }
nav a { font-size: 15px; padding: 12px; gap: 10px; }
nav a b { font-size: 12px; }
.store-picker select { font-size: 16px; }
.store-picker > .small:first-child { font-size: 11px; }
.account b { font-size: 15px; }
.account small { font-size: 13px; }
.help-card { padding: 14px; }
.help-card b, .help-card p { font-size: 13px; }
.sidebar-bottom { padding-top: 22px; }
.topbar { gap: 12px; }
.topbar-right { gap: 12px; }
.connection, .role-chip { font-size: 13px; }
.breadcrumb { font-size: 14px; }
.badge { font-size: 12px; }
.stat-label { color: var(--text-secondary); font-size: 15px; }
.stat small { color: var(--text-muted); font-size: 13px; }
.stat > strong { font-size: 30px; }
.stat.featured .stat-label { color: #e0efd0; }
.stat.featured small { color: #c8dbb9; }
.stat.featured > strong { color: #f5fbea; }
table { font-size: 15px; }
th { color: var(--text-secondary); font-size: 13px; }
td, td b { color: var(--text); font-size: 15px; }
td small { color: var(--text-muted); font-size: 13px; }
.dashboard-grid td, .dashboard-grid td b { font-size: 14px; }
.alert-row b, .top-product b, .top-product strong { font-size: 14px; }
.alert-row small, .top-product small { font-size: 13px; }
.alert-row b { white-space: normal; }
.top-product { gap: 10px; }
.top-product strong { white-space: nowrap; }
.bottom-metrics > span, .bottom-metrics b { font-size: 14px; }
.filter-bar > select, .search-field input, .filter-bar > .check-label { font-size: 15px; }
.notice, .toast, .empty p { font-size: 15px; color: var(--text-secondary); }
.notice, .notice.soft { background: var(--surface-soft); border-color: var(--border); }
label, dialog input, dialog select { font-size: 16px; }
.empty h3 { font-size: 19px; }
.receipt td, .receipt th { font-size: 14px; }
.receipt small { font-size: 12px; }
.receipt-total { font-size: 16px; }
.receipt > p { font-size: 14px; }
.receipt .receipt-id { font-size: 11px; }
.success-banner { font-size: 15px; }
.payment-due strong { font-size: 42px; }
.change-display { font-size: 16px; }
.change-display strong { font-size: 28px; }
.quick-cash .btn { font-size: 15px; }
.payment-due { padding: 16px; }
.change-display { padding: 15px; margin: 15px 0; }
#payment-help { margin-bottom: 14px; }
.modal-heading { position: sticky; top: 0; z-index: 2; background: var(--surface); }

/* A barcode field and a bill: no catalog browsing at the counter. */
.checkout-entry { margin-bottom: 22px; }
.checkout-entry .scan-banner { padding: 18px 22px; }
.checkout-entry .scan-banner b { font-size: 18px; }
.checkout-entry .scan-banner small { font-size: 14px; }
.checkout-entry .scan-form { padding: 18px 22px 8px; }
#barcode-input { font-size: 22px; min-height: 56px; letter-spacing: .5px; background: var(--surface); }
.scan-form .btn { min-height: 56px; padding-inline: 22px; font-size: 17px; }
.scan-hint { margin: 0; padding: 4px 22px 18px; font-size: 13px; color: var(--text-muted); }
.scan-hint span { margin: 0 10px; }
.scan-hint kbd { font-family: inherit; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-secondary); }
.barcode-bill { position: static; }
.bill-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.barcode-bill #bill-items { min-height: 270px; max-height: 450px; padding: 0 24px; }
.barcode-bill .bill-bottom { border-top: 0; border-left: 1px solid var(--border); background: var(--surface-soft); padding: 24px; }
.barcode-bill .bill-item-title b { font-size: 18px; color: var(--text); }
.barcode-bill .bill-item > small { font-size: 14px; }
.barcode-bill .bill-item-bottom strong { font-size: 20px; color: var(--text); }
.bill-subtotal, .bill-total span { font-size: 17px; color: var(--text-secondary); }
.bill-total strong { font-size: 32px; }
.bill-bottom > .small, .bill-bottom p { font-size: 13px; }
.stepper { height: 40px; border-color: var(--border); }
.stepper button { width: 40px; height: 38px; font-size: 22px; }
.stepper span { min-width: 40px; font-size: 17px; }
.remove-item { width: 32px; height: 32px; }
.pay-button { min-height: 54px; font-size: 17px; }
.pay-button kbd { font-size: 12px; }
.barcode-bill .empty { padding: 48px 24px; }
.barcode-bill .empty p { max-width: 390px; }
@media (min-width: 1101px) {
  .checkout-entry { display: grid; grid-template-columns: 235px minmax(0, 1fr); }
  .checkout-entry .scan-banner { border: 0; background: transparent; padding: 16px 20px; }
  .checkout-entry .scan-banner small, .checkout-entry .scan-banner .badge { display: none; }
  .checkout-entry .scan-form { align-self: center; padding: 16px 20px 12px 0; }
  .checkout-entry .scan-hint { grid-column: 1 / -1; padding-bottom: 14px; }
  .barcode-bill .bill-bottom { padding: 20px; }
  .barcode-bill .bill-total { margin: 12px 0; padding-top: 12px; }
}

/* All roles can change this browser's appearance without manager access. */
.appearance-panel { max-width: 980px; }
.theme-options { padding: 8px 24px 24px; margin: 0; border: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.theme-options legend { margin: 8px 0 18px; font-size: 16px; color: var(--text-secondary); padding: 0; }
.theme-option { position: relative; border: 2px solid var(--border); border-radius: 12px; padding: 18px; margin: 0; cursor: pointer; display: flex; gap: 12px; }
.theme-option:has(input:checked) { border-color: var(--focus); background: var(--surface-soft); }
.theme-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.theme-option input { width: 20px; height: 20px; min-height: 0; accent-color: var(--focus); position: absolute; right: 14px; top: 14px; }
.theme-title { font-size: 18px; color: var(--text); }
.theme-description { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.theme-swatch { width: 100%; height: 94px; padding: 18px; display: flex; flex-direction: column; gap: 8px; border-radius: 7px; background: #f0f4e9; margin-top: 18px; }
.theme-swatch i { height: 8px; width: 74%; display: block; background: #a7b8a3; border-radius: 3px; }
.theme-swatch i:first-child { width: 45%; background: #315c3e; }
.theme-swatch.dark { background: #18261e; }
.theme-swatch.dark i { background: #4e6855; }
.theme-swatch.dark i:first-child { background: #9fcfaa; }
.theme-swatch.system { background: linear-gradient(90deg, #f0f4e9 50%, #18261e 50%); }
.appearance-note { padding: 0 24px 24px; color: var(--text-muted); font-size: 14px; }
.picker-search { margin-top: 0; }
.picker-search .search-field { min-width: 180px; }
.picker-items { max-height: 48vh; overflow-y: auto; }
.picker-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.picker-item b { font-size: 17px; color: var(--text); }
.picker-item small { font-size: 13px; margin-top: 5px; color: var(--text-muted); overflow-wrap: anywhere; }
.picker-item > strong { color: var(--accent-text); font-size: 17px; white-space: nowrap; }
.picker-count, .picker-loading, .bill-search-help { font-size: 14px; color: var(--text-muted); }
.picker-count { margin: 18px 0 6px; }
.picker-loading { padding: 28px 0; }
.bill-filters { align-items: flex-end; }
.bill-search-label { flex: 1; min-width: 240px; }
.bill-search-help { padding: 0 22px 18px; }
@media (max-width: 680px) {
  .picker-item { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .picker-item button { grid-column: 1 / -1; }
  .picker-item b { font-size: 16px; }
  .picker-search .actions > button { width: 100%; }
  .bill-search-label { min-width: 100%; }
  .bill-filters > .btn { flex: 1; }
}

html[data-theme="dark"] {
  --canvas: #111914;
  --surface: #1b271f;
  --paper: #1b271f;
  --surface-soft: #24342a;
  --text: #e5eee2;
  --ink: #e5eee2;
  --text-secondary: #c0d0b9;
  --text-muted: #a1b29c;
  --muted: #a1b29c;
  --border: #39493b;
  --line: #344338;
  --focus: #99c69d;
  --green: #aed5a8;
  --accent-text: #b9ddb0;
}
html[data-theme="dark"] :is(.sidebar, .topbar, .panel, dialog, input, select, textarea, .btn.secondary, .login-panel, .login-card) { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] :is(.store-picker, .help-card, th, .scan-banner, .stat-icon, .product-avatar, .avatar, .bottom-metrics, .stock-snapshot, .payment-due, .calculator-display, .audit-details, .demo-logins, .catalog-card, .catalog-icon) { background: var(--surface-soft); color: var(--text-secondary); border-color: var(--border); }
html[data-theme="dark"] :is(p, small, label, .small, .eyebrow, .nav-label, .connection, .role-chip, .breadcrumb, .breadcrumb b, .overview-strip, .stat-label, .stat small, .chart-total span, .bar-value, .bar-label, .chart-footer, .rank, .pagination, .receipt-number, .restock-summary, .app-footer, .catalog-category) { color: var(--text-muted); }
html[data-theme="dark"] :is(h1, h2, h3, .brand, .account b, .help-card b, .alert-row b, .top-product b, .top-product strong, .stock-snapshot b, .restock-summary b, .sales-summary b, .catalog-card b, .catalog-card strong, .bill-item-title b, .bill-item-bottom strong, .receipt, .receipt h2, .receipt > p, .receipt-total) { color: var(--text); }
html[data-theme="dark"] :is(td, td b, th, .bottom-metrics span, .bottom-metrics b, .scan-banner b, .scan-banner small, .empty h3, .bill-subtotal, .bill-total span, .btn.text-btn) { color: var(--text-secondary); }
html[data-theme="dark"] :is(.panel, .panel-heading, .alert-row, .bill-item, .top-product, td, th, .chart-footer, .bar-track, .bill-bottom, .bill-total, .account, .stepper, .panel-link, .search-field input, .scan-banner) { border-color: var(--border); }
html[data-theme="dark"] .stat { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .stat.featured { background: #2d5138; border-color: #41654a; }
html[data-theme="dark"] .stat.featured :is(.stat-label, small) { color: #cfdfc3; }
html[data-theme="dark"] .stat.featured strong { color: #f1f8e9; }
html[data-theme="dark"] nav a { color: var(--text-secondary); }
html[data-theme="dark"] nav a.active, html[data-theme="dark"] nav a:hover { background: #304534; color: #d5ebc8; }
html[data-theme="dark"] nav a b { background: #466044; color: #e3f3ce; }
html[data-theme="dark"] .btn.primary { background: #aed5a8; color: #112618; box-shadow: none; }
html[data-theme="dark"] .btn.primary:hover { background: #c1e3b8; }
html[data-theme="dark"] .btn.secondary:hover, html[data-theme="dark"] .icon-btn:hover { background: #2d4031; }
html[data-theme="dark"] .icon-btn, html[data-theme="dark"] .remove-item { color: #b9cbb0; }
html[data-theme="dark"] .stepper button { background: #2b3d2e; color: #d5e6c9; }
html[data-theme="dark"] .stepper span { color: var(--text); }
html[data-theme="dark"] .badge.green, html[data-theme="dark"] .success-banner { background: #2d4832; color: #c2e0ae; }
html[data-theme="dark"] .badge.amber, html[data-theme="dark"] .count-pill { background: #493b24; color: #f1cf8b; }
html[data-theme="dark"] .badge.red { background: #4b2d27; color: #f0b2a0; }
html[data-theme="dark"] .badge.blue { background: #2b3c50; color: #bfd7f4; }
html[data-theme="dark"] .badge.neutral { background: #2d3b30; color: #c2d1b8; }
html[data-theme="dark"] .low-number { color: #eac67e !important; }
html[data-theme="dark"] .change-display { background: #2a4430; color: #cae3b7; border-color: #446148; }
html[data-theme="dark"] .change-display strong, html[data-theme="dark"] .payment-due strong { color: #e4f4d7; }
html[data-theme="dark"] .bar { background: #466544; }
html[data-theme="dark"] .bar.current { background: #a3c98b; }
html[data-theme="dark"] .toast { background: #2a4030; border-color: #52764c; color: #e0eed5; }
html[data-theme="dark"] .toast.error, html[data-theme="dark"] .form-error { background: #472e28; border-color: #775046; color: #f5c4b4; }
html[data-theme="dark"] .barcode-label { background: #fff; color: #111; }
html[data-theme="dark"] .barcode-label h3 { color: #111; }
html[data-theme="dark"] .pay-button kbd { background: #17351d18; color: #24432c; }
html[data-theme="dark"] .search-field input, html[data-theme="dark"] #barcode-input { background: #142019; }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus { border-color: #b1d89c; box-shadow: 0 0 0 3px #a1cb7826; }
html[data-theme="dark"] dialog::backdrop { background: #000a; }
html[data-theme="dark"] .login-brand { background: #173525; }
html[data-theme="dark"] .login-brand :is(h1, .eyebrow) { color: #e1efce; }

@media (max-width: 1100px) {
  .sidebar { width: 242px; }
  .main-shell { margin-left: 242px; width: calc(100% - 242px); }
  .main-shell main { padding: 24px; }
  .brand { font-size: 17px; }
  nav a { font-size: 14px; padding: 11px 8px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bill-workspace { grid-template-columns: minmax(0, 1fr) 290px; }
  .theme-options { grid-template-columns: 1fr; }
  .theme-swatch { max-width: 240px; }
}
@media (max-width: 800px) {
  .bill-workspace { grid-template-columns: 1fr; }
  .barcode-bill .bill-bottom { border-left: 0; border-top: 1px solid var(--border); }
  .barcode-bill #bill-items { min-height: 180px; }
  .topbar .role-chip, .topbar .connection { display: none; }
  .scan-banner .badge { display: none; }
  .scan-form { flex-wrap: wrap; }
  .scan-form .search-field { min-width: 160px; }
}
@media (max-width: 680px) {
  .sidebar { width: 100%; }
  .main-shell { margin-left: 0; width: 100%; }
  .main-shell main { padding: 24px 16px; }
  .sidebar nav a { font-size: 14px; padding: 11px; }
  .sidebar .brand { font-size: 18px; }
  .brand small { font-size: 8px; }
  .store-picker select { font-size: 13px; }
  .sidebar .store-picker { max-width: 142px; }
  .page-heading h1 { font-size: 30px; }
  .page-heading .btn { font-size: 15px; }
  .scan-form .search-field { flex-basis: 100%; }
  .scan-form .btn { width: 100%; }
  #barcode-input { font-size: 20px; }
  .scan-hint { font-size: 13px; line-height: 2; }
  .stat { padding: 16px; }
  .stat-label { font-size: 14px; }
  .stat > strong { font-size: 26px; }
  .stat small { font-size: 12px; }
  .stat-icon { display: none; }
  .app-footer { flex-direction: column; }
}
@media print {
  html, body, #print-area { color-scheme: light !important; background: white !important; color: black !important; }
  #print-area * { color: black !important; border-color: #aaa !important; }
  #print-area .receipt td, #print-area .receipt th { background: white !important; font-size: 11px; }
  #print-area .receipt small { font-size: 9px; }
  #print-area .receipt > p, #print-area .receipt-total { font-size: 12px; }
  #print-area .receipt .receipt-id { font-size: 8px; }
}
.btn.danger { background: #b52b35; color: #fff; border: 1px solid #b52b35; }
.btn.danger:hover { background: #95212a; border-color: #95212a; }
.password-panel { margin-top: 24px; }
.password-form { max-width: 520px; display: grid; gap: 18px; margin: 0 24px 24px; }
.install-panel { margin-bottom: 24px; }
.install-content { padding: 0 24px 24px; }
.install-content p { margin: 0 0 16px; }
.install-content .btn { margin-bottom: 16px; }

/* Operational documents use the existing theme and readable controls. */
.operation-line{padding:18px;margin:12px 0;border:1px solid var(--border);border-radius:12px}.operation-line small,td small{display:block}.product-search-results{display:grid;gap:8px;max-height:260px;overflow:auto;margin:12px 0}.product-search-results .btn{justify-content:flex-start;text-align:left}.sidebar nav{overflow-y:auto;min-height:0}.bill-panel .bill-bottom .small{line-height:1.6}

.operations-page > .panel{padding:20px;margin-bottom:20px}.operations-page form{display:grid;gap:14px}.operations-page h2{margin-bottom:12px}.sidebar:has(nav a:nth-child(10)) .help-card{display:none}
