:root {
  color-scheme: dark;
  --bg: #0b0c0e; --panel: #131416; --panel-solid: #131416; --panel-soft: #1b1c1f;
  --fg: #f2f2f2; --text: #f2f2f2; --muted: #a0a1a8; --border: #ffffff18;
  --accent: #60a5fa; --danger: #f87171; --ok: #4ade80; --warning: #facc15;
  --font-main: Inter, 'Segoe UI', Arial, sans-serif; --radius: 6px;
  font-family: var(--font-main); font-size: 14px; line-height: 1.5; letter-spacing: 0;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--bg); color: var(--fg); }
button,input,select,textarea { font: inherit; color: inherit; }
button,a,input,select { touch-action: manipulation; }
button,a { -webkit-tap-highlight-color: #60a5fa25; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { cursor: pointer; }
button:disabled,.disabled { opacity: .45; cursor: default; pointer-events: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
input:focus-visible,select:focus-visible,textarea:focus-visible { outline-offset: 1px; }
.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; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 20px; padding: 12px; background: var(--fg); color: var(--bg); }
.skip-link:focus { top: 12px; }
h1,h2,h3,p { margin-top: 0; }
h1 { font-size: 26px; font-weight: 400; line-height: 1.3; margin-bottom: 0; overflow-wrap: anywhere; }
h2 { font-size: 18px; font-weight: 500; line-height: 1.4; }
h3 { font-size: 14px; font-weight: 500; }
small,.small { font-size: 12px; color: var(--muted); }
strong,b { font-weight: 600; }
.muted { color: var(--muted); }
.error-text { color: var(--danger); }
.numeric,.text-right { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.wrap-cell { min-width: 150px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; }
.wrap-cell strong { display: block; }
.lucide { width: 18px; height: 18px; stroke-width: 1.65; flex: 0 0 auto; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; padding: 28px 16px 16px; border-right: .5px solid var(--border); background: #101113; display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 12px 42px; font-size: 22px; font-weight: 500; }
.brand small { display: block; font-size: 11px; font-weight: 400; margin-top: 1px; }
.brand-icon { width: 38px; height: 38px; display: grid; place-items: center; background: #202125; border: .5px solid #ffffff22; border-radius: 8px; }
.brand-icon .lucide { width: 23px; height: 23px; }
.sidebar-label { padding: 0 12px 10px; color: #777982; font-size: 11px; }
.sidenav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sidenav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 10px 12px; color: #b2b3ba; border-radius: 6px; font-size: 13px; }
.sidenav a:hover { background: #ffffff06; color: #fff; }
.sidenav a.active { background: #ffffff0a; color: #fff; box-shadow: inset 2px 0 var(--accent); }
.sidenav a.active .lucide { color: var(--accent); }
.sidenav .sidebar-label { margin-top: 24px; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.userbox { display: flex; gap: 10px; padding: 16px 8px; border-top: .5px solid var(--border); }
.userbox>div { min-width: 0; }
.userbox strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.userbox small { font-size: 11px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: #292b30; font-size: 12px; }
.workspace { margin-left: 238px; min-width: 0; }
.topbar { height: 64px; border-bottom: .5px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; color: var(--muted); font-size: 12px; }
.page-content { padding: 30px 32px 48px; max-width: 1920px; margin: auto; min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.back-link .lucide { width: 14px; height: 14px; }
.btn,.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; border: .5px solid #ffffff20; border-radius: 6px; background: #ffffff05; padding: 8px 14px; font-size: 13px; font-weight: 400; color: #e0e1e4; white-space: normal; text-align: center; }
.btn:hover,.icon-btn:hover { background: #ffffff0c; color: #fff; }
.btn.primary { background: #f2f2f2; color: #252628; border-color: transparent; }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger,.icon-btn.danger { color: var(--danger); }
.icon-btn { width: 34px; height: 34px; min-height: 34px; padding: 7px; border-color: transparent; flex: 0 0 34px; }
.btn.sm { min-height: 32px; font-size: 12px; padding: 5px 10px; }
.block { width: 100%; }
.row-actions,.actions-bar,.dialog-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions { flex-wrap: nowrap; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #b4b5bc; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=hidden])),select,textarea { width: 100%; min-width: 0; min-height: 38px; padding: 9px 11px; background: #191a1d; border: .5px solid #ffffff20; border-radius: 6px; color: var(--fg); font-size: 13px; }
input::placeholder,textarea::placeholder { color: #777982; }
input:disabled,select:disabled,textarea:disabled { opacity: .75; cursor: default; }
input[type=checkbox],input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
select { max-width: 100%; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-grid,.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.form-grid>label { min-width: 0; }
.form-grid .full,.form-grid .actions-bar { grid-column: 1 / -1; }
.stack-form { display: grid; gap: 18px; min-width: 0; width: min(400px,100%); }
.employee-filters { justify-content: flex-start; align-items: end; }.employee-filters>label { min-width: 0; flex: 1 1 170px; }
.stock-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 4px 0 20px; }
.stock-filters>.field { flex: 1 1 220px; max-width: 350px; min-width: 0; }
.stock-filters .check-label { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 38px; }
.stock-actions { flex-basis: 100%; flex-wrap: wrap; gap: 8px; }
.inline-checkbox { flex-direction: row; align-items: center; min-height: 38px; }.employee-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
.section-toolbar,.toolbar,.toolbar-flex__form { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 0; }
.search-form { display: flex; gap: 8px; align-items: center; min-width: 0; }
.search-field { display: flex; flex-direction: row; align-items: center; gap: 9px; background: #151619; border: .5px solid #ffffff20; border-radius: 6px; padding: 0 11px; min-width: 0; }
.search-field input[type=search] { background: transparent; border: 0; min-width: 0; padding-left: 0; width: 290px; outline-offset: 0; }
.search-field .lucide { color: #85878f; width: 16px; }
.view-tabs { display: flex; gap: 24px; border-bottom: .5px solid var(--border); overflow-x: auto; }
.view-tabs a { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 12px 0; font-size: 13px; border-bottom: 2px solid transparent; color: var(--muted); }
.view-tabs a.active { color: #fff; border-bottom-color: #e1e2e5; }
.tab-count { font-size: 10px; padding: 1px 5px; background: #ffffff09; border-radius: 4px; color: #9698a1; }
.table-scroll,.table-wrap,.table-container,.table-responsive { position: relative; width: 100%; overflow: auto; border-top: .5px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: #ffffff03; padding: 12px 14px; color: #92949d; text-align: left; font-size: 11px; font-weight: 500; white-space: nowrap; }
.table td { padding: 15px 14px; border-top: .5px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: #ffffff02; }
.table td small { display: block; margin-top: 4px; font-size: 10px; }
.table th.numeric,.table td.numeric,.table .text-right { text-align: right; }
.document-link { color: #f2f2f2; font-weight: 500; white-space: nowrap; }
.status-badge,.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; border: .5px solid #ffffff22; padding: 3px 7px; border-radius: 4px; color: #c6c7ce; white-space: nowrap; }
.status-badge:before { content: ''; width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.status-badge.posted,.badge.success { color: #77dca0; background: #4ade8007; border-color: #4ade8028; }
.status-badge.draft { color: #a2bdde; background: #60a5fa05; border-color: #60a5fa24; }
.status-badge.cancelled { color: #aaaab2; }
.pagination,.pager { display: flex; justify-content: space-between; align-items: center; gap: 14px; border-top: .5px solid var(--border); padding: 18px 0; font-size: 12px; }
.empty-state { padding: 54px 16px; display: grid; justify-items: center; text-align: center; gap: 10px; color: var(--muted); }
.empty-state .lucide { width: 28px; height: 28px; }
.empty-state h2 { font-size: 14px; margin: 0; font-weight: 400; }
.alert { padding: 12px 16px; border: .5px solid var(--border); border-radius: 6px; margin: 16px 0; font-size: 13px; overflow-wrap: anywhere; }
.alert p { margin: 0; }
.alert.error { color: #fba3a3; background: #f8717109; border-color: #f8717133; }
.alert.success { color: #90e2b0; background: #4ade8007; border-color: #4ade8033; }
.operation-status { display: flex; align-items: center; gap: 16px; margin: 12px 0; padding: 14px; background: #131619; border: .5px solid var(--border); font-size: 12px; }
progress { width: 140px; height: 5px; accent-color: var(--accent); flex: 0 0 140px; }
.document-meta { display: grid; grid-template-columns: 160px 180px minmax(220px,1fr); gap: 20px; max-width: 950px; padding: 4px 0 30px; }
.editor-lines { border-top: .5px solid var(--border); padding-top: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.material-search { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 12px; position: relative; margin-bottom: 20px; max-width: 1000px; }
.material-search .search-field input { width: 100%; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 350px; overflow: auto; overscroll-behavior: contain; background: #1a1b1f; border: .5px solid #ffffff30; border-radius: 6px; box-shadow: 0 14px 35px #0008; z-index: 20; }
.material-option { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 15px; border-bottom: .5px solid var(--border); cursor: pointer; }
.material-option strong { font-size: 13px; font-weight: 400; }
.material-option small { display: block; font-size: 11px; margin-top: 5px; }
.material-option[aria-selected=true],.material-option:hover { background: #ffffff09; }
.material-option>div { min-width: 0; overflow-wrap: anywhere; }
.material-option>.numeric { flex: 0 0 auto; font-size: 12px; color: #b4cadf; }
.search-state { padding: 20px; color: var(--muted); }
.line-table { min-width: 890px; }
.line-table td { padding: 12px 10px; }
.line-table .material-cell { min-width: 230px; max-width: 340px; overflow-wrap: anywhere; }
.line-table .material-cell strong { font-size: 12px; font-weight: 400; }
.line-table select { width: 170px; }
.line-table input[type=number] { width: 94px; text-align: right; }
.document-totals { display: flex; justify-content: flex-end; align-items: baseline; gap: 35px; padding: 24px 20px; border-top: .5px solid var(--border); color: var(--muted); }
.document-totals strong { font-size: 24px; font-weight: 400; color: #fff; font-variant-numeric: tabular-nums; }
.document-totals { flex-wrap: wrap; gap: 16px 28px; }
.recipient-field>.btn { margin-top: 8px; }
#employeeForm { display: grid; gap: 18px; width: 400px; max-width: 100%; }
#employeeDialog { width: 450px; }
#paperPreview>summary { cursor: pointer; padding: 16px 0; font-size: 14px; }
.signatures { border-top: .5px solid var(--border); padding: 24px 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 30px; }
.signatures legend { padding-right: 16px; font-size: 13px; color: var(--muted); }
.signatures label { margin: 14px 0; }
.editor-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 0; border-top: .5px solid var(--border); }
dialog { max-width: min(680px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); background: #18191d; color: var(--fg); border: .5px solid #ffffff28; border-radius: 8px; padding: 24px; overscroll-behavior: contain; }
dialog::backdrop { background: #000a; }
.confirm-dialog { width: 430px; }
.dialog-heading { display: flex; gap: 16px; justify-content: space-between; align-items: center; }
.dialog-heading h2 { font-size: 18px; margin: 0; }
.confirm-dialog p { color: var(--muted); margin: 18px 0 28px; }
.dialog-actions { justify-content: flex-end; }
.mobile-menu,.sidebar-backdrop { display: none; }
.auth-screen { min-height: 100dvh; display: grid; place-items: center; }
.auth-content { width: min(380px,calc(100% - 40px)); padding: 40px 0; }
.auth-content h1 { margin-bottom: 28px; }
.auth-content .brand { margin: 0 0 38px; }
.auth-content form { display: grid; gap: 20px; }
.auth-content .btn { margin-top: 6px; }
.metric-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-block: .5px solid var(--border); margin: 28px 0 36px; }
.metric { padding: 22px 24px; border-right: .5px solid var(--border); }
.metric:first-child { padding-left: 0; }.metric:last-child { border-right: 0; }
.metric span { display: block; font-size: 12px; color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: 30px; font-weight: 400; font-variant-numeric: tabular-nums; }
.card { padding: 0; background: transparent; border: 0; border-radius: 0; }
.statsbar,.stats { display: flex; gap: 18px; flex-wrap: wrap; padding: 14px 0; color: var(--muted); font-size: 12px; }
.chip,.docs-chip { display: inline-flex; gap: 8px; font-size: 12px; color: var(--muted); }
.chip-v,.docs-chip b { color: var(--fg); }
.cards-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.sku-card,.item-card { background: #131416; border: .5px solid var(--border); border-radius: 6px; padding: 16px; min-width: 0; }
.material-cards.cards-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,340px),1fr)); align-items: stretch; gap: 20px; }
.material-cards .item-card { display: flex; flex-direction: column; padding: 0; border: 1px solid #393b40; background: #18191c; overflow-wrap: anywhere; }
.material-cards .item-card.is-active { border-color: #93c5fd; }
.material-card-heading { padding: 22px 22px 18px; }
.material-card-heading h2 { font-size: 18px; line-height: 1.5; font-weight: 600; color: #f7f8fa; margin: 0 0 12px; }
.material-card-code { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; line-height: 1.6; }
.material-card-code span,.material-card-facts dt,.material-card-description>span { color: #b8bbc3; }
.material-card-code strong { font-weight: 500; color: #e5e7eb; min-width: 0; }
.material-card-facts { margin: 0; padding: 0 22px; }
.material-card-facts>div { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: baseline; gap: 10px 20px; padding: 12px 0; border-top: 1px solid #34363b; }
.material-card-facts dt { font-size: 14px; line-height: 1.6; }
.material-card-facts dd { margin: 0; text-align: right; font-size: 16px; line-height: 1.5; font-weight: 500; font-variant-numeric: tabular-nums; color: #f7f8fa; }
.material-card-facts .material-card-stock { padding-block: 16px; }
.material-card-stock dd { font-size: 22px; font-weight: 600; }
.material-card-description { padding: 14px 22px 20px; font-size: 14px; line-height: 1.65; }
.material-card-description p { margin: 6px 0 0; color: #e0e2e7; }
.material-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding: 16px 22px; border-top: 1px solid #34363b; }
.material-card-actions .btn { min-height: 42px; font-size: 13px; padding-inline: 10px; white-space: normal; }
.material-card-actions form { margin: 0 0 0 auto; flex: 0 0 auto; }
.material-card-actions .material-card-delete { width: 42px; padding: 0; }
@media (max-width: 380px) {
  .material-card-heading { padding: 18px 16px 14px; }
  .material-card-facts { padding-inline: 16px; }
  .material-card-facts>div { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .material-card-facts dd { text-align: left; }
  .material-card-description,.material-card-actions { padding: 16px; }
  .material-card-actions .js-more { flex: 1 0 100%; }
}
.modal { width: 880px; max-width: calc(100vw - 32px); padding: 0; }
.modal__card { margin: 0; }.modal__head,.modal__foot { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: .5px solid var(--border); }
.modal__close { background: transparent; border: 0; color: var(--muted); font-size: 24px; }
.modal__body { padding: 24px; display: grid; gap: 16px; }.m-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.m-k { font-size: 11px; color: var(--muted); }.m-v { margin-top: 5px; }.m-box { overflow-wrap: anywhere; }
.users-head,.wh-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 24px; }
.users-toolbar,.wh-toolbar { display: flex; gap: 12px; padding: 16px 0; }.users-toolbar input,.wh-toolbar input { max-width: 360px; }.users-toolbar select,.wh-toolbar select { max-width: 180px; }
@media (min-width: 1650px) { .page-content { padding: 36px 48px 60px; }.topbar { padding-inline: 48px; } }
@media (max-width: 1120px) { .sidebar { width: 208px; padding-inline: 12px; }.workspace { margin-left: 208px; }.page-content { padding-inline: 22px; }.topbar { padding-inline: 22px; }.document-meta { grid-template-columns: 130px 160px minmax(180px,1fr); gap: 14px; }.cards-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.view-tabs { gap: 18px; } }
@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); width: 238px; transition: transform 160ms ease; }.workspace { margin-left: 0; }
  .mobile-menu { display: inline-flex; }.topbar { height: 56px; justify-content: flex-start; gap: 12px; }.topbar-date { margin-left: auto; font-size: 11px; }
  .menu-open .sidebar { transform: translateX(0); }.sidebar-backdrop { position: fixed; inset: 0; background: #0008; border: 0; z-index: 30; }.menu-open .sidebar-backdrop { display: block; }
  .page-content { padding: 24px 20px 40px; }h1 { font-size: 23px; }.page-heading { gap: 18px; margin-bottom: 24px; }
  .metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }.metric { padding: 20px; }.metric:nth-child(3) { padding-left: 0; }.metric:nth-child(2) { border-right: 0; }.metric:nth-child(n+3) { border-top: .5px solid var(--border); }
  .document-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }.recipient-field { grid-column: 1 / -1; }
  .signatures { grid-template-columns: 1fr; gap: 12px; }.signatures>div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.signatures h3 { grid-column: 1 / -1; margin-bottom: 0; }
  .material-search { grid-template-columns: minmax(0,1fr) 150px; }.form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .page-content { padding: 22px 14px 32px; }.topbar { padding-inline: 14px; }.topbar-label { display: none; }
  .page-heading>.row-actions { width: 100%; flex-wrap: wrap; }.page-heading>.btn { width: 100%; }
  .search-form { width: 100%; }.search-field { flex: 1; }.search-field input[type=search] { width: 100%; }
  .section-toolbar>#postAll { width: 100%; }.view-tabs { gap: 20px; }.view-tabs a { font-size: 12px; }
  .document-meta { gap: 14px; }.material-search { grid-template-columns: 1fr; }.material-search>select { max-width: none; }
  .material-option { align-items: flex-start; gap: 10px; }.material-option>.numeric { max-width: 85px; font-size: 11px; }
  .signatures>div { grid-template-columns: 1fr; gap: 0; }.signatures label { margin: 10px 0; }
  .cards-grid { grid-template-columns: 1fr; }.users-toolbar,.wh-toolbar { flex-wrap: wrap; }
  .operation-status { flex-wrap: wrap; gap: 10px; }.operation-status progress { width: 100%; flex-basis: 100%; }
  .m-grid { grid-template-columns: 1fr; }.modal__body { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .sidebar,.topbar,.page-heading .btn,.section-toolbar,.view-tabs,.pagination,.row-actions,.editor-footer,.material-search,.no-print { display: none !important; }.workspace { margin: 0; }.page-content { padding: 0; }body { color: #111; background: #fff; }.table td,.table th { color: #111; }.table-scroll { overflow: visible; }.line-table { min-width: 0; } }
