:root {
  --brand-burgundy: #8f1230;
  --brand-burgundy-strong: #740d25;
  --brand-burgundy-soft: #fff1f4;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-muted: #f1f3f6;
  --border: #dfe3ea;
  --border-strong: #cbd2dc;
  --text: #171a1f;
  --muted: #68707d;
  --success: #16834a;
  --warning: #ef7d16;
  --danger: #d92d32;
  --info: #1769c2;
  --surface-subtle: color-mix(in srgb, var(--surface) 72%, var(--surface-muted));
  --surface-danger: color-mix(in srgb, var(--danger) 8%, var(--surface));
  --surface-warning: color-mix(in srgb, var(--warning) 9%, var(--surface));
  --surface-success: color-mix(in srgb, var(--success) 8%, var(--surface));
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --topbar-height: 64px;
  --content-max: 1520px;
  --icon-stroke: 1.75;
  --focus-ring: 0 0 0 3px rgba(143, 18, 48, 0.18);
  color-scheme: light;
}

[data-theme="dark"] {
  --brand-burgundy: #d44a6b;
  --brand-burgundy-strong: #f06b8a;
  --brand-burgundy-soft: rgba(212, 74, 107, 0.14);
  --bg: #111418;
  --surface: #191d23;
  --surface-elevated: #20252d;
  --surface-muted: #252b34;
  --border: #303743;
  --border-strong: #46505e;
  --text: #f4f6f8;
  --muted: #a8b0bd;
  --success: #48c787;
  --warning: #ffb15c;
  --danger: #ff6570;
  --info: #73b7ff;
  --focus-ring: 0 0 0 3px rgba(212, 74, 107, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: var(--icon-stroke);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

[hidden] {
  display: none !important;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr) minmax(230px, auto);
  align-items: stretch;
  min-height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-brand,
.topbar-link,
.depot-select-pill,
.icon-button,
.session-logout-btn,
.profile-button {
  border: 0;
  background: transparent;
  color: inherit;
}

.topbar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-right: 1px solid var(--border);
  color: var(--brand-burgundy);
  font-size: 18px;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand-burgundy);
  color: #fff;
  font-weight: 900;
  line-height: 1;
}

.app-brand-logo {
  display: grid;
  place-items: center;
  width: 128px;
  height: 38px;
  background: var(--surface-elevated);
  overflow: hidden;
}

.app-brand-logo img {
  display: block;
  width: 118px;
  height: auto;
  object-fit: contain;
}

.topbar-nav {
  display: flex;
  align-items: stretch;
  min-width: 0;
  gap: 2px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: max-content;
  padding: 0 7px;
  border-bottom: 3px solid transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.topbar-link svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.topbar-link.active {
  color: var(--brand-burgundy);
  border-bottom-color: var(--brand-burgundy);
  font-weight: 700;
}

.topbar-link.active svg {
  color: var(--brand-burgundy);
}

.topbar-link.options-menu-trigger[aria-expanded="true"] {
  color: var(--brand-burgundy);
  border-bottom-color: var(--brand-burgundy);
}

.menu-chevron {
  width: 14px;
  height: 14px;
}

.module-subbar {
  position: sticky;
  top: var(--topbar-height);
  z-index: 19;
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.subbar-context {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 0 16px;
  border-right: 1px solid var(--border);
  color: var(--brand-burgundy);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.subbar-context svg {
  width: 15px;
  height: 15px;
}

.subbar-items {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 3px;
  padding: 6px 8px;
  overflow: hidden;
}

.subbar-items button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: max-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.subbar-items button svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.subbar-items button:hover,
.subbar-items button.active {
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.subbar-items button:hover svg,
.subbar-items button.active svg {
  color: var(--brand-burgundy);
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  min-width: 0;
  border-left: 1px solid var(--border);
}

.session-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.session-logout-btn svg {
  width: 16px;
  height: 16px;
}

.session-logout-btn:hover {
  color: var(--brand-burgundy);
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--brand-burgundy-soft);
}

.topbar-search {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 10px;
  width: clamp(170px, 17vw, 250px);
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
}

.topbar-search::after {
  content: "Recherche";
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 50;
  transform: translateX(-50%);
  display: none;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: white;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.topbar-search:hover::after {
  display: none;
}

.topbar-search input,
.filter-toolbar input,
.filter-toolbar select,
.desktop-quick-scan input,
.desktop-quick-scan select,
.mobile-scan-panel input,
.mobile-scan-panel select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.topbar-search kbd {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.depot-select-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  white-space: nowrap;
  flex: 0 0 auto;
}

.depot-select-pill svg:first-child,
.mobile-depot-card svg:first-child {
  color: var(--brand-burgundy);
}

.depot-select-pill svg:last-child,
.mobile-depot-card svg:last-child {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.options-menu-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 76px;
  z-index: 35;
  width: 340px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.options-menu-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border);
}

.options-menu-header strong {
  color: var(--brand-burgundy);
  font-size: 14px;
}

.options-menu-header span,
.options-menu-list small,
.mobile-options-list small,
.mobile-options-sheet header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.options-menu-list,
.mobile-options-list {
  display: grid;
  gap: 4px;
  padding-top: 8px;
}

.options-menu-list button,
.mobile-options-list button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.options-menu-list button:hover,
.mobile-options-list button:active {
  background: var(--brand-burgundy-soft);
}

.options-menu-list svg,
.mobile-options-list svg {
  color: var(--brand-burgundy);
}

.options-menu-list span,
.mobile-options-list span {
  display: grid;
  gap: 2px;
}

.options-menu-list strong,
.mobile-options-list strong {
  font-size: 13px;
}

.global-search-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 96px;
  z-index: 36;
  width: min(520px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.global-search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 6px 0 14px;
  border: 1px solid rgba(143, 18, 48, 0.28);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--brand-burgundy);
}

.global-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.global-search-box button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.global-search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.global-search-suggestions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.icon-button,
.profile-button {
  min-height: 42px;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  border-left: 1px solid var(--border);
}

.bell-dot {
  position: absolute;
  top: 3px;
  right: 5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand-burgundy);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.topbar-popover {
  position: fixed;
  top: calc(var(--topbar-height) + 10px);
  right: 12px;
  z-index: 60;
  width: min(380px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - var(--topbar-height) - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.location-popover {
  right: 74px;
}

.topbar-popover header,
.topbar-popover footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.topbar-popover footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.topbar-popover header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.topbar-popover header svg {
  width: 16px;
  height: 16px;
  color: var(--brand-burgundy);
}

.topbar-popover-list {
  display: grid;
  gap: 4px;
  padding: 8px;
  overflow: auto;
}

.topbar-popover-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.topbar-popover-row:hover,
.topbar-popover-row.active {
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--brand-burgundy-soft);
}

.topbar-popover-row strong,
.topbar-popover-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-popover-row strong {
  font-size: 13px;
  font-weight: 800;
}

.topbar-popover-row small,
.topbar-popover-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.topbar-popover-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--brand-burgundy);
}

.topbar-popover-icon.critical {
  color: var(--danger);
}

.topbar-popover-icon.low {
  color: var(--warning);
}

.topbar-popover-icon.info {
  color: var(--info);
}

.topbar-popover-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.topbar-popover-empty svg {
  color: var(--success);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  text-align: left;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--brand-burgundy);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.profile-button small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.profile-button > span:last-child {
  max-width: 104px;
  overflow: hidden;
}

.profile-button > span:last-child strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 12px;
}

.view {
  display: none;
}

.view.active-view {
  display: block;
}

.view.workspace-page.active-view {
  display: grid;
}

.view.options-workspace.active-view {
  display: grid;
}

#options.options-workspace.active-view {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-height: 360px;
}

