:root {
    --ink: #172033;
    --muted: #697386;
    --line: #e6e9ef;
    --surface: #ffffff;
    --canvas: #f5f6f8;
    --nav: #0b2c40;
    --nav-soft: #123a52;
    --primary: #007bb6;
    --primary-dark: #005f8f;
    --primary-soft: #e5f3fa;
    --danger: #d94667;
    --danger-dark: #b92f50;
    --danger-soft: #fff0f3;
    --teal: #0f9488;
    --teal-soft: #e5f7f4;
    --green: #1f9d72;
    --green-soft: #eaf8f3;
    --amber: #d98b28;
    --amber-soft: #fff5e6;
    --violet: #7657d6;
    --shadow: 0 8px 30px rgba(23, 32, 51, .06);
    --radius: 16px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
body { font-size: 14px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand strong, .metric-card strong { font-family: Manrope, Inter, ui-sans-serif, sans-serif; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 252px; display: flex; flex-direction: column; color: #d7dbe5; background: var(--nav); border-right: 1px solid rgba(255,255,255,.06); }
.brand { height: 82px; padding: 0 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, #1596c9, #00618f); box-shadow: 0 9px 20px rgba(0,123,182,.3); font: 800 21px/1 Manrope, sans-serif; }
.brand > span:last-child { display: grid; }
.brand strong { color: white; font-size: 19px; line-height: 1.2; letter-spacing: -.02em; }
.brand small, .sidebar-footer small { color: #858da1; font-size: 11px; }

.main-nav { flex: 1; overflow-y: auto; padding: 18px 12px; scrollbar-width: thin; }
.main-nav details { margin: 8px 0 14px; }
.main-nav summary { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; color: #7f8799; cursor: pointer; list-style: none; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.main-nav summary::-webkit-details-marker { display: none; }
.main-nav .chevron { font-size: 15px; transition: transform .2s; }
.main-nav details:not([open]) .chevron { transform: rotate(-90deg); }
.main-nav a { min-height: 43px; margin: 3px 0; padding: 8px 11px; display: flex; align-items: center; gap: 11px; border-radius: 11px; color: #aeb5c4; font-weight: 600; transition: .18s ease; }
.main-nav a:hover { color: white; background: rgba(255,255,255,.05); }
.main-nav a.active { color: white; background: linear-gradient(90deg, rgba(0,123,182,.32), rgba(0,123,182,.08)); box-shadow: inset 3px 0 var(--primary); }
.nav-icon { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.06); font-size: 11px; font-weight: 800; }
.main-nav a.active .nav-icon { color: #9edcf5; background: rgba(0,123,182,.24); }
.sidebar-footer { margin: 12px; padding: 13px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(255,255,255,.025); }
.sidebar-footer > span:last-child { min-width: 0; display: grid; }
.sidebar-footer strong { color: #d7dbe5; font-size: 11px; }
.environment-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.environment-dot.demo { background: var(--amber); }
.environment-dot.live { background: #2bd59b; }

.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; z-index: 25; top: 0; height: 66px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-title { display: grid; line-height: 1.1; }
.topbar-title strong { font-size: 15px; }
.topbar-title .eyebrow { font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.date-chip { padding: 7px 11px; color: var(--muted); background: var(--canvas); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; text-transform: capitalize; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--ink); font-size: 10px; font-weight: 800; }
.mobile-menu { display: none; }
.page-content { width: min(1500px, 100%); margin: 0 auto; padding: 15px 15px 15px; }

.page-header { min-height: 66px; margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-header h1 { margin: 3px 0 5px; font-size: clamp(25px, 3vw, 34px); line-height: 1.1; letter-spacing: -.035em; }
.page-header p { max-width: 680px; margin-bottom: 0; color: var(--muted); }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.btn { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-primary { color: white; background: var(--primary); box-shadow: 0 8px 18px rgba(0,123,182,.22); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: var(--ink); background: white; border-color: var(--line); }
.btn-dark { color: white; background: var(--ink); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-danger { color: white; background: #c73c54; }
.btn-danger:hover { background: #a6304a; }
.btn-block { width: 100%; }
.text-link, .text-button { color: var(--primary); border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 12px; }
.text-button.danger { color: #c73c54; }

.metric-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { position: relative; min-height: 150px; padding: 20px; display: flex; flex-direction: column; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card::after { content: ""; position: absolute; right: -30px; bottom: -38px; width: 110px; height: 110px; border-radius: 50%; opacity: .55; }
.metric-card > span { margin: 5px 0 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-card > strong { position: relative; z-index: 1; font-size: clamp(20px, 2vw, 27px); letter-spacing: -.035em; }
.metric-card > small { margin-top: auto; color: #8c94a3; font-size: 10px; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-weight: 800; }
.accent-rose .metric-icon { color: var(--primary); background: var(--primary-soft); }.accent-rose::after { background: var(--primary-soft); }
.accent-blue .metric-icon { color: var(--teal); background: var(--teal-soft); }.accent-blue::after { background: var(--teal-soft); }
.accent-amber .metric-icon { color: var(--amber); background: var(--amber-soft); }.accent-amber::after { background: var(--amber-soft); }
.accent-green .metric-icon { color: var(--green); background: var(--green-soft); }.accent-green::after { background: var(--green-soft); }
.dashboard-grid { display: grid; grid-template-columns: .85fr 1.5fr; gap: 18px; }
.panel-heading { padding: 19px 20px 13px; display: flex; align-items: center; justify-content: space-between; }
.panel-heading h2 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.02em; }
.quick-actions { padding: 0 12px 13px; }
.quick-actions a { padding: 10px; display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 11px; border-radius: 12px; transition: .18s; }
.quick-actions a:hover { background: var(--canvas); }
.quick-actions a > span:nth-child(2) { display: grid; }
.quick-actions strong { font-size: 13px; }.quick-actions small { color: var(--muted); font-size: 10px; }.quick-actions b { color: #a7adba; font-size: 21px; }
.quick-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; }
.quick-icon.rose { color: var(--primary); background: var(--primary-soft); }.quick-icon.violet { color: var(--violet); background: #f2efff; }.quick-icon.blue { color: var(--teal); background: var(--teal-soft); }.quick-icon.amber { color: var(--amber); background: var(--amber-soft); }
.compact-list { padding: 0 13px 12px; }
.compact-row { min-height: 58px; padding: 9px 8px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 11px; border-top: 1px solid #eff1f4; }
.operation-dot { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-weight: 800; font-size: 11px; }
.operation-dot.collection, .operation-dot.payment { color: var(--teal); background: var(--teal-soft); }.operation-dot.purchase { color: var(--amber); background: var(--amber-soft); }.operation-dot.debitnote { color: var(--violet); background: #f2efff; }.operation-dot.creditnote { color: var(--green); background: var(--green-soft); }
.compact-main, .compact-amount { display: grid; }.compact-main strong, .compact-amount strong { font-size: 12px; }.compact-main small, .compact-amount small { color: var(--muted); font-size: 10px; }.compact-amount { text-align: right; }
.status-text.pending { color: var(--amber); }.status-text.paid { color: var(--green); }

.list-panel { overflow: hidden; }
.list-toolbar { min-height: 72px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.search-box { width: min(520px, 100%); display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fafbfc; }
.search-box > span { padding-left: 13px; color: #9aa1af; font-size: 19px; }
.search-box input { min-width: 0; flex: 1; height: 42px; padding: 0 10px; border: 0; outline: 0; background: transparent; }
.search-box button { align-self: stretch; padding: 0 15px; border: 0; border-left: 1px solid var(--line); color: var(--ink); background: white; cursor: pointer; font-weight: 700; }
.result-count { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 43px; padding: 0 16px; color: #7c8494; background: #fafbfc; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
.data-table td { min-height: 59px; padding: 12px 16px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfd; }
.data-table td > small { display: block; color: var(--muted); font-size: 10px; }
.data-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.badge.paid { color: #157a59; background: var(--green-soft); }.badge.pending { color: #a56616; background: var(--amber-soft); }.badge.cancelled { color: #9a4253; background: var(--danger-soft); }
.row-action { width: 66px; text-align: right; }.row-action a { color: var(--primary); font-size: 11px; font-weight: 700; }
.stock.low { color: #b36e17; padding: 4px 7px; background: var(--amber-soft); border-radius: 7px; }
.table-loading { height: 220px; display: grid; place-content: center; grid-auto-flow: column; gap: 5px; }
.table-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1s infinite ease-in-out; }.table-loading span:nth-child(2) { animation-delay: .12s; }.table-loading span:nth-child(3) { animation-delay: .24s; }
@keyframes pulse { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }

.status-banner { margin: -8px 0 18px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid; border-radius: 11px; }
.status-banner.success { color: #176d52; background: var(--green-soft); border-color: #cdeade; }.status-banner.error { color: #a6354c; background: var(--danger-soft); border-color: #f4cdd6; }
.status-symbol { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 800; }
.status-banner.success .status-symbol { background: var(--green); }.status-banner.error .status-symbol { background: var(--danger); }.status-banner > button { margin-left: auto; border: 0; color: currentColor; background: none; cursor: pointer; font-size: 18px; }
.validation-summary { margin: 0 0 16px; padding: 12px 16px; color: #a6354c; background: var(--danger-soft); border: 1px solid #f4cdd6; border-radius: 11px; }.validation-summary:empty { display: none; }.validation-summary ul { margin: 0; padding-left: 18px; }
.validation-message, .field-error { color: #b52f4a; font-size: 11px; }
input.invalid, select.invalid, textarea.invalid { border-color: #dc7186 !important; box-shadow: 0 0 0 3px rgba(217,70,103,.09); }

.entity-form, .document-form { display: grid; gap: 18px; }
.form-section { padding: 22px; }
.section-heading { margin-bottom: 20px; display: flex; align-items: flex-start; gap: 12px; }
.section-heading > div { min-width: 0; }.section-heading h2 { margin: 1px 0 3px; font-size: 17px; letter-spacing: -.02em; }.section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.section-number { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.form-grid { display: grid; gap: 16px; }.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }.form-grid .span-2 { grid-column: span 2; }
.field { position: relative; min-width: 0; display: grid; align-content: start; gap: 6px; }
.field > span, .field > label { color: #555f70; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.field input, .field select, .field textarea, .line-adder select, .customer-select select { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #dfe3e9; border-radius: 9px; outline: 0; transition: .15s; }
.field textarea { resize: vertical; }.field input:focus, .field select:focus, .field textarea:focus, .line-adder select:focus { border-color: #4fa5cc; box-shadow: 0 0 0 3px rgba(0,123,182,.15); }
.field input[readonly] { color: var(--muted); background: #f7f8fa; }
.money-field b { position: absolute; z-index: 1; left: 11px; bottom: 12px; color: #8a92a0; font-size: 10px; }.money-field input { padding-left: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.toggle-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.toggle-field { min-height: 49px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; cursor: pointer; }
.toggle-field input { width: 17px; height: 17px; accent-color: var(--primary); }.toggle-field span { display: grid; }.toggle-field strong { font-size: 11px; }.toggle-field small { color: var(--muted); font-size: 9px; }
.segmented { padding: 4px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fa; }
.segmented.full { width: 100%; }.segmented label { position: relative; min-height: 34px; padding: 8px 13px; flex: 1; display: grid; place-items: center; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; }
.segmented input { position: absolute; opacity: 0; }.segmented label:has(input:checked) { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(23,32,51,.09); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }.form-actions.centered { justify-content: center; }.narrow-form { max-width: 900px; margin: 0 auto; }
.credit-section { border-top: 3px solid var(--primary); }
.form-loading { min-height: 470px; background: linear-gradient(100deg, #fff 30%, #f4f5f7 45%, #fff 60%); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }

.document-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }.document-main { min-width: 0; display: grid; gap: 18px; }.document-summary { position: sticky; top: 84px; }
.line-adder { margin-bottom: 16px; padding: 13px; display: grid; grid-template-columns: minmax(220px, 1fr) 110px auto; gap: 10px; align-items: end; background: #f7f8fa; border: 1px solid var(--line); border-radius: 12px; }.line-adder .btn { height: 42px; }.empty-lines { min-height: 155px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); border: 1px dashed #d7dbe3; border-radius: 12px; }.empty-lines > span { width: 34px; height: 34px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-weight: 800; }.empty-lines strong { color: var(--ink); font-size: 12px; }.empty-lines small { font-size: 10px; }.success-empty > span { color: var(--green); background: var(--green-soft); }
.line-table-wrap { border: 1px solid var(--line); border-radius: 12px; }.edit-cell input { width: 88px; height: 34px; padding: 5px 7px; text-align: right; border: 1px solid var(--line); border-radius: 7px; }.delete-button { width: 28px; height: 28px; display: inline-grid; place-items: center; color: #b1465a; background: var(--danger-soft); border: 0; border-radius: 8px; cursor: pointer; font-size: 17px; }
.summary-card { padding: 20px; }.summary-card > .eyebrow { display: block; margin-bottom: 8px; }.totals-list { margin: 18px 0; display: grid; gap: 10px; }.totals-list > div { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 12px; }.totals-list strong { color: var(--ink); font-variant-numeric: tabular-nums; }.totals-list .grand-total { margin-top: 4px; padding-top: 15px; align-items: baseline; border-top: 1px solid var(--line); color: var(--ink); font-weight: 800; }.grand-total strong { color: var(--primary); font-size: 23px; letter-spacing: -.035em; }
.payment-box { margin: 0 -4px 17px; padding: 13px; display: grid; gap: 10px; background: #f7f8fa; border-radius: 12px; }.payment-heading, .payment-total, .change-total { display: flex; justify-content: space-between; align-items: center; }.payment-heading button { color: var(--primary); border: 0; background: none; cursor: pointer; font-size: 9px; font-weight: 800; }.payment-total { padding-top: 10px; border-top: 1px solid var(--line); }.change-total { margin: 8px 0; padding: 10px 12px; color: #176d52; background: var(--green-soft); border-radius: 9px; }.credit-note { margin: 15px 0; padding: 11px; display: flex; gap: 9px; color: #2b5b74; background: var(--primary-soft); border-radius: 10px; }.credit-note > span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #a9d3e6; border-radius: 50%; font-weight: 800; }.credit-note p { margin: 0; font-size: 10px; }

.allocation-section .section-heading { align-items: center; }.distribution-total { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }.form-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }.action-field .btn { width: 100%; }.applied-box { margin-top: 22px; padding: 14px; display: grid; gap: 14px; background: var(--primary-soft); border: 1px solid #cfe8f4; border-radius: 12px; }.note-impact { padding: 17px 20px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; }.note-impact > div { display: grid; }.note-impact span, .note-impact small { color: var(--muted); font-size: 10px; }.note-impact strong { font-size: 17px; }

.pos-header { align-items: center; }.pos-ticket { padding: 10px 13px; display: grid; text-align: right; background: white; border: 1px solid var(--line); border-radius: 10px; }.pos-ticket span { color: var(--muted); font-size: 9px; text-transform: uppercase; }.pos-ticket strong { font-size: 11px; }.pos-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(350px, .7fr); gap: 18px; align-items: start; }.pos-catalog { min-width: 0; }.pos-search { height: 54px; padding: 0 15px; display: flex; align-items: center; gap: 9px; }.pos-search > span { color: #9299a7; font-size: 20px; }.pos-search input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; }.category-strip { margin: 13px 0; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }.category-strip::-webkit-scrollbar { display: none; }.category-strip button { padding: 8px 13px; flex: 0 0 auto; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 700; }.category-strip button.active { color: white; background: var(--ink); border-color: var(--ink); }.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }.product-tile { position: relative; min-height: 218px; padding: 0; overflow: hidden; text-align: left; background: white; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; box-shadow: 0 5px 18px rgba(23,32,51,.04); transition: .18s; }.product-tile:hover { transform: translateY(-2px); border-color: #d2d7e0; box-shadow: var(--shadow); }.product-tile:disabled { opacity: .5; cursor: not-allowed; transform: none; }.product-visual { height: 92px; display: grid; place-items: center; color: #0f5a78; background: linear-gradient(135deg, #e6f4fa, #d2e9f6); font: 800 27px/1 Manrope, sans-serif; }.product-visual.category-2 { color: #0f6e63; background: linear-gradient(135deg, #e3f6f2, #cdeee7); }.product-visual.category-3 { color: #6a55a7; background: linear-gradient(135deg, #f2efff, #e6e0fb); }.product-visual.category-4 { color: #397b68; background: linear-gradient(135deg, #eaf8f3, #d4eee5); }.product-data { padding: 12px; display: grid; }.product-data small { color: var(--muted); font-size: 9px; }.product-data strong { min-height: 36px; margin: 3px 0 4px; font-size: 12px; }.product-data b { color: var(--primary); font-size: 15px; }.product-data em { color: #8b93a2; font-size: 9px; font-style: normal; }.tile-add { position: absolute; right: 9px; bottom: 10px; width: 27px; height: 27px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 8px; }
.pos-cart { top: 83px; display: flex; flex-direction: column; overflow: hidden; }.cart-heading { padding: 18px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }.cart-heading h2 { margin: 2px 0 0; font-size: 18px; }.cart-heading h2 b { margin-left: 4px; padding: 3px 7px; color: var(--primary); background: var(--primary-soft); border-radius: 999px; font-size: 9px; }.customer-select { padding: 12px 16px; border-bottom: 1px solid var(--line); }.cart-lines { min-height: 165px; overflow-y: auto; }.empty-cart { height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }.empty-cart > span { font-size: 26px; filter: grayscale(1); opacity: .5; }.empty-cart strong { margin-top: 7px; color: var(--ink); font-size: 12px; }.empty-cart small { font-size: 9px; }.cart-line { padding: 12px 14px; display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; align-items: center; gap: 9px; border-bottom: 1px solid #eef0f3; }.cart-line-main { min-width: 0; display: grid; }.cart-line-main strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.cart-line-main small { color: var(--muted); font-size: 9px; }.quantity-control { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }.quantity-control button { width: 27px; height: 27px; padding: 0; border: 0; background: #f7f8fa; cursor: pointer; }.quantity-control span { width: 27px; text-align: center; font-size: 10px; }.cart-line-total { min-width: 65px; text-align: right; font-size: 11px; }.cart-footer { padding: 15px 17px 17px; background: #fafbfc; border-top: 1px solid var(--line); }.pos-totals { margin: 12px 0; }.pos-cash { margin: 9px 0; }.checkout-button { margin-top: 11px; justify-content: space-between; padding-inline: 18px; }

.empty-state { min-height: 420px; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }.empty-state.compact { min-height: 240px; }.empty-state h1, .empty-state h2 { margin: 10px 0 4px; }.empty-state p { color: var(--muted); }.empty-icon { min-width: 48px; height: 48px; padding: 0 10px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 14px; font-weight: 800; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }.skeleton-card { height: 150px; border-radius: var(--radius); background: linear-gradient(100deg,#fff 30%,#eff1f4 45%,#fff 60%); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
.menu-scrim { display: none; }

#blazor-error-ui { position: fixed; z-index: 1000; right: 18px; bottom: 18px; display: none; padding: 13px 15px; color: white; background: #8f293e; border-radius: 10px; box-shadow: var(--shadow); }#blazor-error-ui .reload { margin-left: 12px; text-decoration: underline; }#blazor-error-ui .dismiss { margin-left: 10px; color: white; background: none; border: 0; cursor: pointer; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .document-layout { grid-template-columns: minmax(0, 1fr) 310px; }
    .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .app-shell { display: block; }.sidebar { transform: translateX(-102%); transition: transform .24s ease; box-shadow: 16px 0 40px rgba(0,0,0,.18); }.app-shell.menu-open .sidebar { transform: translateX(0); }.workspace { min-width: 0; }.mobile-menu { width: 34px; height: 34px; padding: 8px; display: grid; align-content: center; gap: 4px; background: white; border: 1px solid var(--line); border-radius: 9px; }.mobile-menu span { height: 2px; display: block; background: var(--ink); border-radius: 2px; }.topbar { padding: 0 18px; }.topbar-title { margin-right: auto; margin-left: 12px; }.menu-scrim { position: fixed; z-index: 35; inset: 0; display: block; background: rgba(12,16,25,.45); border: 0; }.page-content { padding: 24px 20px 45px; }
    .document-layout, .pos-layout { grid-template-columns: 1fr; }.document-summary, .pos-cart { position: static; max-height: none; }.pos-cart { order: -1; }.cart-lines { max-height: 340px; }
    .dashboard-grid { grid-template-columns: 1fr; }.form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }.form-two-column { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    body { font-size: 13px; }.page-content { padding: 20px 13px 40px; }.topbar { height: 60px; }.date-chip { display: none; }.page-header { align-items: flex-start; flex-direction: column; gap: 14px; }.page-header .btn { width: 100%; }.page-header h1 { font-size: 27px; }.panel { border-radius: 13px; }
    .metric-grid, .skeleton-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card, .skeleton-card { min-height: 132px; height: auto; padding: 15px; }.metric-card > strong { font-size: 18px; }
    .list-toolbar { align-items: stretch; flex-direction: column; }.search-box { width: 100%; }.result-count { padding-left: 2px; }
    .data-table.responsive, .data-table { min-width: 0; }.data-table thead { display: none; }.data-table tbody { display: grid; gap: 10px; padding: 10px; }.data-table tr { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 11px; }.data-table td { min-height: 0; padding: 0; display: grid; border: 0; }.data-table td::before { content: attr(data-label); margin-bottom: 2px; color: #8a92a1; font-size: 8px; font-weight: 800; text-transform: uppercase; }.data-table td.number { text-align: left; }.data-table .row-action { width: auto; text-align: left; }.data-table .row-action::before { display: none; }.data-table .row-action a { min-height: 32px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 8px; }.line-table tr { grid-template-columns: 1fr 1fr; }.line-table td:first-child { grid-column: 1 / -1; }.edit-cell input { width: 100%; }.delete-button { width: 100%; }
    .form-section { padding: 17px 14px; }.section-heading { margin-bottom: 16px; }.form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }.form-grid .span-2 { grid-column: auto; }.toggle-grid { grid-template-columns: 1fr; }.line-adder { grid-template-columns: 1fr 100px; }.line-adder .product-picker { grid-column: 1 / -1; }.line-adder .btn { align-self: end; }.form-actions { display: grid; grid-template-columns: 1fr 1fr; }.allocation-section .section-heading { flex-wrap: wrap; }.distribution-total { width: 100%; margin-left: 41px; }
    .summary-card { padding: 16px; }.product-grid { grid-template-columns: 1fr 1fr; gap: 9px; }.product-tile { min-height: 196px; }.product-visual { height: 76px; }.product-data strong { font-size: 11px; }.cart-line { grid-template-columns: minmax(0, 1fr) auto; }.quantity-control { grid-row: 2; }.cart-line-total { grid-row: 2; }.cart-line > .delete-button { position: absolute; right: 15px; width: 25px; }.cart-line { position: relative; padding-right: 45px; }
    .note-impact { grid-template-columns: 36px 1fr; }.note-impact > small { grid-column: 2; }
}

@media (max-width: 420px) {
    .metric-grid, .skeleton-grid { grid-template-columns: 1fr; }.metric-card { min-height: 125px; }.product-grid { grid-template-columns: 1fr; }.product-tile { min-height: 185px; }.form-actions { grid-template-columns: 1fr; }
}

/* Login: no existe en Jefunix.Rose.Web, se arma con las mismas variables. */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
.login-card { width: min(400px, 100%); padding: 30px; }
.login-brand { margin-bottom: 22px; display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 44px; height: 44px; font-size: 22px; }
.login-brand strong { display: block; font-family: Manrope, Inter, sans-serif; font-size: 19px; letter-spacing: -.02em; }
.login-brand small { color: var(--muted); font-size: 11px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { margin-top: 6px; }
.login-error { margin-bottom: 14px; padding: 10px 12px; color: #a6354c; background: var(--danger-soft); border: 1px solid #f4cdd6; border-radius: 10px; font-size: 12px; }
.logout-actions { margin-top: 18px; display: flex; justify-content: center; gap: 10px; }

/* Barra de sesión del topbar. */
.topbar-user { display: grid; text-align: right; line-height: 1.15; }
.topbar-user strong { font-size: 12px; }
.topbar-user small { color: var(--muted); font-size: 10px; }

/* Nombres muy largos (la base de prueba tiene algunos de 100 caracteres) no
   deben empujar las columnas de montos fuera de la pantalla. */
.data-table td.ellipsis > span { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .data-table td.ellipsis > span { max-width: none; white-space: normal; } }

/* Balance: rojo cuando el tercero debe, verde cuando tiene saldo a favor.
   Mismos colores que los badges de estado (cancelled / paid). */
.balance-deuda { color: #9a4253; }
.balance-favor { color: #157a59; }

/* Resultados del buscador de cliente/producto. En Jefunix.Rose.Web esto es un
   <select> con todo el catálogo; aquí es búsqueda incremental. */
.picker-results { position: relative; z-index: 5; max-height: 210px; margin-top: 4px; overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.picker-results button { width: 100%; padding: 9px 12px; display: grid; gap: 1px; text-align: left; background: none; border: 0; border-bottom: 1px solid #f1f3f6; cursor: pointer; }
.picker-results button:last-child { border-bottom: 0; }
.picker-results button:hover { background: var(--canvas); }
.picker-results strong { font-size: 12px; }
.picker-results small { color: var(--muted); font-size: 10px; }

/* El carrito del POS lleva cliente y tipo de NCF (en el escritorio el tipo se
   elige en la ventana de pago). */
.customer-select { padding: 12px 16px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }

