/* BirDesk enterprise UI foundation.
   Geometry only: colors, layout ownership and business-state behavior stay in
   their existing component/theme styles. */
:root {
  /* Controls */
  --ui-control-height: 40px;
  --ui-control-height-sm: 36px;
  --ui-table-action-size: 28px;
  --ui-control-height-lg: 44px;
  --ui-button-height: 40px;
  --ui-icon-button-size: 40px;

  /* Data tables */
  --ui-table-row-height: 46px;
  --ui-table-header-height: 42px;

  /* 4px spacing grid */
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-8: 32px;
  --ui-space-10: 40px;
  --ui-space-12: 48px;

  /* Typography */
  --ui-font-xs: 12px;
  --ui-font-sm: 13px;
  --ui-font-base: 14px;
  --ui-font-md: 16px;
  --ui-font-lg: 18px;
  --ui-font-page-title: 22px;
  --ui-font-kpi: 26px;
  --ui-line-xs: 16px;
  --ui-line-sm: 18px;
  --ui-line-base: 20px;
  --ui-line-md: 22px;
  --ui-line-lg: 24px;
  --ui-line-page-title: 28px;
  --ui-line-kpi: 32px;

  /* Application shell */
  --ui-sidebar-width: 216px;
  --ui-sidebar-width-collapsed: 64px;
  --ui-sidebar-item-height: 42px;
  --ui-topbar-height: 56px;
  --ui-card-padding: 16px;
  --ui-badge-height: 26px;

  /* Shape and page rhythm */
  --ui-radius-control: 6px;
  --ui-radius-panel: 8px;
  --ui-page-padding-x: 24px;
  --ui-page-padding-y: 20px;

  /* Backward-compatible bridge for existing shared components. */
  --entry-control-height: var(--ui-control-height);
}

html[data-theme="standard"] {
  --radius-control: var(--ui-radius-control);
  --radius-card: var(--ui-radius-panel);
}

/* Shared typography hierarchy */
html[data-theme="standard"] #erpApp .topbar h2 {
  font-size: var(--ui-font-page-title);
  font-weight: 600;
  line-height: var(--ui-line-page-title);
}

html[data-theme="standard"] body {
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] :where(
  .section-head h3,
  .settings-section-head h3,
  .developer-tool-section-head h3,
  .cashbox-section-head h3,
  .operation-section h4,
  .operation-summary h4,
  .entry-form-panel > h4
) {
  font-size: var(--ui-font-md);
  line-height: var(--ui-line-md);
}

/* Application shell rhythm. The standard skin keeps its existing colors and
   states; only shared dimensions and semantic text roles are normalized. */
html[data-theme="standard"] .app {
  grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
}

html[data-theme="standard"] .app.sidebar-collapsed {
  grid-template-columns: var(--ui-sidebar-width-collapsed) minmax(0, 1fr);
}

html[data-theme="standard"] .nav {
  gap: var(--ui-space-1);
  padding: var(--ui-space-2);
}