.flat-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.flat-panel,
.page-heading,
.workspace-toolbar,
.filter-toolbar {
  letter-spacing: 0;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title-row h2,
.panel-title-row h3,
.flat-panel h1,
.page-heading h1 {
  margin: 0;
  color: var(--text);
}

.panel-title-row h2 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel-title-row h3 {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.panel-title-row button,
.link-button {
  border: 0;
  background: transparent;
  color: var(--brand-burgundy);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dashboard-command-bar h1,
.dashboard-command-bar p {
  margin: 0;
}

.dashboard-command-bar h1 {
  font-size: 22px;
  line-height: 1.15;
}

.dashboard-command-bar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-command-actions,
.dashboard-edit-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiet-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.quiet-command svg,
.dashboard-hide-btn svg,
.available-widget-list svg,
.row-action svg {
  width: 15px;
  height: 15px;
}

.quiet-command:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.quiet-command-primary,
.save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  background: var(--surface);
  border-color: rgba(143, 18, 48, 0.36);
  color: var(--brand-burgundy);
}

.quiet-command-primary:hover,
.save-btn:hover {
  border-color: var(--brand-burgundy);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.dashboard-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 86px;
  grid-auto-flow: dense;
  align-items: stretch;
  gap: 12px;
}

.dashboard-grid.is-editing {
  padding: 10px;
  border: 1px dashed rgba(143, 18, 48, 0.32);
  border-radius: var(--radius-lg);
  background-image:
    linear-gradient(rgba(143, 18, 48, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 18, 48, 0.08) 1px, transparent 1px);
  background-size: calc((100% - 11 * 12px) / 12 + 12px) 98px;
}

.dashboard-stock-overview,
.dashboard-movements-panel,
.dashboard-watch-panel,
.dashboard-priority-alerts,
.dashboard-orders-panel,
.dashboard-recoveries-panel,
.dashboard-inventory-validation-panel,
.dashboard-documents-panel,
.dashboard-risk-panel,
.dashboard-activity-panel,
.dashboard-top-movements-panel,
.dashboard-operational-health-panel,
.desktop-quick-scan,
.stock-supervision-panel {
  padding: 14px;
}

.dashboard-widget {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.dashboard-widget[hidden] {
  display: none;
}

.dashboard-widget.is-dragging {
  z-index: 15;
  border-color: var(--brand-burgundy);
  box-shadow: 0 0 0 3px rgba(143, 18, 48, 0.12);
}

.subbar-target-highlight {
  border-color: rgba(143, 18, 48, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(143, 18, 48, 0.12) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-widget-editbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: -5px -5px 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.dashboard-grid.is-editing .dashboard-widget-editbar {
  display: flex;
}

.dashboard-drag-handle,
.dashboard-hide-btn,
.dashboard-size-controls button,
.available-widget-list button,
.mobile-reorder-controls button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
}

.dashboard-drag-handle {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 26px;
  color: var(--muted);
  cursor: grab;
}

.dashboard-drag-handle:active {
  cursor: grabbing;
}

.dashboard-size-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dashboard-size-controls button,
.dashboard-hide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 7px;
}

.dashboard-size-controls button.active {
  border-color: rgba(143, 18, 48, 0.32);
  background: transparent;
  color: var(--brand-burgundy);
}

.dashboard-available-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.available-widget-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.available-widget-list button {
  min-height: 32px;
  padding: 0 10px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.kpi-tile,
.summary-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 14px;
}

.kpi-tile {
  min-width: 0;
  padding: 10px;
}

.kpi-tile span,
.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.kpi-tile strong,
.summary-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1;
}

.kpi-tile strong {
  font-size: 18px;
  line-height: 1.12;
}

.kpi-tile small {
  display: block;
  margin-top: 8px;
  font-size: 11px;
}

.positive {
  color: var(--success);
}

.negative,
.danger-text {
  color: var(--danger);
}

.warning-text {
  color: var(--warning);
}

.muted-text {
  color: var(--muted);
}

.dashboard-health-strip {
  padding: 10px 0 12px;
  border-top: 1px solid var(--border);
}

.dashboard-health-strip h3 {
  margin: 0 0 9px;
  font-size: 12px;
  text-transform: uppercase;
}

.health-bar {
  display: flex;
  gap: 4px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.health-bar span,
.health-legend i {
  display: block;
}

.health-bar span {
  flex: 1 1 0;
}

.health-bar .ok,
.health-legend .ok {
  background: var(--success);
}

.health-bar .low,
.health-legend .low {
  background: var(--warning);
}

.health-bar .critical,
.health-legend .critical {
  background: var(--danger);
}

.health-bar .order,
.health-legend .order {
  background: var(--info);
}

.health-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.health-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.health-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.dashboard-metric-list {
  display: grid;
  gap: 8px;
}

.dashboard-metric-row {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.dashboard-metric-row:hover {
  border-color: rgba(143, 18, 48, 0.28);
  background: var(--surface-muted);
}

.dashboard-metric-row strong,
.dashboard-metric-row small {
  display: block;
  min-width: 0;
}

.dashboard-metric-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

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

.dashboard-metric-row em {
  justify-self: end;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.dashboard-metric-row em.critical,
.dashboard-metric-icon.critical {
  color: var(--danger);
}

.dashboard-metric-row em.warning,
.dashboard-metric-icon.warning,
.dashboard-metric-row em.urgent-30,
.dashboard-metric-icon.urgent-30 {
  color: var(--warning);
}

.dashboard-metric-row em.ok,
.dashboard-metric-icon.ok {
  color: var(--success);
}

.dashboard-metric-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--brand-burgundy);
}

.dashboard-metric-icon svg {
  width: 16px;
  height: 16px;
}

.dashboard-empty-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 12px;
}

.dashboard-pilotage-grid {
  width: min(var(--content-max), calc(100vw - 32px));
  margin: 0 auto 14px;
}

.dashboard-pilotage-main {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.panel-subtitle,
.dashboard-chart-caption {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-period-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(143, 18, 48, 0.18);
  border-radius: 999px;
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-pilotage-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-kpi-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
}

.dashboard-kpi-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-kpi-card strong {
  font-size: 24px;
  line-height: 1;
}

.dashboard-kpi-card small {
  color: var(--muted);
  font-size: 11px;
  min-height: 28px;
}

.dashboard-kpi-card.is-danger strong,
.dashboard-kpi-card.is-danger small {
  color: var(--danger);
}

.dashboard-kpi-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.dashboard-kpi-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-burgundy);
  transition: width 220ms ease;
}

.dashboard-kpi-progress.is-warning span {
  background: var(--warning);
}

.dashboard-kpi-card canvas {
  width: 100%;
  height: 32px;
}

.dashboard-pilotage-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 10px;
}

.dashboard-chart-card,
.dashboard-summary-card,
.dashboard-widget-visual-card {
  display: grid;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.dashboard-chart-card {
  min-height: 286px;
  grid-template-rows: auto minmax(0, 1fr);
}

.dashboard-widget-visual-card {
  gap: 8px;
}

.dashboard-chart-card canvas,
.dashboard-widget-visual-card canvas {
  display: block;
  width: 100%;
}

.dashboard-chart-card canvas {
  height: 220px !important;
  min-height: 220px;
  max-height: 220px;
}

.dashboard-widget-visual-card canvas {
  height: 132px !important;
  min-height: 132px;
  max-height: 132px;
}

.dashboard-summary-list,
.dashboard-status-pill-grid,
.dashboard-health-status-grid,
.dashboard-progress-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-summary-item,
.dashboard-health-status-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.dashboard-summary-item strong,
.dashboard-health-status-item strong {
  font-size: 12px;
}

.dashboard-summary-item small,
.dashboard-health-status-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-summary-item em,
.dashboard-health-status-item em {
  justify-self: end;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.dashboard-summary-item em.critical,
.dashboard-health-status-item em.critical {
  color: var(--danger);
}

.dashboard-summary-item em.warning,
.dashboard-health-status-item em.warning {
  color: var(--warning);
}

.dashboard-summary-item em.ok,
.dashboard-health-status-item em.ok {
  color: var(--success);
}

.dashboard-status-pill-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-status-pill {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  text-align: center;
}

.dashboard-status-pill strong {
  display: block;
  font-size: 18px;
}

.dashboard-status-pill span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-progress-bar {
  display: grid;
  gap: 6px;
}

.dashboard-progress-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.dashboard-progress-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.dashboard-progress-bar-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-burgundy);
  transition: width 220ms ease;
}

.dashboard-animate-in {
  animation: dashboardFadeRise 240ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-animate-in {
    animation: none;
  }

  .dashboard-kpi-progress span,
  .dashboard-progress-bar-track span {
    transition: none;
  }
}

@keyframes dashboardFadeRise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-kpi-card:hover,
.dashboard-chart-card:hover,
.dashboard-summary-card:hover,
.dashboard-widget-visual-card:hover {
  border-color: rgba(143, 18, 48, 0.22);
  background: var(--surface-muted);
}

.flat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.flat-table th,
.flat-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.flat-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.status-badge {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
}

.article-cell {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 190px;
}

.location-cell {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 190px;
}

.alert-cell {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 230px;
}

.location-cell > svg {
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid rgba(143, 18, 48, 0.16);
  border-radius: var(--radius-sm);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.alert-cell > svg {
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid rgba(143, 18, 48, 0.16);
  border-radius: var(--radius-sm);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.article-cell strong,
.article-cell small,
.location-cell strong,
.location-cell small,
.alert-cell strong,
.alert-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-cell small,
.location-cell small,
.alert-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.product-thumb {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--brand-burgundy);
  font-size: 13px;
  font-weight: 900;
}

.product-thumb.danger {
  border-color: color-mix(in srgb, var(--danger) 18%, var(--border));
  background: var(--surface-danger);
  color: var(--danger);
}

.product-thumb.warning {
  border-color: color-mix(in srgb, var(--warning) 18%, var(--border));
  background: var(--surface-warning);
  color: var(--warning);
}

.product-thumb.ok {
  border-color: color-mix(in srgb, var(--success) 18%, var(--border));
  background: var(--surface-success);
  color: var(--success);
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.row-action:hover {
  border-color: rgba(143, 18, 48, 0.36);
  color: var(--brand-burgundy);
  background: var(--brand-burgundy-soft);
}

.row-link {
  border: 0;
  background: transparent;
  color: var(--brand-burgundy);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.row-link.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.row-action svg {
  width: 15px;
  height: 15px;
}

.validate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--success) 32%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--surface-success);
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.validate-btn:hover {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

.validate-btn svg,
.save-btn svg {
  width: 15px;
  height: 15px;
}

.stock-action-dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.stock-action-dialog::backdrop {
  background: rgba(23, 26, 31, 0.28);
}

.stock-action-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.stock-action-header,
.stock-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stock-action-header h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.stock-action-header span,
.stock-action-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.stock-action-context {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-size: 13px;
}

.stock-action-context strong {
  color: var(--brand-burgundy);
}

.user-create-dialog {
  width: min(760px, calc(100vw - 28px));
}

.user-create-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-burgundy);
}

.user-create-header-actions > svg {
  width: 18px;
  height: 18px;
}

.user-create-intro {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(143, 18, 48, 0.18);
  border-radius: var(--radius-md);
  background: var(--brand-burgundy-soft);
}

.user-create-intro svg {
  width: 18px;
  height: 18px;
  color: var(--brand-burgundy);
}

.user-create-intro > svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.user-create-intro strong,
.user-create-intro span {
  display: block;
}

.user-create-intro span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.user-rights-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.user-rights-fieldset legend,
.module-permissions-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.module-permissions-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.module-permissions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-permissions-toolbar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.module-permissions-toolbar .ghost-btn {
  min-height: 30px;
  padding: 0 9px;
}

.module-permission-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.module-permission-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.module-permission-tabs button.active {
  border-color: rgba(143, 18, 48, 0.16);
  background: var(--surface);
  color: var(--brand-burgundy);
}

.module-permission-tabs svg,
.module-access-row svg {
  width: 15px;
  height: 15px;
}

.module-permission-panel[hidden] {
  display: none !important;
}

.module-access-list {
  display: grid;
  gap: 8px;
}

.module-access-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(330px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.module-access-row.is-invalid {
  border-color: var(--danger);
  background: var(--surface-danger);
}

.module-access-row > div:first-child {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
}

.module-access-row > div:first-child span {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.module-access-row svg {
  color: var(--brand-burgundy);
}

.module-access-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.module-access-segmented button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.module-access-segmented button.active {
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.module-summary {
  color: var(--brand-burgundy);
  font-weight: 800;
}

.user-rights-fieldset label,
.user-active-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.user-rights-fieldset label:hover,
.user-active-toggle:hover {
  border-color: rgba(143, 18, 48, 0.28);
  background: var(--surface-subtle);
}

.user-rights-fieldset label span,
.user-active-toggle span {
  min-width: 0;
}

.user-rights-fieldset input,
.user-active-toggle input {
  accent-color: var(--brand-burgundy);
}

.stock-action-form label {
  display: grid;
  gap: 7px;
}

.stock-action-form .user-rights-fieldset label,
.stock-action-form .user-active-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stock-action-form input,
.stock-action-form select,
.stock-action-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

.stock-action-form .user-rights-fieldset input[type="checkbox"],
.stock-action-form .user-active-toggle input[type="checkbox"] {
  appearance: none;
  display: grid;
  place-items: center;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
}

.stock-action-form .user-rights-fieldset input[type="checkbox"]::after,
.stock-action-form .user-active-toggle input[type="checkbox"]::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: transparent;
}

.stock-action-form .user-rights-fieldset input[type="checkbox"]:checked,
.stock-action-form .user-active-toggle input[type="checkbox"]:checked {
  border-color: var(--brand-burgundy);
  background: var(--brand-burgundy);
}

.stock-action-form .user-rights-fieldset input[type="checkbox"]:checked::after,
.stock-action-form .user-active-toggle input[type="checkbox"]:checked::after {
  background: #fff;
}

.stock-action-form textarea {
  padding-block: 10px;
  resize: vertical;
}

.stock-action-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 18%, var(--border));
  border-radius: var(--radius-md);
  background: var(--surface-danger);
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
}

.stock-action-footer {
  justify-content: flex-end;
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 90;
  display: grid;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(23, 26, 31, 0.08);
  border-left: 3px solid var(--brand-burgundy);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 18px 38px rgba(23, 26, 31, 0.14);
  pointer-events: auto;
  animation: toastIn 180ms ease-out;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.toast-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.toast-copy strong {
  font-size: 13px;
  line-height: 1.15;
}

.toast-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}

.toast-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.app-toast.error {
  border-left-color: var(--danger);
}

.app-toast.error .toast-icon {
  background: #fff0f1;
  color: var(--danger);
}

.app-toast.success {
  border-left-color: var(--success);
}

.app-toast.success .toast-icon {
  background: #edf8f2;
  color: var(--success);
}

.app-toast.warning {
  border-left-color: var(--warning);
}

.app-toast.warning .toast-icon {
  background: #fff4e8;
  color: var(--warning);
}

.app-toast.info {
  border-left-color: var(--info);
}

.app-toast.info .toast-icon {
  background: #edf5ff;
  color: var(--info);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.status-badge.critical,
.summary-tile.danger {
  background: #fff0f1;
  color: var(--danger);
}

.status-badge.low,
.summary-tile.warning {
  background: #fff4e8;
  color: var(--warning);
}

.status-badge.ok,
.summary-tile.neutral {
  background: #edf8f2;
  color: var(--success);
}

.status-badge.neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.status-badge.urgent-30 {
  border: 1px solid rgba(143, 18, 48, 0.22);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.status-badge.location-type {
  min-width: 70px;
  border: 1px solid rgba(143, 18, 48, 0.16);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.status-badge.alert-type {
  min-width: 94px;
  border: 1px solid rgba(143, 18, 48, 0.16);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.summary-tile.info {
  background: #edf5ff;
  color: var(--info);
}

.alert-list,
.mobile-alert-list {
  display: grid;
  gap: 8px;
}

.alert-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.alert-row svg {
  width: 18px;
  height: 18px;
}

.alert-row.danger svg {
  color: var(--danger);
}

.alert-row.warning svg {
  color: var(--warning);
}

.alert-row.info svg {
  color: var(--info);
}

.alert-row span {
  color: var(--muted);
  font-size: 12px;
}

.alert-row.danger strong {
  color: var(--danger);
}

.alert-row.warning strong {
  color: var(--warning);
}

.alert-row.info strong {
  color: var(--info);
}

.desktop-quick-scan h2,
.desktop-quick-scan p {
  margin: 0;
}

.desktop-quick-scan p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.scan-field-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.camera-scan-btn {
  display: grid;
  place-items: center;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-burgundy);
  color: #fff;
  font-weight: 800;
}

.camera-scan-btn svg {
  width: 18px;
  height: 18px;
}

.desktop-scan-controls,
.scan-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.qty-stepper,
.quantity-control {
  display: grid;
  grid-template-columns: 38px 34px minmax(42px, 1fr) 34px 40px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.qty-stepper button,
.qty-stepper input,
.quantity-control button,
.quantity-control input {
  border: 0;
  background: transparent;
  text-align: center;
}

.qty-stepper button,
.quantity-control button {
  height: 100%;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.qty-stepper button:nth-of-type(2),
.quantity-control button:nth-of-type(2) {
  font-size: 18px;
}

.qty-stepper button:nth-of-type(3),
.quantity-control button:nth-of-type(3) {
  border-left: 1px solid var(--border);
  font-size: 18px;
}

.qty-stepper button:last-child,
.quantity-control button:last-child {
  border-right: 0;
}

.qty-stepper input,
.quantity-control input {
  min-width: 0;
  height: 100%;
  font-weight: 800;
}

.form-quantity-control {
  width: 100%;
}

.stock-action-form .form-quantity-control input {
  min-height: 38px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border-radius: var(--radius-sm);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.primary-btn svg,
.ghost-btn svg {
  width: 15px;
  height: 15px;
}

.primary-btn {
  border: 1px solid var(--brand-burgundy);
  background: var(--brand-burgundy);
  color: #fff;
}

.primary-btn.success {
  border-color: var(--success);
  background: var(--success);
}

.ghost-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #2f3540;
}

.ghost-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.page-heading {
  display: grid;
  gap: 4px;
  margin: 18px 0 14px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-heading h1 {
  font-size: 24px;
  font-weight: 850;
}

.stock-supervision-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 160px 148px auto auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.filter-toolbar input,
.filter-toolbar select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.stock-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.catalog-panel {
  margin-top: 14px;
  padding: 14px;
}

.catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.catalog-heading h2,
.catalog-heading p {
  margin: 0;
}

.catalog-heading h2 {
  font-size: 16px;
}

.catalog-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-toolbar {
  margin-bottom: 12px;
}

.catalog-toolbar input {
  width: min(100%, 420px);
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.catalog-table td:last-child {
  white-space: nowrap;
}

.view.stock-workspace.active-view {
  display: grid;
  gap: 14px;
}

.stock-subview-panel {
  display: none;
  gap: 12px;
}

.stock-subview-panel.active {
  display: grid;
}

.stock-subview-panel .page-heading {
  margin-bottom: 0;
}

.stock-orders-panel,
.stock-thresholds-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.stock-order-table th:first-child,
.stock-order-table td:first-child {
  width: 34px;
  text-align: center;
}

.stock-order-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-burgundy);
}

.stock-order-dialog {
  width: min(760px, calc(100vw - 28px));
}

.recovery-pdf-dialog {
  width: min(1040px, calc(100vw - 24px));
}

.recovery-pdf-form {
  gap: 14px;
}

.recovery-pdf-preview {
  position: relative;
  min-height: min(68vh, 720px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  overflow: hidden;
}

.recovery-pdf-preview iframe {
  width: 100%;
  height: min(68vh, 720px);
  border: 0;
  background: var(--surface);
}

.recovery-pdf-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.recovery-pdf-empty i,
.recovery-pdf-empty svg {
  width: 32px;
  height: 32px;
  color: var(--brand-burgundy);
}

.recovery-pdf-empty strong {
  color: var(--text);
}

.inventory-export-primary {
  border-color: color-mix(in srgb, var(--brand-burgundy) 28%, var(--border));
  background: color-mix(in srgb, var(--brand-burgundy) 8%, var(--surface));
}

.inventory-export-dialog {
  width: min(1120px, calc(100vw - 24px));
}

.inventory-export-dialog[open] {
  animation: inventoryExportDialogIn 0.18s ease-out;
}

.inventory-export-form {
  gap: 16px;
}

.inventory-export-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.inventory-export-summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.inventory-export-summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.inventory-export-summary-card strong {
  color: var(--text);
  font-size: 0.98rem;
}

.inventory-export-preview {
  position: relative;
  min-height: min(70vh, 760px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 88%, white) 0%, var(--surface-muted) 100%);
  overflow: hidden;
}

.inventory-export-preview iframe {
  width: 100%;
  height: min(70vh, 760px);
  border: 0;
  background: var(--surface);
}

.inventory-export-preview-empty,
.inventory-export-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
}

.inventory-export-preview-empty {
  color: var(--muted);
}

.inventory-export-preview-empty i,
.inventory-export-preview-empty svg {
  width: 32px;
  height: 32px;
  color: var(--brand-burgundy);
}

.inventory-export-preview-empty strong,
.inventory-export-loading strong {
  color: var(--text);
}

.inventory-export-loading {
  background:
    linear-gradient(135deg, rgba(143, 18, 48, 0.04), rgba(143, 18, 48, 0.01)),
    var(--surface);
  color: var(--muted);
}

.inventory-export-loading-bar {
  width: min(280px, 72%);
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-burgundy) 10%, var(--surface-muted));
  position: relative;
  overflow: hidden;
}

.inventory-export-loading-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 44%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-burgundy), color-mix(in srgb, var(--brand-burgundy) 45%, white));
  animation: inventoryExportLoading 1.15s ease-in-out infinite;
}

@keyframes inventoryExportLoading {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(240%); }
}

@keyframes inventoryExportDialogIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stock-order-recipient,
.stock-order-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.stock-order-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.stock-order-recipient svg {
  color: var(--brand-burgundy);
}

.stock-order-recipient span,
.stock-order-summary .muted-text {
  color: var(--muted);
  font-size: 12px;
}

.stock-order-recipient strong {
  display: block;
}

.stock-order-summary {
  max-height: 260px;
  overflow: auto;
  padding: 8px;
}

.stock-presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stock-presence-list span {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-pagination button {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.table-pagination button.active {
  border-color: var(--brand-burgundy);
  background: var(--brand-burgundy);
  color: #fff;
}

.simple-view .flat-panel {
  max-width: 980px;
  margin: 40px auto;
  padding: 28px;
}

.simple-view p {
  color: var(--muted);
}

.workspace-page {
  gap: 14px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.workspace-main,
.workspace-side,
.options-workspace,
.users-workspace {
  padding: 18px;
}

.workspace-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.side-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.side-section-heading strong {
  font-size: 14px;
}

.side-section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stacked-form {
  display: grid;
  gap: 10px;
}

.stacked-form label {
  display: grid;
  gap: 6px;
}

.stacked-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stacked-form input,
.stacked-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.stacked-form textarea {
  padding-block: 10px;
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.recovery-detail-view {
  display: grid;
  gap: 14px;
}

.recovery-detail-view[hidden] {
  display: none !important;
}

.recovery-documents-view {
  display: grid;
  gap: 14px;
}

.recovery-documents-view[hidden] {
  display: none !important;
}

.recovery-documents-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.recovery-documents-toolbar {
  margin-bottom: 0;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.mobile-workspace-cards {
  display: none;
}

.mobile-workspace-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.movement-table-scroll {
  border-radius: var(--radius-md);
}

.recovery-documents-table {
  min-width: 1080px;
}

.recovery-calendar-view {
  display: grid;
  gap: 14px;
}

.recovery-calendar-view[hidden] {
  display: none !important;
}

.recovery-calendar-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.recovery-calendar-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recovery-calendar-summary article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.recovery-calendar-summary span,
.calendar-deadline-small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recovery-calendar-summary strong {
  color: var(--brand-burgundy);
  font-size: 24px;
}

.deadline-alert-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.deadline-alert-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.deadline-alert-card > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--brand-burgundy);
}

.deadline-alert-card strong,
.deadline-alert-card small {
  display: block;
}

.deadline-alert-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.deadline-alert-card.critical {
  border-color: rgba(143, 18, 48, 0.36);
  background: var(--surface-danger);
}

.deadline-alert-card.urgent-30 {
  border-color: rgba(143, 18, 48, 0.28);
  background: linear-gradient(0deg, var(--brand-burgundy-soft), var(--surface));
  box-shadow: inset 3px 0 0 var(--brand-burgundy);
}

.recovery-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
}

.recovery-calendar-month,
.google-calendar-panel,
.recovery-calendar-list-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.recovery-calendar-month-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.recovery-calendar-month-head > strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  text-transform: capitalize;
}

.recovery-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 6px;
  overflow-x: auto;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 98px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.calendar-day.today {
  border-color: rgba(143, 18, 48, 0.34);
  box-shadow: inset 0 0 0 1px rgba(143, 18, 48, 0.18);
}

.calendar-day.muted {
  border-color: transparent;
  background: transparent;
}

.calendar-day strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.calendar-event {
  display: block;
  width: 100%;
  min-height: 22px;
  margin-top: 4px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.calendar-event.overdue,
.calendar-event.week {
  border-color: rgba(143, 18, 48, 0.32);
  color: var(--danger);
}

.calendar-event.month {
  border-color: rgba(143, 18, 48, 0.24);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.google-calendar-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.google-calendar-panel header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.google-calendar-panel header svg {
  color: var(--brand-burgundy);
}

.google-calendar-panel h2,
.recovery-calendar-list-panel h2 {
  margin: 0;
  font-size: 16px;
}

.google-calendar-panel p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.google-calendar-actions {
  display: grid;
  gap: 8px;
}

.google-calendar-events {
  display: grid;
  gap: 8px;
}

.google-calendar-events div,
.google-calendar-events p {
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.google-calendar-events span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.recovery-calendar-table {
  min-width: 980px;
}

.calendar-deadline-cell {
  display: grid;
  align-items: start;
  gap: 6px;
  min-width: 132px;
}

.calendar-deadline-cell strong {
  display: block;
  line-height: 1.15;
  white-space: nowrap;
}

.calendar-deadline-pill {
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

.calendar-deadline-pill.critical {
  border-color: rgba(143, 18, 48, 0.28);
  background: var(--danger-soft);
  color: var(--danger);
}

.calendar-deadline-pill.urgent-30 {
  border-color: rgba(143, 18, 48, 0.24);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.calendar-deadline-pill.ok {
  border-color: rgba(30, 126, 82, 0.2);
  background: var(--success-soft);
  color: var(--success);
}

.document-status-cell {
  display: grid;
  gap: 5px;
  min-width: 120px;
}

.document-status-cell small {
  color: var(--muted);
  font-size: 11px;
}

.row-action-cluster {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: max-content;
}

.empty-table-state {
  display: block;
  padding: 18px 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.recovery-detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.recovery-detail-hero h1 {
  margin: 3px 0;
  font-size: 24px;
}

.recovery-detail-hero p,
.recovery-detail-hero span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recovery-detail-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.recovery-detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.recovery-detail-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.recovery-detail-card h2 {
  margin: 0;
  font-size: 16px;
}

.recovery-document-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.recovery-document-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.recovery-document-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.recovery-detail-wide {
  grid-column: 1 / -1;
}

.detail-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-form-grid label,
.recovery-detail-wide {
  min-width: 0;
}

.detail-form-grid label {
  display: grid;
  gap: 6px;
}

.detail-form-grid span,
.recovery-detail-card label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-form-grid input,
.detail-form-grid select,
.recovery-detail-card textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.recovery-detail-card textarea {
  padding-block: 11px;
  resize: vertical;
}

.recovery-events {
  display: grid;
  gap: 10px;
}

.recovery-event {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.recovery-event span {
  color: var(--brand-burgundy);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.recovery-event strong {
  font-size: 13px;
}

.recovery-event small,
.recovery-events p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.workspace-toolbar input,
.workspace-toolbar select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.workspace-toolbar input {
  min-width: min(100%, 320px);
}

/* Signature commune des menus métier */
@media (min-width: 768px) {
  #dashboard.active-view,
  #users.option-section.active,
  .view.workspace-page.active-view,
  .view.stock-workspace.active-view,
  #options.options-workspace.active-view {
    width: min(var(--content-max), calc(100vw - 32px));
    margin-inline: auto;
  }

  #dashboard.active-view {
    padding-bottom: 40px;
  }

  .view.workspace-page.active-view,
  .view.stock-workspace.active-view,
  #options.options-workspace.active-view {
    padding: 18px 0 40px;
  }
}

.page-heading,
.dashboard-command-bar,
.option-section > header,
.option-panel-header,
.recovery-documents-panel > header,
.recovery-calendar-panel > header,
.recovery-detail-hero,
.inventory-header {
  position: relative;
  padding: 0 0 13px;
  border-bottom: 1px solid var(--border);
}

.page-heading,
.option-section > header,
.option-panel-header,
.recovery-documents-panel > header,
.recovery-calendar-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  margin: 0 0 14px;
}

.module-heading-title {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.page-heading::before,
.dashboard-command-bar::before,
.option-section > header::before,
.option-panel-header::before,
.recovery-documents-panel > header::before,
.recovery-calendar-panel > header::before,
.inventory-header::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-burgundy);
}

.page-heading h1,
.dashboard-command-bar h1,
.option-section > header h1,
.option-panel-header h1,
.recovery-documents-panel > header h1,
.recovery-calendar-panel > header h1,
.inventory-header h1 {
  color: var(--text);
  font-size: 21px;
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: 0;
}

.page-heading h1,
.page-heading p,
.dashboard-command-bar h1,
.dashboard-command-bar p,
.option-panel-header h1,
.option-panel-header p {
  margin: 0;
}

.page-heading p,
.dashboard-command-bar p,
.option-section > header p,
.option-panel-header p,
.recovery-documents-panel > header p,
.recovery-calendar-panel > header p,
.inventory-header p {
  max-width: 680px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.flat-panel {
  color: var(--text);
}

.workspace-main,
.workspace-side,
.inventory-operation-panel,
.inventory-validation-panel,
.recovery-documents-panel,
.recovery-calendar-panel,
.stock-supervision-panel,
.stock-orders-panel,
.stock-thresholds-panel,
.catalog-panel,
.option-section,
.settings-card {
  padding: 14px;
}

.module-heading-title > svg,
.page-heading > svg,
.option-panel-header svg,
.option-section > header > svg,
.recovery-documents-panel > header > svg,
.recovery-calendar-panel > header > svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid rgba(143, 18, 48, 0.18);
  border-radius: var(--radius-sm);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.page-heading > div,
.module-heading-title > div,
.option-panel-header > div,
.option-section > header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workspace-toolbar,
.filter-toolbar,
.depot-toolbar,
.alerts-toolbar,
.security-toolbar,
.recovery-documents-toolbar,
.recovery-calendar-toolbar {
  min-height: 58px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--surface) 18%);
}

.workspace-toolbar input,
.workspace-toolbar select,
.filter-toolbar input,
.filter-toolbar select,
.catalog-toolbar input,
.option-section input,
.option-section select,
.option-section textarea {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.workspace-toolbar input::placeholder,
.filter-toolbar input::placeholder,
.catalog-toolbar input::placeholder,
.option-section input::placeholder,
.option-section textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.flat-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.flat-table thead,
.flat-table tr:first-child:has(th) {
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--surface) 18%);
}

.flat-table th {
  height: 38px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.flat-table td {
  height: 44px;
  color: var(--text);
}

.flat-table tbody tr,
.flat-table tr:not(:first-child) {
  transition: background-color 0.16s ease, color 0.16s ease;
}

.flat-table tbody tr:hover,
.flat-table tr:not(:first-child):hover {
  background: color-mix(in srgb, var(--brand-burgundy-soft) 42%, var(--surface) 58%);
}

.summary-tile,
.metric-card,
.role-template-card,
.security-status-row,
.smtp-summary-card,
.deadline-alert-card,
.calendar-summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
}

.status-badge,
.type-badge,
.priority-badge,
.module-summary-pill,
.pill {
  border-radius: var(--radius-sm);
  font-weight: 800;
  letter-spacing: 0;
}

.row-action,
.icon-button,
.ghost-btn,
.primary-btn,
.save-btn,
.validate-btn,
.quiet-command,
.session-logout-btn {
  border-radius: var(--radius-sm);
  letter-spacing: 0;
}

.row-action {
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.row-action:disabled,
.ghost-btn:disabled,
.primary-btn:disabled,
.save-btn:disabled,
.validate-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.subbar,
.options-horizontal-nav,
.user-horizontal-nav,
.stock-subnav,
.recovery-subnav,
.inventory-subnav {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.subbar button,
.options-horizontal-nav button,
.user-horizontal-nav button,
.stock-subnav button,
.recovery-subnav button,
.inventory-subnav button {
  min-height: 36px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
}

.user-accounts-panel {
  display: grid;
  gap: 14px;
  overflow-x: auto;
}

.depot-management-panel {
  display: grid;
  gap: 14px;
  overflow: visible;
}

.alerts-management-panel {
  display: grid;
  gap: 14px;
  overflow: visible;
}

.security-management-panel {
  display: grid;
  gap: 14px;
  overflow: visible;
}

.smtp-management-panel {
  display: grid;
  gap: 14px;
  overflow: visible;
}

.barcode-scanner-dialog {
  width: min(520px, calc(100vw - 24px));
}

.barcode-scanner-form {
  gap: 14px;
}

.unknown-scan-dialog {
  width: min(540px, calc(100vw - 24px));
}

.unknown-scan-form {
  gap: 12px;
}

.unknown-scan-code {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(143, 18, 48, 0.18);
  border-radius: var(--radius-md);
  background: var(--brand-burgundy-soft);
}

.unknown-scan-code span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.unknown-scan-code strong {
  color: var(--brand-burgundy);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.barcode-video-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.barcode-video-frame video {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  background: #111418;
}

.barcode-video-frame::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(143, 18, 48, 0.72);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 999px rgba(17, 20, 24, 0.28);
  pointer-events: none;
}

.barcode-video-empty {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.barcode-video-empty svg {
  width: 36px;
  height: 36px;
  color: var(--brand-burgundy);
}

.barcode-video-empty strong {
  color: var(--text);
}

.barcode-video-frame.is-running .barcode-video-empty {
  display: none;
}

.security-restricted-panel {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(143, 18, 48, 0.18);
  border-radius: var(--radius-md);
  background: var(--brand-burgundy-soft);
}

.security-restricted-panel svg {
  color: var(--brand-burgundy);
}

.security-restricted-panel strong,
.security-restricted-panel span {
  display: block;
}

.security-restricted-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.security-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.smtp-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.security-summary-grid article,
.smtp-summary-grid article {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.security-summary-grid span,
.smtp-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.security-summary-grid strong,
.smtp-summary-grid strong {
  font-size: 18px;
}

.security-summary-grid small,
.smtp-summary-grid small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.security-summary-grid small svg,
.smtp-summary-grid small svg {
  width: 14px;
  height: 14px;
  color: var(--brand-burgundy);
}

.security-summary-grid em,
.smtp-summary-grid em {
  justify-self: start;
  font-style: normal;
}

.smtp-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 12px;
}

.smtp-config-card,
.smtp-template-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.smtp-config-card h2,
.smtp-template-panel h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}

.smtp-config-card h2 svg,
.smtp-template-panel h2 svg {
  width: 17px;
  height: 17px;
  color: var(--brand-burgundy);
}

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

.smtp-security-grid {
  grid-template-columns: minmax(0, 1fr);
}

.smtp-certificate-toggle {
  align-self: end;
  min-height: 34px;
  padding: 7px 9px;
  border-color: rgba(143, 18, 48, 0.14);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font-size: 12px;
}

.smtp-certificate-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand-burgundy);
  flex: 0 0 auto;
}

.smtp-test-btn {
  justify-self: start;
  min-height: 36px;
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--surface);
}

.mail-template-table {
  min-width: 900px;
}

.mail-template-table-scroll {
  overflow-x: auto;
}

.mail-template-table th:last-child,
.mail-template-table td:last-child {
  width: 130px;
  text-align: right;
  white-space: nowrap;
}

.mail-template-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mail-template-cell svg {
  width: 16px;
  height: 16px;
  color: var(--brand-burgundy);
}

.mail-template-cell strong,
.mail-template-cell small {
  display: block;
}

.mail-template-cell small {
  color: var(--muted);
  font-size: 11px;
}

.mail-template-variable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mail-template-variable-list span {
  padding: 5px 8px;
  border: 1px solid rgba(143, 18, 48, 0.18);
  border-radius: var(--radius-sm);
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
  font-size: 11px;
  font-weight: 800;
}

.mail-template-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.mail-template-preview p {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.security-toolbar {
  margin-bottom: 0;
}

.security-toolbar .ghost-btn {
  min-height: 36px;
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--surface);
}

.security-toolbar .ghost-btn:disabled,
.security-toolbar .ghost-btn.disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.security-audit-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.security-audit-filters label {
  display: grid;
  gap: 6px;
}

.security-audit-filters span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.security-audit-filters input,
.security-audit-filters select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.depot-toolbar {
  margin-bottom: 0;
}

.alerts-toolbar {
  margin-bottom: 0;
}

.location-table {
  min-width: 920px;
}

.alerts-table {
  min-width: 980px;
}

.security-audit-table {
  min-width: 980px;
}

.location-table-scroll {
  overflow-x: auto;
}

.alerts-table-scroll {
  overflow-x: auto;
}

.security-table-scroll {
  overflow-x: auto;
}

.location-table th:last-child,
.location-table td:last-child {
  width: 88px;
  text-align: right;
  white-space: nowrap;
}

.alerts-table th:last-child,
.alerts-table td:last-child {
  width: 88px;
  text-align: right;
  white-space: nowrap;
}

.security-audit-table th:last-child,
.security-audit-table td:last-child {
  width: 110px;
  text-align: right;
  white-space: nowrap;
}

.security-control-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.security-control-cell svg {
  width: 16px;
  height: 16px;
  color: var(--brand-burgundy);
}

.security-module-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-account-overview {
  display: grid;
  gap: 12px;
}

.user-account-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.user-account-summary article {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.user-account-summary article {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.user-account-summary span,
.user-accounts-table td {
  color: var(--muted);
  font-size: 12px;
}

.user-account-summary strong {
  color: var(--brand-burgundy);
  font-size: 22px;
}

.user-accounts-table {
  min-width: 760px;
}

.user-accounts-table th:last-child,
.user-accounts-table td:last-child {
  width: 58px;
  text-align: right;
}

.inventory-detail {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.inventory-detail[hidden] {
  display: none;
}

.inventory-panel {
  display: grid;
  gap: 14px;
}

.inventory-panel[hidden] {
  display: none !important;
}

.inventory-operation-panel,
.inventory-validation-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.inventory-summary-strip,
.inventory-validation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.inventory-summary-strip article,
.inventory-validation-summary article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.inventory-summary-strip span,
.inventory-validation-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.inventory-summary-strip strong,
.inventory-validation-summary strong {
  color: var(--brand-burgundy);
  font-size: 20px;
}

.inventory-counting-grid {
  align-items: start;
}

.inventory-validation-comment {
  display: grid;
  gap: 7px;
}

.inventory-validation-comment span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.inventory-validation-comment textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
}

.inventory-validation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inventory-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.inventory-detail-heading h2,
.inventory-detail-heading p {
  margin: 0;
}

.inventory-detail-heading h2 {
  margin-top: 3px;
  font-size: 17px;
}

.inventory-detail-heading p,
.inventory-detail-heading span,
.muted-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inventory-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inventory-count-input {
  width: 86px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

.inventory-print-document {
  color: var(--text);
}

@media print {
  .app-topbar,
  .module-subbar,
  .mobile-bottom-nav,
  .toast-stack,
  .dashboard-widget-editbar,
  .stock-action-dialog {
    display: none !important;
  }

  body {
    background: #fff;
  }
}

.mini-stat-list,
.settings-list,
.role-grid {
  display: grid;
  gap: 10px;
}

.role-template-list {
  display: grid;
  gap: 10px;
}

.role-template-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.role-template-card div,
.role-template-card p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.role-template-card span,
.role-template-card p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-name-field {
  display: grid;
  gap: 6px;
}

.role-management-heading {
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--surface-subtle);
}

.role-create-btn {
  min-height: 34px;
  padding: 0 10px;
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--surface);
  color: var(--brand-burgundy);
  font-size: 12px;
  font-weight: 850;
}

.role-create-btn svg {
  width: 15px;
  height: 15px;
}

.mini-stat,
.setting-row,
.role-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.mini-stat strong,
.setting-row strong,
.role-card strong {
  color: var(--text);
}

.mini-stat span,
.setting-row span,
.role-card span {
  color: var(--muted);
  font-size: 12px;
}

.options-workspace {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  padding: 18px;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
  background: var(--bg);
  color: var(--text);
}

.auth-shell,
.login-shell {
  width: min(420px, 100%);
}

.auth-panel,
.login-panel {
  display: grid;
  gap: 28px;
  width: 100%;
  padding: 32px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-burgundy);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-sizing: border-box;
}

.auth-brand {
  display: grid;
  justify-items: center;
}

.login-logo {
  display: grid;
  place-items: center;
  width: 180px;
  min-height: 48px;
}

.login-logo img {
  display: block;
  width: 174px;
  height: auto;
  object-fit: contain;
}

.auth-view,
.auth-heading,
.login-copy,
.auth-form,
.login-form {
  display: grid;
  gap: 8px;
}

.auth-view {
  gap: 24px;
}

.auth-heading {
  text-align: center;
}

.auth-heading h1,
.login-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.2;
}

