@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    color-scheme: light;
    --ink: #1c2d2a;
    --muted: #73817d;
    --line: #e3e9e6;
    --canvas: #f4f7f5;
    --surface: #fff;
    --green: #1e493d;
    --green-deep: #17382f;
    --mint: #e9f4ec;
    --lime: #c8ec72;
    --amber: #9b5e09;
    --amber-bg: #fff4db;
    --red: #a54138;
    --red-bg: #fff0ee;
    --shadow: 0 14px 38px rgba(22, 55, 47, .07);
}

.terminal-pairing-panel { margin: 0 0 22px; border: 2px solid var(--lime); padding: 24px; }
.terminal-pairing-code { display: inline-block; max-width: 100%; margin: 14px 0 18px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--mint); color: var(--ink); font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 800; letter-spacing: .2em; overflow-wrap: anywhere; }
@media (max-width: 640px) { .terminal-pairing-panel { padding: 18px; } }

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 'DM Sans', sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { background: var(--green-deep); color: #f7fbf8; padding: 26px 17px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 29px; }
.brand-logo { display: block; width: 190px; max-width: 100%; height: auto; }
.login-brand .brand-logo { width: 225px; }
.pos-receipt-brand { justify-content: center; padding: 0; }
.pos-receipt-logo { display: block; width: 182px; max-width: 100%; height: auto; }
.pos-receipt-logo-print { display: none; }
.nav-label { color: #94afa2; padding: 7px 12px 10px; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.nav-link { color: #c8d7d0; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; font-weight: 600; transition: .15s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #172f28; background: var(--lime); box-shadow: 0 6px 18px rgba(11, 28, 21, .16); }
.nav-glyph { width: 21px; text-align: center; font-size: 16px; line-height: 1; }
.nav-count { margin-left: auto; min-width: 22px; text-align: center; border-radius: 20px; padding: 2px 6px; background: rgba(255,255,255,.13); color: #e8f3ed; font-size: 11px; }
.nav-link.active .nav-count { color: #1c3a2e; background: rgba(23,56,47,.12); }
.sidebar-spacer { flex: 1; }
.sidebar-note { margin: 14px 4px; padding: 14px; border: 1px solid rgba(220,241,229,.14); background: rgba(255,255,255,.045); border-radius: 12px; color: #b8cbc2; font-size: 11px; }
.sidebar-note strong { color: #edf6f0; display: block; font-size: 12px; margin-bottom: 3px; }
.sidebar-user { border-top: 1px solid rgba(220,241,229,.14); padding: 16px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { flex: 0 0 auto; width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: #d8e9df; color: var(--green); font-weight: 800; font-size: 12px; }
.sidebar-user-name { font-size: 12px; font-weight: 700; color: #f4faf6; }
.sidebar-user-role { color: #9cb4a8; font-size: 10px; }
.sidebar-credit { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 18px; padding: 6px; color: #b8cbc2; font-size: 11px; }
.sidebar-credit strong { color: #edf6f0; font-weight: 600; }
.sidebar-credit span { margin-left: 3px; }
.sidebar-credit:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.sidebar-credit:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 5px; }
.mobile-credit { display: none; }
@media (max-width: 760px) {
    .sidebar-credit { display: none; }
    .mobile-credit { display: flex; justify-content: center; padding: 0 22px 24px; color: var(--muted); font-size: 11px; }
    .mobile-credit a:hover { text-decoration: underline; text-underline-offset: 4px; }
    .mobile-credit a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
}
.logout-form { margin-left: auto; }
.logout-button { border: 0; padding: 5px 7px; cursor: pointer; color: #a9c0b5; background: transparent; font-size: 11px; }
.logout-button:hover { color: #fff; }

.main-column { min-width: 0; }
.topbar { min-height: 99px; background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px clamp(22px, 4vw, 58px); }
.crumb { font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: #8b9994; }
.topbar h1 { margin: 4px 0 0; font: 800 24px/1.2 'Manrope', sans-serif; letter-spacing: -.045em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.demo-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 30px; padding: 7px 11px; background: #f0f4f1; color: #62746c; font-size: 11px; font-weight: 700; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #d49b31; }
.page-content { width: min(1440px, 100%); margin: 0 auto; padding: 28px clamp(22px, 4vw, 58px) 50px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.page-heading h2 { font: 800 21px/1.25 'Manrope', sans-serif; letter-spacing: -.035em; margin: 0; }
.page-heading p { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.eyebrow { color: #789087; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; margin-bottom: 7px; }
.button { min-height: 39px; padding: 9px 14px; border-radius: 9px; border: 1px solid transparent; display: inline-flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 700; transition: .15s ease; white-space: nowrap; }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 5px 12px rgba(30,73,61,.15); }
.button-primary:hover { background: #28604f; transform: translateY(-1px); }
.button-light { color: var(--green); border-color: #dce7e1; background: #fff; }
.button-light:hover { background: #f5faf6; }
.button-warning { color: #fff; background: #a65f08; }
.button-danger { color: var(--red); background: var(--red-bg); border-color: #f2d5d1; }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.busy-spinner { display: inline-block; width: 15px; height: 15px; flex: 0 0 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .75s linear infinite; vertical-align: middle; }
.busy-operation-form button:disabled { cursor: wait; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-spinner { animation-duration: 1.8s; } }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 18px rgba(25,54,46,.025); }
.stat-card { padding: 17px 18px; min-height: 112px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: var(--green); background: var(--mint); font-size: 14px; }
.stat-number { margin-top: 12px; font: 800 26px/1 'Manrope', sans-serif; letter-spacing: -.04em; }
.stat-foot { color: #8a9992; margin-top: 6px; font-size: 10px; }
.stat-card.attention .stat-icon { color: var(--amber); background: var(--amber-bg); }
.stat-card.attention .stat-number { color: #82500d; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .8fr); gap: 17px; align-items: start; }
.panel { overflow: hidden; }
.panel-header { min-height: 62px; padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1ef; }
.panel-title { font: 800 14px 'Manrope', sans-serif; letter-spacing: -.02em; }
.panel-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.panel-body { padding: 16px 19px; }
.text-link { color: var(--green); font-size: 11px; font-weight: 700; }
.text-link:hover { text-decoration: underline; }
.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }
.empty-icon { width: 43px; height: 43px; display: grid; place-items: center; background: var(--mint); border-radius: 13px; margin: 0 auto 12px; color: var(--green); font-size: 19px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #8a9892; background: #fbfcfb; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; padding: 11px 14px; white-space: nowrap; font-weight: 700; }
td { border-top: 1px solid #eff2f0; padding: 12px 14px; vertical-align: middle; font-size: 12px; }
tbody tr:hover { background: #fbfdfb; }
.primary-cell { color: #2a3f38; font-weight: 700; }
.secondary-cell { color: #84918c; font-size: 10px; margin-top: 3px; }
.mono { font: 600 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: #52635c; }
.number-cell { font: 700 13px 'Manrope', sans-serif; }
.qty-positive { color: #34734e; }
.qty-negative { color: #a54138; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 30px; padding: 4px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-draft { color: #8b5b0a; background: var(--amber-bg); }
.status-posted { color: #35734d; background: #e9f5eb; }
.status-low { color: var(--red); background: var(--red-bg); }
.status-ok { color: #37724e; background: #e9f5eb; }
.status-neutral { color: #687771; background: #eef2f0; }
.low-stock-list { display: grid; gap: 0; }
.low-stock-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eff2f0; }
.low-stock-item:last-child { border-bottom: 0; }
.low-stock-title { font-size: 12px; font-weight: 700; }
.low-stock-meta { color: var(--muted); font-size: 10px; margin-top: 3px; }
.low-stock-count { min-width: 38px; text-align: center; color: var(--red); font: 800 15px 'Manrope', sans-serif; }
.quick-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.search-form { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 600px; }
.input, .select, .textarea { width: 100%; border: 1px solid #dce5e0; background: #fff; border-radius: 8px; padding: 9px 11px; color: var(--ink); outline: none; font-size: 12px; transition: .15s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: #7ba894; box-shadow: 0 0 0 3px rgba(65,130,95,.12); }
.input::placeholder, .textarea::placeholder { color: #a0aca6; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: #4f635a; margin-bottom: 6px; }
.form-help { color: #87958f; font-size: 10px; margin-top: 5px; }
.form-error { color: #a54138; font-size: 11px; margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.staff-panel > .form-grid { padding: 25px 28px 29px; gap: 19px 22px; }
.staff-panel .panel-header { padding: 21px 28px; }
.staff-panel .panel-header h2 { margin: 0; }
.staff-panel .panel-header p { margin: 5px 0 0; line-height: 1.5; }
.staff-panel .check-row { padding: 11px 12px; min-height: 46px; gap: 10px; }
.staff-panel .check-row:has(input:checked) { border-color: #96b9a3; background: #f2faf3; }
.staff-panel .form-field > .muted { display: block; margin: 4px 0 11px; line-height: 1.5; }
.staff-panel .form-field > div:has(.check-row) { margin-top: 11px; gap: 10px !important; }
.staff-panel .form-field > .button { margin-top: 5px; }
.staff-list-panel .table-wrap { margin: 0 17px 8px; border: 1px solid var(--line); border-radius: 9px; }
.staff-list-panel .data-table th, .staff-list-panel .data-table td { padding: 15px 13px; }
@media(max-width:760px) { .staff-panel > .form-grid { padding: 19px 17px 24px; } .staff-panel .panel-header { padding: 17px; } .staff-list-panel .table-wrap { margin: 0 10px 8px; } }
.check-row { display: flex; align-items: flex-start; gap: 8px; min-height: 38px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 11px; line-height: 1.4; }
.check-row input { margin: 2px 0 0; accent-color: var(--green); }
.check-row small { display: block; color: var(--muted); font-size: 10px; }
:root[data-theme="dark"] .staff-panel .check-row:has(input:checked) { color: #e4f0e8; border-color: #5b8b6a; background: #263d31; }
:root[data-theme="dark"] .staff-panel .check-row:has(input:checked) input { accent-color: #8ecba0; }
.muted { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.login-demo code { color: inherit; font-size: 11px; }
.form-field.full { grid-column: 1 / -1; }
.flash { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; border: 1px solid #cfe5d5; background: #edf8ef; color: #34734e; border-radius: 10px; padding: 11px 13px; font-size: 12px; }
.flash-error { border-color: #f0d2ce; color: #9e473c; background: #fff3f1; }
.notice { border: 1px solid #f0dfb6; border-radius: 11px; padding: 12px 14px; background: #fff9e9; color: #765c2c; font-size: 11px; }
.notice strong { color: #654810; }
.notice-blue { border-color: #d5e6eb; background: #f0f8fa; color: #4b6b76; }
.notice-blue strong { color: #294b58; }
.extraction-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.extraction-notice form { flex: 0 0 auto; }
.extraction-message { margin-top: 6px; font-weight: 600; line-height: 1.55; white-space: pre-line; }
.extraction-progress { display: flex; align-items: center; gap: 8px; }
.extraction-paw { display: inline-block; flex: 0 0 auto; animation: paw-breathe 1.2s ease-in-out infinite; }
@keyframes paw-breathe { 0%, 100% { transform: scale(.88); opacity: .65; } 50% { transform: scale(1.12); opacity: 1; } }
.pagination { padding: 14px 18px; border-top: 1px solid #edf1ef; }
.pagination nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pagination p { color: var(--muted); font-size: 11px; }
.pagination a, .pagination span[aria-current] { border-radius: 7px; padding: 6px 9px; border: 1px solid var(--line); font-size: 11px; }
.pagination span[aria-current] { background: var(--green); color: #fff; border-color: var(--green); }

.details-summary { color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; padding: 5px 0; }
.manual-entry { margin-bottom: 8px; padding-bottom: 9px; border-bottom: 1px solid #edf1ef; }
.manual-entry[open] > summary { margin-bottom: 12px; }
.adjust-form { width: min(360px, 90vw); padding: 12px; background: #f9fbfa; border: 1px solid var(--line); border-radius: 10px; margin-top: 7px; }
.adjust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.adjust-grid .wide { grid-column: 1 / -1; }
.product-add-panel { margin-bottom: 16px; }
.product-add-panel details > summary { list-style: none; cursor: pointer; }
.product-add-panel details > summary::-webkit-details-marker { display: none; }
.product-add-panel details[open] > summary { margin-bottom: 15px; }
.product-add-inner { padding: 18px; }
.table-product { min-width: 195px; }
.table-stock { min-width: 320px; }
.store-stock-grid { display: grid; grid-template-columns: repeat(2, minmax(145px, 1fr)); gap: 0 12px; }
.store-stock { display: flex; align-items: center; gap: 6px; margin: 2px 0; color: #5b6b64; font-size: 10px; }
.store-stock b { min-width: 25px; text-align: right; color: var(--ink); }
.store-stock-row { min-width: 0; padding: 5px 0 7px; border-bottom: 1px solid #f0f3f1; }
.store-stock-dates { display: flex; flex-wrap: wrap; gap: 4px 8px; padding-left: 1px; color: #87958e; font-size: 9px; }
.store-stock-dates span:first-child { color: #64766d; }
.table-actions { min-width: 84px; }
.item-badge { color: #788680; font-size: 9px; background: #f1f4f2; padding: 3px 6px; border-radius: 4px; }

.invoice-create-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 16px; align-items: start; }
.upload-zone { display: block; border: 1.5px dashed #a7beb1; background: #f8fbf9; border-radius: 13px; min-height: 190px; padding: 27px; text-align: center; cursor: pointer; transition: .15s ease; }
.upload-zone:hover, .upload-zone.dragover { border-color: #418267; background: #f0f8f2; }
.upload-icon { width: 46px; height: 46px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 14px; background: #e7f2ea; color: var(--green); font-size: 21px; }
.upload-zone strong { display: block; font: 700 13px 'Manrope', sans-serif; }
.upload-zone span { display: block; color: var(--muted); margin-top: 5px; font-size: 11px; }
.upload-zone input { display: none; }
.file-list { text-align: left; margin-top: 12px; color: #52635c; font-size: 11px; }
.file-list:empty { display: none; }
.file-item { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; margin-top: 5px; }
.document-stack { display: grid; gap: 12px; max-height: 800px; overflow-y: auto; padding: 14px; }
.document-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f8faf9; }
.document-card-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; color: #52635c; font-size: 10px; font-weight: 700; }
.document-preview { width: 100%; max-height: 510px; object-fit: contain; display: block; background: #f1f3f2; }
.pdf-preview { width: 100%; height: 490px; border: 0; display: block; background: #f1f3f2; }
.invoice-workspace { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.invoice-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 15px; }
.meta-box { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.meta-label { color: #87948e; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.meta-value { margin-top: 4px; font-size: 12px; font-weight: 700; }
.add-line-grid { display: grid; grid-template-columns: 1.15fr .8fr .7fr .8fr .65fr .75fr auto; gap: 8px; align-items: end; }
.line-edit-grid { display: grid; grid-template-columns: .75fr 1fr .8fr .65fr .75fr .65fr .65fr auto; gap: 7px; align-items: end; }
.line-field label { color: #87948e; display: block; font-size: 9px; font-weight: 700; margin-bottom: 4px; }
.line-field .input, .line-field .select { padding: 7px 8px; font-size: 10px; }
.invoice-lines { margin-top: 14px; }
.line-card { border-top: 1px solid #edf1ef; padding: 12px 0; }
.line-card:first-child { border-top: 0; }
.line-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.line-product { font-weight: 700; font-size: 12px; }
.line-product-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.line-actions { display: flex; align-items: center; gap: 8px; }
.line-total { font: 700 12px 'Manrope', sans-serif; white-space: nowrap; }
.invoice-footer { position: sticky; bottom: 0; margin: 14px -19px -16px; padding: 13px 19px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; backdrop-filter: blur(10px); }
.invoice-footer form { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.review-confirm { display: flex; align-items: center; gap: 7px; max-width: 250px; color: #66776f; font-size: 10px; line-height: 1.35; }
.review-confirm input { flex: 0 0 auto; accent-color: var(--green); }
.invoice-total { font: 800 17px 'Manrope', sans-serif; }
.invoice-total small { display: block; font: 500 9px 'DM Sans', sans-serif; color: var(--muted); }
.inline-form { display: inline; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top right, #e3f1e8 0, transparent 42%), var(--canvas); }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 30px; box-shadow: var(--shadow); }
.login-brand { margin: 0 0 25px; padding: 0; }
.login-card h1 { font: 800 24px 'Manrope', sans-serif; letter-spacing: -.04em; margin: 0 0 6px; }
.login-card > p { color: var(--muted); margin: 0 0 22px; font-size: 12px; }
.login-card .form-field { margin-bottom: 14px; }
.login-demo { margin-top: 18px; padding: 12px; border-radius: 9px; background: #f3f7f4; color: #66776f; font-size: 10px; }
.login-demo strong { display: block; color: #3e5b4d; margin-bottom: 3px; }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 220px minmax(0,1fr); }
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .invoice-workspace { grid-template-columns: 1fr; }
    .document-stack { max-height: 420px; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .add-line-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { min-height: auto; padding: 13px 14px 10px; }
    .brand { padding: 0 4px 12px; }
    .nav-label, .sidebar-spacer, .sidebar-note, .sidebar-user { display: none; }
    .nav-list { display: flex; overflow-x: auto; gap: 5px; padding-bottom: 2px; scrollbar-width: none; }
    .nav-list::-webkit-scrollbar { display: none; }
    .nav-link { flex: 0 0 auto; padding: 9px 11px; font-size: 11px; }
    .nav-glyph { font-size: 14px; }
    .topbar { min-height: 74px; padding: 14px 18px; }
    .topbar h1 { font-size: 20px; }
    .demo-pill { display: none; }
    .page-content { padding: 20px 15px 36px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading .button { width: 100%; }
    .dashboard-grid, .invoice-create-grid { grid-template-columns: 1fr; }
    .stats-grid { gap: 9px; }
    .stat-card { min-height: 98px; padding: 13px; }
    .stat-number { font-size: 23px; }
    .stat-top { font-size: 10px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-form { max-width: none; }
    .toolbar > .button { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field.full { grid-column: auto; }
    .invoice-meta-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .document-stack { grid-template-columns: 1fr; }
    .pdf-preview { height: 360px; }
    .add-line-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .add-line-grid .wide-mobile { grid-column: 1 / -1; }
    .line-edit-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .line-edit-grid .line-submit { grid-column: 1 / -1; }
    .invoice-footer { margin-left: -13px; margin-right: -13px; padding-left: 13px; padding-right: 13px; flex-wrap: wrap; }
    .invoice-footer form, .invoice-footer .button { flex: 1; }
    .invoice-footer form { flex-direction: column; align-items: stretch; }
    .review-confirm { max-width: none; }
    .extraction-notice { align-items: stretch; flex-direction: column; }
    .extraction-notice form, .extraction-notice form .button { width: 100%; }
    .pagination { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { .extraction-paw { animation: none; } }

.pos-cart-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.pos-cart-actions .button { min-height: 29px; padding: 0 8px; font-size: 8px; }
.pos-cart-actions #pos-open-held-sales span { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 3px; border-radius: 50%; color: var(--green); background: #e7f1ea; font-size: 8px; }
.pos-cart-actions #pos-park-sale:disabled { opacity: .55; cursor: default; }
.pos-held-dialog { width: min(560px, calc(100vw - 28px)); max-height: 86vh; padding: 0; overflow: hidden; border: 1px solid #dfe8e2; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(16,42,31,.26); }
.pos-held-dialog::backdrop { background: rgba(17,35,27,.48); backdrop-filter: blur(2px); }
.pos-held-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 20px 15px; border-bottom: 1px solid #edf1ef; }
.pos-held-dialog-header .eyebrow { margin-bottom: 4px; }
.pos-held-dialog-header h3 { margin: 0; color: #283d33; font: 800 19px 'Manrope', sans-serif; }
.pos-held-dialog-header p { margin: 5px 0 0; color: #819087; font-size: 10px; }
.pos-held-close { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border: 0; border-radius: 8px; color: #6d7d74; background: #f1f5f2; font-size: 20px; cursor: pointer; }
.pos-held-notice { display: none; margin: 12px 16px 0; padding: 9px 11px; border-radius: 8px; color: #456e53; background: #eff7f0; font-size: 10px; }
.pos-held-notice.is-visible { display: block; }
.pos-held-notice.is-error { color: #9b473d; background: #fbf0ef; }
.pos-held-list { display: grid; gap: 9px; max-height: calc(86vh - 120px); overflow-y: auto; padding: 14px 16px 17px; }
.pos-held-card { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 12px; border: 1px solid #e7eee9; border-radius: 11px; background: #fbfdfb; }
.pos-held-card-details { display: grid; min-width: 0; flex: 1; gap: 4px; }
.pos-held-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pos-held-card-heading > strong { overflow: hidden; color: #33483d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pos-held-card-details small { overflow: hidden; color: #849189; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pos-held-total { color: var(--green); font: 800 13px 'Manrope', sans-serif; white-space: nowrap; }
.pos-held-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.pos-held-actions .button { min-height: 31px; padding: 0 9px; font-size: 9px; }
.pos-held-actions .button:disabled { opacity: .45; cursor: not-allowed; }
.pos-held-empty { display: grid; justify-items: center; gap: 5px; min-height: 140px; place-content: center; color: #87958d; text-align: center; font-size: 10px; }
.pos-held-empty strong { color: #52645a; font-size: 12px; }
.pos-held-empty.is-error { color: #9b473d; }

@media (max-width: 760px) {
    .pos-cart-header { align-items: flex-start; gap: 8px; padding: 13px 11px 11px; }
    .pos-cart-actions { max-width: 205px; }
    .pos-cart-actions .button { min-height: 27px; padding: 0 6px; font-size: 7px; }
    .pos-held-dialog-header { padding: 16px 15px 12px; }
    .pos-held-list { padding: 11px; }
    .pos-held-card { align-items: flex-start; flex-direction: column; gap: 9px; }
    .pos-held-actions { width: 100%; }
    .pos-held-actions .button { flex: 1; }
}

.store-add-panel { margin-bottom: 16px; }
.store-form { padding: 16px 18px 18px; }
.store-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; align-items: end; }
.store-edit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.store-check { min-height: 42px; display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); background: #fafcfb; border-radius: 8px; cursor: pointer; }
.store-check input { margin: 2px 0 0; accent-color: var(--green); }
.store-check strong, .store-check small { display: block; }
.store-check strong { color: #465a50; font-size: 10px; }
.store-check small { color: #839189; font-size: 9px; margin-top: 2px; }
.store-form-actions { display: flex; justify-content: flex-end; margin-top: 13px; }
.store-list { display: grid; }
.store-card { position: relative; padding: 17px 19px; border-top: 1px solid #edf1ef; }
.store-card:first-child { border-top: 0; }
.store-card.store-inactive { background: #fafbfa; }
.store-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.store-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.store-card-meta { display: flex; flex-wrap: wrap; gap: 14px; margin: 11px 0 0; color: #829088; font-size: 10px; }
.store-card .store-form { margin: 14px 0 0; padding: 14px; border: 1px solid #edf1ef; border-radius: 10px; background: #fbfcfb; }
.store-status-form { display: flex; justify-content: flex-end; margin-top: 9px; }
.stock-filter-form { width: 100%; max-width: none; }
.stock-filter-form > input { flex: 1 1 260px; }
.stock-filter-form > select { flex: 0 1 190px; }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 245px; }
.product-thumb { width: 43px; height: 43px; flex: 0 0 auto; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.product-thumb-empty { display: grid; place-items: center; color: #8ca097; font-size: 17px; }
.network-total { color: var(--green); font: 800 18px 'Manrope', sans-serif; }
.form-panel { overflow: hidden; }
.form-panel-body { padding: 18px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.transfer-lines-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.transfer-lines-heading h3, .transfer-action h3 { margin: 0; font: 700 14px 'Manrope', sans-serif; }
.transfer-lines-heading p, .transfer-action p { color: var(--muted); margin: 4px 0 0; font-size: 11px; }
.transfer-lines { display: grid; gap: 9px; }
.transfer-line-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; align-items: end; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.transfer-line-row .form-field { margin: 0; }
.scan-panel { margin-bottom: 16px; }
.scan-form { padding: 17px 19px; }
.scan-input-row { display: flex; align-items: center; gap: 9px; }
.scan-input { min-height: 45px; font: 600 15px ui-monospace, SFMono-Regular, Menlo, monospace; }
.scan-input-row .button { min-height: 45px; }
.transfer-receipt { padding: 22px; }
.transfer-receipt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.transfer-receipt-header h2 { margin: 0; font: 800 24px 'Manrope', sans-serif; letter-spacing: -.03em; }
.transfer-route-grid { display: grid; grid-template-columns: 1fr 40px 1fr; align-items: center; gap: 12px; margin: 17px 0; }
.transfer-arrow { text-align: center; color: #83958b; font-size: 20px; }
.transfer-note { margin: 12px 0; color: #64766d; font-size: 11px; }
.transfer-table-wrap { margin-top: 12px; }
.receipt-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 14px 0; border-top: 1px dashed #dce4df; }
.receipt-barcode { display: grid; justify-items: center; gap: 4px; min-width: 235px; }
.receipt-barcode img { width: min(100%, 310px); height: auto; image-rendering: pixelated; }
.receipt-barcode strong { font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.transfer-action { display: grid; gap: 13px; margin-top: 14px; padding: 16px; border-radius: 11px; background: #f6faf7; border: 1px solid #e4eee7; }
.transfer-action form { display: flex; justify-content: flex-end; }
.receive-lines { display: grid; gap: 8px; }
.receive-line { display: grid; grid-template-columns: minmax(0, 1fr) 110px; align-items: end; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #e7eeea; }
.receive-line .form-label { margin: 0; }
.transfer-action .form-field { max-width: 620px; }
.count-summary { margin-bottom: 16px; padding: 15px 18px; }
.count-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.count-meta strong { display: block; margin-top: 4px; font-size: 11px; }
.count-entry-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; align-items: end; gap: 10px; padding: 17px 19px; }
.count-entry-form .form-field { margin: 0; }
.count-entry-form .button { min-height: 42px; }
.count-correction-form { display: flex; align-items: center; gap: 6px; min-width: 140px; }
.count-correction-form .input { min-width: 65px; padding: 6px 8px; }
.count-post-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-top: 1px solid #edf1ef; }
.count-post-footer .notice { flex: 1; }
.count-post-footer form { flex: 0 0 auto; }

.pos-screen { display: grid; gap: 17px; }
.pos-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.pos-page-heading h2 { margin: 0; font: 800 23px/1.2 'Manrope', sans-serif; letter-spacing: -.045em; }
.pos-page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.pos-register-bar { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 16px; border: 1px solid #ecd8ac; border-radius: 12px; background: #fffaf0; }
.pos-register-open { border-color: #cfe5d5; background: #f2faf3; }
.pos-register-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; color: #9b700f; background: #f5e9ca; font-size: 11px; }
.pos-register-open .pos-register-mark { color: #33724d; background: #dcefe0; }
.pos-register-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pos-register-copy strong { font: 700 12px 'Manrope', sans-serif; }
.pos-register-copy span { color: #75837d; font-size: 10px; }
.pos-shift-close { position: relative; }
.pos-shift-close > summary { list-style: none; }
.pos-shift-close > summary::-webkit-details-marker { display: none; }
.pos-shift-close-form { position: absolute; z-index: 3; top: calc(100% + 8px); right: 0; width: min(330px, 88vw); padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.pos-shift-close-form p { margin: 7px 0 12px; color: var(--muted); font-size: 10px; }
.pos-shift-close-form .button { width: 100%; }
.pos-day-strip { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)) auto; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pos-day-strip > div { display: grid; gap: 1px; border-right: 1px solid #edf1ef; }
.pos-day-strip > div span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pos-day-strip > div strong { font: 800 15px 'Manrope', sans-serif; }
.pos-day-strip > a { justify-self: end; color: var(--green); font-size: 11px; font-weight: 700; }
.pos-day-strip > a span { margin-left: 4px; }
.pos-open-card { display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: start; gap: 18px; max-width: 840px; padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.pos-open-illustration { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; color: var(--green); background: var(--mint); font-size: 22px; }
.pos-open-copy h3 { margin: 0; font: 800 17px 'Manrope', sans-serif; letter-spacing: -.025em; }
.pos-open-copy p { max-width: 650px; margin: 6px 0 17px; color: var(--muted); font-size: 11px; }
.pos-open-form { display: grid; grid-template-columns: minmax(180px,1fr) minmax(150px,.55fr) auto; gap: 10px; align-items: end; }
.pos-open-form .form-field { margin: 0; }
.pos-open-form .button { min-height: 41px; }
.pos-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(340px,390px); align-items: start; gap: 16px; }
.pos-catalog-column { min-width: 0; }
.pos-search-panel { display: flex; align-items: center; gap: 11px; min-height: 56px; padding: 0 13px; border: 1.5px solid #b6ccbe; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(25,54,46,.035); }
.pos-search-panel:focus-within { border-color: #57906f; box-shadow: 0 0 0 3px rgba(65,130,95,.11); }
.pos-search-icon { color: #668276; font-size: 22px; line-height: 1; }
.pos-search { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.pos-search::placeholder { color: #94a29b; }
.pos-search-panel kbd { padding: 4px 7px; border: 1px solid #e0e8e3; border-radius: 5px; color: #84918b; background: #f8faf8; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.pos-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 17px 1px 10px; }
.pos-results-heading > div { display: grid; gap: 2px; }
.pos-results-heading strong { font: 800 13px 'Manrope', sans-serif; }
.pos-results-heading span { color: var(--muted); font-size: 9px; }
.pos-stock-legend { display: inline-flex; align-items: center; gap: 5px; color: #708078; font-size: 9px; white-space: nowrap; }
.pos-stock-legend i { width: 7px; height: 7px; border-radius: 50%; background: #5eab72; }
.pos-product-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; min-height: 155px; }
.pos-product-card { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 112px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; text-align: left; cursor: pointer; background: #fff; color: var(--ink); transition: .15s ease; }
.pos-product-card:hover { border-color: #a9c5b3; box-shadow: 0 6px 18px rgba(30,73,61,.08); transform: translateY(-1px); }
.pos-product-card:focus-visible { outline: 3px solid rgba(65,130,95,.24); outline-offset: 1px; }
.pos-product-card:disabled { cursor: not-allowed; opacity: .56; filter: grayscale(.25); }
.pos-product-image { display: grid; place-items: center; width: 52px; height: 60px; flex: 0 0 52px; border: 1px solid #edf1ee; border-radius: 9px; object-fit: contain; background: #fafcfb; }
.pos-product-placeholder { color: #8aa195; font-size: 20px; }
.pos-product-details { display: grid; min-width: 0; flex: 1; align-content: start; gap: 3px; }
.pos-product-name { display: -webkit-box; overflow: hidden; min-height: 32px; color: #2d4039; font: 700 10px/1.45 'DM Sans', sans-serif; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pos-product-brand { overflow: hidden; color: #87958e; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-top: 3px; }
.pos-product-price { color: var(--green); font: 800 13px 'Manrope', sans-serif; white-space: nowrap; }
.pos-product-stock { color: #49845a; font-size: 8px; white-space: nowrap; }
.pos-product-stock.is-empty { color: #aa5449; }
.pos-loading, .pos-no-products { display: grid; grid-column: 1 / -1; min-height: 150px; place-content: center; justify-items: center; gap: 7px; border: 1px dashed #dfe8e2; border-radius: 12px; color: var(--muted); font-size: 11px; text-align: center; }
.pos-spinner { width: 20px; height: 20px; border: 2px solid #dfe9e2; border-top-color: var(--green); border-radius: 50%; animation: busy-spin .75s linear infinite; }
.pos-no-products-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--mint); color: var(--green); font-size: 20px; }
.pos-no-products strong { color: #354b40; font-size: 12px; }
.pos-no-products small { color: var(--muted); font-size: 10px; }
.pos-search-hint { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #87948e; font-size: 9px; }
.pos-search-hint span { color: #688778; font-size: 13px; }
.pos-cart-panel { position: sticky; top: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 28px); min-height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.pos-cart-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 13px; border-bottom: 1px solid #edf1ef; }
.pos-cart-header .eyebrow { margin-bottom: 3px; font-size: 8px; }
.pos-cart-header h3 { display: flex; align-items: center; gap: 7px; margin: 0; font: 800 16px 'Manrope', sans-serif; }
.pos-cart-header h3 span { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 20px; color: var(--green); background: var(--mint); font: 700 10px 'DM Sans', sans-serif; }
.pos-clear-button { border: 0; color: #8a9690; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.pos-clear-button:disabled { opacity: .45; cursor: default; }
.pos-cart-items { flex: 1; min-height: 90px; overflow-y: auto; padding: 2px 15px; }
.pos-cart-empty { display: grid; place-content: center; justify-items: center; gap: 5px; height: 100%; min-height: 130px; text-align: center; }
.pos-cart-empty > span { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 4px; border-radius: 12px; color: #71907f; background: #f0f6f2; font-size: 20px; }
.pos-cart-empty strong { color: #51625a; font-size: 11px; }
.pos-cart-empty small { color: #91a098; font-size: 9px; }
.pos-cart-item { padding: 12px 0 10px; border-bottom: 1px solid #edf1ef; }
.pos-cart-item-top { display: flex; justify-content: space-between; gap: 9px; }
.pos-cart-item-info { display: grid; min-width: 0; gap: 2px; }
.pos-cart-item-info strong { color: #35473f; font-size: 10px; line-height: 1.4; }
.pos-cart-item-info small { color: #89958f; font-size: 8px; }
.pos-remove-item { align-self: start; width: 24px; height: 24px; border: 0; border-radius: 6px; color: #9b625b; background: #fbf2f1; font-size: 16px; cursor: pointer; }
.pos-cart-item-bottom { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-top: 9px; }
.pos-quantity-controls { display: inline-flex; align-items: center; gap: 10px; padding: 3px; border: 1px solid #e6ece8; border-radius: 8px; background: #fafcfb; }
.pos-quantity-controls button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; color: var(--green); background: #eaf3ed; font-size: 14px; cursor: pointer; }
.pos-quantity-controls button:disabled { opacity: .4; cursor: not-allowed; }
.pos-quantity-controls span { min-width: 13px; text-align: center; font-size: 10px; font-weight: 700; }
.pos-line-discount-field { display: flex; align-items: center; gap: 5px; color: #7c8983; font-size: 8px; }
.pos-line-discount { width: 53px; padding: 5px 6px; text-align: right; font-size: 9px; }
.pos-cart-line-total { margin-left: auto; color: #33483d; font: 700 11px 'Manrope', sans-serif; white-space: nowrap; }
.pos-cart-customer { padding: 0 15px; }
.pos-cart-customer details { border-bottom: 1px solid #edf1ef; }
.pos-cart-customer summary { display: flex; justify-content: space-between; padding: 10px 0; color: var(--green); font-size: 9px; font-weight: 700; cursor: pointer; }
.pos-cart-customer summary span { color: #9aa59f; font-weight: 500; }
.pos-customer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 10px; }
.pos-customer-fields label { display: grid; gap: 4px; color: #78877f; font-size: 8px; }
.pos-customer-fields .input { padding: 7px 8px; font-size: 9px; }
.pos-totals { display: grid; gap: 7px; padding: 12px 16px; }
.pos-totals > div, .pos-change-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #75827b; font-size: 9px; }
.pos-totals strong { color: #46574f; font-size: 10px; }
.pos-discount-row strong { color: #b06f29; }
.pos-total-row { padding-top: 9px; border-top: 1px dashed #dce5df; }
.pos-total-row span { color: #283d33; font-size: 11px; font-weight: 700; }
.pos-total-row strong { color: var(--green); font: 800 22px 'Manrope', sans-serif; letter-spacing: -.04em; }
.pos-payment-section { padding: 12px 15px 14px; border-top: 1px solid #edf1ef; background: #fafcfb; }
.pos-payment-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pos-payment-heading strong { color: #3f5248; font-size: 10px; }
.pos-payment-heading span { color: #8b9791; font-size: 8px; }
.pos-payment-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 9px; }
.pos-payment-option { min-height: 33px; border: 1px solid #e0e8e3; border-radius: 8px; color: #66756e; background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.pos-payment-option span { margin-right: 4px; font-size: 11px; }
.pos-payment-option.selected { border-color: #89ae96; color: var(--green); background: #edf6ef; box-shadow: inset 0 0 0 1px #a9c9b1; }
.pos-cash-field { display: grid; grid-template-columns: 1fr 132px; align-items: center; gap: 8px; margin-top: 9px; color: #75827b; font-size: 9px; }
.pos-cash-field .input { padding: 7px 8px; text-align: right; font-size: 10px; }
.pos-cash-field[hidden] { display: none; }
.pos-change-row { margin: 7px 1px 10px; }
.pos-change-row strong { color: #346d4d; font-size: 10px; }
.pos-checkout-button { width: 100%; min-height: 46px; justify-content: space-between; padding: 0 15px; }
.pos-checkout-button span { font-size: 11px; }
.pos-checkout-button strong { font: 800 15px 'Manrope', sans-serif; }
.pos-checkout-button:disabled { background: #a1b3a8; box-shadow: none; }
.pos-checkout-button:disabled strong { color: rgba(255,255,255,.85); }
.pos-checkout-message { display: none; margin-top: 7px; color: #4d7158; font-size: 9px; }
.pos-checkout-message.is-visible { display: block; }
.pos-checkout-message.is-error { color: #a54138; }
.pos-payment-note { margin: 8px 0 0; color: #9ba69f; font-size: 8px; line-height: 1.4; }
.pos-recent-panel { margin-top: 2px; }
.pos-sales-toolbar { padding: 14px 16px 0; }
.pos-sales-filters { max-width: none; flex-wrap: wrap; }
.pos-sales-filters > input[type="search"] { flex: 1 1 220px; }
.pos-sales-filters > select, .pos-sales-filters > input[type="date"] { flex: 0 1 150px; }
.pos-receipt { padding: 24px; }
.pos-receipt-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 18px; border-bottom: 1px dashed #dbe4de; }
.pos-receipt-brand { padding: 0; }
.pos-receipt-status { display: grid; justify-items: end; gap: 6px; }
.pos-receipt-status strong { color: #4c5d55; font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.pos-receipt-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; padding: 17px 0; }
.pos-receipt-meta > div { display: grid; gap: 3px; }
.pos-receipt-meta span { color: #94a099; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.pos-receipt-meta strong { color: #40534a; font-size: 10px; }
.pos-receipt-meta small { color: #89968f; font-size: 9px; }
.pos-receipt-table { border: 1px solid #edf1ef; border-radius: 9px; }
.invoice-row-actions { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.invoice-row-actions form { margin: 0; }
.invoice-row-actions .button { min-height: 28px; padding: 0 8px; font-size: 8px; }
.invoice-row-actions .text-link { font-size: 9px; }
.pos-print-hint { color: #87948e; font-size: 9px; white-space: nowrap; }
.pos-receipt-print-lines { display: none; }
.align-right { text-align: right; }
.pos-receipt-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; }
.pos-receipt-notes { display: grid; align-content: end; gap: 4px; color: #61746a; font: 700 11px 'Manrope', sans-serif; }
.pos-receipt-notes small { color: #95a098; font: 400 9px 'DM Sans', sans-serif; }
.pos-receipt-totals { display: grid; gap: 7px; width: min(270px,100%); }
.pos-receipt-totals > div { display: flex; justify-content: space-between; gap: 15px; color: #7d8983; font-size: 10px; }
.pos-receipt-totals strong { color: #43554c; }
.pos-receipt-totals .pos-receipt-grand { margin-top: 3px; padding-top: 9px; border-top: 1px solid #dfe7e2; color: #2f4438; font-size: 12px; font-weight: 700; }
.pos-receipt-grand strong { color: var(--green); font: 800 19px 'Manrope', sans-serif; }
.pos-refunds-panel, .pos-return-panel { margin-top: 15px; }
.pos-return-form { padding: 0 16px 16px; }
.pos-return-quantity { max-width: 90px; }
.pos-return-controls { display: grid; grid-template-columns: auto minmax(200px,1fr) minmax(220px,1.4fr) auto; align-items: end; gap: 12px; margin-top: 15px; }
.pos-return-controls label { display: grid; gap: 5px; color: #66766e; font-size: 9px; font-weight: 700; }
.pos-return-controls .button { min-height: 39px; }
.pos-restock-check { display: flex !important; align-items: center; gap: 7px !important; min-height: 39px; white-space: nowrap; }
.pos-restock-check input { accent-color: var(--green); }
.pos-return-note .input { font-weight: 400; }
.pos-return-form > .form-help { margin-top: 9px; }

@media (max-width: 1100px) {
    .pos-workspace { grid-template-columns: minmax(0,1fr) minmax(320px,360px); gap: 12px; }
    .pos-product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .pos-cart-panel { top: 10px; }
    .pos-day-strip { grid-template-columns: repeat(3,minmax(90px,1fr)); }
    .pos-day-strip > a { grid-column: 1 / -1; justify-self: start; }
    .pos-return-controls { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .pos-screen { gap: 12px; }
    .pos-page-heading { align-items: flex-start; }
    .pos-page-heading h2 { font-size: 20px; }
    .pos-page-heading p { max-width: 520px; font-size: 10px; }
    .pos-register-bar { align-items: flex-start; flex-wrap: wrap; }
    .pos-register-copy { flex-basis: calc(100% - 50px); }
    .pos-shift-close { margin-left: 46px; }
    .pos-day-strip { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding: 10px; }
    .pos-day-strip > div { padding-right: 5px; }
    .pos-day-strip > div strong { font-size: 13px; }
    .pos-day-strip > div span { font-size: 7px; }
    .pos-day-strip > a { margin-top: 3px; font-size: 9px; }
    .pos-open-card { grid-template-columns: 1fr; gap: 12px; padding: 17px; }
    .pos-open-form { grid-template-columns: 1fr 1fr; }
    .pos-open-form .form-field:first-child { grid-column: 1 / -1; }
    .pos-open-form .button { grid-column: 1 / -1; }
    .pos-workspace { grid-template-columns: 1fr; }
    .pos-catalog-column { order: 1; }
    .pos-cart-panel { position: static; order: 2; max-height: none; min-height: 0; }
    .pos-cart-items { flex: initial; max-height: 40vh; }
    .pos-product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
    .pos-product-card { gap: 7px; min-height: 94px; padding: 8px; }
    .pos-product-image { width: 39px; height: 48px; flex-basis: 39px; }
    .pos-product-name { min-height: 28px; font-size: 9px; }
    .pos-product-price { font-size: 11px; }
    .pos-product-stock { font-size: 7px; }
    .pos-receipt { padding: 15px; }
    .pos-receipt-meta { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 8px; }
    .pos-receipt-bottom { align-items: flex-start; flex-direction: column; }
    .pos-receipt-totals { width: 100%; }
    .pos-return-controls { grid-template-columns: 1fr; }
    .pos-return-controls label { width: 100%; }
    .pos-restock-check { white-space: normal; }
    .pos-recent-panel .panel-header { align-items: flex-start; }
    .pos-sales-toolbar { align-items: stretch; }
    .pos-sales-filters > input, .pos-sales-filters > select, .pos-sales-filters > button { flex: 1 1 100%; }
}

@media (max-width: 760px) {
    .store-form-grid, .store-edit-grid { grid-template-columns: 1fr; }
    .store-card-heading { flex-direction: column; }
    .store-badges { justify-content: flex-start; }
    .store-card-meta { gap: 6px 12px; }
    .stock-filter-form { flex-wrap: wrap; }
    .stock-filter-form > input, .stock-filter-form > select, .stock-filter-form > button, .stock-filter-form > a { flex: 1 1 100%; }
    .transfer-line-row { grid-template-columns: 1fr 95px; }
    .transfer-line-row .remove-transfer-line { grid-column: 1 / -1; justify-self: end; }
    .transfer-route-grid { grid-template-columns: 1fr; }
    .transfer-arrow { transform: rotate(90deg); }
    .transfer-receipt { padding: 15px; }
    .transfer-receipt-header { align-items: flex-start; flex-direction: column; }
    .receipt-footer { align-items: flex-start; flex-direction: column; }
    .receipt-barcode { width: 100%; min-width: 0; }
    .receive-line { grid-template-columns: minmax(0,1fr) 80px; }
    .count-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .count-entry-form { grid-template-columns: 1fr 95px; }
    .count-entry-form .button { grid-column: 1 / -1; }
    .count-post-footer { align-items: stretch; flex-direction: column; }
}

/* Keep navigation in view while the main page scrolls. */
.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(220,241,229,.24) transparent;
}

@media (max-width: 760px) {
    .sidebar {
        z-index: 40;
        height: auto;
        max-height: 150px;
        overflow: hidden;
    }
}

.theme-toggle { flex: 0 0 auto; }
.theme-toggle-icon { font-size: 16px; line-height: 1; }
.login-theme-toggle { position: absolute; top: 20px; right: 20px; }
.brand-logo-light { display: none; }

.app-confirm-dialog {
    width: min(460px, calc(100vw - 28px));
    max-width: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(16,42,31,.26);
}
.app-confirm-dialog::backdrop { background: rgba(17,35,27,.5); backdrop-filter: blur(2px); }
.app-confirm-content { display: flex; align-items: flex-start; gap: 13px; padding: 22px 22px 18px; }
.app-confirm-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; color: #76520b; background: var(--amber-bg); font: 800 17px 'Manrope', sans-serif; }
.app-confirm-copy h2 { margin: 1px 0 5px; font: 800 17px 'Manrope', sans-serif; letter-spacing: -.025em; }
.app-confirm-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 86%, var(--canvas)); }
.app-confirm-actions .button { min-width: 112px; }

:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e4ede8;
    --muted: #a4b3ab;
    --line: #35473e;
    --canvas: #111a15;
    --surface: #1b2721;
    --green: #85b49a;
    --green-deep: #12251c;
    --mint: #263c30;
    --lime: #c8ec72;
    --amber: #edc36c;
    --amber-bg: #40341f;
    --red: #ee9288;
    --red-bg: #402925;
    --shadow: 0 14px 38px rgba(0,0,0,.24);
}

:root[data-theme="dark"] body { background: var(--canvas); color: var(--ink); }
:root[data-theme="dark"] .topbar { background: rgba(27,39,33,.94); }
:root[data-theme="dark"] .crumb,
:root[data-theme="dark"] .stat-foot,
:root[data-theme="dark"] .form-help,
:root[data-theme="dark"] .meta-label,
:root[data-theme="dark"] .line-field label,
:root[data-theme="dark"] .store-stock-dates,
:root[data-theme="dark"] .store-card-meta,
:root[data-theme="dark"] .pos-print-hint { color: #9aaba2; }
:root[data-theme="dark"] .eyebrow { color: #9db7aa; }
:root[data-theme="dark"] .demo-pill { color: #bdcbc3; background: #29372f; }
:root[data-theme="dark"] .button-light { color: #d5e5db; border-color: #405349; background: #26362e; }
:root[data-theme="dark"] .button-light:hover { background: #31463a; }
:root[data-theme="dark"] .button-danger { color: #ffb0a7; border-color: #69413a; background: #3b2926; }
:root[data-theme="dark"] .button-primary { color: #f7fff9; background: #32604d; }
:root[data-theme="dark"] .button-primary:hover { background: #3d7057; }
:root[data-theme="dark"] .button-warning { color: #fffaf0; background: #94600e; }
:root[data-theme="dark"] .stat-foot { color: #9aaba2; }
:root[data-theme="dark"] .stat-card.attention .stat-number { color: #edc36c; }
:root[data-theme="dark"] .panel-header,
:root[data-theme="dark"] td,
:root[data-theme="dark"] .low-stock-item,
:root[data-theme="dark"] .pagination,
:root[data-theme="dark"] .manual-entry,
:root[data-theme="dark"] .store-stock-row,
:root[data-theme="dark"] .line-card,
:root[data-theme="dark"] .count-post-footer,
:root[data-theme="dark"] .pos-register-bar,
:root[data-theme="dark"] .pos-cart-header,
:root[data-theme="dark"] .pos-cart-item,
:root[data-theme="dark"] .pos-payment-section { border-color: var(--line); }
:root[data-theme="dark"] th { color: #a7b6ae; background: #202d26; }
:root[data-theme="dark"] tbody tr:hover { background: #223128; }
:root[data-theme="dark"] .primary-cell,
:root[data-theme="dark"] .panel-title,
:root[data-theme="dark"] .empty-state strong,
:root[data-theme="dark"] .store-stock-dates span:first-child,
:root[data-theme="dark"] .store-check strong { color: var(--ink); }
:root[data-theme="dark"] .secondary-cell,
:root[data-theme="dark"] .mono { color: #a3b2a9; }
:root[data-theme="dark"] .qty-positive,
:root[data-theme="dark"] .status-posted,
:root[data-theme="dark"] .status-ok { color: #a7ddb4; }
:root[data-theme="dark"] .status-posted,
:root[data-theme="dark"] .status-ok { background: #253a2c; }
:root[data-theme="dark"] .status-neutral { color: #c1cec6; background: #303c35; }
:root[data-theme="dark"] .status-draft { color: #f0cc7c; }
:root[data-theme="dark"] .input,
:root[data-theme="dark"] .select,
:root[data-theme="dark"] .textarea { color: var(--ink); border-color: #43574c; background: #17221c; }
:root[data-theme="dark"] .input:focus,
:root[data-theme="dark"] .select:focus,
:root[data-theme="dark"] .textarea:focus { border-color: #83b59a; box-shadow: 0 0 0 3px rgba(105,168,128,.2); }
:root[data-theme="dark"] .input::placeholder,
:root[data-theme="dark"] .textarea::placeholder { color: #82938a; }
:root[data-theme="dark"] .form-label { color: #c3d1c9; }
:root[data-theme="dark"] .flash { color: #a7ddb4; border-color: #3c6547; background: #203728; }
:root[data-theme="dark"] .flash-error { color: #ffb0a7; border-color: #69413a; background: #392522; }
:root[data-theme="dark"] .notice { color: #e4c983; border-color: #5b4b2c; background: #332c1d; }
:root[data-theme="dark"] .notice strong { color: #f0d894; }
:root[data-theme="dark"] .notice-blue { color: #b5d7df; border-color: #35525a; background: #1d3035; }
:root[data-theme="dark"] .notice-blue strong { color: #d2edf2; }
:root[data-theme="dark"] .adjust-form,
:root[data-theme="dark"] .upload-zone,
:root[data-theme="dark"] .document-card,
:root[data-theme="dark"] .store-card .store-form,
:root[data-theme="dark"] .transfer-line-row { background: #202d26; }
:root[data-theme="dark"] .item-badge { color: #c0cec6; background: #303c35; }
:root[data-theme="dark"] .upload-zone { border-color: #5f7d6d; }
:root[data-theme="dark"] .upload-zone:hover,
:root[data-theme="dark"] .upload-zone.dragover { border-color: #85b49a; background: #263b2e; }
:root[data-theme="dark"] .upload-icon,
:root[data-theme="dark"] .store-check,
:root[data-theme="dark"] .pos-cart-actions #pos-open-held-sales span { background: #2b4034; }
:root[data-theme="dark"] .file-list,
:root[data-theme="dark"] .document-card-header { color: #bdcbc3; }
:root[data-theme="dark"] .file-item,
:root[data-theme="dark"] .product-thumb { background: #17221c; }
:root[data-theme="dark"] .document-preview,
:root[data-theme="dark"] .pdf-preview { background: #17221c; }
:root[data-theme="dark"] .meta-box { background: #202d26; }
:root[data-theme="dark"] .invoice-footer { background: rgba(27,39,33,.97); }
:root[data-theme="dark"] .review-confirm,
:root[data-theme="dark"] .login-demo { color: #bac8c0; }
:root[data-theme="dark"] .login-screen { background: radial-gradient(ellipse at top right, #203a2d 0, transparent 42%), var(--canvas); }
:root[data-theme="dark"] .login-card { background: var(--surface); }
:root[data-theme="dark"] .login-demo { background: #26372e; }
:root[data-theme="dark"] .login-demo strong { color: #d3e5da; }
:root[data-theme="dark"] .login-brand .brand-logo-dark { display: none; }
:root[data-theme="dark"] .login-brand .brand-logo-light { display: block; }
:root[data-theme="dark"] .pos-held-dialog { color: var(--ink); border-color: var(--line); background: var(--surface); }
:root[data-theme="dark"] .pos-held-dialog-header { border-color: var(--line); }
:root[data-theme="dark"] .pos-held-dialog-header h3,
:root[data-theme="dark"] .pos-held-card-heading > strong,
:root[data-theme="dark"] .pos-held-empty strong { color: var(--ink); }
:root[data-theme="dark"] .pos-held-dialog-header p,
:root[data-theme="dark"] .pos-held-card-details small,
:root[data-theme="dark"] .pos-held-empty { color: var(--muted); }
:root[data-theme="dark"] .pos-held-close { color: #c3d1c9; background: #2d3c34; }
:root[data-theme="dark"] .pos-held-notice { color: #b8e0c0; background: #263b2c; }
:root[data-theme="dark"] .pos-held-notice.is-error,
:root[data-theme="dark"] .pos-held-empty.is-error { color: #ffb0a7; background: #392522; }
:root[data-theme="dark"] .pos-held-card { border-color: var(--line); background: #202d26; }
:root[data-theme="dark"] .store-check strong { color: #d4e1d9; }
:root[data-theme="dark"] .store-check small,
:root[data-theme="dark"] .store-stock,
:root[data-theme="dark"] .transfer-note,
:root[data-theme="dark"] .transfer-arrow { color: #aab9b1; }
:root[data-theme="dark"] .store-card.store-inactive { background: #202922; }
:root[data-theme="dark"] .store-card .store-form { border-color: var(--line); }
:root[data-theme="dark"] .product-thumb-empty,
:root[data-theme="dark"] .pos-product-placeholder { color: #9db7aa; }
:root[data-theme="dark"] .transfer-action { border-color: #364b3d; background: #1d2c23; }
:root[data-theme="dark"] .pos-register-bar { border-color: #5d4a28; background: #2d281d; }
:root[data-theme="dark"] .pos-register-open { border-color: #3c6547; background: #203728; }
:root[data-theme="dark"] .pos-register-mark { color: #e8c36c; background: #473b23; }
:root[data-theme="dark"] .pos-register-open .pos-register-mark { color: #a7ddb4; background: #2d4935; }
:root[data-theme="dark"] .pos-register-copy span { color: #b2c0b8; }
:root[data-theme="dark"] .pos-shift-close-form,
:root[data-theme="dark"] .pos-day-strip,
:root[data-theme="dark"] .pos-open-card,
:root[data-theme="dark"] .pos-search-panel,
:root[data-theme="dark"] .pos-product-card,
:root[data-theme="dark"] .pos-cart-panel { color: var(--ink); background: var(--surface); }
:root[data-theme="dark"] .pos-search-panel { border-color: #526b5d; }
:root[data-theme="dark"] .pos-search-panel:focus-within { border-color: #83b59a; }
:root[data-theme="dark"] .pos-search-icon,
:root[data-theme="dark"] .pos-search-hint span { color: #9fc4ad; }
:root[data-theme="dark"] .pos-search::placeholder,
:root[data-theme="dark"] .pos-search-hint,
:root[data-theme="dark"] .pos-stock-legend,
:root[data-theme="dark"] .pos-product-brand,
:root[data-theme="dark"] .pos-payment-heading span,
:root[data-theme="dark"] .pos-payment-note { color: #9aaba2; }
:root[data-theme="dark"] .pos-search-panel kbd { color: #b3c0b8; border-color: var(--line); background: #202d26; }
:root[data-theme="dark"] .pos-product-card:hover { border-color: #85b49a; }
:root[data-theme="dark"] .pos-product-image { border-color: var(--line); background: #17221c; }
:root[data-theme="dark"] .pos-product-name,
:root[data-theme="dark"] .pos-no-products strong,
:root[data-theme="dark"] .pos-cart-item-info strong,
:root[data-theme="dark"] .pos-cart-line-total,
:root[data-theme="dark"] .pos-totals strong,
:root[data-theme="dark"] .pos-payment-heading strong,
:root[data-theme="dark"] .pos-receipt-meta strong,
:root[data-theme="dark"] .pos-receipt-totals strong { color: var(--ink); }
:root[data-theme="dark"] .pos-product-stock { color: #a7ddb4; }
:root[data-theme="dark"] .pos-product-stock.is-empty,
:root[data-theme="dark"] .pos-remove-item { color: #ffb0a7; }
:root[data-theme="dark"] .pos-remove-item { background: #392522; }
:root[data-theme="dark"] .pos-cart-empty > span,
:root[data-theme="dark"] .pos-quantity-controls { color: #bdd1c4; border-color: var(--line); background: #202d26; }
:root[data-theme="dark"] .pos-cart-empty strong { color: #d4e1d9; }
:root[data-theme="dark"] .pos-cart-empty small,
:root[data-theme="dark"] .pos-cart-item-info small,
:root[data-theme="dark"] .pos-line-discount-field,
:root[data-theme="dark"] .pos-customer-fields label,
:root[data-theme="dark"] .pos-totals > div,
:root[data-theme="dark"] .pos-change-row,
:root[data-theme="dark"] .pos-cash-field,
:root[data-theme="dark"] .pos-receipt-meta small,
:root[data-theme="dark"] .pos-receipt-meta span,
:root[data-theme="dark"] .pos-receipt-status strong { color: #9aaba2; }
:root[data-theme="dark"] .pos-quantity-controls button { color: var(--ink); background: #2c4034; }
:root[data-theme="dark"] .pos-discount-row strong { color: #efbd73; }
:root[data-theme="dark"] .pos-total-row span { color: #dce9e1; }
:root[data-theme="dark"] .pos-payment-section { background: #202d26; }
:root[data-theme="dark"] .pos-payment-option { color: #c0cec6; border-color: var(--line); background: #17221c; }
:root[data-theme="dark"] .pos-payment-option.selected { color: #d4e9da; border-color: #6b9b7b; background: #294033; box-shadow: inset 0 0 0 1px #52795f; }
:root[data-theme="dark"] .pos-change-row strong,
:root[data-theme="dark"] .pos-checkout-message { color: #a7ddb4; }
:root[data-theme="dark"] .pos-checkout-button:disabled { background: #41554a; }
:root[data-theme="dark"] .pos-checkout-message.is-error { color: #ffb0a7; }
:root[data-theme="dark"] .pos-receipt-table { border-color: var(--line); }
:root[data-theme="dark"] .pos-receipt-head { border-color: var(--line); }
:root[data-theme="dark"] .pos-receipt-notes,
:root[data-theme="dark"] .pos-receipt-totals > div,
:root[data-theme="dark"] .pos-receipt-totals .pos-receipt-grand,
:root[data-theme="dark"] .pos-return-controls label { color: #b6c5bc; }
:root[data-theme="dark"] .pos-receipt-logo { display: none; }
:root[data-theme="dark"] .pos-receipt-logo-light { display: block; width: 182px; max-width: 100%; height: auto; }
:root[data-theme="dark"] .app-confirm-dialog { color: var(--ink); border-color: var(--line); background: var(--surface); }
:root[data-theme="dark"] .app-confirm-actions { border-color: var(--line); background: #202d26; }
:root[data-theme="dark"] .app-confirm-icon { color: #f0cc7c; }
:root[data-theme="dark"] .transfer-receipt-logo { display: none; }
:root[data-theme="dark"] .transfer-receipt-logo-light { display: block; }

@media print {
    :root[data-theme="dark"] { color-scheme: light; }
    :root[data-theme="dark"] body,
    :root[data-theme="dark"] .pos-receipt,
    :root[data-theme="dark"] .transfer-receipt { color: #111; background: #fff; }
    :root[data-theme="dark"] .pos-receipt-logo-light,
    :root[data-theme="dark"] .transfer-receipt-logo-light { display: none !important; }
}

@media (max-width: 760px) {
    .topbar-right .theme-toggle { width: 39px; min-width: 39px; padding: 8px; }
    .topbar-right .theme-toggle [data-theme-label] { display: none; }
}

.credit-note-toolbar { padding: 13px 16px 0; }
.credit-note-paper-brand { justify-content: center; padding: 0; }
.credit-note-paper-brand .brand-logo { width: 165px; }
.credit-note-logo-light, .credit-note-logo-print { display: none; }
.credit-note-receipt-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 0 15px; border-bottom: 1px dashed var(--line); }
.credit-note-receipt-title { text-align: right; }
.credit-note-receipt-title h2 { margin: 0; font: 800 21px 'Manrope', sans-serif; letter-spacing: -.03em; }
.credit-note-paper-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.credit-note-paper-meta > div { display: grid; gap: 3px; min-width: 0; }
.credit-note-paper-meta span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.credit-note-paper-meta strong { overflow-wrap: anywhere; font-size: 10px; }
.credit-note-items { display: grid; gap: 7px; padding: 11px 0; }
.credit-note-item { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); }
.credit-note-item > strong, .credit-note-item > small { display: block; }
.credit-note-item > strong { font-size: 11px; }
.credit-note-item > small { color: var(--muted); margin-top: 2px; font-size: 9px; }
.credit-note-item-total { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 9px; }
.credit-note-item-total strong { white-space: nowrap; }
.credit-note-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 11px; }
.credit-note-total strong { color: var(--green); font: 800 17px 'Manrope', sans-serif; }
.credit-note-paper-notes, .credit-note-paper-footer { padding-top: 7px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 9px; }
.credit-note-paper-footer { margin-top: 7px; text-align: center; }
.credit-note-tools { margin-top: 14px; }
.credit-line-add-form { display: grid; grid-template-columns: minmax(220px,1.5fr) repeat(3,minmax(120px,.7fr)); align-items: end; gap: 11px; }
.credit-line-add-form .form-field { margin: 0; }
.credit-line-add-form .form-field.full { grid-column: 1 / -1; }
.credit-note-edit-lines { display: grid; gap: 0; padding: 0 18px; }
.credit-note-edit-line { padding: 14px 0; border-top: 1px solid var(--line); }
.credit-note-edit-line:first-child { border-top: 0; }
.credit-note-edit-heading { margin-bottom: 9px; }
.credit-note-edit-heading strong { font-size: 12px; }
.credit-note-line-edit { display: grid; grid-template-columns: .65fr .8fr 1fr 1.4fr auto; align-items: end; gap: 8px; }
.credit-note-line-edit .form-field { min-width: 0; margin: 0; }
.credit-note-line-edit .form-label { font-size: 9px; }
.credit-note-line-edit .input, .credit-note-line-edit .select { padding: 7px 8px; font-size: 10px; }
.credit-note-edit-line > form:last-child { display: flex; justify-content: flex-end; margin-top: 7px; }
.credit-note-footer-actions { justify-content: flex-end; margin-top: 14px; }
.credit-note-footer-actions form { margin: 0; }
.credit-reference-form { display: flex; align-items: end; gap: 9px; max-width: 850px; }
.credit-reference-form .form-field { flex: 1; min-width: 145px; margin: 0; }

.refund-receipt { max-width: 850px; margin: 0 auto; }
.refund-receipt-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 15px; border-bottom: 1px dashed var(--line); }
.refund-receipt-head > div:last-child { text-align: right; }
.refund-receipt-head h2 { margin: 0; font: 800 21px 'Manrope', sans-serif; letter-spacing: -.03em; }
.refund-receipt-logo-light, .refund-receipt-logo-print { display: none; }
.refund-receipt-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.refund-receipt-meta > div { display: grid; gap: 3px; min-width: 0; }
.refund-receipt-meta span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.refund-receipt-meta strong { overflow-wrap: anywhere; font-size: 10px; }
.refund-receipt-items { display: grid; }
.refund-receipt-item { display: grid; gap: 3px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.refund-receipt-item-heading { display: flex; justify-content: space-between; gap: 10px; }
.refund-receipt-item-heading strong { font-size: 11px; }
.refund-receipt-item small { color: var(--muted); font-size: 9px; }
.refund-receipt-total { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.refund-receipt-notes, .refund-receipt-footer { padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 10px; }
.refund-receipt-footer { margin-top: 8px; text-align: center; }

:root[data-theme="dark"] .credit-note-item { background: #202d26; }
:root[data-theme="dark"] .credit-note-logo-dark { display: none; }
:root[data-theme="dark"] .credit-note-logo-light { display: block; width: 165px; max-width: 100%; height: auto; }
:root[data-theme="dark"] .refund-receipt-logo-dark { display: none; }
:root[data-theme="dark"] .refund-receipt-logo-light { display: block; width: 165px; max-width: 100%; height: auto; }
:root[data-theme="dark"] .refund-receipt-meta,
:root[data-theme="dark"] .refund-receipt-head,
:root[data-theme="dark"] .refund-receipt-item,
:root[data-theme="dark"] .refund-receipt-total { border-color: var(--line); }

@media (max-width: 760px) {
    .credit-note-paper-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .refund-receipt-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .credit-line-add-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .credit-line-add-form .form-field:first-child, .credit-line-add-form .form-field.full { grid-column: 1 / -1; }
    .credit-note-line-edit { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .credit-note-line-edit > .button { min-height: 36px; }
    .credit-reference-form { align-items: stretch; flex-direction: column; }
}

/* Demo outbox: present saved messages like a familiar, readable mailbox. */
.outbox-heading { align-items: center; margin-bottom: 18px; }
.outbox-message { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.outbox-toolbar { min-height: 64px; display: flex; align-items: center; gap: 13px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, var(--canvas)); }
.outbox-back { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--green); font-size: 18px; }
.outbox-toolbar-title { display: flex; align-items: center; gap: 9px; flex: 1; font: 800 13px 'Manrope', sans-serif; }
.outbox-mail-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--mint); font-size: 16px; }
.outbox-content { width: min(100%, 1050px); margin: 0 auto; padding: 23px clamp(14px, 4vw, 38px) 30px; }
.outbox-notice { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 20px; padding: 14px 16px; }
.outbox-notice-icon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(51, 111, 126, .12); font: 800 12px 'Manrope', sans-serif; }
.outbox-notice div { display: grid; gap: 2px; }
.outbox-notice div span { line-height: 1.55; }
.mail-paper { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.mail-subject-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 23px 17px; }
.mail-subject-row h3 { min-width: 0; margin: 0; color: var(--ink); font: 800 clamp(17px, 2.4vw, 22px)/1.35 'Manrope', sans-serif; overflow-wrap: anywhere; }
.outbox-copy { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--green); cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }
.outbox-copy:hover { background: var(--mint); }
.mail-sender-row { display: flex; align-items: center; gap: 12px; padding: 14px 23px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mail-avatar { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--green-deep); font: 800 15px 'Manrope', sans-serif; }
.mail-sender-details { display: grid; min-width: 0; flex: 1; gap: 2px; }
.mail-sender-details strong { font-size: 12px; }
.mail-sender-details > span { min-width: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.mail-recipient-summary { color: var(--ink); }
.mail-sender-row time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.mail-details { padding: 0 23px; background: color-mix(in srgb, var(--canvas) 65%, var(--surface)); }
.mail-details summary { padding: 10px 0; color: var(--muted); cursor: pointer; font-size: 10px; }
.mail-details[open] { padding-bottom: 12px; }
.mail-detail-line { display: flex; align-items: flex-start; gap: 13px; padding: 4px 0; font-size: 11px; }
.mail-detail-line > span { width: 44px; flex: 0 0 44px; color: var(--muted); }
.mail-detail-line strong { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.mail-detail-line button { border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 10px; font-weight: 700; }
.mail-preview-label { display: flex; justify-content: space-between; gap: 10px; padding: 14px 22px 9px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mail-preview-label span:last-child { font-weight: 500; letter-spacing: 0; text-transform: none; }
.mail-html-preview { width: 100%; min-height: 320px; display: block; border: 0; border-top: 1px solid var(--line); background: #fff; }
.mail-text-preview { min-height: 220px; padding: 20px 23px 25px; border-top: 1px solid var(--line); color: var(--ink); font: 13px/1.7 'DM Sans', sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.outbox-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--canvas) 65%, var(--surface)); }
.outbox-actions-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.outbox-action-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; background: var(--mint); color: var(--green); }
.outbox-actions-copy div { display: grid; gap: 2px; }
.outbox-actions-copy strong { font-size: 11px; }
.outbox-actions-copy span:last-child { color: var(--muted); font-size: 10px; }
.outbox-copy-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.outbox-copy-actions .button { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.mail-original { margin-top: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.mail-original summary { padding: 12px 15px; color: var(--green); cursor: pointer; font-size: 11px; font-weight: 700; }
.mail-original-fields { display: grid; gap: 12px; padding: 0 15px 15px; }
.mail-original-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.mail-original-fields textarea, .mail-original-fields input { width: 100%; min-height: 40px; padding: 9px 11px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); color: var(--ink); font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.mail-original-fields textarea { min-height: 110px; }
.outbox-copy-status { position: fixed; z-index: 99; right: 22px; bottom: 22px; padding: 10px 15px; border: 1px solid #377450; border-radius: 10px; background: var(--green-deep); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s ease; }
.outbox-copy-status.visible { opacity: 1; transform: translateY(0); }
:root[data-theme="dark"] .outbox-message, :root[data-theme="dark"] .mail-paper, :root[data-theme="dark"] .mail-original { background: var(--surface); }
:root[data-theme="dark"] .outbox-toolbar, :root[data-theme="dark"] .mail-details, :root[data-theme="dark"] .outbox-actions { background: color-mix(in srgb, var(--surface) 82%, var(--canvas)); }
:root[data-theme="dark"] .mail-avatar { color: #17382f; }
:root[data-theme="dark"] .outbox-copy { background: #26362e; }
:root[data-theme="dark"] .outbox-copy:hover { background: #31463a; }
:root[data-theme="dark"] .mail-html-preview { background: #fff; }

@media (max-width: 760px) {
    .outbox-heading { align-items: flex-start; flex-direction: column; }
    .outbox-toolbar { min-height: 56px; padding: 9px 12px; }
    .outbox-content { padding: 14px 10px 18px; }
    .outbox-notice { margin-bottom: 12px; padding: 11px 12px; }
    .mail-subject-row { padding: 17px 14px 13px; }
    .mail-sender-row { align-items: flex-start; padding: 12px 14px; }
    .mail-avatar { width: 36px; height: 36px; flex-basis: 36px; }
    .mail-sender-row time { max-width: 82px; text-align: right; line-height: 1.4; }
    .mail-details { padding: 10px 14px; }
    .mail-preview-label { padding: 12px 14px 8px; }
    .mail-html-preview { min-height: 280px; }
    .mail-text-preview { padding: 15px 14px 20px; }
    .outbox-actions { align-items: stretch; flex-direction: column; padding: 13px; }
    .outbox-copy-actions { justify-content: flex-start; }
}

/* Appointment forms use the same controls as staff and receiving screens. */
.appointment-edit .form-field,.staff-panel[data-appointments] .form-field{display:flex;flex-direction:column;gap:7px;min-width:0}
.appointment-edit .input,.appointment-edit .select{font-size:14px;padding:12px 14px;min-height:46px;background:var(--surface);border-color:var(--line);color:var(--ink)}
.appointment-title{padding-bottom:14px;border-bottom:1px solid var(--line)}
.appointment-title strong{font-size:16px}.appointment-title .mono{padding:5px 9px;background:var(--surface-soft);border-radius:6px;color:var(--green)}