html[data-theme="standard"] .nav button {
  min-height: var(--ui-sidebar-item-height);
  margin-bottom: 0;
  gap: var(--ui-space-2);
  padding: 0 var(--ui-space-3);
  font-size: var(--ui-font-base);
  font-weight: 500;
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] .nav-submenu button {
  min-height: var(--ui-control-height-sm);
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .nav .ico {
  width: 20px;
  min-width: 20px;
  height: 20px;
  flex-basis: 20px;
}

html[data-theme="standard"] .nav .ico svg {
  width: 18px;
  height: 18px;
}

html[data-theme="standard"] .side-title {
  min-height: var(--ui-control-height-sm);
  padding-inline: var(--ui-space-4);
  font-size: var(--ui-font-xs);
  line-height: var(--ui-line-xs);
}

html[data-theme="standard"] .sidebar-profile {
  min-height: 64px;
  padding: var(--ui-space-2) var(--ui-space-3);
}

html[data-theme="standard"] .profile-avatar {
  width: 36px;
  min-width: 36px;
  height: 36px;
  font-size: var(--ui-font-xs);
}

html[data-theme="standard"] .profile-summary span {
  font-size: var(--ui-font-xs);
  line-height: var(--ui-line-xs);
}

html[data-theme="standard"] .profile-summary strong {
  font-size: var(--ui-font-sm);
  font-weight: 600;
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .topbar {
  flex: 0 0 var(--ui-topbar-height);
  height: var(--ui-topbar-height);
  min-height: var(--ui-topbar-height);
  padding: 0 var(--ui-space-4);
  gap: var(--ui-space-4);
}

html[data-theme="standard"] .topbar-title {
  column-gap: var(--ui-space-3);
}

html[data-theme="standard"] .topbar-tools {
  height: var(--ui-icon-button-size);
  min-height: var(--ui-icon-button-size);
  margin-top: 0;
  gap: var(--ui-space-2);
}

html[data-theme="standard"] .topbar-global-search {
  flex-basis: var(--ui-icon-button-size);
  width: var(--ui-icon-button-size);
  min-width: var(--ui-icon-button-size);
  height: var(--ui-icon-button-size);
}

html[data-theme="standard"] .topbar-global-search input {
  height: var(--ui-control-height-sm);
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] .topbar-clock {
  flex-basis: 152px;
  width: 152px;
  gap: var(--ui-space-2);
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .topbar-clock strong {
  font-size: var(--ui-font-base);
  font-weight: 600;
  line-height: var(--ui-line-base);
}

/* Canonical form controls. Checkbox/radio/range/file controls retain their
   native, purpose-specific geometry. */
html[data-theme="standard"] :where(
  .content,
  .modal,
  .info-drawer-inner,
  .notification-panel,
  .mail-compose-modal,
  .developer-tools-content
) :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]),
  select,
  .fake-input,
  .searchable-select-input,
  .searchable-trigger,
  .mail-multi-trigger
) {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding-block: 0;
  padding-inline: var(--ui-space-3);
  border-radius: var(--ui-radius-control);
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

/* Legacy modules historically set the same controls with selectors such as
   `.module-filter-field input` and `.modal.entry-mode input`.  Keep the
   canonical rule semantic and explicit enough to win that cascade without
   resorting to forced-priority declarations. */
html[data-theme="standard"] .module-filter-field input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="standard"] .module-filter-field select,
html[data-theme="standard"] .operation-form input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="standard"] .operation-form select,
html[data-theme="standard"] .settings-field input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="standard"] .settings-field select,
html[data-theme="standard"] .customer-entry-sections input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="standard"] .customer-entry-sections select,
html[data-theme="standard"] .modal.entry-mode input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="standard"] .modal.entry-mode select,
html[data-theme="standard"] .modal.entry-mode .searchable-select-input,
html[data-theme="standard"] .cashbox-form-grid input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="standard"] .cashbox-form-grid select,
html[data-theme="standard"] .report-filter-fields input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="standard"] .report-filter-fields select,
html[data-theme="standard"] .mail-compose-body input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="standard"] .mail-compose-body select,
html[data-theme="standard"] .mail-compose-body .mail-multi-trigger {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding-block: 0;
  padding-inline: var(--ui-space-3);
  border-radius: var(--ui-radius-control);
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] :where(
  .content,
  .modal,
  .info-drawer-inner,
  .notification-panel,
  .mail-compose-modal,
  .developer-tools-content
) textarea {
  min-height: 88px;
  padding: var(--ui-space-2) var(--ui-space-3);
  border-radius: var(--ui-radius-control);
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] .btn,
html[data-theme="standard"] .workspace-toolbar .btn.add-record,
html[data-theme="standard"] .settings-save.btn,
html[data-theme="standard"] .settings-edit.btn,
html[data-theme="standard"] .settings-cancel-edit.btn,
html[data-theme="standard"] .operation-modal-footer .btn,
html[data-theme="standard"] .modal .footer .btn,
html[data-theme="standard"] .server-pagination button,
html[data-theme="standard"] .module-filter-clear {
  height: var(--ui-button-height);
  min-height: var(--ui-button-height);
  padding-block: 0;
  padding-inline: var(--ui-space-3);
  border-radius: var(--ui-radius-control);
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

/* Shared vertical form rhythm. Integrated/floating labels keep their existing
   positioning; this only normalizes readable type and group spacing. */
html[data-theme="standard"] :where(
  .form-grid,
  .operation-field-grid,
  .entry-panel-grid,
  .settings-fields,
  .customer-entry-grid,
  .report-filter-fields,
  .cashbox-filter-fields
) {
  gap: var(--ui-space-3) var(--ui-space-4);
}

html[data-theme="standard"] :where(
  .form-grid > label,
  .operation-form label,
  .entry-panel-grid > label,
  .settings-field,
  .customer-entry-sections label,
  .module-filter-field,
  .report-filters label,
  .cashbox-report-filters label,
  .mail-compose-body label
) {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] :where(
  .operation-section + .operation-section,
  .entry-form-panel + .entry-form-panel,
  .settings-section + .settings-section
) {
  margin-top: var(--ui-space-6);
}

/* Button system */
html[data-theme="standard"] :where(
  .btn,
  .module-filter-clear,
  .server-pagination button,
  .pagination button,
  .field-add-button,
  .operation-add-line,
  .identity-scan-trigger,
  .identity-scan-file-button,
  .account-create-button,
  .mail-compose-trigger,
  .notification-panel-actions button,
  .notification-item footer button
) {
  height: var(--ui-button-height);
  min-height: var(--ui-button-height);
  padding-block: 0;
  padding-inline: var(--ui-space-3);
  border-radius: var(--ui-radius-control);
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] :where(
  .icon-btn,
  button.table-action,
  .operation-edit-line,
  .operation-remove-line,
  .mail-reader-back
) {
  width: var(--ui-control-height-sm);
  min-width: var(--ui-control-height-sm);
  height: var(--ui-control-height-sm);
  min-height: var(--ui-control-height-sm);
  padding: 0;
  border-radius: var(--ui-radius-control);
}

html[data-theme="standard"] :where(
  .topbar-global-search-toggle,
  .notification-toggle,
  .standard-sidebar-toggle
) {
  width: var(--ui-icon-button-size);
  min-width: var(--ui-icon-button-size);
  height: var(--ui-icon-button-size);
  min-height: var(--ui-icon-button-size);
}

html[data-theme="standard"] .topbar-global-search-toggle svg,
html[data-theme="standard"] .notification-toggle svg,
html[data-theme="standard"] .standard-sidebar-toggle svg {
  width: 19px;
  height: 19px;
}

/* Repeated table actions stay inside the shared 92/116px action columns. */
html[data-theme="standard"] .mini-actions .icon-btn,
html[data-theme="standard"] .account-row-actions .icon-btn {
  width: var(--ui-table-action-size);
  min-width: var(--ui-table-action-size);
  height: var(--ui-table-action-size);
  min-height: var(--ui-table-action-size);
  padding: 0;
}

html[data-theme="standard"] .mini-actions {
  gap: 1px;
  overflow: hidden;
}

/* Other compact tools retain the shared 36px small-control target. */
html[data-theme="standard"] button.table-action,
html[data-theme="standard"] .identity-scan-trigger {
  width: var(--ui-control-height-sm);
  min-width: var(--ui-control-height-sm);
  height: var(--ui-control-height-sm);
  min-height: var(--ui-control-height-sm);
  padding: 0;
}

/* Tabs share one baseline, while horizontal overflow remains owned by the
   existing responsive architecture. */
html[data-theme="standard"] :where(
  .cashbox-tabs,
  .module-tabs,
  .settings-tabs,
  .customer-tabs,
  .developer-tools-nav
) {
  min-height: var(--ui-control-height);
  gap: var(--ui-space-1);
}

html[data-theme="standard"] :where(
  .cashbox-tabs > button,
  .module-tabs > button,
  .settings-tabs > button,
  .customer-tabs > button,
  .developer-tools-nav > button
) {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding: 0 var(--ui-space-3);
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

/* Filter bars use the same controls and a consistent 4px-grid rhythm. Query,
   URL state and pagination behavior remain untouched. */
html[data-theme="standard"] :where(
  .module-filters,
  .cashbox-report-filters,
  .report-filters
) {
  gap: var(--ui-space-2) var(--ui-space-3);
  padding: var(--ui-space-2) var(--ui-space-3);
}

html[data-theme="standard"] .module-filter-field {
  min-height: var(--ui-control-height);
}

html[data-theme="standard"] .module-filter-meta {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .workspace-toolbar {
  min-height: var(--ui-space-12);
  height: var(--ui-space-12);
  padding-inline: var(--ui-space-3);
  gap: var(--ui-space-2);
}

html[data-theme="standard"] .workspace-toolbar .search {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
}

html[data-theme="standard"] .workspace-toolbar .btn.add-record {
  line-height: var(--ui-line-base);
}

/* Cards, summaries and supporting copy follow one hierarchy. */
html[data-theme="standard"] .card > :not(.section-head),
html[data-theme="standard"] .report-card,
html[data-theme="standard"] .info-card,
html[data-theme="standard"] .detail-card,
html[data-theme="standard"] .permission-card,
html[data-theme="standard"] .developer-tool-card {
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] .kpi,
html[data-theme="standard"] .developer-kpi-grid > div,
html[data-theme="standard"] .business-notification-metric {
  padding: var(--ui-card-padding);
}

html[data-theme="standard"] .section-head h3,
html[data-theme="standard"] .settings-section-head h3,
html[data-theme="standard"] .cashbox-section-head h3,
html[data-theme="standard"] .developer-tool-section-head h3,
html[data-theme="standard"] .entry-form-panel > h4,
html[data-theme="standard"] .customer-section-heading h4,
html[data-theme="standard"] .credit-detail-section h4 {
  font-size: var(--ui-font-md);
  font-weight: 600;
  line-height: var(--ui-line-md);
}

html[data-theme="standard"] .section-head span,
html[data-theme="standard"] .settings-section-head p,
html[data-theme="standard"] .developer-tool-section-head p,
html[data-theme="standard"] .entry-form-intro span,
html[data-theme="standard"] .entry-form-intro small,
html[data-theme="standard"] .field-hint,
html[data-theme="standard"] .form-hint,
html[data-theme="standard"] .customer-legacy-name small,
html[data-theme="standard"] .account-balances-summary span,
html[data-theme="standard"] .account-balances-summary small,
html[data-theme="standard"] .server-pagination span,
html[data-theme="standard"] .server-infinite-scroll .server-list-error {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .kpi .label,
html[data-theme="standard"] .developer-kpi-grid small,
html[data-theme="standard"] .cashbox-balance-grid small {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .kpi strong,
html[data-theme="standard"] .developer-kpi-grid strong {
  font-size: var(--ui-font-kpi);
  line-height: var(--ui-line-kpi);
  font-weight: 700;
}

html[data-theme="standard"] #erpApp #dashboard .dashboard-panel > .section-head {
  flex-basis: var(--ui-table-header-height);
  min-height: var(--ui-table-header-height);
  padding-inline: var(--ui-space-3);
}

html[data-theme="standard"] #erpApp #dashboard .dashboard-panel > .section-head h3 {
  font-size: var(--ui-font-md);
  font-weight: 600;
  line-height: var(--ui-line-md);
}

html[data-theme="standard"] #erpApp #dashboard .dashboard-panel > .section-head span,
html[data-theme="standard"] #erpApp #dashboard .dashboard-metric-list span {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] #erpApp #dashboard .dashboard-metric-list > div {
  min-height: 60px;
  padding: var(--ui-space-2) var(--ui-space-3);
}

html[data-theme="standard"] #erpApp #dashboard .dashboard-metric-list strong {
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
}

html[data-theme="standard"] .badge,
html[data-theme="standard"] .status-badge,
html[data-theme="standard"] .status {
  min-height: var(--ui-badge-height);
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ui-font-xs);
  font-weight: 600;
  line-height: var(--ui-line-xs);
}

