:root {
  --sidebar-width: 224px;
  --sidebar-collapsed-width: 56px;
  --topbar-height: 48px;
  --mobile-nav-height: 58px;
  --shell-bg: #f3f4f2;
  --shell-dark: #1c2722;
  --shell-dark-soft: #26332d;
  --shell-border: #c8ccc8;
  --focus-ring: 0 0 0 3px rgba(199, 70, 52, 0.2);
  --font-mono: "Cascadia Mono", Consolas, monospace;
}

html {
  min-width: 320px;
}

body {
  background: var(--shell-bg);
  overflow-x: hidden;
}

body.nav-area-stock { --area-accent: #176b87; }
body.nav-area-operations { --area-accent: #027a48; }
body.nav-area-catalog { --area-accent: #8b4f23; }
body.nav-area-analysis { --area-accent: #8a3142; }
body.nav-area-admin { --area-accent: #555e68; }

.skip-link {
  background: #fff;
  border: 2px solid var(--accent);
  color: var(--text);
  left: 8px;
  padding: 8px 12px;
  position: fixed;
  top: -80px;
  z-index: 200;
}

.skip-link:focus {
  top: 8px;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 160ms ease;
}

.app-sidebar {
  background: var(--shell-dark);
  border-right: 1px solid #33423b;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 80;
}

.sidebar-brand-row {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex: 0 0 var(--topbar-height);
  justify-content: space-between;
  min-width: 0;
  padding: 5px 8px;
}

.sidebar-brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 9px;
  min-width: 0;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: #fff;
  text-decoration: none;
}

.brand-mark-small {
  align-items: center;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: inline-flex;
  flex: 0 0 30px;
  font-size: 10px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand strong {
  font-size: 12px;
}

.sidebar-brand small {
  color: #aebbb5;
  font-size: 9px;
  font-weight: 600;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 6px;
  scrollbar-color: #63726b transparent;
  scrollbar-width: thin;
}

.sidebar-group {
  margin: 0 0 10px;
}

.sidebar-group h2 {
  color: #8fa098;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  margin: 0;
  padding: 5px 9px 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-link {
  align-items: center;
  border-left: 3px solid transparent;
  color: #d8dfdb;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  min-height: 34px;
  padding: 6px 9px;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-link i {
  color: #aebbb5;
  flex: 0 0 17px;
  text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--shell-dark-soft);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  border-left-color: var(--accent);
}

.sidebar-link.active i {
  color: #fff;
}

.sidebar-collapse-control {
  align-items: center;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #c7d0cc;
  cursor: pointer;
  display: flex;
  flex: 0 0 42px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  gap: 10px;
  padding: 8px 15px;
  text-align: left;
  width: 100%;
}

.sidebar-collapse-control:hover {
  background: var(--shell-dark-soft);
  color: #fff;
}

.sidebar-close {
  display: none !important;
}

.sidebar-collapsed .app-layout {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-group h2 {
  display: none;
}

.sidebar-collapsed .sidebar-brand-row {
  justify-content: center;
  padding-inline: 4px;
}

.sidebar-collapsed .sidebar-link {
  border-left-width: 2px;
  justify-content: center;
  padding-inline: 7px;
}

.sidebar-collapsed .sidebar-collapse-control {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-collapsed .sidebar-collapse-control i {
  transform: rotate(180deg);
}

.app-workspace {
  min-width: 0;
}

.app-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--shell-border);
  display: flex;
  height: var(--topbar-height);
  justify-content: space-between;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-start,
.topbar-tools {
  align-items: center;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.topbar-location {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-control {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--muted-strong);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  padding: 0;
  position: relative;
  text-decoration: none;
}

.icon-control:hover,
.icon-control:focus-visible {
  background: var(--surface-strong);
  border-color: var(--line-strong);
  color: var(--text);
  outline: none;
  text-decoration: none;
}

.global-search-trigger {
  align-items: center;
  background: #f7f7f5;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 11px;
  gap: 7px;
  height: 32px;
  min-width: 230px;
  padding: 0 10px;
  text-align: left;
}

.global-search-trigger:hover,
.global-search-trigger:focus-visible {
  background: #fff;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  outline: none;
}

.alert-count {
  align-items: center;
  background: var(--danger);
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 8px;
  font-weight: 900;
  height: 17px;
  justify-content: center;
  min-width: 17px;
  padding: 0 3px;
  position: absolute;
  right: -3px;
  top: -4px;
}

.app-topbar .nav-dropdown-btn {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
  height: 34px;
  padding: 0 7px;
}

.app-topbar .nav-dropdown-btn:hover,
.app-topbar .nav-dropdown-btn.active,
.app-topbar .dropdown.open .nav-dropdown-btn {
  background: var(--surface-strong);
  border-color: var(--line-strong);
  color: var(--text);
}

.app-topbar .dropdown-menu {
  top: calc(100% + 5px);
}

.page {
  margin: 0;
  max-width: none;
  min-width: 0;
  padding: 10px 14px 34px;
}

.breadcrumbs {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  font-weight: 700;
  gap: 6px;
  min-height: 24px;
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumbs a {
  color: var(--muted-strong);
}

.breadcrumbs span[aria-current="page"] {
  color: var(--area-accent, var(--text));
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-separator {
  color: var(--line-strong);
  font-size: 7px;
}

.section-head,
.page-header,
.form-page {
  border-radius: var(--radius-md);
}

.section-head,
.page-header {
  min-height: 72px;
}

.page-head-actions,
.mobile-record-actions,
.mobile-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.page-action-menu .nav-dropdown-btn {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--primary-dark);
  min-height: 32px;
  padding: 6px 10px;
}

.page-action-menu .nav-dropdown-btn:hover,
.page-action-menu.open .nav-dropdown-btn {
  background: var(--surface-strong);
  color: var(--primary-dark);
}

.page-action-menu .dropdown-menu a {
  color: var(--text);
}

.stock-filter-form {
  grid-template-columns: minmax(260px, 1fr) 150px 125px 95px auto;
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.compact-metrics .metric {
  min-height: 62px;
  padding: 9px 11px;
}

.compact-metrics .metric strong {
  font-size: 20px;
}

.data-panel {
  margin-top: 10px;
}

.status-ok-pill {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success-dark);
}

.inline-details {
  position: relative;
}

.inline-details summary {
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.location-popover {
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0;
  min-width: 225px;
  padding: 5px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 30;
}

.location-popover > div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1px;
  padding: 6px;
}

.location-popover > div:last-child {
  border-bottom: 0;
}

.location-popover span {
  color: var(--muted);
  font-size: 10px;
}

.mobile-record-list {
  display: none;
}

.dashboard-page-head {
  border-top-color: var(--accent);
}

.dashboard-alert-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto 10px;
  min-height: 62px;
  padding: 8px 10px;
  text-decoration: none;
}

.dashboard-alert-row:last-child {
  border-bottom: 0;
}

.dashboard-alert-row:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.dashboard-alert-row strong,
.dashboard-alert-row small {
  display: block;
}

.dashboard-alert-row small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.dashboard-alert-row > i {
  color: var(--line-strong);
  font-size: 9px;
}

.responsive-filters > summary {
  display: none;
}

.mobile-movement-lines {
  border: 1px solid var(--line);
  display: grid;
  margin-bottom: 10px;
}

.mobile-movement-lines > div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 7px;
}

.mobile-movement-lines > div:last-child {
  border-bottom: 0;
}

.mobile-movement-lines small {
  color: var(--muted);
  display: block;
  font-size: 9px;
}

.form-page:not(.operation-form-page) {
  margin-inline: auto;
  max-width: 1180px;
}

.operation-form-page {
  max-width: 980px;
}

.alerts {
  margin: 0 0 9px;
}

.alert {
  align-items: center;
  justify-content: space-between;
}

.alert-dismiss {
  background: transparent;
  border: 0;
  color: currentColor;
  cursor: pointer;
  height: 28px;
  width: 28px;
}

.mobile-bottom-nav {
  display: none;
}

.sidebar-overlay {
  background: rgba(12, 18, 15, 0.55);
  inset: 0;
  position: fixed;
  z-index: 70;
}

dialog {
  color: var(--text);
  font-family: inherit;
}

dialog::backdrop {
  background: rgba(16, 22, 19, 0.58);
}

.command-dialog {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 55px rgba(14, 20, 17, 0.28);
  margin-top: min(14vh, 120px);
  max-height: min(620px, 76vh);
  max-width: 680px;
  overflow: hidden;
  padding: 0;
  width: calc(100% - 28px);
}

.command-header {
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
  display: grid;
  gap: 8px;
  grid-template-columns: 24px minmax(0, 1fr) 32px;
  padding: 10px 12px;
}

.command-header > i {
  color: var(--muted);
  text-align: center;
}

.command-header input {
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  height: 34px;
  outline: none;
  width: 100%;
}

.command-status {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
}

.command-results {
  max-height: min(500px, 62vh);
  overflow-y: auto;
  padding: 5px;
}

.command-result {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 6px 8px;
  text-decoration: none;
}

.command-result:hover,
.command-result.active {
  background: var(--surface-strong);
  border-color: var(--line-strong);
  color: var(--text);
  text-decoration: none;
}

.command-result-icon {
  align-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.command-result strong,
.command-result small {
  display: block;
}

.command-result small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 1px;
}

.command-kind {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-empty {
  color: var(--muted);
  padding: 28px 12px;
  text-align: center;
}

.confirm-dialog {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--danger);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 55px rgba(14, 20, 17, 0.28);
  display: none;
  gap: 12px;
  grid-template-columns: 34px minmax(0, 1fr);
  max-width: 470px;
  padding: 18px;
  width: calc(100% - 28px);
}

.confirm-dialog[open] {
  display: grid;
}

.confirm-icon {
  align-items: center;
  background: var(--danger-soft);
  color: var(--danger);
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.confirm-dialog h2 {
  font-size: 16px;
  margin: 0 0 5px;
}

.confirm-dialog p {
  color: var(--muted-strong);
  margin: 0;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: 6px;
}

.button[aria-busy="true"],
.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.form-error-summary {
  align-items: flex-start;
  display: block;
}

.form-error-summary ul {
  margin: 5px 0 0;
  padding-left: 18px;
}

.form-error-summary a {
  color: inherit;
  text-decoration: underline;
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.sticky-form-actions {
  align-items: center;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line-strong);
  bottom: 0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 4px -16px -16px;
  padding: 10px 16px;
  position: sticky;
  z-index: 20;
}

.nfe-upload-panel {
  border-top: 3px solid var(--success);
}

.nfe-upload-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, 0.4fr) minmax(320px, 1fr) auto;
  padding: 14px;
}

.nfe-fixed-local {
  display: grid;
  gap: 5px;
}

.nfe-fixed-local > span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
}

.nfe-fixed-local > strong {
  align-items: center;
  border: 1px solid var(--line-strong);
  display: flex;
  gap: 8px;
  min-height: 34px;
  padding: 6px 9px;
}

.nfe-file-control {
  align-items: center;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
}

.nfe-file-control > i {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-right: 0;
  color: var(--area-accent);
  display: flex;
  height: 34px;
  justify-content: center;
}

.nfe-file-control .input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  min-width: 0;
  padding: 4px;
}

.nfe-file-control input::file-selector-button {
  background: var(--surface-strong);
  border: 0;
  border-right: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  margin: -4px 9px -4px -4px;
  min-height: 32px;
  padding: 5px 10px;
}

.nfe-upload-actions {
  margin: 0;
}

.nfe-upload-actions .button {
  white-space: nowrap;
}

.nfe-history-table td {
  vertical-align: middle;
}

.nfe-key-short {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.table-actions form,
.page-head-actions form,
.mobile-record-actions form {
  margin: 0;
}

.nfe-summary-strip {
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 10px;
}

.nfe-summary-strip > div {
  background: #fff;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.nfe-summary-strip span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.nfe-summary-strip strong {
  font-size: 15px;
}

.nfe-review-panel .panel-note {
  margin: 0;
  padding: 0 12px 10px;
}

.nfe-document-meta {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.nfe-document-meta > div {
  display: grid;
  gap: 4px;
}

.nfe-document-meta span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.nfe-document-meta code,
.nfe-key-mobile {
  overflow-wrap: anywhere;
}

.nfe-review-table {
  min-width: 1060px;
}

.nfe-review-table td {
  vertical-align: middle;
}

.nfe-review-table td:first-child {
  min-width: 180px;
}

.nfe-review-table td:nth-child(2) {
  min-width: 220px;
}

.nfe-review-table .input {
  min-width: 86px;
}

.nfe-review-table .searchable-select {
  min-width: 210px;
}

.compact-check {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-height: 32px;
}

.nfe-confirm-actions {
  margin: 0;
}

@media (max-width: 1099px) and (min-width: 769px) {
  body:not(.sidebar-expanded) .app-layout {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
  }

  body:not(.sidebar-expanded) .sidebar-label,
  body:not(.sidebar-expanded) .sidebar-group h2 {
    display: none;
  }

  body:not(.sidebar-expanded) .sidebar-brand-row,
  body:not(.sidebar-expanded) .sidebar-link,
  body:not(.sidebar-expanded) .sidebar-collapse-control {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .app-layout,
  .sidebar-collapsed .app-layout {
    display: block;
  }

  .app-sidebar {
    box-shadow: 12px 0 30px rgba(12, 18, 15, 0.28);
    left: 0;
    max-width: 86vw;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    width: 250px;
    z-index: 90;
  }

  .drawer-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-collapsed .sidebar-label,
  .sidebar-collapsed .sidebar-group h2 {
    display: block;
  }

  .sidebar-collapsed .sidebar-brand-row,
  .sidebar-collapsed .sidebar-link,
  .sidebar-collapsed .sidebar-collapse-control {
    justify-content: flex-start;
  }

  .sidebar-collapse-control {
    display: none;
  }

  .sidebar-close {
    color: #fff;
    display: inline-flex !important;
  }

  .app-topbar {
    padding: 0 8px;
  }

  .topbar-location,
  .global-search-trigger span,
  .user-menu-label {
    display: none;
  }

  .global-search-trigger {
    justify-content: center;
    min-width: 34px;
    padding: 0;
    width: 34px;
  }

  .page {
    padding: 7px 8px 22px;
  }

  .breadcrumbs {
    min-height: 28px;
  }

  .mobile-bottom-nav {
    background: #fff;
    border-top: 1px solid var(--line-strong);
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    left: 0;
    padding-bottom: env(safe-area-inset-bottom);
    position: fixed;
    right: 0;
    z-index: 65;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    align-items: center;
    background: transparent;
    border: 0;
    border-top: 3px solid transparent;
    color: var(--muted-strong);
    display: flex;
    flex-direction: column;
    font: inherit;
    font-size: 9px;
    font-weight: 800;
    gap: 3px;
    justify-content: center;
    min-width: 0;
    padding: 4px 2px;
    text-decoration: none;
  }

  .mobile-bottom-nav i {
    font-size: 15px;
  }

  .mobile-bottom-nav a.active {
    border-top-color: var(--area-accent, var(--accent));
    color: var(--area-accent, var(--accent-dark));
  }

  .section-head,
  .page-header {
    min-height: 0;
  }

  .page-head-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .page-head-actions .button {
    width: 100%;
  }

  .page-action-menu .nav-dropdown-btn {
    font-size: 0;
    min-width: 44px;
    padding: 0;
  }

  .page-action-menu .nav-dropdown-btn > i {
    font-size: 13px;
  }

  .page-action-menu .nav-dropdown-btn .chevron {
    display: none;
  }

  .stock-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-filter-form .filter-search-field,
  .stock-filter-form .filter-actions {
    grid-column: 1 / -1;
  }

  .compact-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-metrics .metric {
    min-height: 58px;
  }

  .desktop-record-table {
    display: none;
  }

  .movements-desktop-table {
    display: none;
  }

  .mobile-record-list {
    display: block;
  }

  .mobile-record {
    border-bottom: 1px solid var(--line);
  }

  .mobile-record:last-child {
    border-bottom: 0;
  }

  .mobile-record > summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto 10px;
    list-style: none;
    min-height: 64px;
    padding: 8px 10px;
  }

  .mobile-record > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-record > summary::after {
    color: var(--muted);
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-size: 10px;
    font-weight: 900;
    grid-column: 3;
  }

  .mobile-record[open] > summary {
    background: var(--surface-soft);
  }

  .mobile-record[open] > summary::after {
    transform: rotate(180deg);
  }

  .mobile-record summary strong,
  .mobile-record summary small {
    display: block;
  }

  .mobile-record summary strong {
    overflow-wrap: anywhere;
  }

  .mobile-record summary small {
    color: var(--muted);
    font-size: 10px;
    margin-top: 2px;
  }

  .mobile-record-value {
    text-align: right;
  }

  .mobile-record-body {
    border-top: 1px solid var(--line);
    padding: 10px;
  }

  .mobile-record-body dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 10px;
  }

  .mobile-record-body dl > div {
    border-bottom: 1px solid var(--line);
    padding: 7px 4px;
  }

  .mobile-record-body dt {
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-record-body dd {
    font-weight: 800;
    margin: 2px 0 0;
  }

  .mobile-location-list {
    border: 1px solid var(--line);
    margin-bottom: 10px;
  }

  .mobile-location-list > div {
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 7px;
  }

  .mobile-location-list > div:last-child {
    border-bottom: 0;
  }

  .mobile-location-list span {
    color: var(--muted);
    font-size: 10px;
    text-align: right;
  }

  .mobile-record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .responsive-filters > summary {
    align-items: center;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    display: flex;
    font-size: 11px;
    font-weight: 900;
    gap: 7px;
    min-height: 44px;
    padding: 8px 10px;
  }

  .responsive-filters:not([open]) > summary {
    border-bottom: 0;
  }

  .movement-filters {
    padding: 9px;
  }

  .operation-form-page .form > [type="submit"] {
    bottom: calc(var(--mobile-nav-height) + 7px);
    box-shadow: 0 2px 8px rgba(12, 18, 15, 0.18);
    position: sticky;
    z-index: 10;
  }

  .nfe-upload-form {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .nfe-upload-actions,
  .nfe-upload-actions .button {
    width: 100%;
  }

  .nfe-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nfe-summary-strip > div:last-child {
    grid-column: 1 / -1;
  }

  .nfe-summary-strip > div {
    min-height: 62px;
    padding: 8px 10px;
  }

  .nfe-document-meta {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .nfe-review-table {
    min-width: 0;
  }

  .nfe-review-table td:first-child,
  .nfe-review-table td:nth-child(2),
  .nfe-review-table .searchable-select {
    min-width: 0;
  }

  .nfe-review-table td[data-label] {
    grid-template-columns: minmax(94px, 0.36fr) minmax(0, 1fr);
  }

  .nfe-key-mobile {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    display: block;
    font-size: 10px;
    margin-bottom: 10px;
    padding: 7px;
  }

  .mobile-record-actions > :only-child {
    grid-column: 1 / -1;
  }

  .nfe-confirm-actions {
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
  }

  .nfe-confirm-actions .button {
    min-height: 44px;
    white-space: normal;
  }

  .mobile-movement-lines .movement-badge {
    font-size: 0;
    height: 25px;
    justify-content: center;
    padding: 3px;
    width: 25px;
  }

  .mobile-movement-lines .movement-badge i {
    font-size: 10px;
  }

  .responsive-detail-table,
  .responsive-detail-table tbody,
  .responsive-detail-table tr,
  .responsive-detail-table td {
    display: block;
    width: 100%;
  }

  .responsive-detail-table thead {
    display: none;
  }

  .responsive-detail-table tbody tr {
    border-bottom: 1px solid var(--line-strong);
    padding: 7px 9px;
  }

  .responsive-detail-table tbody tr:last-child {
    border-bottom: 0;
  }

  .responsive-detail-table td {
    align-items: flex-start;
    border: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    padding: 4px 0;
    text-align: left;
    white-space: normal;
  }

  .responsive-detail-table td[data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 900;
    padding-top: 2px;
    text-transform: uppercase;
  }

  .responsive-detail-table td.numeric {
    text-align: left;
  }

  .responsive-detail-table tfoot {
    display: block;
  }

  .responsive-detail-table tfoot tr {
    display: grid;
    grid-template-columns: 1fr;
  }

  .responsive-detail-table tfoot th {
    display: block;
    text-align: right;
  }

  .button,
  .input,
  .searchable-select-input,
  .icon-control {
    min-height: 44px;
  }

  .command-dialog {
    margin-top: 8px;
    max-height: calc(100vh - 16px);
    width: calc(100% - 16px);
  }

  .command-results {
    max-height: calc(100vh - 112px);
  }

  .command-result {
    min-height: 54px;
  }

  .sticky-form-actions {
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .compact-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .compact-metrics .metric span {
    font-size: 9px;
  }

  .stock-filter-form {
    grid-template-columns: 1fr;
  }

  .stock-filter-form .filter-search-field,
  .stock-filter-form .filter-actions {
    grid-column: auto;
  }
}

@media print {
  .app-sidebar,
  .app-topbar,
  .mobile-bottom-nav,
  .sidebar-overlay,
  .breadcrumbs,
  dialog {
    display: none !important;
  }

  .app-layout {
    display: block;
  }
}
