/* Plain working interface. No themes, wallpaper, glass or appearance controls. */
:root,
:root[data-theme] {
  color-scheme: light;
  font-family: Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  --text: #1f2937;
  --secondary: #4b5563;
  --muted: #64748b;
  --faint: #6b7280;
  --line: #dce1e7;
  --shell: #ffffff;
  --side: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --field: #ffffff;
  --modal: #ffffff;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --green: #187443;
  --amber: #94550c;
  --danger: #b42318;
  --shadow: none;
  --inner: none;
  --radius: 6px;
  --side-width: 224px;
}
*, *::before, *::after {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html, body {height: 100%; min-height: 0; overflow: hidden; scrollbar-gutter: auto; background: #f3f4f6;}
body {height: 100dvh; color: var(--text); overscroll-behavior: none;}
button:active:not(:disabled) {transform: none;}
button:focus-visible, a:focus-visible {outline: 2px solid #2563eb; outline-offset: 2px;}
input:focus, select:focus, textarea:focus {outline: 2px solid #2563eb; outline-offset: 1px;}
.glass {background: #ffffff; border: 0;}
.surface {background: #ffffff; border: 1px solid var(--line); border-radius: 6px;}
.wallpaper, .wallpaper-shade, .theme-picker, .appearance-entry, .appearance-trigger, .eyebrow {display: none !important;}
.window {position: fixed; inset: 0; display: grid; grid-template-columns: var(--side-width) minmax(0,1fr); grid-template-rows: minmax(0,1fr); height: 100dvh; min-height: 0; max-height: 100dvh; padding: 0; gap: 0; overflow: hidden; align-items: stretch;}
.window .sidebar {position: relative; inset: auto; top: 0; height: 100%; max-height: none; min-height: 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: #f8fafc; padding: 16px 10px 12px;}
.sidebar-heading {min-height: 42px; margin-bottom: 24px;}
.brand {gap: 10px; padding: 0 9px;}
.brand-mark {width: 34px; height: 34px; border-radius: 5px; font-size: 29px; font-weight: 500; padding-bottom: 4px; letter-spacing: -1px; background: #2563eb; color: #ffffff;}
.brand-word {font-size: 22px; letter-spacing: 0; font-weight: 600;}
.brand-caption {font-size: 11px; margin-top: 2px;}
.sidebar-scroll {min-height: 0; overflow: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain;}
.nav-label {font-size: 11px; font-weight: 600; letter-spacing: 0; padding: 0 10px; margin-bottom: 6px; min-height: 20px;}
.nav-label.category-label, .nav-label.location-label, .finance-label {margin-top: 22px;}
.nav-item {border-radius: 4px; min-height: 39px; padding: 9px 10px; margin: 2px 0; font-size: 13px; gap: 10px; color: #374151;}
.nav-item .icon {width: 18px; height: 18px; color: #64748b;}
.nav-item.active {background: #e8eefb; color: #1d4ed8; font-weight: 600;}
.nav-count {font-size: 11px;}
.sidebar-bottom {margin-top: 14px; padding-top: 12px;}
.connection {padding: 0 10px 9px; font-size: 11px;}
.connection-dot {width: 6px; height: 6px;}
.profile-button {border-radius: 4px; padding: 8px 9px; gap: 9px; min-height: 44px;}
.avatar {width: 30px; height: 30px; background: #e2e8f0; color: #334155; font-size: 12px;}
.profile-copy strong {font-size: 12px;}
.profile-copy small {font-size: 10px;}
.main-pane.glass {min-width: 0; height: 100%; min-height: 0; max-height: 100%; border: 0; border-radius: 0; background: #f3f4f6; display: flex; flex-direction: column; overflow: hidden;}
.toolbar {flex: 0 0 auto; min-height: 66px; padding: 13px 24px; gap: 14px; border-bottom: 1px solid var(--line); background: #ffffff; position: relative; z-index: 5;}
.toolbar-title {font-size: 18px; font-weight: 600; gap: 14px;}
.toolbar-title>span {font-size: 13px; padding-left: 14px; font-weight: 400;}
.toolbar-spacer {display: block; flex: 1;}
.icon-button {border-radius: 4px; width: 36px; height: 36px;}
.sidebar-toggle {border: 1px solid var(--line); background: #ffffff;}
.search {height: 36px; width: clamp(180px,22vw,320px); border-radius: 4px; background: #ffffff; padding: 0 11px; gap: 8px;}
.search input {font-size: 13px;}
.search .icon {width: 17px; height: 17px;}
.search kbd {border: 0; background: #ffffff; font-size: 11px;}
.content, #finance-content {flex: 1 1 auto; min-height: 0; padding: 24px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable;}
h1, .finance-content h1 {font-size: 27px; font-weight: 600; line-height: 1.25; letter-spacing: -.3px;}
.page-heading {align-items: flex-start; margin-bottom: 22px; gap: 16px;}
.page-heading p {font-size: 13px; margin-top: 8px; color: #64748b;}
.heading-actions, .finance-content .heading-actions {gap: 8px; flex-wrap: wrap;}
.button {border-radius: 4px; min-height: 37px; padding: 9px 14px; font-size: 13px; font-weight: 500; gap: 7px;}
.button .icon {width: 17px; height: 17px;}
.button.primary {background: #2563eb; color: #ffffff; border: 1px solid #2563eb;}
.button.primary:hover {background: #1d4ed8;}
.button.secondary {background: #ffffff; border: 1px solid #cbd5e1; color: #334155;}
.button.secondary:hover {background: #f1f5f9;}
.input {border-radius: 4px; border: 1px solid #cbd5e1; padding: 10px 11px; font-size: 14px; background: #ffffff; color: #1f2937;}
.form-field {font-size: 12px; gap: 7px; color: #374151;}
.form-field small, .form-note, .document-note {font-size: 12px;}
.form-note, .document-note {border-radius: 4px; background: #f8fafc; border: 1px solid var(--line); padding: 13px; color: #475569;}
.form-error {border-radius: 4px; background: #fef2f2; color: #b42318; border: 1px solid #fecaca;}
.summary {gap: 12px; margin-bottom: 16px;}
.summary-card {background: #ffffff; border: 1px solid var(--line); border-radius: 6px; padding: 18px; gap: 12px;}
.summary-icon {width: 34px; height: 34px; border-radius: 4px; background: #f1f5f9; color: #475569;}
.summary-label {font-size: 12px; margin-bottom: 5px;}
.summary-value {font-size: 27px; font-weight: 600; letter-spacing: -.5px;}
.summary-value small {font-size: 12px;}
.quick-actions {gap: 10px; margin-bottom: 22px;}
.action-tile {border-radius: 4px; min-height: 61px; padding: 14px; background: #ffffff; border: 1px solid var(--line); gap: 10px;}
.quick-actions .action-tile:first-child {background: #ffffff; color: #334155; border-color: var(--line);}
.quick-actions .action-tile .tile-copy, .quick-actions .action-tile .tile-icon {color: #475569;}
.tile-icon {width: 24px; height: 24px; background: none; border: 0; color: #475569;}
.tile-icon .icon {width: 21px; height: 21px;}
.tile-copy strong {font-size: 13px; font-weight: 500;}
.tile-copy small {display: none;}
.tile-arrow {display: none;}
.workspace-grid {gap: 16px;}
.inventory-panel {padding: 20px; border-radius: 6px;}
.panel-heading {margin-bottom: 18px;}
.panel-heading h2, .context-title h2 {font-size: 17px; font-weight: 600;}
.filter-bar {gap: 12px; margin-bottom: 15px;}
.segment, .filter-button, .view-switch {border-radius: 4px; font-size: 12px;}
.segment {border: 1px solid #cbd5e1; padding: 7px 12px; background: #ffffff;}
.segment.active {background: #e8eefb; border-color: #b6c9f3; color: #1d4ed8;}
.view-switch {background: #f8fafc; border: 1px solid var(--line);}
.view-switch button {border-radius: 3px;}
.view-switch button.active {background: #e2e8f0; color: #1f2937;}
.location-select {border-radius: 4px; background: #ffffff;}
.location-select select {font-size: 12px;}
.stock-table th, .doc-list th, .document-lines th {font-size: 12px; text-transform: none; letter-spacing: 0; color: #64748b; font-weight: 600;}
.stock-table td, .doc-list td {padding: 14px 8px; font-size: 13px;}
.stock-table .item-name, .doc-list .item-name {font-size: 13px; font-weight: 500;}
.stock-table .item-sku, .doc-list .item-sku {font-size: 11px;}
.stock-table .qty {font-size: 15px;}
.product-icon, .doc-icon, .storage-icon {border-radius: 4px; background: #f1f5f9; color: #475569;}
.product-icon.raw, .product-icon.pack, .product-icon.finished {background: #f1f5f9; color: #475569;}
.grid {gap: 12px;}
.product-card {background: #ffffff; border: 1px solid var(--line); border-radius: 6px; padding: 18px;}
.product-card .item-name {font-size: 13px; font-weight: 500;}
.product-card .qty {font-size: 24px;}
.status, .badge {border-radius: 3px; font-size: 11px;}
.storage-panel, .activity-panel {border-radius: 6px; padding: 20px;}
.storage-place, .activity-row {border-radius: 4px;}
.storage-place strong, .activity-row strong {font-size: 13px; font-weight: 500;}
.empty-state {min-height: 250px; padding: 30px 16px;}
.empty-state h3 {font-size: 21px; font-weight: 500;}
.empty-state p {font-size: 13px;}
.statusbar {font-size: 11px; padding-top: 18px;}
.popover, .operation-menu {background: #ffffff; border: 1px solid #cbd5e1; border-radius: 5px;}
.menu-item {border-radius: 3px;}
dialog.sheet {border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; max-height: calc(100dvh - 40px);}
.sheet-header {padding: 20px 24px 17px; border-bottom: 1px solid var(--line);}
.sheet-header h2 {font-size: 21px; letter-spacing: 0; font-weight: 600;}
.sheet-header p {font-size: 12px; color: #64748b;}
.sheet-header .icon-button {background: #ffffff; border-radius: 4px;}
.sheet-body {padding: 22px 24px;}
.sheet-footer {padding: 16px 24px; border-top: 1px solid var(--line);}
.sheet::backdrop, .inspector::backdrop {background: rgba(15,23,42,.32);}
.inspector {background: #ffffff; border: 0; border-left: 1px solid #cbd5e1; border-radius: 0; inset: 0 0 0 auto; height: 100dvh; width: 450px;}
.inspector-hero h2 {font-size: 24px;}
.toast {border-radius: 5px; background: #1f2937; color: #ffffff; padding: 12px 18px; font-size: 13px;}
.toast.error {background: #991b1b; color: #ffffff;}
.f-cards {gap: 14px; grid-template-columns: repeat(auto-fill,minmax(min(100%,290px),1fr));}
.f-card {border-radius: 6px; padding: 20px; gap: 8px;}
.f-card h2 {font-size: 19px; font-weight: 600; letter-spacing: 0;}
.f-kicker {font-size: 11px; text-transform: none; letter-spacing: 0;}
.f-card-foot {padding: 12px 0;}
.f-inline {color: #2563eb; margin-top: 6px;}
.f-panel {padding: 22px; border-radius: 6px;}
.f-metric {padding: 18px; border-radius: 6px;}
.f-metric>strong {font-size: 25px; font-weight: 600;}
.f-metric>span {font-size: 12px;}
.f-balance {font-size: 25px; font-weight: 600;}
.f-table-panel {border-radius: 6px; padding: 4px 16px;}
.f-table {font-size: 13px; table-layout: auto;}
.f-table th {font-size: 12px; text-transform: none; letter-spacing: 0; color: #64748b; font-weight: 600; padding: 14px 10px;}
.f-table td {padding: 15px 10px;}
.f-link {color: #1d4ed8; font-weight: 500; text-decoration: none;}
.f-link:hover {text-decoration: underline;}
.f-tabs {gap: 7px; margin-bottom: 20px;}
.f-tabs .segment {font-size: 13px;}
.f-filter {gap: 14px; margin-bottom: 20px;}
.f-filter>label:first-child {font-size: 12px;}
.f-empty {min-height: 250px; gap: 18px;}
.f-empty h2 {font-size: 21px;}
.f-company-checks {border-radius: 4px;}
.f-pagination .button {min-height: 33px;}
.f-section-title {font-size: 19px;}
.f-invoice-line .input {font-size: 14px;}
body.signed-out {overflow-y: auto;}
.auth-screen {height: auto; min-height: 100dvh; padding: 24px; background: #f3f4f6; overflow: visible;}
.auth-card.glass {width: 400px; max-width: 100%; background: #ffffff; border: 1px solid #dce1e7; border-radius: 6px; padding: 32px;}
.auth-card>.brand-mark {margin-bottom: 22px;}
.auth-card h1 {font-size: 27px; letter-spacing: 0;}
.auth-card>p {font-size: 14px; margin-top: 10px;}
.auth-card .button {margin-top: 8px;}
@media(min-width:768px) {
  .window.sidebar-compact {--side-width: 70px;}
  .sidebar-compact .sidebar {padding-left: 7px; padding-right: 7px;}
  .sidebar-compact .nav-item {width: 54px; border-radius: 4px;}
  .sidebar-compact .brand {padding-left: 10px;}
  .sidebar-compact .finance-label {border-top: 1px solid var(--line);}
}
@media(max-width:1099px) {
  .toolbar {padding: 12px 20px; min-height: 62px;}
  .content, #finance-content {padding: 22px 20px;}
  .quick-actions {grid-template-columns: repeat(2,minmax(0,1fr));}
  .action-tile {min-height: 55px;}
}
@media(max-width:767px) {
  .window, .window.sidebar-compact {display: grid; grid-template-columns: minmax(0,1fr); padding: 0; gap: 0;}
  .window .sidebar {position: fixed; inset: 0 auto 0 0; top: 0; width: min(280px,calc(100% - 48px)); height: 100dvh; max-height: none; padding: max(16px,env(safe-area-inset-top)) 10px 12px; border-radius: 0; background: #ffffff; transform: translateX(-100%); visibility: hidden;}
  .window.sidebar-mobile-open .sidebar {transform: translateX(0); visibility: visible;}
  .sidebar-mobile-open .sidebar-scrim {background: rgba(15,23,42,.32);}
  .icon-button.mobile-close {display: inline-grid;}
  .toolbar {min-height: 104px; padding: max(12px,env(safe-area-inset-top)) 16px 12px; gap: 10px;}
  .toolbar-title {font-size: 17px; margin-right: auto;}
  .toolbar-spacer {display: none;}
  .toolbar .search {order: 5; width: 100%; height: 38px; margin-top: 0; border-radius: 4px; padding: 0 10px;}
  .toolbar .search input {font-size: 16px;}
  .sidebar-toggle {width: 34px; height: 34px;}
  .content, #finance-content {padding: 20px 14px max(20px,env(safe-area-inset-bottom)); scrollbar-gutter: auto;}
  h1, .finance-content h1 {font-size: 25px;}
  .page-heading {margin-bottom: 20px; gap: 15px;}
  .page-heading p {font-size: 13px; margin-top: 7px;}
  .button, .finance-content .button {min-height: 42px; font-size: 13px; padding: 10px 13px;}
  .summary {gap: 8px;}
  .summary-card {padding: 13px 10px; border-radius: 5px;}
  .summary-label {font-size: 11px; min-height: 30px; margin-bottom: 6px;}
  .summary-value {font-size: 24px;}
  .quick-actions {gap: 8px; margin-bottom: 18px;}
  .action-tile {min-height: 51px; flex-direction: row; align-items: center; padding: 12px; gap: 8px;}
  .tile-copy strong {font-size: 12px;}
  .tile-icon {width: 19px; height: 19px;}
  .tile-icon .icon {width: 18px; height: 18px;}
  .inventory-panel {padding: 16px 12px; border-radius: 5px;}
  .panel-heading h2 {font-size: 17px;}
  .location-select select {font-size: 16px;}
  .stock-table .item-name, .doc-list .item-name {font-size: 13px;}
  .stock-table .qty {font-size: 13px;}
  .stock-table td, .doc-list td {padding: 13px 3px;}
  .doc-list td:last-child {font-size: 11px;}
  .context-panels {grid-template-columns: minmax(0,1fr);}
  .storage-panel, .activity-panel {padding: 18px; border-radius: 5px;}
  .grid {grid-template-columns: minmax(0,1fr);}
  .product-card {border-radius: 5px;}
  .input, .line-row .input, .f-invoice-line .input {font-size: 16px;}
  .form-grid {grid-template-columns: minmax(0,1fr); gap: 17px;}
  .form-field.full {grid-column: auto;}
  dialog.sheet {width: calc(100% - 20px); max-width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 6px;}
  .sheet-header, .sheet-body {padding: 18px;}
  .sheet-footer {padding: 15px 18px;}
  .sheet-header h2 {font-size: 20px;}
  .sheet-header p {font-size: 12px;}
  .inspector {inset: 0; width: 100%; max-width: 100%; height: 100dvh; border-radius: 0;}
  .f-cards {grid-template-columns: minmax(0,1fr); gap: 12px;}
  .f-card, .f-panel {padding: 18px; border-radius: 5px;}
  .f-table-panel {padding: 4px 10px; border-radius: 5px;}
  .f-table {font-size: 13px; min-width: 760px; table-layout: auto;}
  .f-table-panel::before {content: 'Таблицу можно прокрутить в сторону'; display: block; padding: 10px 0 4px; font-size: 11px; color: #64748b;}
  .f-table td:first-child {min-width: 190px;}
  .f-table td:nth-child(2) {min-width: 180px;}
  .f-table th {font-size: 11px;}
  .f-table td {padding: 14px 8px;}
  .f-filter>label:first-child {font-size: 12px;}
  .f-filter select {font-size: 16px;}
  .f-tabs .segment {font-size: 12px;}
  .f-metric>strong {font-size: 24px;}
  .auth-screen {padding: 16px;}
  .auth-card.glass {padding: 28px 22px;}
  .toast {bottom: 16px; max-width: calc(100% - 24px); font-size: 12px;}
}
