:root {
  --bg: #f7f7f6;
  --ink: #171717;
  --muted: #6e6b66;
  --line: #dfddd8;
  --panel: #ffffff;
  --accent: #b98a3c;
  --accent-soft: #fbf6ea;
  --accent-2: #1a1a1a;
  --success: #315d45;
  --success-soft: #e6f1e8;
  --info-soft: #edf1f4;
  --warn: #a45d1a;
  --bad: #a62d2d;
  --radius-sm: 6px;
  --radius-md: 8px;
  --shadow-panel: 0 8px 24px rgba(35, 31, 24, .06);
}

* { box-sizing: border-box; }
.bot-trap { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.app-loading { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(17,17,17,.38); backdrop-filter: blur(2px); }
.app-loading[hidden] { display: none !important; }
.loading-dialog { width: min(360px, calc(100vw - 36px)); background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 8px; padding: 22px; display: grid; gap: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.loading-dialog small { color: var(--muted); line-height: 1.35; }
.loading-mark { width: 26px; height: 26px; border: 3px solid #e8dfce; border-top-color: var(--accent); border-radius: 50%; animation: loading-spin .75s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.app-locked .sidebar,
.app-locked main { display: none; }
body.app-locked { display: block; }
.login-screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background: #f2f1ed;
}
.app-locked .login-screen { display: grid; }
.login-shell {
  width: min(980px, 100%);
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
  overflow: hidden;
  border: 1px solid #d7d2c8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(25, 22, 17, .14);
}
.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 48px;
  background: #171717;
  color: #fff;
}
.login-intro-logo { width: 205px; height: 64px; object-fit: contain; object-position: left center; filter: brightness(1.3); }
.login-kicker { display: block; margin-bottom: 10px; color: #d4ad68; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.login-intro h1 { max-width: 520px; margin-bottom: 14px; font-size: 38px; line-height: 1.08; }
.login-intro p { max-width: 500px; margin-bottom: 0; color: #d1d1ce; line-height: 1.55; }
.login-route { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.login-route li { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid #393733; color: #d9d8d5; }
.login-route b { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #d4ad68; border-radius: 50%; color: #d4ad68; }
.login-route strong { display: block; margin-bottom: 2px; color: #fff; }
.login-intro .login-scope { color: #aaa7a1; font-size: 12px; }
.login-card {
  width: 100%;
  background: var(--panel);
  padding: 54px 44px;
  display: grid;
  align-content: center;
  gap: 18px;
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 2px; }
.login-brand img { width: 54px; height: 54px; object-fit: contain; }
.login-brand div { display: grid; gap: 3px; }
.login-brand strong { color: var(--accent-2); font-size: 22px; }
.login-brand span { color: var(--muted); font-size: 13px; }
.login-runtime { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.login-runtime span { padding: 5px 8px; border: 1px solid #d8c39b; border-radius: 5px; background: var(--accent-soft); color: #78551d; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.login-runtime small { color: var(--muted); }
.login-card label { display: grid; gap: 7px; color: #3e3b36; font-size: 13px; font-weight: 700; }
.login-card input { min-height: 48px; }
.login-card > button { min-height: 48px; font-weight: 800; }
.login-help { color: var(--muted); line-height: 1.45; }
.form-error { color: var(--bad); min-height: 20px; margin: 0; font-size: 13px; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #111111;
  color: #fff;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { padding: 8px 10px 18px; display: flex; gap: 10px; align-items: center; }
.brand img { width: 42px; height: 42px; object-fit: contain; filter: brightness(1.25); }
.brand strong { font-size: 22px; }
.brand span { color: #b7c7b8; font-size: 13px; }
.sidebar-context { display: grid; gap: 3px; margin: 0 10px 12px; padding: 10px 0; border-top: 1px solid #385040; border-bottom: 1px solid #385040; }
.sidebar-context span { color: #b98a3c; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.sidebar-context strong { color: #fff; font-size: 13px; font-weight: 600; }
.session-user {
  margin: 0 10px 12px;
  padding: 9px 0 12px;
  border-bottom: 1px solid #385040;
  display: grid;
  gap: 3px;
}
.session-user strong { font-size: 13px; }
.session-user span { color: #b7c7b8; font-size: 12px; text-transform: capitalize; }
.sidebar button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #dfe9df;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.sidebar button.active, .sidebar button:hover { background: #b98a3c; color: #111; }
.operations-nav { border-left: 1px solid #4d6655; margin: 4px 0 8px 11px; padding-left: 5px; }
.operations-nav button { font-size: 13px; padding: 8px 10px; }
.sidebar button.nav-section-toggle { margin-top: 10px; color: #b7c7b8; border-top: 1px solid #385040; border-radius: 0; }
.sidebar button.session-action {
  margin-top: 12px;
  border: 1px solid #4d6655;
  color: #fff;
}
.nav-label { margin: 16px 11px 5px; color: #b98a3c; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mobile-nav-toggle { display: none; }

main { padding: 22px; overflow: visible; min-width: 0; }
.topbar {
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(260px, 1fr) auto;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.topbar-heading { min-width: 0; }
.topbar-eyebrow { display: block; margin-bottom: 5px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.global-search { position: relative; display: flex; align-items: center; min-width: 0; }
.global-search input { height: 42px; padding-left: 38px; padding-right: 62px; border-color: #d2cec5; box-shadow: 0 5px 14px rgba(35, 31, 24, .05); }
.global-search input:focus { border-color: var(--accent); outline: 3px solid rgba(185, 138, 60, .13); }
.global-search kbd { position: absolute; right: 12px; top: 11px; color: var(--muted); font-size: 10px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; background: #fafbf8; }
.search-icon { position: absolute; z-index: 1; left: 14px; width: 13px; height: 13px; border: 2px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; background: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.global-search-results { position: absolute; z-index: 80; top: calc(100% + 8px); left: 0; right: 0; max-height: 430px; overflow: auto; padding: 8px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 8px; box-shadow: 0 18px 36px rgba(0,0,0,.16); }
.global-search-results[hidden] { display: none !important; }
.global-search-group { display: grid; gap: 3px; }
.global-search-group + .global-search-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.global-search-label { padding: 3px 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.global-search-result { display: grid; grid-template-columns: 32px 1fr; gap: 9px; align-items: center; width: 100%; padding: 9px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; }
.global-search-result:hover, .global-search-result:focus { background: #fbf6ea; outline: 0; }
.global-search-result strong, .global-search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search-result small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.search-result-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #f1eadc; color: var(--accent); font-size: 9px; font-weight: 800; }
.global-search-empty { padding: 16px 10px; color: var(--muted); font-size: 13px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 26px; }
h2 { font-size: 18px; margin-bottom: 14px; }
#view-subtitle { color: var(--muted); margin-bottom: 0; }

.workflow-strip {
  display: grid;
  grid-template-columns: minmax(145px, .6fr) minmax(340px, 1.8fr) minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 62px;
  margin: -2px 0 18px;
  padding: 11px 14px;
  border: 1px solid #d8c39b;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}
.workflow-title { display: grid; gap: 4px; min-width: 0; }
.workflow-title span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.workflow-title strong { font-size: 14px; }
.workflow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.workflow-step { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 11px; }
.workflow-step b { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 10px; }
.workflow-step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-step.active { color: var(--ink); font-weight: 700; }
.workflow-step.active b { border-color: var(--accent); background: var(--accent); color: #fff; }
.workflow-step.done { color: var(--success); }
.workflow-step.done b { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.workflow-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }

.view { display: none; }
.view.active { display: block; }
.phase-base [data-phase="later"] { display: none !important; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.product-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fafbf8; }
.photo-preview { min-height: 78px; display: grid; place-items: center; gap: 6px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px; color: var(--muted); }
.product-photo-preview { max-width: 110px; max-height: 78px; object-fit: contain; border-radius: 6px; }
.pricing-page.active { display: flex; flex-direction: column; }
.pricing-intro { order: 0; display: flex; justify-content: space-between; gap: 28px; align-items: end; padding: 12px 4px 22px; }
.pricing-intro h2 { font-size: 29px; margin: 4px 0 8px; }
.pricing-intro p { color: var(--muted); margin: 0; max-width: 620px; }
.eyebrow, .step-label { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.pricing-overview-strip { display: flex; gap: 18px; flex-wrap: wrap; }
.pricing-overview-strip div { min-width: 78px; }
.pricing-overview-strip strong, .pricing-overview-strip span { display: block; }
.pricing-overview-strip strong { font-size: 21px; }
.pricing-overview-strip span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.pricing-catalog { order: 1; }
.pricing-workspace { order: 2; border-top: 4px solid var(--accent); }
.pricing-advanced { order: 3; }
.price-list { display: grid; max-height: 540px; overflow: auto; border-top: 1px solid var(--line); }
.price-row { display: grid; grid-template-columns: minmax(230px, 2fr) repeat(5, minmax(90px, .65fr)) auto; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.price-row > div span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; margin-bottom: 4px; }
.price-row > div strong { font-size: 14px; }
.price-product strong, .price-product span { text-transform: none !important; }
.price-product strong { font-size: 15px !important; }
.price-status strong { color: var(--warn); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow-panel);
}
.nested-panel { background: #fafbf8; border-style: dashed; margin-top: 14px; }
.table-scroll { overflow: auto; max-height: 620px; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; background: #fff; box-shadow: 0 1px 0 var(--line); }
#productMaster.view.active { display: flex; flex-direction: column; }
#productMaster > #product-editor-panel { order: 2; }
#productMaster > .panel:not(#product-editor-panel) { order: 1; }
.product-quick-search { display: grid; gap: 6px; margin-bottom: 12px; }
.advanced-filters { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbf8; }
.advanced-filters summary { padding: 12px 14px; cursor: pointer; color: var(--primary); font-weight: 800; }
.advanced-filters[open] summary { border-bottom: 1px solid var(--line); }
.advanced-filters .filter-grid, .advanced-filters .query-row, .advanced-filters .muted-box { margin: 12px; }
.master-editor { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbf8; }
.master-editor summary { padding: 12px 14px; cursor: pointer; color: var(--primary); font-weight: 800; }
.master-editor[open] summary { border-bottom: 1px solid var(--line); }
.master-editor form { margin: 14px; }
.inventory-count-input { min-width: 105px; }
.inventory-diff-ok { color: var(--accent); font-weight: 700; }
.inventory-diff-bad { color: var(--bad); font-weight: 700; }
.inventory-diff-warn { color: var(--warn); font-weight: 700; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.channel-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 7px;
  background: #fafbf8;
}
.channel-card span { color: var(--accent); font-size: 12px; text-transform: uppercase; font-weight: 700; }
.channel-card p { margin: 0; color: var(--muted); }
.channel-card small { color: var(--muted); line-height: 1.35; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-bottom: 16px; }
.compact-kpis { margin-top: 12px; }
.quality-list, .backup-list { display: grid; gap: 8px; }
.quality-item, .backup-item {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf8;
  font-size: 12px;
}
.quality-item strong { font-size: 12px; }
.quality-item.warning { border-left: 3px solid var(--warn); background: #fff8e9; }
.quality-item.ok { border-left: 3px solid var(--success); background: var(--success-soft); }
.backup-item { grid-template-columns: 1fr; }
.backup-item span { color: var(--muted); font-size: 11px; }
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.kpi span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.kpi strong { font-size: 22px; }
.health-list { display: grid; gap: 8px; }
.health-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfa;
}
.health-item strong { text-transform: uppercase; font-size: 12px; }
.health-item.warning strong { color: var(--warn); }
.health-item.critical strong { color: var(--bad); }
.health-item.info strong, .health-item.ok strong { color: var(--accent); }
.muted-box, .empty-cell, .hint {
  color: var(--muted);
  background: #fafbf8;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
}
.scope-banner { border-left: 4px solid var(--accent); background: #fbf6ea; color: var(--ink); border-radius: 8px; padding: 11px 12px; margin-bottom: 14px; }
.hint { margin: 12px 0 0; font-size: 13px; border-style: solid; }

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
button.secondary { background: white; color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}
label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.form-row.compact { grid-template-columns: repeat(5, minmax(130px, 1fr)); align-items: end; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 16px; align-items: end; }
.inline-form { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; align-items: end; }
.master-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.master-form button { min-height: 39px; }
.stack-form { display: grid; gap: 10px; margin-bottom: 16px; }
.query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin: 12px 0; }
.query-row button { min-height: 39px; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 39px; color: var(--ink); }
.check-row input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1.2fr 2fr 1fr auto; gap: 10px; margin: 14px 0; align-items: end; }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.two-cols button { width: fit-content; }
.simulator-grid { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.simulation-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.simulation-result .result-value { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.simulation-result strong { display: block; font-size: 19px; margin-top: 4px; }
.recommendation-box { display: grid; gap: 10px; }
.recommendation-box h3 { margin: 4px 0 0; font-size: 14px; }
.recommendation-box ul { margin: 0; padding-left: 18px; }
.recommendation-box li { margin: 4px 0; }
.section-gap { margin-top: 22px; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; }
.settings-form button { grid-column: 1 / -1; width: fit-content; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.panel-head.wrap { align-items: start; flex-wrap: wrap; }
.panel-head input { max-width: 340px; }
.inline-hint { margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: #fafbf8; }
td.num, th.num { text-align: right; }
.wide-table { min-width: 1680px; }
.table-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 10px 2px 0; color: var(--muted); font-size: 12px; }
.table-pager > div { display: flex; align-items: center; gap: 9px; }
.table-pager button { min-width: 90px; }
.table-pager b { color: var(--ink); font-size: 12px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 700; }
.badge.ok { color: var(--accent-2); background: #e5f0e6; }
.badge.bad { color: var(--bad); background: #fae8e8; }

.pos-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.results { display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.result {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.result small { color: var(--muted); display: block; margin-top: 3px; }
.result > small { grid-column: 1; margin: 0; }
.total-line { display: flex; justify-content: space-between; align-items: center; font-size: 20px; margin: 14px 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.topbar-control { position: relative; }
.topbar-assistant { display: inline-flex; align-items: center; gap: 7px; border-color: #d8c39b; }
.assistant-icon { position: relative; display: inline-block; width: 15px; height: 12px; border: 2px solid currentColor; border-radius: 5px; }
.assistant-icon::after { content: ""; position: absolute; left: 2px; bottom: -5px; width: 5px; height: 5px; border-left: 2px solid currentColor; transform: skewY(-28deg); }
.assistant-panel { position: fixed; z-index: 950; top: 74px; right: 20px; bottom: 20px; width: min(460px, calc(100vw - 40px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto auto; overflow: hidden; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 10px; background: #fff; box-shadow: 0 20px 48px rgba(0,0,0,.2); }
.assistant-panel[hidden] { display: none !important; }
.assistant-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: #171717; color: #fff; }
.assistant-header > div { display: grid; gap: 4px; min-width: 0; }
.assistant-header span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.assistant-header strong { font-size: 16px; }
.assistant-header small { display: flex; align-items: center; gap: 6px; color: #d9d9d9; font-size: 10px; }
.assistant-header small i { width: 7px; height: 7px; border-radius: 50%; background: #d2a74f; }
.assistant-header small.online i { background: #5dc878; box-shadow: 0 0 0 3px rgba(93,200,120,.16); }
.assistant-header small.local i { background: var(--info); box-shadow: 0 0 0 3px rgba(55,126,184,.14); }
.assistant-header small.offline i { background: #d2a74f; }
.assistant-header button { padding: 6px 9px; }
.assistant-context { display: grid; gap: 3px; padding: 10px 15px; border-bottom: 1px solid var(--line); background: #fbf6ea; }
.assistant-context span { font-size: 12px; font-weight: 700; }
.assistant-context small { color: var(--muted); }
.assistant-messages { display: grid; align-content: start; gap: 10px; padding: 14px; overflow: auto; background: #fafbf8; }
.assistant-message { max-width: 90%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 2px 7px rgba(35,31,24,.04); }
.assistant-message.user { justify-self: end; border-color: #d8c39b; background: #fffdf8; }
.assistant-message-author { display: block; margin-bottom: 4px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.assistant-message.user .assistant-message-author { color: var(--muted); }
.assistant-message p { margin: 0; font-size: 13px; line-height: 1.42; }
.assistant-message.pending { opacity: .72; }
.assistant-message.pending p::after { content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 7px; border: 2px solid #e5d5b2; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.assistant-message-sources { display: block; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.35; }
.assistant-action-draft { display: grid; gap: 5px; margin-top: 10px; padding: 9px; border-left: 3px solid var(--accent); background: #fbf6ea; }
.assistant-action-draft strong { font-size: 11px; color: var(--accent-2); }
.assistant-action-draft span { font-size: 12px; }
.assistant-action-draft button { justify-self: start; margin-top: 2px; padding: 7px 9px; }
.assistant-message-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.assistant-message-actions button { padding: 6px 8px; font-size: 11px; }
.assistant-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 12px; border-top: 1px solid var(--line); background: #fff; }
.assistant-suggestions button { padding: 6px 8px; font-size: 11px; }
.assistant-audio-row { display: flex; align-items: center; gap: 7px; padding: 8px 12px 0; border-top: 1px solid var(--line); background: #fff; }
.assistant-audio-row button, .audio-file-label { min-height: 36px; padding: 7px 10px; font-size: 11px; }
.assistant-audio-row button[aria-pressed="true"] { border-color: var(--bad); color: var(--bad); background: #fff4f4; }
.audio-file-label { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.assistant-audio-row span { min-width: 0; color: var(--muted); font-size: 10px; }
.assistant-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 11px 12px 7px; border-top: 1px solid var(--line); background: #fff; }
.assistant-form input { min-width: 0; }
.assistant-form button { white-space: nowrap; }
.assistant-disclaimer { margin: 0; padding: 0 12px 11px; color: var(--muted); font-size: 10px; line-height: 1.3; background: #fff; }
.topbar-icon { display: inline-flex; align-items: center; gap: 7px; }
.topbar-icon b { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; text-align: center; }
.bell-icon { position: relative; display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 8px 8px 4px 4px; border-bottom-width: 3px; }
.bell-icon::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: -5px; height: 2px; border-radius: 2px; background: currentColor; }
.topbar-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(360px, calc(100vw - 32px)); padding: 12px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 8px; box-shadow: 0 14px 30px rgba(0,0,0,.16); display: grid; gap: 9px; }
.topbar-popover[hidden] { display: none !important; }
.popover-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.link-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 12px; }
.profile-popover { width: 230px; }
.profile-popover > span { margin-top: -5px; }
.profile-popover button { width: 100%; text-align: left; }
.alerts-list { display: grid; gap: 7px; max-height: 310px; overflow: auto; }
.alert-item { display: grid; grid-template-columns: 68px 1fr; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; background: #fbfcfa; }
.alert-item strong { text-transform: uppercase; color: var(--accent); }
.alert-item.warning strong { color: var(--warn); }
.alert-item.critical strong { color: var(--bad); }
.dashboard-alert-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; margin-bottom: 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: #fffdf8; }
.dashboard-alert-strip div { display: grid; gap: 3px; }
.dashboard-alert-strip span { color: var(--muted); font-size: 13px; }
.dashboard-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.dashboard-toolbar > div:first-child { display: grid; gap: 4px; }
.dashboard-toolbar span { color: var(--muted); font-size: 13px; }
.dashboard-command-grid { display: grid; grid-template-columns: minmax(180px, .78fr) minmax(360px, 1.55fr) minmax(270px, 1fr); gap: 14px; margin-bottom: 16px; align-items: stretch; }
.dashboard-module-panel, .dashboard-stat-panel, .dashboard-alert-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.dashboard-module-panel { background: #fbfcfa; }
.dashboard-stat-panel { border-top: 4px solid var(--accent); }
.dashboard-alert-panel { border-top: 4px solid #315d45; }
.dashboard-reference-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 70px; padding: 13px 15px; background: #171717; color: #fff; }
.dashboard-reference-head > div { min-width: 0; }
.dashboard-reference-head span { display: block; margin-bottom: 5px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.dashboard-reference-head h2 { margin: 0; color: inherit; font-size: 18px; }
.dashboard-stat-panel .dashboard-reference-head { background: #fbf6ea; color: var(--ink); }
.dashboard-alert-panel .dashboard-reference-head { background: #edf3ee; color: var(--ink); }
.dashboard-alert-panel .dashboard-reference-head span { color: #315d45; }
.dashboard-stat-head .segmented-control { flex-shrink: 0; }
.dashboard-stat-head .segmented-control button { padding: 7px 9px; font-size: 11px; }
.dashboard-panel-subtitle { margin: 0; padding: 11px 15px 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.dashboard-module-list { display: grid; padding: 5px 0; }
.dashboard-module-link { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; width: 100%; min-height: 57px; padding: 9px 13px; border: 0; border-bottom: 1px solid #e8ebe6; border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.dashboard-module-link:hover, .dashboard-module-link:focus { background: #f1eadc; color: var(--ink); outline: 0; }
.dashboard-module-link strong, .dashboard-module-link small { display: block; }
.dashboard-module-link small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.module-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: #171717; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.dashboard-module-link:first-child .module-icon { background: var(--accent); }
.dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 15px 0; }
.dashboard-kpis .kpi { padding: 10px; border: 0; border-left: 3px solid #e3d2af; border-radius: 5px; background: #fafbf8; }
.dashboard-kpis .kpi span { margin-bottom: 5px; font-size: 10px; }
.dashboard-kpis .kpi strong { font-size: 17px; }
.dashboard-kpis-secondary { margin-top: 8px; overflow: visible; }
.dashboard-kpis-secondary .kpi { border-left-color: #dce6df; }
.dashboard-kpis-secondary .kpi strong { font-size: 14px; }
.dashboard-mini-chart { margin: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.mini-chart-heading { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.mini-chart-heading strong { font-size: 13px; }
.mini-chart-heading span { color: var(--muted); font-size: 11px; }
.dashboard-mini-chart .chart-area, .dashboard-mini-chart .line-chart { min-height: 145px; height: 145px; }
.dashboard-mini-chart .chart-legend { font-size: 11px; }
.dashboard-alert-head button { padding: 6px 9px; font-size: 11px; }
.dashboard-alert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 11px 12px 13px; }
.dashboard-alert-tile { display: grid; min-height: 88px; align-content: center; gap: 3px; padding: 10px 8px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); text-align: center; }
button.dashboard-alert-tile { cursor: pointer; }
button.dashboard-alert-tile:hover, button.dashboard-alert-tile:focus { border-color: var(--accent); outline: 0; transform: translateY(-1px); }
.dashboard-alert-tile strong { font-size: 19px; line-height: 1.1; }
.dashboard-alert-tile span { font-size: 11px; line-height: 1.2; }
.dashboard-alert-tile small { color: var(--muted); font-size: 10px; line-height: 1.2; }
.dashboard-alert-tile.ok { background: #e6f1e8; }
.dashboard-alert-tile.warning { background: #fff1d5; }
.dashboard-alert-tile.info { background: #edf1f4; }
.dashboard-welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; padding: 20px; border: 1px solid #d8c39b; border-left: 5px solid var(--accent); border-radius: 8px; background: #fffdf8; }
.welcome-copy { min-width: 0; }
.welcome-copy h2 { margin: 7px 0 5px; font-size: 23px; }
.welcome-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.quick-actions button { white-space: nowrap; }
.quick-actions button span { display: inline-block; margin-right: 4px; font-size: 16px; line-height: 0; }
.segmented-control { display: inline-flex; gap: 0; }
.segmented-control button { border-radius: 0; background: #fff; color: var(--accent-2); }
.segmented-control button:first-child { border-radius: 7px 0 0 7px; }
.segmented-control button:last-child { border-radius: 0 7px 7px 0; }
.segmented-control button.active { background: var(--accent); color: #fff; }
.chart-area { min-height: 220px; display: grid; align-items: center; }
.line-chart { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-grid-line { stroke: #e8e5df; stroke-width: 1; }
.chart-axis-label { fill: var(--muted); font-size: 10px; }
.chart-dot { cursor: pointer; stroke: #fff; stroke-width: 1.5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.span-wide { grid-column: 1 / -1; }
.profile-dialog-form { min-width: min(340px, 80vw); }
.profile-detail { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.profile-detail span { color: var(--muted); }
.jausai-action-form { min-width: min(560px, 82vw); }
.jausai-action-fields { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.jausai-action-fields div { display: grid; grid-template-columns: minmax(120px, .7fr) 1.3fr; gap: 12px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.jausai-action-fields div:last-child { border-bottom: 0; }
.jausai-action-fields span { color: var(--muted); text-transform: capitalize; }
.customer-search-head > div { display: grid; gap: 3px; }
.customer-search-head small { color: var(--muted); }
.customer-search-head > input { min-width: min(420px, 48vw); }

.bars { display: grid; gap: 9px; }
.bar-row { display: grid; gap: 4px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.bar { height: 9px; border-radius: 999px; background: #e5ebdf; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

#toast { color: var(--accent-2); font-size: 13px; }
dialog {
  border: 0;
  border-radius: 8px;
  padding: 18px;
  width: min(720px, 92vw);
}
dialog::backdrop { background: rgba(0,0,0,.28); }
.prose { line-height: 1.55; max-width: 820px; }
.status-pedido { color: var(--warn); }
.status-pagado { color: var(--accent); }
.status-despachado { color: var(--accent-2); font-weight: 700; }
.status-anulado { color: var(--bad); }
.receipt-qty, .receipt-cost, .receipt-batch, .receipt-expiry { min-width: 105px; }

@media (max-width: 1400px) and (min-width: 981px) {
  .experience-switch, .topbar-actions > #backup-btn { display: none; }
  .topbar { grid-template-columns: minmax(200px, 1fr) minmax(250px, .9fr) auto; }
  .topbar-actions { flex-wrap: nowrap; }
  .topbar-actions button { padding-right: 10px; padding-left: 10px; }
}

@media (max-width: 980px) {
  .login-screen { padding: 16px; }
  .login-shell { min-height: 0; grid-template-columns: 1fr; }
  .login-intro { padding: 32px; }
  .login-intro h1 { font-size: 31px; }
  .login-intro-logo, .login-route, .login-scope { display: none; }
  .login-card { padding: 34px 32px; }
  body { display: block; }
  .sidebar { position: fixed; z-index: 900; inset: 0 auto 0 0; width: min(310px, 84vw); height: 100dvh; overflow-y: auto; display: block; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 36px rgba(0,0,0,.24); }
  .nav-open .sidebar { transform: translateX(0); }
  .brand { padding-bottom: 12px; }
  .brand img { width: 150px; height: 46px; object-position: left center; }
  .mobile-nav-toggle { display: inline-flex; align-items: center; min-height: 39px; }
  .topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0 12px; align-items: center; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar h1 { font-size: 21px; }
  .topbar-eyebrow { margin-bottom: 2px; }
  .global-search { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .topbar .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .topbar-actions > #backup-btn, .topbar-actions > #toast { display: none; }
  .topbar-assistant { padding: 8px 9px; }
  .topbar-popover { position: fixed; right: 14px; top: 60px; }
  .assistant-panel { top: 68px; right: 12px; bottom: 12px; left: 12px; width: auto; }
  .assistant-suggestions { overflow-x: auto; flex-wrap: nowrap; }
  .assistant-suggestions button { flex: 0 0 auto; }
  .assistant-audio-row { flex-wrap: wrap; }
  .assistant-form { grid-template-columns: minmax(0, 1fr) auto; }
  .customer-search-head > input { min-width: 0; width: 100%; }
  .jausai-action-form { min-width: 0; }
  .workflow-strip { grid-template-columns: 1fr; gap: 9px; margin-top: 0; }
  .workflow-steps { gap: 4px; }
  .workflow-step { justify-content: center; flex-direction: column; gap: 4px; text-align: center; }
  .workflow-step span { max-width: 100%; font-size: 10px; }
  .workflow-hint { font-size: 11px; }
  .dashboard-command-grid { grid-template-columns: 1fr; }
  .dashboard-stat-head, .dashboard-toolbar, .dashboard-alert-strip, .dashboard-welcome { align-items: stretch; flex-direction: column; }
  .dashboard-stat-head .segmented-control { width: 100%; }
  .dashboard-stat-head .segmented-control button { flex: 1; }
  .quick-actions { justify-content: stretch; }
  .quick-actions button { flex: 1 1 180px; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
  .kpis, .grid.two, .pos-layout, .form-row, .filter-grid, .inline-form, .master-form, .settings-form, .query-row, .form-grid, .form-grid.two-cols, .simulator-grid { grid-template-columns: 1fr; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 14px; }
  .pricing-intro { align-items: start; flex-direction: column; }
  .price-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-product { grid-column: 1 / -1; }
  .price-row button { grid-column: 1 / -1; }
}

/* 0.32 - UX tactil y gestion por estados. Los tokens siguen la identidad
   INDAJAUS y dan un significado consistente a cada estado operativo. */
:root {
  --bg: #f5f7fa;
  --ink: #111827;
  --muted: #64748b;
  --line: #dde3ea;
  --panel: #ffffff;
  --accent: #c39743;
  --accent-soft: #fff8df;
  --accent-2: #14213d;
  --navy: #0d172d;
  --primary: #14213d;
  --focus: #2563eb;
  --success: #177245;
  --success-soft: #e8f6ee;
  --info: #1769aa;
  --info-soft: #eaf4fb;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --bad: #b42318;
  --bad-soft: #fff0ee;
}

body { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: var(--navy); }
.sidebar-context, .session-user { border-color: #283653; }
.sidebar button { min-height: 44px; color: #dbe4f0; }
.sidebar button.active, .sidebar button:hover { background: var(--accent); color: #111827; }
button, input, select, textarea { min-height: 44px; }
button { font-weight: 700; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; }
.panel { border-color: var(--line); box-shadow: 0 4px 16px rgba(20, 33, 61, .05); }

.experience-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.experience-switch button { min-height: 34px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.experience-switch button.active { background: var(--primary); color: #fff; }

@media (max-width: 1400px) and (min-width: 981px) {
  .experience-switch, .topbar-actions > #backup-btn { display: none; }
}

.touch-hero, .status-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 22px; border: 1px solid #d9c38f; border-left: 6px solid var(--accent); border-radius: 8px; background: #fff; }
.touch-hero h2, .status-header h2 { margin: 6px 0; font-size: 26px; }
.touch-hero p, .status-header p { margin: 0; color: var(--muted); }
.touch-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.touch-action { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; gap: 2px 12px; min-height: 104px; padding: 18px; border: 1px solid var(--line); border-left: 5px solid #4f7cac; border-radius: 8px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 4px 14px rgba(20, 33, 61, .05); }
.touch-action:hover { border-color: var(--focus); background: #f7fbff; color: var(--ink); transform: translateY(-1px); }
.touch-action.primary { border-left-color: var(--accent); }
.touch-action-mark { grid-row: 1 / 3; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; }
.touch-action.primary .touch-action-mark { background: var(--accent); color: #111827; }
.touch-action strong { align-self: end; font-size: 16px; }
.touch-action small { align-self: start; color: var(--muted); font-weight: 500; }

.status-tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.status-tabs button { display: inline-flex; align-items: center; gap: 8px; min-width: max-content; border-color: var(--line); background: #fff; color: var(--muted); }
.status-tabs button.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.status-tabs b { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .18); text-align: center; }
.state-card-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.state-card { display: grid; align-content: start; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-left: 5px solid var(--info); border-radius: 8px; background: #fff; }
.state-card.warning { border-left-color: var(--warn); }
.state-card.danger { border-left-color: var(--bad); }
.state-card.success { border-left-color: var(--success); }
.state-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.state-kind { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.state-badge { padding: 4px 7px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 11px; font-weight: 800; }
.state-badge.warning { background: var(--warn-soft); color: var(--warn); }
.state-badge.danger { background: var(--bad-soft); color: var(--bad); }
.state-badge.success { background: var(--success-soft); color: var(--success); }
.state-card h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.state-card dl { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 0; }
.state-card dl div { display: grid; gap: 2px; }
.state-card dt { color: var(--muted); font-size: 10px; }
.state-card dd { margin: 0; font-size: 12px; font-weight: 700; }
.state-blocking { margin: 0; padding: 9px; border-radius: 6px; background: var(--warn-soft); color: #684800; font-size: 12px; line-height: 1.4; }
.state-next { display: grid; gap: 3px; padding-top: 10px; border-top: 1px solid var(--line); }
.state-next span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.state-next strong { font-size: 12px; }
.state-card > button { align-self: end; }
.empty-state { grid-column: 1 / -1; display: grid; place-items: center; min-height: 180px; padding: 30px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 16px; }

.guided-shell { max-width: 1050px; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 26px rgba(20, 33, 61, .07); overflow: hidden; }
.guided-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.guided-head h2 { margin: 5px 0 0; }
.guided-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #f8fafc; list-style: none; }
.guided-progress li { position: relative; display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.guided-progress li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guided-progress li:not(:last-child)::after { content: ""; position: absolute; right: 8px; bottom: 0; left: 38px; height: 2px; background: var(--line); }
.guided-progress b { z-index: 1; display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: #fff; }
.guided-progress li.active { color: var(--ink); font-weight: 800; }
.guided-progress li.active b { border-color: var(--accent); background: var(--accent); color: #111827; }
.guided-progress li.done b { border-color: var(--success); background: var(--success); color: #fff; }
.guided-step { display: none; min-height: 390px; padding: 24px; }
.guided-step.active { display: block; }
.guided-step.active.entering { animation: guided-step-in .18s ease-out; }
@keyframes guided-step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.step-copy { margin-bottom: 20px; }
.step-copy span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.step-copy h3 { margin: 6px 0; font-size: 23px; }
.step-copy p { margin: 0; color: var(--muted); }
.cart-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 7px; background: var(--accent-soft); }
.cart-summary span { color: var(--muted); }
.pos-product-results { display: grid; gap: 9px; max-height: 430px; margin-top: 8px; padding-right: 4px; overflow: auto; }
.pos-product-card { display: grid; grid-template-columns: minmax(240px, 1.5fr) minmax(155px, .75fr) minmax(210px, .9fr) auto; gap: 14px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 7px; background: #fff; }
.pos-product-card.no-stock { border-left-color: var(--warn); }
.pos-product-main, .pos-product-stock, .pos-product-price { display: grid; gap: 3px; min-width: 0; }
.pos-product-main h4, .pos-cart-line h4 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.pos-product-main p, .pos-product-stock small, .pos-product-price small, .pos-cart-line small { margin: 0; color: var(--muted); font-size: 11px; }
.product-sku { color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.pos-product-stock span { width: fit-content; padding: 3px 6px; border-radius: 5px; font-size: 11px; font-weight: 800; }
.stock-ok { background: var(--success-soft); color: var(--success); }
.stock-zero { background: var(--warn-soft); color: var(--warn); }
.pos-product-price > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.pos-product-price strong { font-size: 18px; }
.pos-add-product { min-width: 92px; }
.quantity-stepper { display: grid; grid-template-columns: 38px minmax(54px, 68px) 38px; align-items: center; gap: 4px; }
.quantity-stepper button { min-height: 38px; padding: 6px; }
.quantity-stepper input { min-height: 38px; padding: 6px; text-align: center; }
.quantity-stepper.compact { grid-template-columns: 32px 52px 32px; }
.quantity-stepper.compact button, .quantity-stepper.compact input { min-height: 34px; }
.pos-cart-editor { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.pos-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pos-section-head h4 { margin: 0; font-size: 15px; }
.pos-section-head span { color: var(--muted); font-size: 11px; }
.pos-cart-lines { display: grid; gap: 7px; }
.pos-cart-line { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(145px, auto) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfe; }
.pos-cart-line-price { display: grid; gap: 2px; text-align: right; }
.pos-cart-line-price span, .pos-cart-line-price small { color: var(--muted); font-size: 10px; }
.pos-fiscal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 16px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--line); overflow: hidden; }
.pos-fiscal-summary > div { display: grid; gap: 5px; padding: 11px 12px; background: #fff; }
.pos-fiscal-summary span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.pos-fiscal-summary strong { font-size: 16px; }
.pos-fiscal-summary .total { background: var(--accent-soft); }
.pos-review-actions { display: flex; justify-content: flex-end; }
.outcome-head { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.outcome-head h4 { margin: 0 0 4px; }
.outcome-head p { margin: 0; color: var(--muted); font-size: 12px; }
.document-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.document-choice button { display: grid; gap: 3px; min-height: 76px; text-align: left; }
.document-choice small { font-weight: 500; opacity: .82; }
.document-choice button.selected { outline: 3px solid rgba(197, 145, 50, .28); background: var(--accent-soft); color: var(--ink); }
.pos-confirmation { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-top: 14px; padding: 16px; border: 1px solid var(--accent); border-radius: 7px; background: #fffaf0; }
.pos-confirmation[hidden] { display: none; }
.pos-confirmation-copy { display: grid; gap: 6px; }
.pos-confirmation-copy h4, .pos-confirmation-copy p { margin: 0; }
.pos-confirmation-copy p { color: var(--muted); font-size: 12px; }
.confirmation-badge { width: fit-content; color: var(--warn); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.pos-operation-status { display: grid; gap: 2px; margin-top: 3px; padding: 9px 10px; border-left: 3px solid var(--info); background: var(--info-soft); font-size: 11px; }
.pos-operation-status[data-state="processing"] { border-color: var(--warn); background: var(--warn-soft); }
.pos-operation-status[data-state="error"] { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.pos-operation-status span { color: inherit; opacity: .86; }
.guided-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 72px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -6px 16px rgba(20, 33, 61, .05); }
.guided-actions span { color: var(--muted); font-size: 12px; text-align: center; }
.operation-result { display: grid; place-items: center; min-height: 290px; text-align: center; }
.result-mark { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-weight: 900; }
.operation-result h3 { margin-bottom: 8px; font-size: 24px; }
.operation-result p { color: var(--muted); }
.operation-result-detail { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 1px; width: min(100%, 760px); margin-top: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--line); overflow: hidden; }
.operation-result-detail div { display: grid; gap: 5px; padding: 12px; background: #fff; }
.operation-result-detail dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.operation-result-detail dd { margin: 0; font-weight: 900; }
.purchase-entry { border-top: 5px solid var(--accent); }
.integration-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.integration-summary > * { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fb; }
.integration-channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.integration-channel { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: 7px; background: #fff; }
.integration-channel.ok { border-left-color: var(--success); }
.integration-channel.warning { border-left-color: var(--warn); }
.integration-channel.blocked { border-left-color: var(--bad); }
.integration-channel p, .integration-channel ul { margin: 0; color: var(--muted); font-size: 12px; }
.integration-channel ul { padding-left: 18px; }
.integration-channel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.integration-channel-head span { padding: 4px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--primary); font-size: 9px; font-weight: 900; }
.integration-channel dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--line); }
.integration-channel dl div { padding: 8px; background: #fff; }
.integration-channel dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.integration-channel dd { margin: 4px 0 0; font-size: 12px; font-weight: 800; }

.mobile-bottom-nav { display: none; }
.app-locked .mobile-bottom-nav { display: none !important; }

@media (max-width: 1180px) {
  .state-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .touch-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  main { padding-bottom: 92px; }
  .experience-switch { display: none; }
  .mobile-bottom-nav { position: fixed; z-index: 700; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 72px; padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 20px rgba(20, 33, 61, .12); }
  .mobile-bottom-nav button { position: relative; display: grid; place-items: center; gap: 2px; min-height: 56px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
  .mobile-bottom-nav button.active { background: var(--accent-soft); color: var(--primary); }
  .mobile-bottom-nav span { font-size: 12px; font-weight: 900; }
  .mobile-bottom-nav small { font-size: 10px; }
  .mobile-bottom-nav b { position: absolute; top: 1px; right: calc(50% - 19px); min-width: 17px; padding: 2px 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 9px; }
  .touch-hero, .status-header { align-items: stretch; flex-direction: column; }
  .guided-step { min-height: 360px; padding: 18px; }
  .pos-product-card { grid-template-columns: minmax(220px, 1fr) minmax(140px, .7fr) minmax(180px, .8fr); }
  .pos-product-action { grid-column: 3; justify-self: end; }
  .pos-cart-line { grid-template-columns: minmax(200px, 1fr) auto minmax(130px, auto); }
  .pos-cart-line > .link-button { grid-column: 3; justify-self: end; }
  .integration-channel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .login-screen { align-items: start; padding: 0; background: #fff; }
  .login-shell { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .login-intro { justify-content: flex-start; gap: 8px; padding: 28px 22px 24px; }
  .login-intro h1 { font-size: 27px; }
  .login-intro p { font-size: 14px; }
  .login-card { align-content: start; padding: 32px 22px; }
  input, select, textarea { min-height: 48px; font-size: 16px; }
  button { min-height: 48px; }
  main { padding: 10px 10px 90px; }
  .topbar { gap: 8px; }
  .topbar-heading p, .topbar-eyebrow, .topbar-assistant span, #profile-menu-btn { display: none; }
  .topbar-actions { gap: 4px; }
  .topbar-actions button { min-height: 42px; padding: 7px; font-size: 11px; }
  .table-pager { align-items: stretch; flex-direction: column; }
  .table-pager > div { justify-content: space-between; }
  .table-pager button { flex: 1; min-width: 0; }
  .workflow-strip { display: none; }
  .touch-hero, .status-header { padding: 17px; }
  .touch-hero h2, .status-header h2 { font-size: 23px; }
  .touch-action-grid, .state-card-list { grid-template-columns: 1fr; gap: 10px; }
  .touch-action { min-height: 92px; }
  .status-tabs { margin-right: -10px; padding-right: 10px; }
  .state-card { padding: 14px; }
  .guided-head { padding: 14px; }
  .guided-head h2 { font-size: 18px; }
  .guided-progress { padding: 10px; }
  .guided-progress li { justify-content: center; }
  .guided-progress li span { display: none; }
  .guided-progress li:not(:last-child)::after { right: 4px; width: calc(100% - 34px); }
  .guided-step { padding: 16px 12px; }
  .step-copy h3 { font-size: 21px; }
  .pos-product-results { max-height: none; overflow: visible; }
  .pos-product-card { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .pos-product-stock, .pos-product-price { grid-column: 1; }
  .pos-product-action { grid-column: 2; grid-row: 1 / span 3; align-self: end; }
  .pos-product-price strong { font-size: 17px; }
  .pos-cart-line { grid-template-columns: minmax(0, 1fr) auto; }
  .pos-cart-line .quantity-stepper { grid-column: 1; }
  .pos-cart-line-price { grid-column: 2; grid-row: 2; }
  .pos-cart-line > .link-button { grid-column: 2; grid-row: 1; }
  .pos-fiscal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-confirmation { position: sticky; bottom: 70px; z-index: 4; grid-template-columns: 1fr; box-shadow: 0 8px 24px rgba(20, 33, 61, .16); }
  .pos-confirmation > button { width: 100%; }
  .operation-result-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-choice { grid-template-columns: 1fr; }
  .guided-actions { min-height: 72px; grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 12px; }
  .guided-actions span { display: none; }
  .table-scroll { overflow: visible; }
  .table-scroll thead th { position: static; box-shadow: none; }
  table:not(.document-copy table) { display: block; width: 100%; }
  table.wide-table:not(.document-copy table) { min-width: 0; }
  table:not(.document-copy table) thead { display: none; }
  table:not(.document-copy table) tbody { display: grid; gap: 10px; }
  table:not(.document-copy table) tr { display: grid; gap: 0; padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid #91a7c2; border-radius: 8px; background: #fff; }
  table:not(.document-copy table) td { display: grid; grid-template-columns: minmax(95px, .8fr) minmax(0, 1.2fr); gap: 10px; align-items: center; min-height: 38px; padding: 7px 0; border-bottom: 1px solid #edf0f4; text-align: right; overflow-wrap: anywhere; }
  table:not(.document-copy table) td:last-child { border-bottom: 0; }
  table:not(.document-copy table) td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
  table:not(.document-copy table) td.num { text-align: right; }
  table:not(.document-copy table) td.empty-cell { display: block; text-align: center; }
  table:not(.document-copy table) td.empty-cell::before { display: none; }
  table input, table select { width: 100%; min-width: 0 !important; }
  .table-actions { justify-content: flex-end; }
}

@media (max-width: 360px) {
  .topbar h1 { font-size: 18px; }
  .mobile-nav-toggle { padding: 7px; font-size: 11px; }
  .touch-action { padding: 14px; }
  .guided-actions button { padding: 8px 10px; }
  .pos-product-card { grid-template-columns: 1fr; }
  .pos-product-action { grid-column: 1; grid-row: auto; }
  .pos-product-action .quantity-stepper, .pos-product-action button { width: 100%; }
  .pos-fiscal-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}