.auth-heading p,
.login-copy p,
.auth-status,
.login-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-form,
.login-form {
  gap: 16px;
}

.auth-form label,
.login-form label,
.option-form-grid label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.auth-input,
.login-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-input:focus-within,
.login-input:focus-within {
  border-color: var(--brand-burgundy);
  box-shadow: 0 0 0 3px var(--brand-burgundy-soft);
}

.auth-input input,
.login-input input {
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.auth-input input:focus-visible,
.login-input input:focus-visible {
  box-shadow: none;
}

.auth-input button,
.login-input button,
.forgot-password-link {
  border: 0;
  background: transparent;
  color: var(--brand-burgundy);
  font-weight: 700;
  cursor: pointer;
}

.auth-input button,
.login-input button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border-radius: var(--radius-sm);
}

.auth-input button:hover,
.login-input button:hover {
  background: var(--surface-muted);
}

.forgot-password-link {
  justify-self: end;
  padding: 0;
  font-size: 12px;
}

.auth-submit,
.login-submit {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-color: var(--brand-burgundy);
  background: var(--brand-burgundy);
  color: #fff;
}

.auth-submit:hover,
.login-submit:hover {
  border-color: var(--brand-burgundy-strong);
  background: var(--brand-burgundy-strong);
  color: #fff;
}

