/* #ARB #Tecnologia #UX */
:root {
  --gold: #927747;
  --ink: #20382b;
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --surface-soft: #eee8dc;
  --line: #d7cebd;
  --muted: #5d665f;
  --accent: #426b50;
  --purple: #244b39;
  --blue: #142d22;
  --deep: #163628;
  --danger: #7c2729;
  --warning: #865a15;
  --success: #1f6d55;
  --shadow: 0 24px 70px -42px rgba(20,16,10,.65);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { min-height: 100%; max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-height: 100vh; max-width: 100%; overflow-x: hidden; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.product-name-button { display: block; border: 0; background: transparent; padding: 4px 0; text-align: left; font-weight: 750; color: var(--deep); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.product-name-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.movement-review { padding-top: 22px; }
.movement-review h2 { font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
.movement-review .history-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.review-balances { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 22px 0; }
.review-balances article { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--surface-soft); }
.review-balances article > span, .review-balances article > strong, .review-balances small { display: block; }
.review-balances article > span, .review-balances small { color: var(--muted); font-size: 12px; }
.review-balances strong { margin-top: 8px; overflow-wrap: anywhere; }
.review-balances p { font-size: 22px; font-weight: 750; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pending-warning { border: 1px solid var(--warning); border-radius: 10px; padding: 14px; color: var(--warning); }
.product-detail-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-bottom: 22px; }
.product-detail-summary .panel { display: grid; padding: 22px; gap: 10px; }
.product-detail-summary strong { font-size: 25px; overflow-wrap: anywhere; }
.product-detail-summary small, .detail-section > p, .detail-lot p, .detail-movement small { color: var(--muted); }
.detail-section { padding: 24px; margin-bottom: 22px; }
.detail-section h2 { margin-top: 0; }
.location-balances { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; }
.location-balances article { display: grid; padding: 15px; gap: 8px; border: 1px solid var(--line); border-radius: 10px; }
.detail-lot { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 20px 0; }
.detail-lot h3 { margin: 0; overflow-wrap: anywhere; }
.detail-lot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.detail-movement { padding: 20px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-movement > div { display: flex; justify-content: space-between; gap: 12px; }
.detail-movement p { margin: 8px 0; }
.detail-movement small { display: block; margin-top: 8px; }
@media (max-width: 600px) {
  .review-balances, .movement-review .history-details, .product-detail-summary { grid-template-columns: 1fr; }
  .review-actions .button { width: 100%; }
  .detail-section { padding: 18px; }
  .detail-lot { flex-direction: column; }
  .detail-lot-actions .button { flex: 1; }
  .product-detail-summary strong { font-size: 23px; }
}
.eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 780; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: var(--purple); color: var(--surface); box-shadow: inset 0 -4px 0 var(--gold); font-family: Georgia, serif; font-style: italic; font-weight: 700; }
.brand-light { color: var(--surface); }
.auth-page { overflow-x: hidden; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(430px,.92fr); }
.auth-story { min-height: 100vh; padding: 38px 50px; display: flex; flex-direction: column; justify-content: space-between; color: var(--surface); background: var(--deep); border-right: 1px solid #42604a; position: relative; overflow: hidden; }
.auth-story::after { content: "01"; position: absolute; right: -20px; bottom: -100px; font: 500 360px/1 Georgia,serif; color: rgba(231,197,131,.06); }
.story-copy { max-width: 760px; position: relative; z-index: 1; }
.story-copy .eyebrow { color: #d4c190; }
.story-copy h1 { margin: 0; font: 500 clamp(48px,5.4vw,78px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.05em; }
.story-copy h1 em { color: #d4c190; font-weight: inherit; }
.story-copy > p:last-child { max-width: 580px; margin: 30px 0 0; color: #d4e0d1; font-size: 18px; line-height: 1.65; }
.story-ledger { width: min(680px,90%); display: grid; grid-template-columns: 1fr auto 1.5fr; gap: 1px; background: #42604a; border: 1px solid #42604a; position: relative; z-index: 1; }
.story-ledger > * { padding: 12px 16px; background: #203e2e; }
.story-ledger span { color: #bccdb6; font-size: 10px; letter-spacing: .12em; }
.story-ledger strong { color: #d4c190; text-align: right; }
.story-ledger small { color: #fffdf8; }
.auth-panel { padding: 40px clamp(28px,5vw,80px); display: grid; align-content: center; background: var(--paper); }
.auth-mobile-brand { display: none; }
.auth-card { width: 100%; max-width: 520px; margin: auto; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 42px; border-bottom: 1px solid var(--line); }
.auth-tab { border: 0; border-bottom: 2px solid transparent; padding: 15px 8px; background: transparent; cursor: pointer; font-weight: 700; color: var(--muted); }
.auth-tab.active { border-color: var(--ink); color: var(--ink); }
.form-heading h2 { margin: 0; font: 500 36px/1.1 Georgia,serif; letter-spacing: -.035em; }
.form-heading p { margin: 9px 0 30px; color: var(--muted); }
.auth-form, .form-stack { display: grid; gap: 18px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 720; }
label small { color: var(--muted); font-weight: 450; }
input, select, textarea { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink); background: var(--surface); outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(66,107,80,.18); }
textarea { min-height: 92px; resize: vertical; }
.form-grid-two, .form-grid-three { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.button { min-height: 44px; border: 0; border-radius: 8px; padding: 0 18px; cursor: pointer; font-weight: 760; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.button:disabled { opacity: .5; cursor: wait; }
.button-primary { background: var(--purple); color: var(--surface); }
.button-primary:hover { background: #163628; }
.button-accent { background: var(--accent); color: #fff; }
.button-quiet { background: var(--surface-soft); }
.button-danger { background: #f1e1dd; color: var(--danger); }
.button-wide { width: 100%; margin-top: 6px; }
.form-error { min-height: 19px; margin: 0; color: var(--danger); font-size: 13px; }
.privacy-note, .auth-footer { color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-footer { text-align: center; margin: 34px 0 0; }

.app-page { --tenant-primary: var(--purple); --tenant-accent: var(--accent); overflow-x: clip; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px 18px; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-right: 1px solid var(--line); }
.sidebar .brand { padding: 0 10px 28px; }
.main-nav { display: grid; gap: 5px; }
.main-nav button { width: 100%; border: 0; border-radius: 10px; padding: 12px 13px; display: flex; align-items: center; gap: 12px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.main-nav button:hover { background: var(--surface-soft); color: var(--ink); }
.main-nav button.active { background: #e7ede4; color: #244b39; box-shadow: inset 3px 0 0 var(--accent); font-weight: 800; }
.nav-icon { width: 24px; text-align: center; font-size: 17px; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.user-chip { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 10px; min-width: 0; }
.user-chip span:last-child { display: grid; min-width: 0; }
.user-chip strong, .user-chip small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-chip small { color: var(--muted); margin-top: 2px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--purple); color: var(--surface); box-shadow: inset 0 -3px 0 var(--accent); }
.quiet-button, .icon-button { border: 0; background: transparent; cursor: pointer; }
.quiet-button { color: var(--muted); padding: 12px 0 0 46px; }
.mobile-header, .bottom-nav { display: none; }
.nav-backdrop { display: none; }
#workspace { min-width: 0; padding: 38px clamp(24px,4vw,66px) 80px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-head h1 { margin: 0; font: 500 clamp(34px,4vw,52px)/1 Georgia,serif; letter-spacing: -.045em; }
.page-head p { color: var(--muted); margin: 10px 0 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.date-stamp { color: var(--muted); font-size: 12px; text-align: right; }
.quick-actions { min-height: 54px; margin: -10px 0 16px; padding: 8px 10px 8px 16px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.quick-actions strong { margin-right: auto; font-size: 12px; }
.quick-actions button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 720; }
.quick-actions button:hover { border-color: var(--accent); background: #e7ede4; }
.loading-state, .empty-state { min-height: 50vh; display: grid; place-items: center; align-content: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.metric-grid { display: grid; grid-template-columns: 1.25fr repeat(3,1fr); gap: 12px; }
.metric { min-height: 154px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.metric-primary { background: #f1e1dd; color: var(--ink); border-color: #d9bbb3; box-shadow: inset 0 3px 0 var(--purple); }
.metric-label { font-size: 11px; letter-spacing: .12em; font-weight: 800; color: var(--muted); }
.metric-primary .metric-label { color: var(--muted); }
.metric strong { font: 500 40px/1 Georgia,serif; letter-spacing: -.04em; }
.metric small { color: var(--muted); }
.metric-primary small { color: var(--muted); }
.metric.danger strong { color: var(--danger); }
.metric.warning strong { color: var(--warning); }
.action-hero { margin: 14px 0; padding: 26px; border: 1px solid #c8d2bf; border-left: 5px solid var(--accent); border-radius: var(--radius); background: #e7ede4; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; }
.action-hero h2 { margin: 4px 0 6px; font: 500 27px/1.1 Georgia,serif; }
.action-hero p { margin: 0; color: var(--muted); }
.onboarding-panel { min-height: 420px; display: grid; grid-template-columns: 1.12fr .88fr; border: 1px solid #c8d2bf; border-left: 6px solid var(--accent); border-radius: var(--radius); background: #edf1e8; overflow: hidden; }
.onboarding-copy { padding: clamp(32px,5vw,64px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.onboarding-copy h2 { max-width: 650px; margin: 18px 0 14px; font: 500 clamp(36px,4.6vw,62px)/1 Georgia,serif; letter-spacing: -.045em; }
.onboarding-copy p { max-width: 610px; margin: 0 0 28px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.onboarding-copy > small { margin-top: 12px; color: var(--muted); }
.status-pill { min-height: 27px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; background: #d7e8e4; color: #244b39; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.setup-steps { margin: 0; padding: 42px; display: grid; align-content: center; gap: 0; background: var(--surface); border-left: 1px solid #c8d2bf; list-style: none; counter-reset: setup; }
.setup-steps li { min-height: 96px; display: grid; grid-template-columns: 42px 1fr; gap: 14px; position: relative; color: var(--muted); }
.setup-steps li:not(:last-child)::after { content: ""; position: absolute; top: 38px; bottom: 0; left: 18px; width: 1px; background: var(--line); }
.setup-steps li > span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-weight: 800; z-index: 1; }
.setup-steps li.complete > span { border-color: #8bb9a7; background: #e1ede5; color: var(--success); }
.setup-steps li.current > span { border-color: var(--purple); background: #f1e1dd; color: var(--purple); }
.setup-steps li strong { display: block; margin: 7px 0 5px; color: var(--ink); }
.setup-steps li small { line-height: 1.4; }
.how-it-works { margin-top: 14px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.how-it-works article { min-height: 118px; padding: 22px; display: grid; grid-template-columns: auto 1fr; align-content: center; column-gap: 14px; border-right: 1px solid var(--line); }
.how-it-works article:last-child { border-right: 0; }
.how-it-works span { grid-row: span 2; color: var(--purple); font: italic 500 14px Georgia,serif; }
.how-it-works strong { font-size: 14px; }
.how-it-works p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel-head { padding: 20px 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 600 21px/1.2 Georgia,serif; }
.panel-head small { color: var(--muted); }
.list { display: grid; }
.list-row { padding: 15px 22px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; border-bottom: 1px solid #e3dccf; }
.list-row:last-child { border-bottom: 0; }
.list-row strong { display: block; }
.list-row small { color: var(--muted); display: block; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 0 10px; background: var(--surface-soft); font-size: 11px; font-weight: 760; white-space: nowrap; }
.tag-danger { background: #f1e1dd; color: var(--danger); }
.tag-warning { background: #f2e5ca; color: #8a6428; }
.tag-success { background: #e1ede5; color: var(--success); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.search { max-width: 400px; position: relative; flex: 1; }
.search input { padding-left: 42px; }
.search::before { content: "⌕"; position: absolute; left: 15px; top: 10px; color: var(--muted); font-size: 20px; z-index: 1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; background: var(--surface-soft); text-align: left; font-size: 10px; letter-spacing: .11em; color: var(--muted); white-space: nowrap; }
td { padding: 15px 16px; border-top: 1px solid #e3dccf; font-size: 13px; vertical-align: middle; }
td strong { display: block; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.stock-low { color: var(--danger); font-weight: 800; }
.empty-action { min-height: 430px; padding: 50px 24px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed #c7b9a7; border-radius: var(--radius); background: #fffaf0; }
.empty-action-icon { width: 58px; height: 58px; margin-bottom: 20px; display: grid; place-items: center; border-radius: 14px; background: #f1e1dd; color: var(--purple); font-size: 28px; }
.empty-action h2 { margin: 0; font: 500 32px/1.1 Georgia,serif; }
.empty-action p { max-width: 520px; margin: 12px 0 24px; color: var(--muted); line-height: 1.6; }
.operation-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.operation-form { padding: 24px; }
.segmented { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; padding: 5px; border-radius: 12px; background: var(--surface-soft); }
.segmented button { min-height: 42px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 740; }
.segmented button.active { background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.operation-context { margin-top: 20px; padding: 16px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; }
.operation-context > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: #f1e1dd; color: var(--purple); font-size: 23px; font-weight: 800; }
.operation-context strong { display: block; }
.operation-context p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.operation-prerequisite { margin-top: 20px; padding: 26px; border: 1px solid #d8bd83; border-radius: 10px; background: #f8efd9; }
.operation-prerequisite strong { font-size: 16px; }
.operation-prerequisite p { margin: 8px 0 20px; color: var(--muted); }
.operation-fields { margin-top: 24px; display: grid; gap: 17px; }
.impact-box { padding: 17px; background: var(--surface-soft); border-radius: 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.aside-note { padding: 24px; }
.aside-note h3 { font: 600 22px/1.1 Georgia,serif; margin: 0 0 12px; }
.aside-note p, .aside-note li { color: var(--muted); font-size: 13px; line-height: 1.6; }
.timeline { position: relative; }
.timeline .list-row { grid-template-columns: 10px 1fr auto; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tenant-accent); box-shadow: 0 0 0 4px rgba(66,107,80,.2); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { padding: 24px; }
.settings-card h2 { font: 600 23px/1.1 Georgia,serif; margin: 0 0 8px; }
.settings-card > p { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.color-field { display: grid; grid-template-columns: 54px 1fr; gap: 10px; }
.color-field input[type=color] { padding: 4px; }
.dialog { width: min(680px,calc(100vw - 24px)); border: 0; border-radius: 20px; padding: 0; background: var(--surface); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(23,24,21,.62); backdrop-filter: blur(4px); }
.dialog-head { padding: 24px 26px 18px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font: 500 30px/1 Georgia,serif; }
.dialog-head p:last-child { max-width: 460px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.icon-button { width: 38px; height: 38px; border-radius: 9px; font-size: 24px; }
.icon-button:hover { background: var(--surface-soft); }
.dialog-body { padding: 24px 26px; }
.advanced-fields { border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; }
.advanced-fields summary { padding: 15px 17px; cursor: pointer; font-size: 13px; font-weight: 760; }
.advanced-fields summary::marker { color: var(--purple); }
.advanced-fields-body { padding: 2px 17px 17px; display: grid; gap: 16px; border-top: 1px solid var(--line); }
.dialog-actions { padding: 16px 26px 24px; display: flex; justify-content: flex-end; gap: 10px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; display: grid; gap: 8px; z-index: 100; }
.toast { max-width: 380px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #f1e1dd; color: var(--danger); border-color: #d9bbb3; }

@media (max-width: 1000px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 500px; }
  .auth-panel { min-height: 650px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .content-grid, .operation-layout { grid-template-columns: 1fr; }
  .onboarding-panel { grid-template-columns: 1fr; }
  .setup-steps { border-left: 0; border-top: 1px solid #c8d2bf; }
}
@media (max-width: 760px) {
 html { scroll-padding-top: calc(80px + env(safe-area-inset-top)); scroll-padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .auth-layout, .auth-panel, .auth-card, .auth-tabs, .auth-form { min-width: 0; max-width: 100%; }
  .app-shell { display: block; }
  html.nav-open { overflow: hidden; }
  .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; width: min(82vw,300px); height: 100dvh; z-index: 50; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 40px rgba(23,21,28,.18); }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .nav-backdrop { position: fixed; inset: 0; z-index: 45; border: 0; background: rgba(23,21,28,.48); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .app-shell.menu-open .nav-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .mobile-header { position: sticky; top: 0; z-index: 30; height: 65px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: rgba(245,241,232,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-header .brand { font-size: 18px; }
  .mobile-header .brand-mark { width: 30px; height: 30px; }
  .mobile-header .icon-button { width: 48px; height: 48px; }
  #workspace { padding: 24px 15px calc(94px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 25; min-height: 68px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4,1fr); background: rgba(255,253,248,.98); color: var(--muted); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .bottom-nav button { min-height: 48px; border: 0; border-radius: 9px; background: transparent; color: inherit; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 10px; }
  .bottom-nav button span { font-size: 19px; }
  .bottom-nav button.active { color: #244b39; background: #e7ede4; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 24px; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 126px; padding: 16px; }
  .metric strong { font-size: 31px; }
  .action-hero { padding: 21px; grid-template-columns: 1fr; }
  .action-hero .button { width: 100%; }
  .segmented { display: flex; grid-template-columns: none; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { min-width: 108px; padding: 0 13px; flex: 1 0 auto; scroll-snap-align: start; }
  .form-grid-two, .form-grid-three, .settings-grid { grid-template-columns: 1fr; }
  input, select, textarea { min-height: 50px; font-size: 16px; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100dvh; padding: 92px 20px 42px; position: relative; align-content: center; }
  .auth-mobile-brand { position: absolute; top: max(22px,env(safe-area-inset-top)); left: 20px; display: inline-flex; }
  .auth-tabs { margin-bottom: 34px; }
  .auth-tab { min-height: 50px; }
  .auth-footer { margin-top: 26px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { max-width: none; }
  .quick-actions { padding: 8px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .quick-actions::-webkit-scrollbar { display: none; }
  .quick-actions strong { display: none; }
  .quick-actions button { min-height: 44px; flex: 0 0 auto; }
  .onboarding-panel { min-height: 0; border-left-width: 1px; }
  .onboarding-copy { padding: 30px 22px; }
  .onboarding-copy h2 { font-size: clamp(34px,10vw,44px); }
  .onboarding-copy .button { width: 100%; }
  .setup-steps { padding: 26px 20px; }
  .setup-steps li { min-height: 84px; }
  .how-it-works { grid-template-columns: 1fr; }
  .how-it-works article { border-right: 0; border-bottom: 1px solid var(--line); }
  .how-it-works article:last-child { border-bottom: 0; }
  .operation-form, .aside-note, .settings-card { padding: 20px 17px; }
  .operation-context { grid-template-columns: 38px 1fr; padding: 14px; }
  .operation-context > span { width: 38px; height: 38px; }
  .panel-head { padding: 18px 17px 14px; }
  .list-row { padding: 15px 17px; gap: 10px; }
  .timeline .list-row { grid-template-columns: 10px 1fr; align-items: start; }
  .timeline .list-row > .numeric { grid-column: 2; text-align: left; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tr { padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  td { min-height: 42px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #e3dccf; text-align: right; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 760; text-align: left; }
  td:first-child { min-height: 58px; display: block; border-top: 0; text-align: left; }
  td:first-child::before { display: none; }
  td small { text-align: right; }
  td:first-child small { text-align: left; }
  .product-actions { width: 100%; white-space: normal; }
  .product-actions .button { width: 100%; min-height: 46px; }
  td[colspan] { display: block; }
  td[colspan]::before { display: none; }
  .dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .dialog form { max-height: 92dvh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
  .dialog-head { padding: 20px 18px 16px; }
  .dialog-head h2 { font-size: 27px; }
  .dialog-body { padding: 20px 18px; overflow-y: auto; overscroll-behavior: contain; }
  .dialog-actions { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .dialog-actions .button { min-height: 48px; }
  .dialog-actions .button-primary { flex: 1; }
  .toast-region { left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); }
  .toast { width: 100%; max-width: none; }
}
@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 112px; }
  .page-head h1 { font-size: clamp(34px,10vw,40px); }
  .form-heading h2 { font-size: 32px; }
  .auth-panel { padding-left: 16px; padding-right: 16px; }
  .auth-mobile-brand { left: 16px; }
  .empty-action { min-height: 360px; padding: 38px 20px; }
  .empty-action h2 { font-size: 29px; }
  .dialog-actions { display: grid; grid-template-columns: auto minmax(0,1fr); }
  .product-dialog-actions { grid-template-columns: 1fr 1fr; }
  .product-dialog-actions .dialog-action-spacer { display: none; }
  .product-dialog-actions .button-danger { grid-column: 1 / -1; }
}

/* Operational UI: calm surfaces, clear actions and accessible focus. */
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #426b50; outline-offset: 4px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 12px 18px; background: var(--deep); color: white; border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.page-head h1 { font-family: inherit; font-size: clamp(30px,3vw,42px); font-weight: 750; line-height: 1.15; letter-spacing: -.04em; }
.page-head p { line-height: 1.6; max-width: 64ch; }
.metric-primary { background: #e7ede4; border-color: #c0cdb7; }
.metric strong { font-family: inherit; font-size: clamp(26px,2.8vw,38px); font-weight: 720; overflow-wrap: anywhere; }
.metric-label { letter-spacing: .06em; line-height: 1.5; }
.metric-grid { grid-template-columns: minmax(0,1.35fr) repeat(3,minmax(0,1fr)); }
.panel-head h2, .settings-card h2, .aside-note h3, .action-hero h2 { font-family: inherit; font-weight: 720; letter-spacing: -.025em; }
.button { transition: background .15s, box-shadow .15s; }
.button-quiet { border: 1px solid var(--line); }
.panel-head .quiet-button { padding: 10px 12px; min-height: 44px; color: var(--purple); font-weight: 700; }
.empty-action-icon, .operation-context > span { background: #e7ede4; }
.empty-action, .operation-context, .advanced-fields { background: var(--surface); }
.search { max-width: 430px; }
.catalog-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.catalog-controls label { min-width: 180px; }
.result-count { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.pagination { min-height: 44px; margin-top: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; color: var(--muted); font-size: 13px; }
.pagination .button { min-width: 112px; }
.pagination .button:disabled { opacity: .45; cursor: not-allowed; }
.table-wrap tbody tr:hover { background: #f7f3eb; }
th { font-size: 11px; letter-spacing: .04em; }
td { line-height: 1.5; }
.stock-status { display: block; font-size: 11px; margin-top: 4px; }
.table-empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.table-empty strong { color: var(--ink); }
.table-empty .button { margin-top: 14px; }
.product-actions { width: 1%; white-space: nowrap; }
.product-actions .button { min-height: 38px; padding-inline: 14px; }
.dialog-small { width: min(560px,calc(100vw - 24px)); }
.dialog-action-spacer { flex: 1; }
.archive-product-summary { padding: 16px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.archive-product-summary small { color: var(--muted); }
.product-dialog-actions .button-danger:disabled { cursor: not-allowed; }
.segmented { grid-template-columns: repeat(5,minmax(0,1fr)); }
.history-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
.loading-state, .empty-state { text-align: center; padding: 24px; line-height: 1.6; }
.error-state { max-width: 560px; margin: 48px auto; padding: 32px; border: 1px solid #d9bbb3; border-radius: 16px; background: var(--surface); text-align: center; }
.error-state h2 { font-size: 24px; margin: 0 0 12px; }
.error-state p { color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.field-help { font-size: 12px; color: var(--muted); line-height: 1.5; margin: -8px 0 0; }
.mobile-menu-close { display: none; }
.auth-story .brand-mark { background: #426b50; }
.auth-tabs { margin-bottom: 30px; }
.auth-tab.active { border-color: var(--purple); color: var(--purple); }
.form-error:empty { min-height: 0; }
.form-error:not(:empty) { padding: 12px 14px; background: #fbeeea; border-radius: 8px; line-height: 1.5; }

@media (max-width: 700px) {
  .pagination { justify-content: space-between; gap: 8px; }
  .pagination .button { min-width: 0; padding-inline: 13px; }
}
@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) {
  .sidebar { visibility: hidden; }
  .app-shell.menu-open .sidebar { visibility: visible; }
  .mobile-menu-close { display: block; position: absolute; top: 18px; right: 12px; }
  .bottom-nav { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .bottom-nav button { font-size: 10px; min-width: 0; font-weight: 650; }
  .catalog-controls { display: grid; grid-template-columns: minmax(0,1fr); }
  .catalog-controls .search { width: 100%; }
  .catalog-controls label { min-width: 0; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-primary { grid-column: 1 / -1; }
  .metric { min-height: 120px; gap: 12px; }
  .metric strong { font-size: 28px; }
  .metric-primary strong { font-size: 36px; }
  .metric:last-child { grid-column: 1 / -1; }
  .list-row > div { min-width: 0; overflow-wrap: anywhere; }
  td { gap: 12px; flex-wrap: wrap; }
  td::before { flex: 0 0 30%; }
  td:first-child { padding-bottom: 16px; }
  td:first-child strong { font-size: 16px; }
  .page-actions .button { min-height: 48px; }
  .error-state { margin: 12px 0; padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

@media (max-width: 760px) { .operation-form .segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: visible; } .operation-form .segmented button { min-width: 0; min-height: 46px; padding: 6px; font-size: 11px; } }

/* Mediterranean palette: marine blue, warm limestone and restrained clay. */
:root { --terracotta: #927747; }
.auth-story .eyebrow, .story-copy h1 em, .story-ledger strong { color: #d4c190; }
.action-hero { background: #f0e8db; border-color: #d7cebd; border-left-color: var(--terracotta); }
.status-pill { background: #e7ede4; color: #244b39; }
.timeline-dot { background: var(--accent); box-shadow: 0 0 0 4px #e7ede4; }
.history-entry { padding: 22px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 16px; align-items: start; }
.history-entry:last-child { border-bottom: 0; }
.history-entry .timeline-dot { margin-top: 7px; }
.history-content { min-width: 0; }
.history-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.history-heading h2 { margin: 0; font-family: inherit; font-size: 16px; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
.history-quantity { flex-shrink: 0; font-weight: 750; color: var(--purple); font-variant-numeric: tabular-nums; line-height: 1.5; white-space: nowrap; }
.history-kind { display: inline-block; margin-top: 6px; color: var(--purple); background: #e7ede4; border-radius: 6px; padding: 4px 9px; font-size: 12px; line-height: 1.5; }
.history-details { display: grid; gap: 9px; margin: 16px 0 0; }
.history-details > div { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 12px; align-items: start; }
.history-details dt { color: var(--muted); font-size: 12px; line-height: 1.6; }
.history-details dd { margin: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.history-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.history-meta span { min-width: 0; overflow-wrap: anywhere; }
.history-meta time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-empty { padding: 40px 24px; text-align: center; line-height: 1.6; }
.history-empty p { color: var(--muted); margin-bottom: 0; }
@media(max-width:760px) {
 .history-entry { padding: 20px 16px; gap: 12px; }
 .history-heading { flex-direction: column; gap: 8px; }
 .history-details > div { grid-template-columns: minmax(0,1fr); gap: 2px; }
 .history-meta { flex-direction: column; gap: 4px; }
}

.history-kind { max-width: 100%; overflow-wrap: anywhere; }
.history-quantity { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.history-tabs { max-width: 400px; }
.kit-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 16px; }
.kit-card, .kit-form { padding: 24px; min-width: 0; }
.kit-card h2 { margin: 0 0 10px; font-size: 22px; overflow-wrap: anywhere; }
.kit-card p, .kit-help { font-size: 14px; line-height: 1.6; color: var(--muted); }
.kit-card ul { list-style: none; padding: 0; margin: 18px 0; }
.kit-card li { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px; overflow-wrap: anywhere; }
.kit-card small, .kit-line small, .kit-review-line small { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.kit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.kit-lines { display: grid; gap: 14px; margin: 20px 0; }
.kit-line { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(110px,.6fr) minmax(0,1.4fr) auto; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; align-items: start; background: var(--paper); }
.kit-line > *, .kit-review-line > * { min-width: 0; overflow-wrap: anywhere; }
.kit-line .button { margin-top: 26px; }
.kit-line-actions { display: grid; gap: 8px; }
.kit-multiplier { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.kit-multiplier input { max-width: 150px; }
.kit-review-line { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
@media(max-width:1000px) { .kit-line { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
@media(max-width:760px) {
 .kit-form, .kit-card { padding: 18px 16px; }
 .kit-line, .kit-review-line { grid-template-columns: minmax(0,1fr); padding: 14px; }
 .kit-line .button { margin-top: 0; }
 .kit-line-actions { display: flex; gap: 16px; }
 .kit-actions .button { flex: 1 1 100%; white-space: normal; }
}
.audit-guide { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 10px; padding: 20px 24px; margin-bottom: 22px; line-height: 1.65; }
.audit-guide p { margin: 6px 0 10px; max-width: 850px; font-size: 14px; }
.audit-guide span, .history-scope { color: var(--muted); font-size: 12px; line-height: 1.6; }
.audit-filters { display: flex; gap: 12px; align-items: end; margin-bottom: 14px; }
.audit-filters label:first-child { flex: 1; }
.audit-filters label { min-width: 0; }
.audit-filters select { width: 100%; }
.audit-summary { margin: 8px 0 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.audit-changes { margin: 14px 0 0; display: grid; gap: 10px; }
.audit-changes > div { padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.audit-changes dt { font-size: 12px; font-weight: 650; margin-bottom: 8px; }
.audit-changes dd { margin: 0; display: grid; grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr); gap: 12px; font-size: 14px; overflow-wrap: anywhere; }
.audit-changes small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.audit-change-arrow { align-self: center; color: var(--muted); }
@media(max-width:760px) {
 .audit-guide { padding: 16px; }
 .audit-filters { flex-wrap: wrap; }
 .audit-filters label, .audit-filters label:first-child { flex: 1 1 100%; }
 .audit-filters .button { flex: 1; }
 .audit-changes dd { grid-template-columns: minmax(0,1fr); gap: 8px; }
 .audit-change-arrow { display: none; }
}

/* Mobile operational layout: visible actions, readable cards and safe-area spacing. */
.pagination-top:empty { display: none; }
.pagination-top { margin: 0 0 16px; }
@media (max-width: 760px) {
 .mobile-header { height: calc(65px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-left: max(15px,env(safe-area-inset-left)); padding-right: max(15px,env(safe-area-inset-right)); }
 .mobile-header .brand { min-width: 0; gap: 10px; }
 #mobileBrandName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 .brand-mark, .icon-button { flex-shrink: 0; }
 .sidebar { padding-top: calc(26px + env(safe-area-inset-top)); padding-bottom: max(18px,env(safe-area-inset-bottom)); }
 .sidebar .brand { padding-right: 38px; font-size: 18px; }
 #brandName { overflow-wrap: anywhere; }
 .main-nav { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
 .main-nav button { min-height: 48px; flex-shrink: 0; }
 .sidebar-foot { flex-shrink: 0; }
 .mobile-menu-close { top: calc(18px + env(safe-area-inset-top)); }
 .icon-button { width: 48px; height: 48px; }
 #workspace { padding-left: max(15px,env(safe-area-inset-left)); padding-right: max(15px,env(safe-area-inset-right)); }
 .bottom-nav { padding-left: max(6px,env(safe-area-inset-left)); padding-right: max(6px,env(safe-area-inset-right)); }
 .bottom-nav button { font-size: 11px; }
 .page-head { gap: 14px; margin-bottom: 20px; }
 .page-head h1 { font-size: clamp(28px,7.5vw,34px); line-height: 1.12; overflow-wrap: anywhere; }
 .page-head p { line-height: 1.55; }
 .button { min-height: 48px; padding: 10px 14px; white-space: normal; line-height: 1.35; scroll-margin-block: 12px; }
 .quiet-button { min-height: 44px; }
 .quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
 .quick-actions button { min-width: 0; min-height: 48px; padding: 8px; font-size: 13px; }
 .metric-grid { gap: 8px; grid-template-columns: repeat(3,minmax(0,1fr)); }
 .metric { min-height: 112px; padding: 14px 10px; gap: 10px; }
 .metric-primary { padding: 18px; min-height: 120px; }
 .metric:last-child { grid-column: auto; }
 .metric-label { font-size: 10px; letter-spacing: .04em; line-height: 1.4; }
 .metric small { font-size: 11px; line-height: 1.45; }
 .metric strong { font-size: 26px; }
 .metric-primary strong { font-size: clamp(29px,8vw,36px); }
 .action-hero { padding: 18px; }
 .action-hero h2 { font-size: 22px; line-height: 1.25; }
 .panel-head, .list-row { padding-left: 16px; padding-right: 16px; }
 .panel-head h2 { font-size: 19px; }
 .list-row { grid-template-columns: minmax(0,1fr) auto; }
 .list-row .tag { white-space: normal; overflow-wrap: anywhere; max-width: 100px; }
 .operation-form .segmented button { font-size: 12px; min-height: 48px; }
 .history-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
 .history-tabs button { min-width: 0; min-height: 48px; white-space: normal; padding: 8px; }
 .catalog-controls, .pagination, [id$=Pagination] { scroll-margin-top: calc(80px + env(safe-area-inset-top)); }
 #productRows tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; padding: 12px 16px; }
 #productRows td { min-width: 0; width: auto; display: block; text-align: left; padding: 10px 0; overflow-wrap: anywhere; }
 #productRows td::before { display: block; margin-bottom: 5px; }
 #productRows td:first-child, #productRows .product-actions, #productRows td[colspan] { grid-column: 1 / -1; width: 100%; }
 #productRows td:first-child::before, #productRows .product-actions::before, #productRows td[colspan]::before { display: none; }
 #productRows td small { text-align: left; line-height: 1.5; }
 #productRows .product-name-button { min-height: 44px; font-size: 16px; line-height: 1.4; }
 #productRows td[data-label=Saldo] { font-size: 19px; font-weight: 750; }
 #productRows td[data-label=Saldo]::before { font-size: 11px; }
 #productRows .stock-status { font-size: 11px; }
 .product-actions .button { width: 100%; }
 .pagination { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; text-align: center; }
 .pagination .button { font-size: 12px; padding-inline: 8px; }
 .pagination > span { grid-column: 1 / -1; grid-row: 1; font-size: 12px; }
 .dialog, .dialog-small { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }
 .dialog form { max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }
 .dialog-head { gap: 8px; padding-top: 16px; }
 .dialog-head > div { min-width: 0; }
 .dialog-head h2 { font-family: inherit; font-size: 23px; line-height: 1.2; }
 .dialog-head p:last-child { line-height: 1.5; }
 .dialog-body { scroll-padding-block: 16px; }
 .dialog-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
 .dialog-action-spacer { display: none; }
 .dialog-actions #archiveProductButton { grid-column: 1 / -1; }
 .kit-line-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
 .kit-line-actions .quiet-button { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
 .kit-form > .button[type=submit], .operation-fields > .button[type=submit] { width: 100%; }
 .kit-multiplier { display: grid; grid-template-columns: minmax(0,1fr); }
 .kit-multiplier input { max-width: none; }
 .kit-review-line, .kit-form p, .review-details dd { overflow-wrap: anywhere; }
 input, select, textarea { min-width: 0; max-width: 100%; }
 input[type=date] { min-width: 0; }
}
@media (max-width: 360px) {
 .metric { padding-inline: 8px; }
 .metric-primary { padding-inline: 16px; }
 .bottom-nav button { font-size: 10px; }
 .operation-form { padding-inline: 12px; }
}
@media (max-width: 760px) and (max-height: 500px) {
 .dialog-head p:last-child { display: none; }
 .dialog-head { padding-block: 10px; }
 .dialog form, .dialog { max-height: calc(100dvh - env(safe-area-inset-top) - 4px); }
}

/* Reversal is a correction, never a physical return or a destructive action. */
.reversal-original p, .reversal-status { overflow-wrap: anywhere; }
.reversal-original code, [data-view="reversal"] code, .reversal-status code { overflow-wrap: anywhere; font-size: 12px; }
.reversal-original small { display: block; }
.reversal-consent { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; line-height: 1.6; }
.reversal-consent input { flex: 0 0 22px; width: 22px; min-height: 22px; margin-top: 3px; }
.reversal-status { color: var(--muted); line-height: 1.6; }
[data-view="reversal"] .review-balances article { min-width: 0; overflow-wrap: anywhere; }
[data-view="reversal"] .review-balances small { display: block; }
@media (max-width: 760px) {
 [data-view="reversal"] .review-actions { display: grid; grid-template-columns: minmax(0,1fr); }
 [data-view="reversal"] .review-actions .button { width: 100%; white-space: normal; }
 .history-content > .button, .detail-movement > .button { min-height: 48px; }
}
