:root {
  --ink: #18201d;
  --muted: #6c756f;
  --canvas: #f4f6f3;
  --surface: #ffffff;
  --line: #dfe4df;
  --green: #17684f;
  --green-dark: #104b3a;
  --green-soft: #e7f2ed;
  --orange: #d66c36;
  --orange-soft: #fff1e8;
  --sidebar: #f8faf9;
  --shadow: 0 16px 40px rgba(19, 42, 35, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view { display: grid; grid-template-columns: minmax(430px, 1.1fr) minmax(420px, .9fr); min-height: 100vh; background: white; }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 44px clamp(44px, 6vw, 88px); overflow: hidden; color: white; background: radial-gradient(circle at 82% 16%, rgba(122,215,169,.2), transparent 27%), linear-gradient(145deg, #102c23, #174d3b 64%, #17684f); }
.login-brand-panel::after { position: absolute; right: -120px; bottom: -180px; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; content: ""; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; color: white; text-decoration: none; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 19px; }
.login-brand small { margin-top: 2px; color: #a7c3b8; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.login-promise { position: relative; z-index: 1; max-width: 680px; margin: 70px 0; }
.login-promise .eyebrow { color: #f2a36f; }
.login-promise h1 { max-width: 680px; font-size: clamp(44px, 5.4vw, 74px); font-weight: 700; line-height: 1.02; letter-spacing: -.05em; }
.login-promise > p:last-child { max-width: 580px; margin: 24px 0 0; color: #c2d8cf; font-size: 16px; line-height: 1.7; }
.login-capabilities { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; }
.login-capabilities span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; color: #cfe1da; background: rgba(255,255,255,.055); font-size: 10px; font-weight: 750; }
.login-form-panel { display: grid; place-items: center; min-height: 100vh; padding: 42px; background: #f5f7f4; }
.login-card { width: min(100%, 430px); padding: 42px; border: 1px solid #dce3de; border-radius: 20px; background: white; box-shadow: 0 24px 70px rgba(20,50,40,.1); }
.login-kicker, .dialog-kicker { color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.login-card h2 { margin: 12px 0 7px; font-size: 35px; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 28px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-card label { display: block; margin-bottom: 17px; }
.login-card label > span:first-child { display: block; margin-bottom: 7px; color: #42564d; font-size: 10px; font-weight: 800; }
.login-field { margin-bottom: 17px; }
.login-field > label { margin-bottom: 7px; color: #42564d; font-size: 10px; font-weight: 800; }
.login-card input { width: 100%; min-height: 47px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fbfcfb; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 55px; }
.password-field button { position: absolute; top: 7px; right: 7px; height: 33px; padding: 0 9px; border: 0; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.login-card .login-error { margin: -4px 0 14px; padding: 10px 12px; border-radius: 8px; color: #883b32; background: #fbeae6; font-size: 11px; }
.login-submit { width: 100%; min-height: 47px; }
.login-notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.login-notice i { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 4px; border-radius: 50%; background: #55b17f; box-shadow: 0 0 0 4px #e9f5ef; }
.login-notice strong { display: block; margin-bottom: 2px; color: #3c5449; }

.erp-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: 282px; min-height: 100vh; padding: 20px 16px 16px; color: var(--ink); border-right: 1px solid #dfe7e2; background: var(--sidebar); box-shadow: 8px 0 28px rgba(24,32,29,.035); }
.erp-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; color: #173d31; text-decoration: none; }
.erp-brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #8ed4b2; border-radius: 10px; color: #173e31; background: #b9ebd2; font-size: 20px; font-weight: 900; }
.erp-brand strong, .erp-brand small { display: block; }
.erp-brand strong { font-size: 18px; letter-spacing: .01em; }
.erp-brand small { margin-top: 2px; color: #71867d; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.company-switcher { display: grid; grid-template-columns: 35px 1fr auto; gap: 10px; align-items: center; width: calc(100% - 4px); margin: 0 2px 18px; padding: 11px; border: 1px solid #d9e6df; border-radius: 10px; color: inherit; background: white; text-align: left; box-shadow: 0 4px 14px rgba(24,70,54,.035); }
.company-switcher:hover { border-color: #b7d2c5; background: #f4faf7; }
.company-avatar, .user-avatar { display: grid; place-items: center; border-radius: 9px; font-size: 11px; font-weight: 850; }
.company-avatar { width: 35px; height: 35px; color: #153e32; background: #dcefe5; }
.company-switcher small, .company-switcher strong, .sidebar-user small, .sidebar-user strong { display: block; }
.company-switcher small { margin-bottom: 3px; color: #789086; font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.company-switcher strong { font-size: 12px; }
.company-switcher em { display: block; margin-top: 3px; color: #81948c; font-size: 9px; font-style: normal; }
.chevron { margin-left: auto; color: #8ba097; }
.erp-nav { flex: 1; overflow-x: hidden; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #c3d2cb transparent; }
.nav-label { margin: 20px 10px 7px; color: #7b8d85; font-size: 8px; font-weight: 900; letter-spacing: .17em; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; color: #4c6259; background: transparent; font-size: 12px; font-weight: 800; text-align: left; text-decoration: none; }
.nav-item.parent { color: #30483e; cursor: pointer; list-style: none; transition: color .18s ease,background .18s ease; }
.nav-item.parent::-webkit-details-marker { display: none; }
.nav-item:hover { color: #174e3d; background: #edf5f1; }
.nav-item-disabled { cursor: default; opacity: .62; }
.nav-item-disabled:hover { background: transparent; }
.nav-icon { display: inline-grid; place-items: center; width: 22px; color: #668078; font-size: 15px; }
.nav-group { position: relative; margin: 1px 0; padding: 2px; border: 0; border-radius: 9px; background: transparent; }
.nav-group .chevron { margin-left: 0; font-size: 11px; transition: transform .2s ease,color .2s ease; }
.nav-group[open] > .nav-item.parent { color: #153f32; background: #edf5f1; }
.nav-group[open] > .nav-item.parent .chevron { color: #39765f; transform: rotate(180deg); }
.nav-group:has(.active) > .nav-item.parent { color: #12513e; background: #e7f3ed; }
.nav-group:has(.active) > .nav-item.parent .nav-icon { color: #197253; }
.nav-children { position: relative; display: grid; gap: 3px; max-height: 0; margin: 0; overflow: hidden; opacity: 0; transition: max-height .24s ease,opacity .18s ease,padding .24s ease; }
.nav-group[open] > .nav-children { max-height: 360px; padding: 4px 2px 7px; opacity: 1; }
.nav-children::before { display: none; }
.nav-subitem { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; margin-left: 0; padding: 7px 8px 7px 37px; border: 0; border-radius: 7px; color: #52685f; background: transparent; font-size: 11px; font-weight: 700; text-align: left; text-decoration: none; }
.nav-subitem::before { position: absolute; left: 19px; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: #99aaa3; content: ""; transform: translateY(-50%); }
.nav-subitem:hover:not(.muted) { color: #174e3d; background: #edf5f1; }
.nav-subitem.active { color: #10513d; background: #dcefe5; font-weight: 900; box-shadow: inset 3px 0 #187151; }
.nav-subitem.active::before { background: #17684f; box-shadow: none; }
.nav-subitem small { color: #7a8d85; font-size: 7px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nav-count { min-width: 19px; margin-left: auto; padding: 2px 5px; border-radius: 99px; color: #6d8279; background: #edf2ef; font-size: 8px; text-align: center; }
.nav-soon { margin-left: auto; padding: 2px 5px; border-radius: 99px; color: #7b8983; background: #edf0ee; font-size: 6px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.nav-group-future { background: transparent; }
.nav-group-future > .nav-item.parent { color: #74847d; font-weight: 700; }
.nav-group-future .nav-subitem { color: #89968f; }
.nav-group-future .nav-subitem::before, .nav-subitem.muted::before { background: #c2ccc7; }
.nav-subitem:disabled { cursor: default; }
.nav-group-disabled > summary { pointer-events: none; }
.muted { cursor: default; opacity: .72; }
.sidebar-user { display: grid; grid-template-columns: 37px 1fr auto; gap: 10px; align-items: center; padding: 14px 10px 2px; border-top: 1px solid #dfe7e2; }
.user-avatar { width: 37px; height: 37px; color: #174735; background: #dcefe5; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user small { margin-top: 3px; color: #7b8d85; font-size: 10px; }
.logout-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d9e4de; border-radius: 8px; color: #6f837a; background: white; }
.logout-button:hover { color: #174e3d; background: #edf5f1; }
.master-nav { padding-bottom: 2px; }
.master-link { font-size: 11px; }

.erp-content { min-width: 0; margin-left: 282px; }
.erp-topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.breadcrumb b { color: #b4bbb7; font-weight: 400; }
.breadcrumb strong { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.local-badge { padding: 7px 11px; border: 1px solid #d7e6de; border-radius: 99px; color: #476359; background: #f4faf7; font-size: 11px; font-weight: 700; }
.local-badge i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #42a873; }
.local-badge.api-mode { color: #7d4b2e; border-color: #eed2bf; background: #fff5ee; }
.local-badge.api-mode i { background: var(--orange); }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: #9aa39e; background: white; font-size: 8px; }
.topbar-date { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; }

.module-main { width: min(1400px, calc(100% - 56px)); margin: auto; padding: 42px 0 0; }
.module-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 12px; color: var(--orange); font-size: 10px; font-weight: 850; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); font-weight: 740; line-height: 1.02; letter-spacing: -.045em; }
.lede { max-width: 720px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.module-state { display: flex; align-items: center; gap: 11px; min-width: 210px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 25px rgba(19,42,35,.04); }
.module-state > span { width: 10px; height: 10px; border-radius: 50%; background: #e8a570; box-shadow: 0 0 0 5px #fff0e4; }
.module-state small, .module-state strong { display: block; }
.module-state small { margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.module-state strong { font-size: 13px; }

.workflow { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 0 0 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); list-style: none; }
.flow-step { position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px 20px; border-right: 1px solid var(--line); }
.flow-step:last-child { border-right: 0; }
.flow-step > span { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; border: 1px solid var(--line); border-radius: 50%; color: #929b96; background: #f8faf8; font-size: 11px; font-weight: 850; }
.flow-step strong, .flow-step small { display: block; }
.flow-step strong { font-size: 12px; }
.flow-step small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.flow-step.active { background: #f2f8f5; }
.flow-step.active > span { color: white; border-color: var(--green); background: var(--green); }
.has-results .flow-step:nth-child(-n+2) > span { color: var(--green); border-color: #b8d8c9; background: var(--green-soft); }
.has-results .flow-step:nth-child(-n+2) > span { font-size: 0; }
.has-results .flow-step:nth-child(-n+2) > span::after { content: "✓"; font-size: 12px; }
.has-results .flow-step { background: white; }
.has-results .flow-step:nth-child(3) { background: #f2f8f5; }
.has-results .flow-step:nth-child(3) > span { color: white; border-color: var(--green); background: var(--green); }

.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.workspace-heading > div { display: flex; align-items: center; gap: 14px; }
.section-number { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 850; }
.workspace-heading h2 { margin: 0 0 4px; font-size: 17px; }
.workspace-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.format-pill { padding: 7px 10px; border: 1px solid #e1e6e2; border-radius: 7px; color: var(--muted); background: #f8faf8; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.workspace-body { padding: 22px; }
.drop-zone { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 140px; padding: 24px; border: 1.5px dashed #9eb7ab; border-radius: 12px; background: #f7fbf8; transition: .18s ease; }
.drop-zone:hover, .drop-zone.dragging, .drop-zone:focus-visible { border-color: var(--green); background: #eff8f3; outline: none; }
.drop-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 24px; font-weight: 500; }
.drop-zone strong { display: block; margin-bottom: 6px; font-size: 16px; }
.drop-zone p { margin: 0; color: var(--muted); font-size: 12px; }
.link-button { padding: 0; border: 0; color: var(--green); background: none; font-weight: 750; text-decoration: underline; }
.manual-entry { margin-top: 15px; border-top: 1px solid var(--line); }
.manual-entry summary { padding: 15px 4px 0; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.manual-entry-body { padding-top: 16px; }
.editor-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
textarea { display: block; width: 100%; min-height: 160px; resize: vertical; padding: 17px; border: 1px solid var(--line); border-radius: 9px; color: #28352f; background: #fafbf9; font: 12px/1.6 Consolas, monospace; }
textarea:focus, input:focus { border-color: var(--green); outline: 2px solid rgba(23,104,79,.12); }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.editor-actions .status-error { color: #a33f35; font-weight: 700; }
.button { padding: 10px 15px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 750; }
.button.primary { color: white; border-color: var(--green); background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.primary span { margin-left: 10px; }
.button.secondary { color: var(--ink); background: white; }
.button.secondary:hover { background: #f2f5f2; }
.button:disabled,.button:disabled:hover { cursor: not-allowed; opacity: .45; color: #607069; border-color: var(--line); background: #e8eeeb; }

.results { padding: 54px 0 20px; }
.results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.results-heading h2 { margin: 0; font-size: clamp(27px, 4vw, 38px); letter-spacing: -.035em; }
.results-heading > div > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.export-actions { display: flex; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 24px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.stat { padding: 18px; background: var(--surface); }
.stat strong { display: block; color: var(--green); font-size: 26px; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.invoice-profile { margin: 0 0 28px; }
.invoice-hero { padding: 23px 25px; border-radius: 13px 13px 0 0; color: white; background: linear-gradient(120deg, var(--green-dark), var(--green)); }
.invoice-hero .eyebrow { margin-bottom: 7px; color: #f3ad7c; }
.invoice-hero h3 { margin: 0; font-size: 26px; }
.invoice-meta { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1px; border: 1px solid var(--line); border-top: 0; background: var(--line); }
.invoice-meta div, .amount-card { padding: 16px; background: var(--surface); }
.invoice-meta span, .amount-card span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-meta strong { font-size: 12px; }
.amount-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 1px; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 13px 13px; background: var(--line); }
.amount-card strong { color: var(--green); font-size: 17px; white-space: nowrap; }
.amount-card.total strong { color: var(--orange); }
.invoice-support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.invoice-profile .result-card { margin-bottom: 16px; }
.invoice-profile .compact-heading { padding: 15px 18px; }
.invoice-profile .compact-heading h3 { font-size: 16px; }
.invoice-profile .invoice-table-card { border-color: #cad8d1; border-radius: 14px; box-shadow: 0 10px 28px rgba(23,104,79,.06); }
.invoice-profile .invoice-table-card .compact-heading { padding: 19px 22px; background: linear-gradient(135deg, #f5faf7, #fff); }
.invoice-profile .invoice-table-card .compact-heading h3 { color: var(--green-dark); font-size: 21px; }
.invoice-profile .invoice-table-card .compact-heading p { margin-top: 4px; font-size: 11px; }
.invoice-table-card .table-wrap { scrollbar-color: #9bb2a8 #edf2ef; scrollbar-width: thin; }
.invoice-table-card table { font-size: 12px; }
.serials-card table { min-width: 1100px; }
.articles-card table { min-width: 1160px; }
.invoice-table-card th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; color: #365449; background: #e7f0eb; font-size: 9px; }
.invoice-table-card td { padding: 14px; line-height: 1.4; }
.invoice-table-card tbody tr:nth-child(even) { background: #fafbf9; }
.invoice-table-card tbody tr:hover { background: #edf5f0; }
.articles-card th:nth-child(3), .articles-card td:nth-child(3), .serials-card th:nth-child(4), .serials-card td:nth-child(4) { min-width: 195px; }
.articles-card th:nth-child(2), .articles-card td:nth-child(2) { min-width: 90px; }
.articles-card th:nth-child(8), .articles-card td:nth-child(8) { color: #9b4829; background: var(--orange-soft); font-weight: 800; }
.serials-card th:nth-child(3), .serials-card td:nth-child(3) { width: 70px; min-width: 70px; }
.serials-card th:nth-child(5), .serials-card td:nth-child(5) { min-width: 170px; }
.serials-card th:nth-child(6), .serials-card td:nth-child(6) { min-width: 210px; }
.invoice-table-card td:nth-last-child(-n+5) { white-space: nowrap; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.tab { padding: 12px 1px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: none; font-size: 11px; font-weight: 750; }
.tab.active { color: var(--ink); border-bottom-color: var(--orange); }
.panel { display: none; padding-top: 20px; }
.panel.active { display: block; }
.result-card { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card-heading { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card-heading .number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; }
.card-heading h3 { margin: 0 0 3px; font-size: 17px; }
.card-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.table-wrap { max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 14px; color: var(--muted); background: #f2f4f1; font-size: 9px; text-align: left; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
td { max-width: 380px; padding: 11px 14px; border-top: 1px solid #e8ece8; vertical-align: top; overflow-wrap: anywhere; }
td:first-child { color: var(--muted); font-family: Consolas, monospace; font-size: 10px; }
.empty { padding: 26px; color: var(--muted); text-align: center; }
.filter-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filter-row input { width: min(420px, 75%); padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.filter-row span { color: var(--muted); font-size: 11px; }
.tree-view { padding: 22px; overflow: auto; font: 12px/1.8 Consolas, monospace; }
.tree-view details { margin-left: 20px; }
.tree-view summary { color: var(--green); cursor: pointer; }
.tree-value { margin-left: 8px; color: #8b4d2e; }
.tree-attribute { color: #825d16; }
.code-card { position: relative; padding: 22px; background: #1b2621; }
pre { margin: 0; overflow: auto; color: #d9e7df; font: 11px/1.65 Consolas, monospace; }
.copy-button { position: absolute; top: 12px; right: 12px; padding: 7px 10px; border: 1px solid #51615a; border-radius: 6px; color: white; background: #293a32; }
.error-box { margin: 22px 0; padding: 16px 19px; border-left: 4px solid #b44e42; border-radius: 6px; color: #78352d; background: #fae8e3; }
.success-toast { position: fixed; z-index: 1000; top: 22px; right: 22px; max-width: min(430px, calc(100vw - 44px)); padding: 15px 18px; border-left: 4px solid #2f9b70; border-radius: 8px; color: #124d39; background: #e8f7f0; box-shadow: 0 12px 32px rgba(24, 64, 47, .18); font-size: 13px; font-weight: 700; line-height: 1.45; opacity: 0; pointer-events: none; transform: translateY(-12px); transition: opacity .18s ease, transform .18s ease; }
.success-toast.visible { opacity: 1; transform: translateY(0); }
footer { display: flex; justify-content: space-between; margin-top: 58px; padding: 24px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
footer span { color: var(--ink); font-weight: 800; }
footer p { margin: 0; }

.registration-choice { margin-bottom: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.choice-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.choice-heading h2 { margin: 0 0 4px; font-size: 17px; }
.choice-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice-card { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 13px; align-items: center; min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcfb; text-align: left; transition: .18s ease; }
.choice-card:hover { border-color: #abc9ba; transform: translateY(-1px); }
.choice-card.active { border-color: var(--green); background: #f0f8f4; box-shadow: 0 0 0 2px rgba(23,104,79,.08); }
.choice-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 900; }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { margin-bottom: 5px; font-size: 13px; }
.choice-card small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.choice-card i { position: absolute; top: 8px; right: 8px; padding: 4px 6px; border-radius: 5px; color: #8a492c; background: var(--orange-soft); font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .08em; }
.registration-panel[hidden] { display: none; }

.manual-purchase-form { padding: 0; }
.form-section { padding: 24px; border-bottom: 1px solid var(--line); }
.form-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.form-section-heading strong { font-size: 14px; }
.form-section-heading span, .form-section-heading small { display: block; color: var(--muted); font-size: 10px; }
.form-section-heading small { margin-top: 4px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid label > span { display: block; margin-bottom: 7px; color: #4c5d55; font-size: 10px; font-weight: 800; }
.form-grid input, .form-grid select, .manual-lines-table input, .manual-lines-table select, .classification-select { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.form-grid select:focus, .manual-lines-table select:focus, .classification-select:focus { border-color: var(--green); outline: 2px solid rgba(23,104,79,.12); }
.line-section { padding-bottom: 18px; }
.manual-line-cards { display: grid; gap: 14px; }
.manual-line-card { overflow: hidden; border: 1px solid #cfded6; border-radius: 13px; background: #fbfdfc; }
.manual-line-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid #dbe6e0; background: #f1f7f4; }
.manual-line-head strong { display: block; margin-bottom: 3px; color: var(--green-dark); font-size: 12px; }
.manual-line-head span { color: var(--muted); font-size: 9px; }
.manual-line-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 12px; padding: 16px; }
.manual-line-field { grid-column: span 2; }
.manual-line-field.medium { grid-column: span 3; }
.manual-line-field.wide { grid-column: span 4; }
.manual-line-field.full { grid-column: 1/-1; }
.manual-line-field > span { display: block; margin-bottom: 6px; color: #4c5d55; font-size: 9px; font-weight: 800; }
.manual-line-field input,.manual-line-field select,.manual-line-field textarea { width: 100%; min-height: 39px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.manual-line-field textarea { min-height: 68px; resize: vertical; font-family: inherit; font-size: 10px; line-height: 1.5; }
.manual-line-field input:focus,.manual-line-field select:focus,.manual-line-field textarea:focus { border-color: var(--green); outline: 2px solid rgba(23,104,79,.12); }
.manual-line-total { display: flex; align-items: center; justify-content: space-between; grid-column: span 2; padding: 10px 12px; border-radius: 8px; background: var(--green-soft); }
.manual-line-total span { color: var(--muted); font-size: 8px; font-weight: 800; }
.manual-line-total strong { color: var(--green-dark); font-size: 13px; }
.manual-lines-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.manual-lines-table { min-width: 1080px; }
.manual-lines-table td { padding: 9px 7px; }
.manual-lines-table td:first-child { min-width: 190px; font-family: inherit; }
.manual-lines-table td:nth-child(2) { min-width: 240px; }
.manual-lines-table td:nth-child(3) { min-width: 110px; }
.manual-lines-table td:nth-child(n+4):nth-child(-n+6) { min-width: 120px; }
.manual-lines-table .line-total { min-width: 130px; color: var(--green); font-family: inherit; font-size: 11px; font-weight: 850; white-space: nowrap; }
.remove-line { width: 30px; height: 30px; border: 0; border-radius: 7px; color: #9b493d; background: #fae9e5; font-size: 18px; }
.manual-total { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 16px; }
.manual-total span { color: var(--muted); font-size: 11px; font-weight: 750; }
.manual-total strong { color: var(--green-dark); font-size: 22px; }
.manual-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; background: #f7faf8; }
.manual-form-actions p { margin: 0; color: var(--muted); font-size: 11px; }
.manual-submit-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.button.large { padding: 12px 18px; }

.operational-summary { margin: 0 0 16px; padding: 20px; border: 1px solid #cad8d1; border-radius: 13px; background: #fbfdfc; }
.operational-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.operational-heading h3 { margin: 0 0 4px; font-size: 17px; }
.operational-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.review-badge, .draft-badge { padding: 7px 9px; border-radius: 6px; color: #95502f; background: var(--orange-soft); font-size: 8px; font-weight: 900; letter-spacing: .09em; }
.effect-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.effect-card { display: flex; align-items: center; gap: 12px; min-height: 67px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.effect-card > strong { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 5px; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 17px; }
.effect-card b, .effect-card small { display: block; }
.effect-card b { margin-bottom: 4px; font-size: 11px; }
.effect-card small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.effect-card.service > strong { color: #725529; background: #f6eddc; }
.effect-card.acquisition-cost > strong { color: #915037; background: var(--orange-soft); }
.classification-table { min-width: 1450px !important; }
.classification-table th:first-child, .classification-table td:first-child { position: sticky; left: 0; z-index: 2; min-width: 210px; background: white; }
.classification-table th:first-child { z-index: 3; background: #e7f0eb; }
.classification-select { min-width: 190px; min-height: 36px; padding: 7px 9px; font-size: 10px; font-weight: 750; }
.classification-select.inventory { border-color: #afd2bf; background: #f1faf5; }
.classification-select.service { border-color: #dac9a7; background: #fffaf0; }
.classification-select.acquisition-cost { border-color: #e4bda8; background: #fff6f1; }

.manual-result { padding: 54px 0 20px; }
.manual-result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.manual-result-heading h2 { margin: 0; font-size: clamp(27px, 4vw, 38px); letter-spacing: -.035em; }
.manual-result-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.draft-meta { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1px; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.draft-meta div { padding: 15px; background: white; }
.draft-meta span, .draft-meta strong { display: block; }
.draft-meta span { margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.draft-meta strong { font-size: 12px; }
.draft-effects { margin-bottom: 16px; }
.draft-effects .effect-card > strong { display: block; min-width: 120px; height: auto; color: var(--green-dark); background: transparent; font-size: 14px; }
.manual-draft-lines table { min-width: 1580px; }
.manual-draft-lines th,.manual-draft-lines td { white-space: nowrap; }
.manual-draft-lines th:nth-child(1),.manual-draft-lines td:nth-child(1) { min-width: 170px; }
.manual-draft-lines th:nth-child(2),.manual-draft-lines td:nth-child(2) { min-width: 240px; white-space: normal; }
.manual-draft-lines th:nth-child(3),.manual-draft-lines td:nth-child(3) { min-width: 260px; white-space: normal; }
.manual-draft-lines th:nth-child(n+4),.manual-draft-lines td:nth-child(n+4) { min-width: 105px; }

.service-accounting-panel { margin-top: 18px; padding: 20px; border: 1px solid #dccfae; border-radius: 13px; background: #fffdf7; }
.service-accounting-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.service-accounting-heading span { color: #8a682d; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.service-accounting-heading h3 { margin: 5px 0 4px; font-size: 18px; }
.service-accounting-heading p { max-width: 680px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.no-kardex-badge { padding: 7px 9px; border-radius: 6px; color: #6f5426; background: #f4e8c8; font-size: 8px; letter-spacing: .08em; white-space: nowrap; }
.service-accounting-totals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; overflow: hidden; margin-bottom: 14px; border: 1px solid #e5dcc4; border-radius: 9px; background: #e5dcc4; }
.service-accounting-totals div { padding: 12px; background: white; }
.service-accounting-totals span,.service-accounting-totals strong { display: block; }
.service-accounting-totals span { margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.service-accounting-totals strong { font-size: 12px; }
.accounting-dimensions,.service-posting-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.service-posting-controls { grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 14px; }
.accounting-dimensions label>span,.service-posting-controls label>span { display: block; margin-bottom: 6px; color: #5c5546; font-size: 8px; font-weight: 800; }
.accounting-dimensions input,.service-posting-controls select,.service-account-lines select { width: 100%; min-height: 39px; padding: 8px 9px; border: 1px solid #ded4bd; border-radius: 8px; color: var(--ink); background: white; }
.service-account-lines { display: grid; gap: 7px; margin-bottom: 12px; }
.service-account-lines label { display: grid; grid-template-columns: minmax(260px,1fr) minmax(250px,.8fr); gap: 12px; align-items: center; padding: 10px 11px; border: 1px solid #e7dfca; border-radius: 9px; background: white; }
.service-account-lines strong,.service-account-lines small { display: block; }
.service-account-lines strong { margin-bottom: 4px; font-size: 10px; }
.service-account-lines small { color: var(--muted); font-size: 8px; }
.accounting-result { margin-top: 15px; padding-top: 14px; border-top: 1px solid #e2d8bf; }
.accounting-result h4 { margin: 0 0 5px; font-size: 13px; }
.accounting-result p { margin: 0 0 10px; color: var(--muted); font-size: 9px; }

.erp-dialog { width: min(92vw, 610px); padding: 0; border: 1px solid #d8e0db; border-radius: 18px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(10,35,27,.25); }
.erp-dialog::backdrop { background: rgba(10,31,24,.66); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 26px 28px 20px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 8px 0 5px; font-size: 25px; letter-spacing: -.025em; }
.dialog-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 20px; }
.company-options { display: grid; gap: 9px; padding: 20px 28px; }
.company-option { display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: center; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfcfb; text-align: left; }
.company-option:hover, .company-option.active { border-color: #94bea9; background: #f0f8f4; }
.company-option > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--green-dark); background: var(--green-soft); font-size: 11px; font-weight: 900; }
.company-option strong, .company-option small { display: block; }
.company-option strong { font-size: 12px; }
.company-option small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.company-option i { color: var(--green); font-size: 17px; font-style: normal; }
.company-options:empty { display: none; }
.company-empty { margin: 0 28px 18px; padding: 14px; border: 1px dashed #b7c8bf; border-radius: 11px; color: var(--muted); background: #f8faf9; font-size: 10px; line-height: 1.5; }
.super-admin-company { margin: 0 28px 20px; overflow: hidden; border: 1px solid #c8dbd1; border-radius: 13px; background: #f7fbf9; }
.super-admin-heading { padding: 16px 18px 13px; border-bottom: 1px solid #dbe7e1; }
.super-admin-heading > span { display: block; margin-bottom: 5px; color: var(--orange); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.super-admin-heading strong { display: block; font-size: 14px; }
.super-admin-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.company-create-form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 16px 18px 18px; }
.company-create-form label > span { display: block; margin-bottom: 5px; color: #52655d; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.company-create-form input, .company-create-form select { width: 100%; min-height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font: inherit; font-size: 10px; }
.company-create-form .wide { grid-column: 1 / -1; }
.dialog-footnote { margin: 0; padding: 0 28px 24px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.compact-dialog { width: min(92vw, 520px); }
.environment-message { min-height: 17px; margin: 13px 0; color: #95502f; font-size: 10px; line-height: 1.45; }
.dialog-submit { width: 100%; }

.master-heading { margin-bottom: 24px; }
.module-state.ready > span { background: #42a873; box-shadow: 0 0 0 5px #e8f5ee; }
.master-stats { display: grid; grid-template-columns: repeat(5,1fr); gap: 1px; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.master-stat { padding: 16px; border: 0; color: var(--ink); background: white; text-align: left; }
.master-stat:hover, .master-stat.active { background: #f0f8f4; }
.master-stat strong, .master-stat span { display: block; }
.master-stat strong { color: var(--green); font-size: 23px; letter-spacing: -.035em; }
.master-stat span { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.master-catalog { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }
.master-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 23px; border-bottom: 1px solid var(--line); }
.master-toolbar > div:first-child { display: flex; align-items: center; gap: 13px; }
.master-toolbar h2 { margin: 0 0 4px; font-size: 19px; }
.master-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.master-filter { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.master-filter input { width: min(430px,75%); min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.master-filter span { color: var(--muted); font-size: 10px; }
.master-table table { min-width: 840px; }
.master-table td { vertical-align: middle; }
.master-table td:first-child { color: var(--ink); font-family: inherit; font-size: 11px; font-weight: 800; }
.master-table .status-pill, .mapping-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 99px; color: #276349; background: #e7f3ec; font-size: 8px; font-weight: 900; letter-spacing: .05em; }
.master-table .status-pill.off { color: #7d6658; background: #f1ece8; }
.master-scope-note { display: flex; gap: 13px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; border: 1px solid #dbe6e0; border-radius: 10px; color: var(--muted); background: #f7faf8; font-size: 10px; line-height: 1.5; }
.master-scope-note strong { flex: 0 0 auto; color: #355448; }
.security-workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }
.security-tabs { display: flex; gap: 4px; padding: 7px; border-bottom: 1px solid var(--line); background: #f5f8f6; }
.security-tab { padding: 10px 15px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; }
.security-tab.active { color: var(--green-dark); background: white; box-shadow: 0 2px 8px rgba(19,42,35,.08); }
.security-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.security-toolbar span { color: var(--orange); font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.security-toolbar h2 { margin: 5px 0 4px; font-size: 20px; }
.security-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.security-table table { min-width: 920px; }
.security-table td:first-child { color: var(--ink); font-family: inherit; font-size: 11px; }
.security-user-name strong,.security-user-name small { display: block; }
.security-user-name small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.security-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 99px; color: #17684f; background: #e7f2ed; font-size: 8px; font-weight: 900; letter-spacing: .05em; }
.security-badge.inactive { color: #965340; background: #fae9e5; }
.security-role-list { display: flex; flex-wrap: wrap; gap: 5px; }
.security-role-list span { padding: 5px 7px; border: 1px solid #d8e5de; border-radius: 6px; color: #3f5e52; background: #f6faf8; font-size: 9px; }
.security-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.security-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); background: white; font-size: 9px; font-weight: 800; }
.security-actions button:hover { border-color: #9fc5b2; background: #f1f8f4; }
.security-stats { margin-bottom: 20px; }
.security-form { padding: 22px 28px 28px; }
.security-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.security-form label>span,.security-form legend { display: block; margin-bottom: 7px; color: #42564d; font-size: 10px; font-weight: 800; }
.security-form label.wide { grid-column: 1/-1; }
.security-form input:not([type="checkbox"]) { width: 100%; min-height: 43px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbfcfb; }
.security-form label small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.security-form fieldset { margin: 18px 0; padding: 0; border: 0; }
.security-form legend { margin-bottom: 10px; }
.security-access-toggle,.security-check-option { display: flex !important; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.security-access-toggle { margin-top: 15px; }
.security-access-toggle input,.security-check-option input { margin-top: 2px; accent-color: var(--green); }
.security-access-toggle strong,.security-access-toggle small,.security-check-option strong,.security-check-option small { display: block; }
.security-access-toggle small,.security-check-option small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.security-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.permission-groups { display: grid; gap: 13px; max-height: 45vh; overflow: auto; padding-right: 5px; }
.permission-group { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.permission-group>strong { display: block; margin-bottom: 9px; color: var(--green-dark); font-size: 10px; letter-spacing: .08em; }
.permission-group-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.permission-group .security-check-option { background: white; }
.permission-critical { color: #9b4d35 !important; }
.role-dialog { width: min(94vw,850px); }
.master-dialog { width: min(94vw,650px); }
#masterRecordForm { padding: 22px 28px 27px; }
.master-form-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.master-form-fields label { display: block; }
.master-form-fields label.wide { grid-column: 1/-1; }
.master-form-fields label > span { display: block; margin-bottom: 7px; color: #43584e; font-size: 9px; font-weight: 850; }
.master-form-fields input, .master-form-fields select { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.master-form-fields .check-field { display: flex; gap: 9px; align-items: center; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.master-form-fields .check-field input { width: auto; min-height: auto; accent-color: var(--green); }
.master-form-fields .check-field span { margin: 0; }

.homologation-panel { margin: 16px 0; padding: 20px; border: 1px solid #cbded4; border-radius: 13px; background: #fbfdfc; }
.homologation-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.homologation-heading h3 { margin: 0 0 4px; font-size: 17px; }
.homologation-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.homologation-progress { padding: 7px 10px; border-radius: 7px; color: #8a4d30; background: var(--orange-soft); font-size: 9px; font-weight: 900; }
.homologation-progress.complete { color: #276349; background: var(--green-soft); }
.homologation-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.homologation-table table { min-width: 0; width: 100%; table-layout: fixed; }
.homologation-table th:first-child { width: 38%; }
.homologation-table th:nth-child(2) { width: 18%; }
.homologation-table th { white-space: normal; line-height: 1.5; }
.homologation-panel .homologation-table td { max-width: none; white-space: normal; padding: 16px; }
.homologation-table td:first-child { font-family: inherit; font-size: 12px; color: var(--ink); }
.homologation-table td p { margin: 8px 0; line-height: 1.55; overflow-wrap: anywhere; }
.homologation-table td small,.homologation-selected { color: var(--muted); font-size: 11px; }
.homologation-table select { display: block; box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); font: inherit; }
.homologation-table .mapping-status { font-size: 10px; letter-spacing: 0; }
@media(max-width:700px){
  .homologation-table thead { display: none; }
  .homologation-table table,.homologation-table tbody,.homologation-table tr,.homologation-table td { display: block; width: 100%; box-sizing: border-box; }
  .homologation-table tr+tr { border-top: 2px solid var(--line); }
  .homologation-table td { border-top: 0; }
  .homologation-table td+td { padding-top: 0; }
  .homologation-table td::before { content: attr(data-label); display: block; margin-bottom: 9px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
}
.purchase-workflow-panel { margin: 18px 0 24px; padding: 24px; border: 1px solid #bdd9cb; border-radius: 15px; background: linear-gradient(145deg,#f8fcfa,#eef8f3); box-shadow: 0 14px 34px rgba(35,86,63,.08); }
.purchase-workflow-heading span { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.purchase-workflow-heading h3 { margin: 5px 0; font-size: 20px; }
.purchase-workflow-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.workflow-notice { margin: 18px 0 0; padding: 14px 16px; border-radius: 9px; background: #fff8e8; color: #755817; font-size: 11px; font-weight: 700; }
.workflow-notice .button { margin-left: 10px; }
.workflow-controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 10px; margin-top: 20px; }
.workflow-controls select,.workflow-controls input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #c8d9d0; border-radius: 8px; background: white; color: var(--ink); }
.workflow-field>span { display: block; margin-bottom: 6px; color: #4b5e54; font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.workflow-controls .workflow-check { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 11px; border: 1px solid #c8d9d0; border-radius: 8px; background: white; color: var(--ink); font-size: 10px; font-weight: 800; }
.workflow-controls .workflow-check input { width: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--green); }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.workflow-actions .button { min-height: 42px; }
.workflow-actions button:disabled { cursor: not-allowed; opacity: .48; }
.confirm-entry { border: 0; background: #173f30; color: white; }
.workflow-readiness { margin: 12px 0 0; color: #2c604a; font-size: 10px; font-weight: 750; }
.workflow-readiness.pending { color: #a05231; }
.workflow-status { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #c8ddd2; }
.workflow-status span { padding: 11px; border-radius: 8px; background: white; color: var(--muted); font-size: 9px; }
.workflow-status strong { display: block; margin-top: 3px; color: var(--ink); font-size: 11px; }
.workflow-movements { margin-top: 18px; overflow-x: auto; }
.workflow-movements h4 { margin: 0 0 10px; font-size: 13px; }
.workflow-movements table { min-width: 880px; background: white; }
.mapping-status.pending { color: #935131; background: var(--orange-soft); }

.saved-purchases-heading { margin-bottom: 24px; }
.saved-purchases-workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.saved-purchases-toolbar { display: grid; grid-template-columns: minmax(280px,1fr) 210px auto; gap: 12px; align-items: end; padding: 20px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.saved-purchases-toolbar label>span { display: block; margin-bottom: 6px; color: #4b5e54; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.saved-purchases-toolbar input,.saved-purchases-toolbar select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.accounts-payable-toolbar { grid-template-columns: repeat(4,minmax(0,1fr)); background:#fff; }
#accountsPayableModule .module-heading h1 { font-size:38px; letter-spacing:-1.2px; }
#accountsPayableModule .module-heading { align-items:center; }
.payable-kpis article { min-width:0; padding:24px; border-radius:16px; box-shadow:none; }
.payable-kpis article span { margin:0 0 14px; letter-spacing:.07em; }
.payable-kpis article strong { font-size:clamp(18px,1.7vw,30px); overflow-wrap:anywhere; }
.payable-kpis article small { display:block; margin-top:12px; font-size:11px; color:#6a7a73; }
.payable-kpis article.primary { background:#193f3b; border-color:#193f3b; }
.payable-kpis article.primary strong { color:#fff; }
.payable-kpis article.primary span,.payable-kpis article.primary small { color:#b8d9d0; }
.payable-kpis article.alert { background:#fff7f2; border-color:#f0dfd3; }
.payable-kpis article.alert strong { color:#a65136; }
.accounts-payable-workspace { box-shadow:none; overflow:hidden; }
.payable-dashboard { padding:24px; background:#f4f7f5; }
.payable-aging,.payable-insights>section { padding:24px; background:#fff; border:1px solid #dde7e1; border-radius:14px; min-width:0; }
.payable-aging header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.payable-overline { font-size:9px; letter-spacing:.12em; font-weight:800; color:#698078; }
.payable-dashboard h2,.payable-table-heading h2 { margin:8px 0; font-size:19px; color:#233e37; }
.payable-dashboard p,.payable-table-heading p { margin:0; font-size:12px; color:#6a7b74; line-height:1.5; }
.payable-stacked { height:12px; display:flex; border-radius:20px; overflow:hidden; background:#edf2ef; margin:26px 0 20px; }
.payable-bands { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.payable-bands button { border:1px solid #e3e9e5; border-top:3px solid var(--band-color); padding:18px 12px; background:#fff; border-radius:8px; text-align:left; color:#344b43; transition:background .15s,transform .15s; min-width:0; }
.payable-bands button:hover,.payable-bands button.selected { background:#f0f6f3; outline:2px solid var(--band-color); outline-offset:1px; transform:translateY(-2px); }
.payable-bands span,.payable-bands strong,.payable-bands small,.payable-bands em { display:block; }
.payable-bands span { font-size:12px; font-weight:800; }
.payable-bands strong { font-size:17px; margin:14px 0 8px; overflow-wrap:anywhere; }
.payable-bands small { font-size:10px; color:#6c7d75; }
.payable-bands em { font-style:normal; font-size:9px; color:var(--band-color); margin-top:14px; }
.payable-insights { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:20px; }
.payable-rank { display:grid; grid-template-columns:1fr auto; gap:8px; width:100%; border:0; background:transparent; text-align:left; padding:18px 0; border-bottom:1px solid #edf1ee; color:#30483e; }
.payable-rank span { font-size:12px; overflow-wrap:anywhere; }
.payable-rank strong { font-size:12px; }
.payable-rank i { height:5px; background:linear-gradient(to right,#4f9380 var(--rank-width),#eef3f0 var(--rank-width)); grid-column:1/-1; border-radius:4px; }
.payable-rank small { grid-column:1/-1; font-size:10px; color:#78867f; }
.payable-priority { display:grid; grid-template-columns:48px 1fr auto; gap:12px; align-items:center; width:100%; padding:18px 0; background:transparent; text-align:left; border:0; border-bottom:1px solid #edf1ee; }
.payable-days { padding:10px 4px; border-radius:9px; background:#fff0e8; color:#a6543a; text-align:center; font-weight:800; }
.payable-priority strong { display:block; font-size:12px; color:#30483e; }
.payable-priority small { display:block; font-size:10px; margin-top:4px; color:#718077; overflow-wrap:anywhere; }
.payable-priority b { font-size:12px; color:#30483e; }
.payable-table-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:20px 24px; border-top:1px solid #dde7e1; }
.payable-empty { padding:35px 12px; text-align:center; color:#638075; font-size:17px; }
.payable-empty small { display:block; margin-top:8px; font-size:12px; }
@media(max-width:1200px){.payable-bands{grid-template-columns:repeat(3,minmax(0,1fr));}.payable-insights{grid-template-columns:1fr;}}
@media(max-width:700px){.payable-bands{grid-template-columns:1fr 1fr;}.payable-dashboard{padding:12px;}.payable-aging,.payable-insights>section{padding:16px;}.payable-table-heading{flex-direction:column;align-items:flex-start;}.payable-priority{grid-template-columns:40px 1fr;}.payable-priority b{grid-column:2;}}
.saved-purchases-table { min-height: 300px; max-height: 610px; overflow: auto; }
.saved-purchases-table table { min-width: 1100px; }
.accounts-payable-workspace td strong,.accounts-payable-workspace td small { display: block; }
.accounts-payable-workspace td small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.accounts-payable-balance { color: var(--green-dark); font-weight: 900; }
.saved-document-identity strong,.saved-document-identity small { display: block; }
.saved-document-identity small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.saved-purchase-badge { display: inline-block; padding: 6px 8px; border-radius: 999px; color: #755817; background: #fff2cb; font-size: 8px; font-weight: 900; white-space: nowrap; }
.saved-purchase-badge.state-contabilizada { color: #205d41; background: #dff2e8; }
.saved-purchase-badge.state-anulada { color: #874237; background: #f7dfda; }
.saved-purchase-badge.state-borrador { color: #4d5e56; background: #e9efec; }
.saved-purchase-badge.state-pendiente { color: #6f5426; background: #fff2cb; }
.saved-purchase-badge.state-vencida { color: #8a4033; background: #f9ded8; }
.saved-purchase-badge.state-pagada { color: #205d41; background: #dff2e8; }
.saved-purchase-detail { margin-top: 20px; padding: 24px; border: 1px solid #bdd9cb; border-radius: 15px; background: #f8fcfa; box-shadow: 0 14px 34px rgba(35,86,63,.08); }
.saved-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.saved-detail-heading span { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.saved-detail-heading h2 { margin: 6px 0; font-size: 24px; }
.saved-detail-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.saved-detail-lines,.saved-detail-serials { margin-top: 18px; }
.saved-detail-lines table { min-width: 1180px; }
.saved-detail-serials table { min-width: 1250px; }
.saved-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.saved-detail-result { margin: 18px 0 0; padding: 15px 16px; border-radius: 9px; color: #205d41; background: #dff2e8; font-size: 10px; font-weight: 800; }
.button.danger { border-color: #d9a69b; color: #8a4033; background: #fff7f5; }

.inventory-heading { margin-bottom: 24px; }
.inventory-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.inventory-stats article { padding: 19px 20px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 24px rgba(27,62,48,.05); }
.inventory-stats strong,.inventory-stats span { display: block; }
.inventory-stats strong { color: var(--green-dark); font-size: 21px; letter-spacing: -.025em; }
.inventory-stats span { margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.inventory-workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.inventory-tabs { display: flex; gap: 3px; overflow-x: auto; padding: 11px 14px 0; border-bottom: 1px solid var(--line); background: #f8faf9; }
.inventory-tab { min-height: 43px; padding: 0 15px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-size: 10px; font-weight: 850; white-space: nowrap; }
.inventory-tab:hover,.inventory-tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.inventory-toolbar { display: grid; grid-template-columns: minmax(260px,1.8fr) minmax(180px,1fr) 150px 150px auto; gap: 11px; align-items: end; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.inventory-toolbar label>span,.inventory-operation-form label>span { display: block; margin-bottom: 6px; color: #4b5e54; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.inventory-toolbar input,.inventory-toolbar select,.inventory-operation-form input,.inventory-operation-form select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.inventory-table { min-height: 320px; max-height: 610px; overflow: auto; }
.inventory-table table { min-width: 1180px; }
.inventory-table th { position: sticky; top: 0; z-index: 1; }
.inventory-table td { vertical-align: middle; }
.inventory-table td:nth-child(n+7) { white-space: nowrap; }
.inventory-table td:last-child { text-align: right; }
.inventory-table td:last-child .button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; }
.warehouse-receipts-table th:last-child,.warehouse-receipts-table td:last-child { width: 120px; padding-left: 8px; text-align: center; }
.warehouse-receipts-table th:nth-last-child(2),.warehouse-receipts-table td:nth-last-child(2) { width: 150px; padding-right: 8px; }
.warehouse-history-table th:last-child,.warehouse-history-table td:last-child { width: 130px; padding-left: 8px; text-align: center; }
.warehouse-issue-groups { display: grid; gap: 18px; }
.warehouse-issue-card { overflow: hidden; border: 1px solid #cbded4; border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(32,75,56,.06); }
.warehouse-issue-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 21px; border-bottom: 1px solid #dce8e2; background: #f6faf8; }
.warehouse-issue-card-head span { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .11em; }
.warehouse-issue-card-head h3 { margin: 5px 0 3px; font-size: 20px; }
.warehouse-issue-card-head p { margin: 0; color: var(--muted); font-size: 9px; }
.warehouse-issue-card-head>strong { padding: 7px 10px; border-radius: 999px; color: #8a4a2e; background: #ffeadf; font-size: 9px; white-space: nowrap; }
.warehouse-issue-list { display: grid; }
.warehouse-issue-row { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); gap: 24px; padding: 22px; }
.warehouse-issue-row+.warehouse-issue-row { border-top: 1px solid var(--line); }
.warehouse-issue-detail h4 { margin: 9px 0 6px; font-size: 15px; }
.warehouse-issue-detail p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.warehouse-issue-detail blockquote { margin: 14px 0 10px; padding: 12px 14px; border-left: 3px solid #d0835f; border-radius: 0 8px 8px 0; color: #6c412e; background: #fff7f2; font-size: 10px; font-style: normal; line-height: 1.55; }
.warehouse-issue-detail small { color: #6d7e76; font-size: 8px; }
.warehouse-issue-badge { display: inline-block; padding: 6px 9px; border-radius: 999px; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.warehouse-issue-badge.received { color: #85501b; background: #fff0cb; }
.warehouse-issue-badge.missing { color: #8a4035; background: #f9ded8; }
.warehouse-issue-form { display: grid; gap: 10px; padding: 15px; border: 1px solid #d7e5de; border-radius: 11px; background: #f8fbfa; }
.warehouse-issue-form label>span { display: block; margin-bottom: 5px; color: #4b5e54; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.warehouse-issue-form select,.warehouse-issue-form textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font: inherit; font-size: 10px; resize: vertical; }
.warehouse-issue-form select { min-height: 39px; }
.warehouse-issue-form .button { justify-self: start; }
.inventory-notice { margin: 15px 20px 0; padding: 12px 14px; border: 1px solid #ead8ac; border-radius: 8px; color: #745918; background: #fff9e9; font-size: 10px; }
.inventory-operation-panel { padding: 25px; }
.operation-heading { margin-bottom: 20px; }
.operation-heading span { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.operation-heading h2 { margin: 6px 0; font-size: 23px; }
.operation-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.inventory-operation-form { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; padding: 20px; border: 1px solid #d5e3dc; border-radius: 12px; background: #f7fbf9; }
.inventory-operation-form .wide { grid-column: 1/-1; }
.operation-result { padding: 13px 15px; border-radius: 8px; color: #225c42; background: #e7f4ed; font-size: 10px; font-weight: 750; }
.operation-result .button { margin-left: 10px; }

.controls-heading { margin-bottom: 24px; }
.control-stats article:last-child strong { font-size: 15px; }
.advanced-workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.advanced-tabs { display: flex; gap: 3px; overflow-x: auto; padding: 11px 14px 0; border-bottom: 1px solid var(--line); background: #f7faf8; }
.advanced-tab { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-size: 9px; font-weight: 850; white-space: nowrap; }
.advanced-tab:hover,.advanced-tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.advanced-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.advanced-toolbar span { color: #b4623f; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.advanced-toolbar h2 { margin: 6px 0 4px; font-size: 21px; }
.advanced-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.advanced-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; min-height: 520px; }
.advanced-primary { min-width: 0; padding-bottom: 24px; border-right: 1px solid var(--line); }
.advanced-table { max-height: 380px; overflow: auto; }
.advanced-table table { min-width: 980px; }
.advanced-table th { position: sticky; top: 0; z-index: 1; }
.advanced-action { display: grid; gap: 16px; padding: 20px 22px 0; }
.control-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; padding: 20px; border: 1px solid #d6e3dc; border-radius: 12px; background: #f7fbf9; }
.control-form h3,.control-form .form-help,.control-form .wide { grid-column: 1/-1; }
.control-form h3 { margin: 0; font-size: 18px; }
.control-form .form-help { margin: -7px 0 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.control-form label>span { display: block; margin-bottom: 6px; color: #4a5d53; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.control-form input,.control-form select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.control-form .button { min-height: 40px; align-self: end; }
.form-divider { display: flex; align-items: baseline; gap: 10px; margin-top: 7px; padding: 14px 0 2px; border-top: 1px solid #ceded6; }
.form-divider strong { font-size: 12px; }
.form-divider small { color: var(--muted); font-size: 9px; }
.control-result { padding: 12px 14px; border-radius: 8px; color: #225c42; background: #e4f4eb; font-size: 10px; font-weight: 750; }
.control-result.error { color: #8c442b; background: #fff0e9; }
.control-result .button { margin-left: 10px; }
.count-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.count-lines { overflow: auto; }
.count-lines table { min-width: 780px; }
.control-subtable { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.control-subtable table { min-width: 720px; }
.control-audit { padding: 20px 17px; background: #fafcfb; }
.control-audit>div:first-child { padding: 0 4px 14px; border-bottom: 1px solid var(--line); }
.control-audit>div:first-child span,.control-audit>div:first-child strong { display: block; }
.control-audit>div:first-child span { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .11em; }
.control-audit>div:first-child strong { margin-top: 5px; font-size: 13px; }
#advancedAudit { display: grid; }
#advancedAudit article { position: relative; padding: 15px 5px 15px 17px; border-bottom: 1px solid var(--line); }
#advancedAudit article::before { position: absolute; top: 19px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--green); content: ''; }
#advancedAudit time,#advancedAudit strong,#advancedAudit small { display: block; }
#advancedAudit time { color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
#advancedAudit strong { margin: 5px 0; font-size: 9px; line-height: 1.4; }
#advancedAudit small { color: var(--muted); font-size: 8px; line-height: 1.4; }

@media (max-width: 1050px) {
  .login-view { grid-template-columns: 1fr 1fr; }
  .login-brand-panel { padding: 38px; }
  .login-promise h1 { font-size: 48px; }
  .module-main { width: min(100% - 32px, 1400px); }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .flow-step:nth-child(2) { border-right: 0; }
  .flow-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .choice-grid, .effect-grid { grid-template-columns: 1fr; }
  .master-stats { grid-template-columns: repeat(3,1fr); }
  .inventory-stats { grid-template-columns: repeat(2,1fr); }
  .inventory-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .saved-purchases-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-operation-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .warehouse-issue-row { grid-template-columns: 1fr; }
  .advanced-layout { grid-template-columns: 1fr; }
  .advanced-primary { border-right: 0; }
  .control-audit { border-top: 1px solid var(--line); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-line-field,.manual-line-field.medium,.manual-line-field.wide { grid-column: span 4; }
  .manual-line-total { grid-column: span 4; }
}

.master-notice { margin: 14px 18px 0; padding: 11px 13px; border: 1px solid #bfdfcf; border-radius: 9px; color: #245f49; background: #eef8f3; font-size: 12px; }
.master-notice.error { border-color: #efc5bb; color: #8b3e34; background: #fff0ec; }
.master-row-actions { display: flex; gap: 7px; min-width: 150px; }
.master-row-action { padding: 7px 10px; border: 1px solid #cfe0d7; border-radius: 7px; color: var(--green); background: #f5faf7; font-size: 10px; font-weight: 800; }
.master-row-action:hover { border-color: var(--green); background: var(--green-soft); }
.master-row-action.danger { border-color: #efc8bf; color: #9b4338; background: #fff5f2; }
.master-row-action.danger:hover { border-color: #b95143; background: #fce8e3; }
.receiving-check-form { overflow: auto; }
.receiving-check-form table { min-width: 980px; }
.receiving-check-form td strong,.receiving-check-form td small { display: block; }
.receiving-check-form td small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.receiving-check-form select,.receiving-check-form input { width: 100%; min-width: 180px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.receiving-check-form input { min-width: 230px; }

@media (max-width: 700px) {
  .sidebar { position: static; width: auto; min-height: auto; padding-bottom: 12px; box-shadow: none; }
  .erp-content { margin-left: 0; }
  .erp-brand { padding-bottom: 14px; }
  .company-switcher, .sidebar-user, .nav-label, .nav-subitem.muted, .nav-item-disabled, .nav-group-future { display: none; }
  .erp-nav { display: flex; flex-wrap: wrap; gap: 5px; overflow: visible; }
  .nav-group { flex: 0 0 auto; }
  .nav-group[open] { flex-basis: 100%; }
  .nav-group[open] > .nav-children { display: flex; flex-wrap: wrap; max-height: 150px; margin: 3px 0 2px; padding: 3px; border-radius: 9px; background: #edf5f1; }
  .nav-children::before { display: none; }
  .nav-subitem { width: auto; margin-left: 0; padding: 9px 13px; border-radius: 8px; background: white; }
  .nav-subitem::before { display: none; }
  .login-view { display: block; background: #f5f7f4; }
  .login-brand-panel { min-height: 255px; padding: 28px 24px; }
  .login-promise { margin: 42px 0 12px; }
  .login-promise h1 { font-size: 34px; }
  .login-promise > p:last-child, .login-capabilities { display: none; }
  .login-form-panel { min-height: auto; padding: 22px 14px 40px; }
  .login-card { margin-top: -1px; padding: 27px 22px; border-radius: 16px; }
  .dialog-heading, .company-options { padding-right: 18px; padding-left: 18px; }
  .super-admin-company { margin-right: 18px; margin-left: 18px; }
  .company-create-form { grid-template-columns: 1fr; }
  .company-create-form .wide { grid-column: auto; }
  .dialog-footnote { padding-right: 18px; padding-left: 18px; }
  .master-stats { grid-template-columns: repeat(2,1fr); }
  .inventory-stats,.inventory-toolbar,.inventory-operation-form,.saved-purchases-toolbar { grid-template-columns: 1fr; }
  .inventory-operation-form .wide { grid-column: auto; }
  .advanced-toolbar { align-items: stretch; flex-direction: column; }
  .control-form { grid-template-columns: 1fr; }
  .control-form h3,.control-form .form-help,.control-form .wide { grid-column: auto; }
  .form-divider { align-items: flex-start; flex-direction: column; }
  .master-toolbar, .homologation-heading { align-items: stretch; flex-direction: column; }
  .security-toolbar { align-items: stretch; flex-direction: column; }
  .security-form-grid,.security-check-grid,.permission-group-grid { grid-template-columns: 1fr; }
  .workflow-controls, .workflow-status { grid-template-columns: 1fr; }
  .master-form-fields { grid-template-columns: 1fr; }
  .manual-line-grid { grid-template-columns: 1fr; }
  .manual-line-field,.manual-line-field.medium,.manual-line-field.wide,.manual-line-field.full,.manual-line-total { grid-column: 1; }
  .master-form-fields label.wide { grid-column: auto; }
  #masterRecordForm { padding-right: 18px; padding-left: 18px; }
  .erp-topbar { height: 60px; padding: 0 16px; }
  .breadcrumb span, .breadcrumb b, .local-badge, .topbar-date { display: none; }
  .module-main { width: min(100% - 22px, 1400px); padding-top: 26px; }
  .module-heading { align-items: stretch; flex-direction: column; gap: 20px; }
  h1 { font-size: 38px; }
  .module-state { min-width: 0; }
  .workflow { grid-template-columns: 1fr; }
  .flow-step { min-height: 62px; border-right: 0; border-bottom: 1px solid var(--line); }
  .flow-step:last-child { border-bottom: 0; }
  .workspace-heading { align-items: flex-start; }
  .format-pill { display: none; }
  .workspace-body { padding: 14px; }
  .drop-zone { flex-direction: column; text-align: center; }
  .editor-actions, .results-heading { align-items: stretch; flex-direction: column; }
  .editor-actions > div, .export-actions { display: flex; }
  .editor-actions .button, .export-actions .button { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .invoice-meta, .amount-grid { grid-template-columns: 1fr 1fr; }
  .invoice-support-grid { grid-template-columns: 1fr; }
  .tabs { gap: 15px; overflow-x: auto; }
  .tab { white-space: nowrap; }
  .choice-grid, .form-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 82px; }
  .form-section, .manual-form-actions { padding: 18px 14px; }
  .form-section-heading, .manual-form-actions, .manual-result-heading, .operational-heading { align-items: stretch; flex-direction: column; }
  .manual-submit-actions { justify-content: stretch; }
  .manual-submit-actions .button { flex: 1 1 100%; }
  .draft-meta { grid-template-columns: 1fr 1fr; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}
/* Recepción por renglón y traslado completo de facturas. */
.payment-report-entry{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px;margin:20px;border:1px solid #c9ded4;border-radius:12px;background:#f1f7f4}
.payment-report-entry h2{margin:0;font-size:20px}.payment-report-entry p{margin:8px 0 0;color:#526b61;line-height:1.5;max-width:700px}.payment-report-entry .button{flex-shrink:0}
.payment-report-dialog{width:min(1100px,94vw);max-height:90vh;overflow:auto;padding:26px;border:1px solid #c9ded4;border-radius:16px;background:white;color:#173f37}
.payment-report-dialog::backdrop{background:#152e3480}
.payment-report-dialog header,.payment-report-actions,.payment-report-dialog footer{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.payment-report-dialog h2{margin:0;font-size:24px}.payment-report-dialog p{line-height:1.5}.payment-report-dialog label{display:grid;gap:8px}
.payment-report-dialog input:not([type=checkbox]){padding:12px;border:1px solid #c9ded4;border-radius:8px;font:inherit;width:min(100%,400px)}
.payment-report-dialog input[type=checkbox]{width:20px;height:20px;accent-color:#17694f}
.payment-report-actions{margin:18px 0}.payment-report-selection{max-height:40vh;overflow:auto}.payment-report-selection table{width:100%;border-collapse:collapse}
.payment-report-selection th,.payment-report-selection td{padding:12px;border-bottom:1px solid #e0eae5;text-align:left}.payment-report-selection th{background:#edf4f0;position:sticky;top:0}.payment-report-disclosure{font-size:13px;color:#586d64;background:#f5f6f3;padding:12px;border-radius:8px}
.payment-report-dialog footer{justify-content:flex-end}.payment-report-dialog [data-report-status]{font-weight:600}
@media(max-width:650px){.payment-report-entry{flex-direction:column;align-items:stretch;margin:12px;padding:16px}.payment-report-dialog{padding:16px}.payment-report-dialog h2{font-size:21px}.payment-report-selection table{min-width:680px}}
.origin-dialog{width:min(1050px,94vw);max-height:90vh;overflow:auto;padding:28px;border:1px solid #ceded7;border-radius:20px;color:#193f3b;background:#fff;box-shadow:0 24px 100px #163d3940}
.origin-dialog::backdrop{background:#152e3480}
.origin-dialog h2{margin:0 0 12px;font-size:26px}
.origin-dialog p{line-height:1.6;color:#61756e}
.origin-dialog select,.origin-dialog input{max-width:100%;min-height:44px;padding:8px;border:1px solid #cbd9d3;border-radius:8px;background:white;color:#193f3b}
.origin-dialog .origin-scroll{overflow:auto;max-height:46vh;margin:20px 0}
.origin-dialog table{width:100%;border-collapse:collapse}
.origin-dialog td,.origin-dialog th{padding:12px;text-align:left;border-bottom:1px solid #e1ebe6}
.origin-dialog th{background:#eaf2ef;position:sticky;top:0}
.origin-dialog td select{min-width:180px}
@media(max-width:650px){.origin-dialog{padding:18px}.origin-dialog .workflow-controls{display:grid;grid-template-columns:1fr}.origin-dialog h2{font-size:21px}}