/* Information drawers and modal content use the same readable roles as pages. */
html[data-theme="standard"] #erpApp .modal > .section-head h3,
html[data-theme="standard"] #erpApp .operation-editor-head h3,
html[data-theme="standard"] #erpApp .info-drawer-head h3,
html[data-theme="standard"] .identity-scan-dialog > header h3,
html[data-theme="standard"] .mail-compose-modal > header h3 {
  font-size: var(--ui-font-lg);
  font-weight: 600;
  line-height: var(--ui-line-lg);
}

html[data-theme="standard"] .modal > .section-head span,
html[data-theme="standard"] .info-drawer-head span,
html[data-theme="standard"] .identity-scan-dialog > header small,
html[data-theme="standard"] .mail-compose-modal > header span {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .modal .body,
html[data-theme="standard"] .info-drawer-body,
html[data-theme="standard"] .system-dialog-body,
html[data-theme="standard"] .notification-list {
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] .modal.entry-mode label,
html[data-theme="standard"] .cashbox-field-group > label,
html[data-theme="standard"] .account-create-bar label,
html[data-theme="standard"] .form-check-field span {
  font-size: var(--ui-font-sm);
  font-weight: 500;
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .drawer-field {
  min-height: var(--ui-control-height);
  padding-block: var(--ui-space-2);
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .drawer-value {
  font-size: var(--ui-font-base);
  line-height: var(--ui-line-base);
}

html[data-theme="standard"] .credit-summary-grid span,
html[data-theme="standard"] .company-info-summary span,
html[data-theme="standard"] .company-info-fields span,
html[data-theme="standard"] .company-section-title span,
html[data-theme="standard"] .company-module-option small,
html[data-theme="standard"] .identity-scan-result-row small {
  font-size: var(--ui-font-xs);
  line-height: var(--ui-line-xs);
}

html[data-theme="standard"] .credit-summary-grid strong,
html[data-theme="standard"] .company-info-summary strong,
html[data-theme="standard"] .company-info-fields strong,
html[data-theme="standard"] .company-module-option strong,
html[data-theme="standard"] .company-data-boundary strong,
html[data-theme="standard"] .company-data-boundary span,
html[data-theme="standard"] .company-package-select span,
html[data-theme="standard"] .platform-announcement strong,
html[data-theme="standard"] .platform-announcement span,
html[data-theme="standard"] .developer-tool-note {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .company-info-section > h4,
html[data-theme="standard"] .developer-subtitle {
  font-size: var(--ui-font-md);
  font-weight: 600;
  line-height: var(--ui-line-md);
}

html[data-theme="standard"] .company-module-chips span,
html[data-theme="standard"] .developer-tool-mode {
  min-height: 24px;
  padding-inline: var(--ui-space-2);
  font-size: var(--ui-font-xs);
  line-height: var(--ui-line-xs);
}

html[data-theme="standard"] .identity-scan-warning,
html[data-theme="standard"] .identity-scan-status,
html[data-theme="standard"] .identity-scan-file-button {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

/* Notification and mail metadata remain tertiary, while informational copy is
   no longer rendered at 9–11px. */
html[data-theme="standard"] .notification-panel-head h3 {
  font-size: var(--ui-font-md);
  line-height: var(--ui-line-md);
}

html[data-theme="standard"] .notification-panel-head span,
html[data-theme="standard"] .notification-item-head strong,
html[data-theme="standard"] .notification-item p,
html[data-theme="standard"] .notification-empty,
html[data-theme="standard"] .notification-panel-actions button,
html[data-theme="standard"] .notification-item footer button {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .notification-item-head span,
html[data-theme="standard"] .notification-item-meta span,
html[data-theme="standard"] .notification-item time,
html[data-theme="standard"] .mail-row-meta time,
html[data-theme="standard"] .mail-row-content small,
html[data-theme="standard"] .mail-reader-head p span,
html[data-theme="standard"] .mail-reader-head small,
html[data-theme="standard"] .mail-recipient-option small,
html[data-theme="standard"] .mail-delivery.is-detailed,
html[data-theme="standard"] .mail-delivery.is-detailed span {
  font-size: var(--ui-font-xs);
  line-height: var(--ui-line-xs);
}

html[data-theme="standard"] .mail-folder,
html[data-theme="standard"] .mail-row-meta strong,
html[data-theme="standard"] .mail-row-content b,
html[data-theme="standard"] .mail-compose-body label,
html[data-theme="standard"] .mail-recipient-option strong,
html[data-theme="standard"] .mail-recipient-all span,
html[data-theme="standard"] .mail-group-toggle,
html[data-theme="standard"] .mail-person-group > header strong {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .business-notification-list header span,
html[data-theme="standard"] .business-notification-row small,
html[data-theme="standard"] .business-notification-row time,
html[data-theme="standard"] .business-notification-detail > header span,
html[data-theme="standard"] .business-notification-metric span,
html[data-theme="standard"] .business-notification-metric small,
html[data-theme="standard"] .business-notification-section header span {
  font-size: var(--ui-font-xs);
  line-height: var(--ui-line-xs);
}

html[data-theme="standard"] .business-notification-list nav button,
html[data-theme="standard"] .business-notification-row strong,
html[data-theme="standard"] .business-notification-detail p,
html[data-theme="standard"] .business-notification-section h4 {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

html[data-theme="standard"] .business-notification-table th,
html[data-theme="standard"] .business-notification-table td,
html[data-theme="standard"] .credit-detail-table th,
html[data-theme="standard"] .credit-detail-table td {
  height: var(--ui-table-row-height);
  padding-inline: var(--ui-space-2);
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-base);
}

/* Canonical enterprise table density. Width calculation, sticky positioning,
   resizing and scroll containers are deliberately not changed here. */
html[data-theme="standard"] :where(
  .data-table,
  .table-fixed-head,
  .table-body-scroll table,
  .table-fixed-foot,
  .operation-item-table,
  .settings-list-table,
  .cashbox-report-table,
  .account-balance-table,
  .audit-table
) thead tr,
html[data-theme="standard"] .erp-table-shell > .table-fixed-head tr {
  height: var(--ui-table-header-height);
}

html[data-theme="standard"] .data-table thead tr,
html[data-theme="standard"] .table-fixed-head thead tr,
html[data-theme="standard"] .operation-item-table thead tr,
html[data-theme="standard"] .settings-list-table thead tr,
html[data-theme="standard"] .cashbox-report-table thead tr,
html[data-theme="standard"] .account-balance-table thead tr,
html[data-theme="standard"] .audit-table thead tr {
  height: var(--ui-table-header-height);
}

html[data-theme="standard"] :where(
  .data-table,
  .table-body-scroll table,
  .operation-item-table,
  .settings-list-table,
  .cashbox-report-table,
  .account-balance-table,
  .audit-table
) tbody tr {
  height: var(--ui-table-row-height);
}

html[data-theme="standard"] .data-table tbody tr,
html[data-theme="standard"] .operation-item-table tbody tr,
html[data-theme="standard"] .settings-list-table tbody tr,
html[data-theme="standard"] .cashbox-report-table tbody tr,
html[data-theme="standard"] .account-balance-table tbody tr,
html[data-theme="standard"] .audit-table tbody tr {
  height: var(--ui-table-row-height);
}

html[data-theme="standard"] :where(
  .data-table,
  .table-fixed-head,
  .table-body-scroll table,
  .table-fixed-foot,
  .operation-item-table,
  .settings-list-table,
  .cashbox-report-table,
  .account-balance-table,
  .audit-table
) :where(th, td) {
  padding-block: 0;
  padding-inline: var(--ui-space-3);
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-base);
  vertical-align: middle;
}

html[data-theme="standard"] :where(
  .data-table,
  .table-fixed-head,
  .operation-item-table,
  .settings-list-table,
  .cashbox-report-table,
  .account-balance-table,
  .audit-table
) th {
  font-size: var(--ui-font-sm);
  line-height: var(--ui-line-sm);
}

/* Inline table editors are the intentional small control variant. */
html[data-theme="standard"] :where(
  .operation-item-table,
  .settings-list-table,
  .account-list-table
) :where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  .searchable-select-input,
  .searchable-trigger
) {
  height: var(--ui-control-height-sm);
  min-height: var(--ui-control-height-sm);
  font-size: var(--ui-font-sm);
}

html[data-theme="standard"] :where(.modal .footer, .modal > footer, .operation-modal-footer) {
  gap: var(--ui-space-2);
  padding: var(--ui-space-3) var(--ui-space-4);
}

/* System confirmation dialogs intentionally remain compact, but their action
   controls use the shared normal button size. */
html[data-theme="standard"] .system-dialog-footer .btn {
  height: var(--ui-button-height);
  min-height: var(--ui-button-height);
  font-size: var(--ui-font-base);
}

@media (max-width: 1366px) {
  :root {
    --ui-page-padding-x: 16px;
    --ui-page-padding-y: 16px;
  }

  html[data-theme="standard"] :where(
    .module-filters,
    .cashbox-report-filters,
    .report-filters
  ) {
    gap: var(--ui-space-2);
    padding-inline: var(--ui-space-2);
  }
}

@media (max-width: 760px) {
  :root {
    --ui-page-padding-x: 12px;
    --ui-page-padding-y: 12px;
  }

  html[data-theme="standard"] :where(
    .cashbox-tabs,
    .module-tabs,
    .settings-tabs,
    .customer-tabs,
    .developer-tools-nav
  ) > button {
    flex: 0 0 auto;
  }
}

/* On compact viewports the sidebar is an off-canvas layer, so the application
   grid must expose one full-width track. Keep this selector aligned with the
   standard-theme desktop rule above so source order cannot restore the desktop
   sidebar track after responsive-architecture.css has collapsed it. */
@media (max-width: 900px) {
  html[data-theme="standard"] .app,
  html[data-theme="standard"] .app.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
}