.auth-submit.is-loading svg {
  animation: auth-spin 900ms linear infinite;
}

.auth-status,
.login-status {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.auth-status[data-tone="error"],
.login-status[data-tone="error"] {
  border-color: color-mix(in srgb, var(--brand-burgundy) 30%, var(--border));
  background: var(--brand-burgundy-soft);
  color: var(--brand-burgundy);
}

.auth-status[data-tone="success"],
.login-status[data-tone="success"] {
  color: var(--success);
}

.auth-back {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.auth-back:hover {
  color: var(--brand-burgundy);
}

.auth-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.auth-success-view {
  justify-items: center;
}

.auth-success-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: var(--success);
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .auth-page {
    align-items: stretch;
    padding: 0;
  }

  .auth-shell,
  .login-shell {
    width: 100%;
  }

  .auth-panel,
  .login-panel {
    min-height: 100vh;
    align-content: center;
    padding: 28px 20px;
    border-width: 3px 0 0;
    border-radius: 0;
  }
}

.options-workspace {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.options-workspace > .settings-card {
  display: none;
}

.options-layout,
.option-section,
.option-row-list,
.option-form-grid {
  display: grid;
  gap: 10px;
}

.option-section {
  display: none;
  padding: 18px;
}

.option-section.active {
  display: grid;
}

.option-section header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.option-section header svg {
  color: var(--brand-burgundy);
}

.option-section h1,
.option-section p {
  margin: 0;
}

.option-section p,
.option-row span,
.options-footer span {
  color: var(--muted);
  font-size: 12px;
}

.option-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-form-grid input,
.option-form-grid select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.option-row,
.option-toggle,
.user-session-card,
.options-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.user-session-card > div,
.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-session-card > div:first-child {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
}

.user-session-card .profile-avatar {
  grid-row: span 2;
}

.user-session-card small {
  color: var(--muted);
}

.option-row {
  align-items: flex-start;
}

.user-management-row {
  border-color: rgba(143, 18, 48, 0.18);
  background: var(--surface-subtle);
}

.user-management-row .primary-btn {
  flex: 0 0 auto;
}

.option-row strong,
.option-row span {
  display: block;
}

.options-footer {
  padding: 10px 12px;
}

@media (max-width: 1320px) {
  .app-topbar {
    grid-template-columns: 148px minmax(0, 1fr) minmax(230px, auto);
  }

  .module-subbar {
    grid-template-columns: 148px minmax(0, 1fr);
  }

  .profile-button > span:last-child {
    display: none;
  }

  .topbar-link {
    gap: 5px;
    padding-inline: 6px;
    font-size: 12px;
  }

  .session-logout-btn span {
    display: none;
  }
}

.mobile-scan-home,
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1200px) {
  .app-topbar {
    grid-template-columns: 168px 1fr;
  }

  .module-subbar {
    position: static;
    grid-template-columns: 168px minmax(0, 1fr);
  }

  .topbar-tools {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
  }

  .dashboard-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .dashboard-watch-panel {
    grid-column: auto;
  }
}

@media (max-width: 1180px) {
  .dashboard-pilotage-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-pilotage-chart-row {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-card {
    min-height: 258px;
  }

  .dashboard-chart-card canvas {
    height: 192px !important;
    min-height: 192px;
    max-height: 192px;
  }
}

@media (max-width: 1500px) {
  .topbar-search {
    display: grid;
    width: 42px;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
    cursor: pointer;
  }

  .topbar-search input,
  .topbar-search kbd {
    display: none;
  }

  .topbar-search:hover::after {
    display: block;
  }

  .profile-button > span:last-child {
    display: none;
  }

  .topbar-brand {
    padding-inline: 12px;
  }

  .topbar-link {
    padding-inline: 6px;
  }
}

@media (max-width: 767px) {
  .dashboard-pilotage-grid {
    display: none;
  }

  .topbar-popover,
  .location-popover {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 24px);
  }

  .app-topbar,
  .options-menu-panel,
  .dashboard-command-bar,
  .dashboard-available-panel,
  .dashboard-grid {
    display: none;
  }

  .module-subbar {
    display: none;
  }

  .module-subbar[data-mobile-visible="true"] {
    position: sticky;
    top: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: auto;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
  }

  .module-subbar[data-mobile-visible="true"] .subbar-context {
    display: none;
  }

  .module-subbar[data-mobile-visible="true"] .subbar-items {
    gap: 8px;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .module-subbar[data-mobile-visible="true"] .subbar-items::-webkit-scrollbar {
    display: none;
  }

  .module-subbar[data-mobile-visible="true"] .subbar-items button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    border-color: rgba(143, 18, 48, 0.12);
    background: #fff;
    white-space: nowrap;
  }

  .app-main {
    padding: 0;
    width: min(100vw, 390px);
    max-width: 390px;
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
  }

  [data-inventory-panel="sessions"] .table-scroll,
  [data-inventory-panel="differences"] .table-scroll,
  [data-recovery-list-view] .table-scroll {
    display: none;
  }

  .mobile-workspace-cards {
    display: grid;
    gap: 12px;
    margin-top: 12px;
  }

  .mobile-workspace-card {
    display: grid;
    gap: 10px;
    padding: 14px;
  }

  .mobile-workspace-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-workspace-card header strong {
    display: block;
    font-size: 15px;
    line-height: 1.3;
  }

  .mobile-workspace-card header span,
  .mobile-workspace-card p,
  .mobile-workspace-card small {
    color: var(--muted);
  }

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

  .mobile-workspace-card dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .mobile-workspace-card dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
  }

  .mobile-workspace-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-workspace-card .row-link {
    padding: 0;
  }

  .mobile-workspace-card .row-action-cluster {
    justify-content: flex-end;
  }

  .mobile-scan-home {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 18px 16px 118px;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }

  .mobile-scan-home > * {
    width: min(100%, 358px);
    max-width: 358px;
    min-width: 0;
  }

  .mobile-home-header,
  .mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-header-actions,
  .mobile-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-edit-toggle {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--brand-burgundy);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-edit-actions {
    width: min(100%, 358px);
    max-width: 358px;
  }

  .mobile-edit-actions[hidden] {
    display: none;
  }

  .mobile-edit-actions .quiet-command {
    flex: 1;
    min-height: 34px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .mobile-brand {
    justify-content: flex-start;
    gap: 10px;
    color: var(--brand-burgundy);
    font-size: 19px;
  }

  .mobile-depot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    overflow: hidden;
  }

  .mobile-scan-panel {
    display: grid;
    gap: 13px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid rgba(143, 18, 48, 0.2);
    border-radius: var(--radius-lg);
    padding: 14px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .mobile-scan-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--brand-burgundy);
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .mobile-scan-title svg {
    width: 30px;
    height: 30px;
    padding: 6px;
    border: 1px solid rgba(143, 18, 48, 0.18);
    border-radius: var(--radius-sm);
    background: var(--brand-burgundy-soft);
  }

  .mobile-scan-panel .scan-field-row {
    grid-template-columns: 22px minmax(0, 1fr) 40px;
    margin-top: 0;
    min-height: 48px;
    padding: 0 6px 0 12px;
    border-color: rgba(143, 18, 48, 0.22);
    background: var(--surface-muted);
    color: var(--muted);
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mobile-scan-panel .scan-field-row > svg {
    display: block;
    width: 18px;
    height: 18px;
    color: var(--brand-burgundy);
  }

  .mobile-scan-panel .scan-field-row input {
    height: 100%;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
  }

  .mobile-scan-panel .camera-scan-btn {
    width: 36px;
    height: 36px;
    border-color: var(--brand-burgundy);
    background: var(--brand-burgundy);
    color: #fff;
  }

  .mobile-scan-panel label > span:first-child {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-scan-panel .qty-stepper,
  .mobile-scan-panel .quantity-control {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
  }

  .scan-meta-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-meta-grid label {
    min-width: 0;
    max-width: 100%;
  }

  .scan-meta-grid label:last-child {
    display: none;
  }

  .scan-meta-grid select {
    min-height: 40px;
    color: var(--text);
  }

  .mobile-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
  }

  .mobile-action-grid .primary-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .mobile-action-grid .primary-btn.success {
    border-color: var(--success);
    background: var(--success);
  }

  .mobile-action-grid .primary-btn:not(.success) {
    border-color: rgba(143, 18, 48, 0.18);
    background: var(--surface);
    color: var(--brand-burgundy);
  }

  .mobile-widget-list {
    display: grid;
    gap: 12px;
    min-width: 0;
  }

  .mobile-widget-card,
  .mobile-alert-list {
    padding: 14px;
    min-width: 0;
    overflow: hidden;
  }

  .mobile-widget-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }

  .mobile-widget-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .mobile-widget-title strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-transform: uppercase;
  }

  .mobile-widget-title svg,
  .mini-stat svg {
    color: var(--brand-burgundy);
  }

  .mobile-reorder-controls {
    display: flex;
    gap: 6px;
  }

  .mobile-reorder-controls button {
    width: 30px;
    height: 30px;
  }

  .mobile-alert-list .panel-title-row button {
    display: none;
  }

  .mobile-alert-list .alert-row {
    min-width: 0;
  }

  .mobile-alert-list .alert-row strong,
  .mobile-alert-list .alert-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    transform: none;
    min-height: 72px;
    width: auto;
    max-width: none;
    padding: 4px 8px 6px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-nav button {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    min-height: 58px;
    border-radius: var(--radius-md);
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-bottom-nav button svg {
    width: 20px;
    height: 20px;
  }

  .mobile-bottom-nav button span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav button.active {
    color: var(--brand-burgundy);
  }

  .mobile-bottom-nav .mobile-scan-fab {
    align-self: start;
    justify-self: center;
    width: 54px;
    height: 54px;
    margin-top: -14px;
    border-radius: 999px;
    background: var(--brand-burgundy);
    color: #fff;
    box-shadow: 0 12px 26px rgba(143, 18, 48, 0.26);
  }

  .mobile-bottom-nav .mobile-scan-fab svg {
    width: 22px;
    height: 22px;
  }

  .mobile-options-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(23, 26, 31, 0.22);
  }

  .mobile-options-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 86px;
    z-index: 46;
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }

  .mobile-options-sheet header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .mobile-options-sheet header > div {
    display: grid;
    gap: 2px;
  }

  .mobile-options-sheet header strong {
    color: var(--brand-burgundy);
    font-size: 16px;
  }

  .sheet-close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--muted);
  }

  .mobile-options-list {
    padding-top: 0;
  }

  .global-search-panel {
    top: 12px;
    left: 10px;
    right: 10px;
    width: auto;
    z-index: 48;
  }

  #stock.view.active-view,
  #movements.view.active-view,
  #inventory.view.active-view,
  #recoveries.view.active-view,
  #users.option-section.active,
  .simple-view.view.active-view,
  .view.workspace-page.active-view {
    display: block;
    padding: 16px 12px 118px;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }

  #options.options-workspace.active-view {
    padding: 16px 12px 132px;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  #options .option-section,
  #options .flat-panel,
  #options .options-footer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stock-supervision-summary,
  .filter-toolbar,
  .workspace-grid,
  .user-account-summary,
  .options-workspace,
  .recovery-detail-form,
  .detail-form-grid,
  .user-rights-fieldset {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .option-panel-header,
  .option-section > header {
    gap: 12px;
    margin-bottom: 12px;
  }

  .page-heading h1,
  .option-panel-header h1,
  .option-section > header h1 {
    font-size: 22px;
    line-height: 1.12;
  }

  .summary-tile {
    min-height: 70px;
    padding: 13px;
  }

  .filter-toolbar,
  .workspace-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .filter-toolbar input,
  .filter-toolbar select,
  .workspace-toolbar input,
  .workspace-toolbar select,
  .filter-toolbar button,
  .workspace-toolbar button {
    width: 100%;
    min-width: 0;
  }

  #users .workspace-toolbar .primary-btn span {
    display: none;
  }

  .filter-toolbar .switch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    justify-items: end;
    width: 100%;
    white-space: normal;
  }

  .filter-toolbar .switch-row input {
    order: 2;
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
  }

  .table-scroll,
  .movement-table-scroll,
  .location-table-scroll,
  .alerts-table-scroll,
  .security-table-scroll,
  .mail-template-table-scroll,
  .stock-supervision-panel,
  .catalog-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .table-scroll::-webkit-scrollbar,
  .stock-supervision-panel::-webkit-scrollbar,
  .catalog-panel::-webkit-scrollbar {
    height: 5px;
  }

  .flat-table {
    min-width: 720px;
  }

  .movement-workspace .workspace-grid {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }

  .movement-workspace .workspace-main,
  .movement-workspace .workspace-side {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .movement-workspace .workspace-toolbar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .module-permissions-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-permission-tabs {
    width: 100%;
  }

  .module-permission-tabs button {
    flex: 1;
    justify-content: center;
  }

  .module-access-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .module-access-segmented {
    width: 100%;
  }

  .role-template-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .recovery-detail-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .recovery-detail-actions {
    justify-content: stretch;
  }

  .recovery-document-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .recovery-document-card-actions {
    justify-content: flex-start;
  }

  .recovery-calendar-summary,
  .deadline-alert-strip,
  .recovery-calendar-layout,
  .inventory-summary-strip,
  .inventory-validation-summary {
    grid-template-columns: 1fr;
  }

  .recovery-calendar-month-head {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .recovery-calendar-month-head [data-recovery-calendar-today] {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .recovery-calendar-grid {
    grid-template-columns: repeat(7, minmax(82px, 1fr));
  }

  .recovery-pdf-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .inventory-export-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .recovery-pdf-preview,
  .recovery-pdf-preview iframe {
    height: 64vh;
    min-height: 64vh;
  }

  .inventory-export-summary {
    grid-template-columns: 1fr;
  }

  .inventory-export-preview,
  .inventory-export-preview iframe {
    height: 64vh;
    min-height: 64vh;
  }

  .inventory-validation-actions {
    justify-content: stretch;
  }

  .inventory-validation-actions button {
    flex: 1 1 100%;
  }

  .stock-supervision-panel {
    overflow-x: auto;
  }

  .catalog-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-panel {
    overflow-x: auto;
  }

  .user-accounts-panel {
    gap: 12px;
  }

  .user-accounts-table {
    min-width: 720px;
  }

  .depot-management-panel {
    gap: 12px;
  }

  .alerts-management-panel {
    gap: 12px;
  }

  .security-management-panel {
    gap: 12px;
  }

  .security-audit-filters {
    grid-template-columns: 1fr;
  }

  .smtp-management-panel {
    gap: 12px;
  }

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

  .smtp-summary-grid,
  .smtp-config-grid,
  .smtp-form-grid {
    grid-template-columns: 1fr;
  }

  .smtp-test-btn {
    width: 100%;
    justify-content: center;
  }

  .depot-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .alerts-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .security-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .depot-toolbar input,
  .depot-toolbar select,
  .depot-toolbar button {
    width: 100%;
  }

  .alerts-toolbar input,
  .alerts-toolbar select,
  .alerts-toolbar button {
    width: 100%;
  }

  .security-toolbar button {
    width: 100%;
  }

  .security-toolbar .ghost-btn {
    justify-content: center;
    min-width: 0;
    padding-inline: 10px;
  }

  .security-toolbar .ghost-btn span {
    display: none;
  }

  .location-table {
    min-width: 840px;
  }

  .alerts-table {
    min-width: 900px;
  }

  .security-audit-table {
    min-width: 820px;
  }

  .mail-template-table {
    min-width: 820px;
  }

  .mail-template-table .row-action {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 560px) {
  .security-summary-grid,
  .smtp-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.smtp-option-section .smtp-security-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
}

.smtp-option-section .smtp-certificate-toggle {
  grid-column: 1 / -1;
  justify-content: flex-start;
  width: max-content;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 8px;
  color: var(--muted);
}

.smtp-option-section .smtp-certificate-toggle input {
  width: 13px;
  height: 13px;
  margin: 0;
}

@media (max-width: 767px) {
  .smtp-option-section .smtp-security-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.appearance-management-panel {
  display: grid;
  gap: 14px;
}

.appearance-choice-row,
.theme-preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.appearance-choice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.appearance-choice-row strong,
.appearance-choice-row span {
  display: block;
}

.appearance-choice-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.theme-segmented-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.theme-segmented-control button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.theme-segmented-control button.active {
  background: var(--surface);
  color: var(--brand-burgundy);
  border: 1px solid rgba(143, 18, 48, 0.16);
}

.theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.theme-preview-card {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 12px;
}

.theme-preview-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.theme-preview-card small {
  color: var(--muted);
}

.theme-preview-card.dark-preview {
  background: #191d23;
  border-color: #303743;
  color: #f4f6f8;
}

.theme-preview-card.dark-preview span,
.theme-preview-card.dark-preview small {
  color: #a8b0bd;
}

[data-theme="dark"] .topbar-search:hover::after,
[data-theme="dark"] .global-search-panel,
[data-theme="dark"] .mobile-options-sheet,
[data-theme="dark"] dialog,
[data-theme="dark"] .stock-action-form {
  background: var(--surface-elevated);
  color: var(--text);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .global-search-box,
[data-theme="dark"] .scan-field-row,
[data-theme="dark"] .qty-stepper,
[data-theme="dark"] .quantity-control,
[data-theme="dark"] .topbar-search,
[data-theme="dark"] .depot-select-pill,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .session-logout-btn,
[data-theme="dark"] .row-action {
  background: var(--surface-elevated);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #7f8997;
}

[data-theme="dark"] .flat-table tr:hover,
[data-theme="dark"] .stock-table-footer,
[data-theme="dark"] .mobile-bottom-nav,
[data-theme="dark"] .module-subbar,
[data-theme="dark"] .options-footer {
  background: var(--surface);
}

[data-theme="dark"] .flat-table th,
[data-theme="dark"] .flat-table td {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .status-badge.critical,
[data-theme="dark"] .danger-text {
  color: #ff8992;
}

[data-theme="dark"] .status-badge.low,
[data-theme="dark"] .warning-text {
  color: #ffc27c;
}

[data-theme="dark"] .status-badge.ok {
  background: rgba(72, 199, 135, 0.12);
  color: #72dca4;
}

[data-theme="dark"] .status-badge.location-type,
[data-theme="dark"] .status-badge.alert-type,
[data-theme="dark"] .status-badge.urgent-30,
[data-theme="dark"] .role-template-card,
[data-theme="dark"] .module-access-row,
[data-theme="dark"] .security-restricted-panel {
  background: var(--surface-elevated);
}

[data-theme="dark"] .deadline-alert-card.critical {
  background: rgba(255, 137, 146, 0.1);
}

[data-theme="dark"] .deadline-alert-card.urgent-30 {
  background: var(--surface-elevated);
  border-color: rgba(212, 74, 107, 0.32);
}

[data-theme="dark"] .calendar-day,
[data-theme="dark"] .recovery-calendar-month,
[data-theme="dark"] .google-calendar-panel,
[data-theme="dark"] .recovery-calendar-list-panel {
  background: var(--surface-elevated);
}

[data-theme="dark"] .calendar-event {
  background: var(--surface);
}

[data-theme="dark"] .product-thumb,
[data-theme="dark"] .location-cell > svg,
[data-theme="dark"] .alert-cell > svg {
  background: var(--brand-burgundy-soft);
  border-color: rgba(212, 74, 107, 0.22);
}

[data-theme="dark"] .app-brand-logo img {
  filter: brightness(1.06) contrast(1.03);
}

@media (max-width: 767px) {
  .appearance-choice-row,
  .theme-preview-grid {
    grid-template-columns: 1fr;
  }

  .appearance-choice-row {
    align-items: stretch;
    flex-direction: column;
  }

  .appearance-option-section .options-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .appearance-option-section .options-footer .primary-btn {
    width: 100%;
    justify-content: center;
  }

  .theme-segmented-control {
    width: 100%;
  }

  .theme-segmented-control button {
    flex: 1;
    justify-content: center;
  }
}
