/*
 * Owner Console — Enterprise visual contract
 * ------------------------------------------
 * Source of truth: the current Enterprise shell and Inventory operational
 * visual contract. This file is intentionally presentation-only and loaded
 * after Owner's legacy identity/usability layers.
 *
 * Do not add product, auth, billing, mapping, or tenant behavior here.
 */

html:root {
  color-scheme: light;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  font-weight: 400;

  --enterprise-bg: #f3f6fb;
  --enterprise-surface: #ffffff;
  --enterprise-surface-muted: #eef3fb;
  --enterprise-border: #d7e1ef;
  --enterprise-border-strong: #b8c7dc;
  --enterprise-text: #0f1728;
  --enterprise-text-muted: #506176;
  --enterprise-primary: #007FFF;
  --enterprise-primary-hover: #006FE6;
  --enterprise-primary-active: #005FCC;
  --enterprise-primary-soft: #EFF6FF;
  --enterprise-success: #0f7b56;
  --enterprise-warning: #b06a00;
  --enterprise-danger: #b42318;
  --enterprise-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 3px 8px rgba(15, 23, 42, 0.025);
  --enterprise-operational-gap: 0.5rem;
  --enterprise-operational-tight-gap: 0.375rem;
  --enterprise-operational-panel-padding: 0.5rem;
  --enterprise-operational-panel-radius: 0.625rem;
  --enterprise-operational-card-radius: 0.5rem;
  --enterprise-operational-control-height: 32px;
  --enterprise-operational-mobile-control-height: 30px;
  --enterprise-operational-title-size: 1.0625rem;
  --enterprise-operational-panel-title-size: 0.8125rem;
  --enterprise-operational-body-size: 0.75rem;
  --enterprise-operational-label-size: 0.6875rem;
  --enterprise-operational-meta-size: 0.625rem;

  /* Bridge legacy Owner tokens to Enterprise. */
  --bg: var(--enterprise-bg);
  --bg-deep: var(--enterprise-bg);
  --panel: var(--enterprise-surface);
  --line: var(--enterprise-border);
  --line-strong: var(--enterprise-border-strong);
  --text: var(--enterprise-text);
  --muted: var(--enterprise-text-muted);
  --blue: var(--enterprise-primary);
  --blue-deep: var(--enterprise-primary-hover);
  --blue-soft: var(--enterprise-primary-soft);
  --blue-tint: rgba(0, 127, 255, 0.12);
  --green: var(--enterprise-success);
  --amber: var(--enterprise-warning);
  --red: var(--enterprise-danger);
}

html,
body,
#root {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100%;
}

body {
  margin: 0 !important;
  overflow-x: hidden;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif !important;
  font-size: 12px;
  color: var(--enterprise-text) !important;
  background:
    radial-gradient(circle at top right, rgba(15, 42, 94, 0.16), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, var(--enterprise-bg) 100%) !important;
}

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(28, 79, 145, 0.35) !important;
  outline-offset: 2px;
}

/* ===== Enterprise shell parity ===== */
#root .platform-shell {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) !important;
  overflow-x: hidden;
  background: transparent;
}

#root .sidebar {
  position: sticky !important;
  top: 0;
  align-self: start;
  width: 232px;
  height: 100vh !important;
  min-height: 100vh !important;
  padding: 0.75rem 0.5rem !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem !important;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0 !important;
  background: var(--enterprise-primary) !important;
  color: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18) !important;
  backdrop-filter: none !important;
}

#root .brand {
  min-height: 38px !important;
  margin: 0 0.25rem 0.25rem;
  padding: 0.25rem 0.375rem !important;
  display: flex;
  align-items: center;
  gap: 0.5rem !important;
}

#root .brand-mark {
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 0.5rem !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 10px !important;
  font-weight: 900;
}

#root .sidebar .brand strong {
  display: block;
  color: #fff !important;
  font-size: 12px !important;
  line-height: 1.1;
  font-weight: 800;
}

#root .sidebar .brand span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 9.5px !important;
  line-height: 1.1;
}

#root .sidebar nav {
  display: grid;
  align-content: start;
  gap: 0.125rem !important;
  margin: 0;
  padding: 0.375rem !important;
}

#root .sidebar .nav-item {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  padding: 0.3125rem 0.625rem !important;
  display: flex;
  align-items: center;
  gap: 0.5rem !important;
  border: 1px solid transparent !important;
  border-radius: 9999px !important;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 0.875rem !important;
  line-height: 1;
  font-weight: 600 !important;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: none !important;
}

#root .sidebar .nav-item:hover,
#root .sidebar .nav-item:focus-visible {
  border-color: rgba(255, 255, 255, 0.10) !important;
  background: rgba(255, 255, 255, 0.10) !important;
  color: #fff !important;
}

#root .sidebar .nav-item.active,
#root .sidebar .nav-item.active:hover {
  border-color: rgba(255, 255, 255, 0.25) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14) !important;
}

#root .sidebar .nav-item svg {
  width: 17px;
  height: 17px;
  min-width: 17px;
  flex: 0 0 17px;
}

#root .sidebar-foot {
  margin-top: auto;
  padding: 0.5rem 0.625rem 0.25rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #fff;
}

#root .sidebar-foot p {
  margin: 0;
  color: #fff !important;
  font-size: 10px;
  font-weight: 800;
}

#root .sidebar-foot span {
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 9.5px;
  line-height: 1.25;
}

#root .content {
  width: 100%;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 1rem 1rem !important;
  overflow-x: hidden;
}

#root .topbar {
  position: sticky !important;
  top: 0;
  z-index: 30;
  min-height: 44px !important;
  margin: 0 -1rem 0.625rem !important;
  padding: 0 1rem !important;
  display: flex;
  align-items: center;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: var(--enterprise-primary) !important;
  color: #fff;
  box-shadow: none !important;
  backdrop-filter: blur(16px) !important;
}

#root .topbar .eyebrow,
#root .topbar p {
  display: none !important;
}

#root .topbar-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center !important;
  justify-content: space-between;
  gap: 0.5rem !important;
}

#root .topbar-row > div:first-child {
  min-width: 0;
}

#root .topbar h1 {
  margin: 0 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff !important;
  font-size: 0.95rem !important;
  line-height: 1.1 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

#root .topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 0.25rem !important;
}

#root .topbar-actions :is(button, a) {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 0.625rem !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 0.6875rem !important;
  line-height: 28px !important;
}

#root .topbar-actions :is(button, a):hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

/* ===== Operational page hierarchy ===== */
#root :is(.page-stack, .workspace, .page-grid, .reader-grid, .detail-stack, .organization-results, .onboarding-form, .onboarding-fields, .onboarding-summary, .summary-stack) {
  min-width: 0;
  gap: var(--enterprise-operational-gap) !important;
}

#root .page-hero {
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 0.5rem 0.75rem !important;
}

#root .page-hero h2,
#root .page-hero-copy h2 {
  margin: 0 !important;
  color: #0f172a;
  font-size: var(--enterprise-operational-title-size) !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
}

#root .page-hero-copy {
  gap: 0 !important;
}

#root .page-hero-copy p {
  margin: 0.1rem 0 0 !important;
  max-width: 74ch;
  color: #64748b !important;
  font-size: var(--enterprise-operational-label-size) !important;
  line-height: 1.25 !important;
  font-weight: 500;
}

#root .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: var(--enterprise-operational-gap) !important;
  margin: 0 0 var(--enterprise-operational-gap) !important;
  min-width: 0;
}

#root :is(.metric-card, .panel) {
  min-width: 0;
  min-height: 0;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  box-shadow: var(--enterprise-shadow) !important;
}

#root .metric-card {
  padding: 0.5rem 0.625rem !important;
  gap: 0.1875rem !important;
  border-radius: var(--enterprise-operational-card-radius) !important;
}

#root .metric-card-icon {
  width: 24px !important;
  height: 24px !important;
  border-radius: 7px !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
}

#root .metric-card-icon svg {
  width: 14px;
  height: 14px;
}

#root .metric-card span {
  color: #64748b !important;
  font-size: var(--enterprise-operational-meta-size) !important;
  line-height: 1.1;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

#root .metric-card strong {
  margin-top: 0.125rem;
  color: #0f172a;
  font-size: 0.9375rem !important;
  line-height: 1.1 !important;
  font-weight: 800;
}

#root .metric-card small {
  color: #64748b !important;
  font-size: var(--enterprise-operational-meta-size) !important;
  line-height: 1.2;
}

#root .panel {
  padding: var(--enterprise-operational-panel-padding) !important;
  border-radius: var(--enterprise-operational-panel-radius) !important;
}

#root .page-grid .panel {
  min-height: 0 !important;
}

#root .panel-head {
  min-width: 0;
  margin: 0 0 0.375rem !important;
  display: flex;
  align-items: center !important;
  justify-content: space-between;
  gap: var(--enterprise-operational-tight-gap) !important;
}

#root .panel h2,
#root .panel-head h2,
#root .panel h3,
#root .wizard-panel h3 {
  margin: 0 !important;
  color: #0f172a;
  font-size: var(--enterprise-operational-panel-title-size) !important;
  line-height: 1.15 !important;
  font-weight: 800;
  letter-spacing: 0 !important;
}

#root .panel-head span,
#root .muted-note {
  color: #64748b !important;
  font-size: var(--enterprise-operational-meta-size) !important;
}

#root :is(.workspace, .page-grid) {
  grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr) !important;
  align-items: start;
}

#root .reader-grid {
  grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr) !important;
  align-items: start;
}

/* ===== Enterprise controls ===== */
#root :is(.primary-button, .secondary-button, .ghost-button, .back-button, .link-button, .filter-pill, .pagination-button, .mini-button, .detail-tab) {
  box-sizing: border-box;
  min-height: var(--enterprise-operational-control-height) !important;
  height: var(--enterprise-operational-control-height);
  padding: 0 0.75rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem !important;
  border: 1px solid var(--enterprise-border-strong) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--enterprise-text) !important;
  box-shadow: none !important;
  font-size: var(--enterprise-operational-body-size) !important;
  line-height: 30px !important;
  font-weight: 750 !important;
  text-decoration: none;
  white-space: nowrap;
  transform: none !important;
}

#root :is(.primary-button, .detail-tab.active, .filter-pill.active, .pagination-button.active) {
  border-color: var(--enterprise-primary) !important;
  background: var(--enterprise-primary) !important;
  color: #fff !important;
}

#root .primary-button:hover {
  border-color: var(--enterprise-primary-hover) !important;
  background: var(--enterprise-primary-hover) !important;
}

#root :is(.secondary-button, .link-button, .mini-button) {
  color: var(--enterprise-primary) !important;
}

#root :is(.secondary-button, .ghost-button, .back-button, .link-button, .filter-pill, .pagination-button, .mini-button, .detail-tab):hover {
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
  color: var(--enterprise-primary) !important;
}

#root :is(.inline-actions, .summary-chip-row, .filter-row, .detail-tabs, .topbar-actions, .modal-actions, .pagination-controls) {
  gap: var(--enterprise-operational-tight-gap) !important;
}

#root .detail-tabs {
  min-width: 0;
  margin: 0;
  padding: 0 0 0.2rem !important;
  display: flex;
  flex-wrap: nowrap !important;
  gap: 0.3rem !important;
  overflow-x: auto;
  scrollbar-width: thin;
}

#root .detail-tab {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 0.65rem !important;
  color: #475569 !important;
  font-size: 0.6875rem !important;
  line-height: 28px !important;
}

#root .detail-tab.active {
  color: #fff !important;
}

/* ===== Compact forms ===== */
#root :is(.form-grid, .module-grid.modal-grid, .product-grid, .quick-links.compact, .organization-card-grid) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--enterprise-operational-gap) !important;
}

#root .wizard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: var(--enterprise-operational-gap) !important;
}

#root :is(.field, .toolbar-field) {
  min-width: 0;
  gap: 0.25rem !important;
}

#root :is(.field span, .toolbar-field span) {
  color: #64748b !important;
  font-size: var(--enterprise-operational-meta-size) !important;
  line-height: 1.1;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

#root :is(.field input, .field select, .toolbar-field input, .toolbar-field select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: var(--enterprise-operational-control-height) !important;
  height: var(--enterprise-operational-control-height);
  padding: 0 0.625rem !important;
  border: 1px solid var(--enterprise-border-strong) !important;
  border-radius: 0.5rem !important;
  background: #fff !important;
  color: var(--enterprise-text) !important;
  box-shadow: none !important;
  font-size: var(--enterprise-operational-body-size) !important;
}

#root textarea {
  height: auto;
  min-height: 64px !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

#root :is(.field input, .field select, .toolbar-field input, .toolbar-field select, input, select, textarea):focus {
  outline: none !important;
  border-color: var(--enterprise-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 127, 255, 0.10) !important;
}

#root .toolbar,
#root .toolbar-row {
  gap: var(--enterprise-operational-tight-gap) !important;
}

#root .toolbar-row {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

/* ===== Tables ===== */
#root .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--enterprise-operational-card-radius) !important;
  background: #fff;
}

#root .data-table {
  width: 100% !important;
  max-width: 100%;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse;
  background: #fff;
  font-size: var(--enterprise-operational-label-size) !important;
}

#root .data-table th,
#root .data-table td {
  min-width: 0;
  width: auto;
  padding: 0.4375rem 0.5rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: #334155;
  font-size: var(--enterprise-operational-label-size) !important;
  line-height: 1.25 !important;
  text-align: left;
  vertical-align: middle;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word;
}

#root .data-table th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: var(--enterprise-operational-meta-size) !important;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

#root .data-table tbody tr:hover {
  background: #fbfdff !important;
}

#root .data-table tbody tr.selected-row {
  background: var(--enterprise-primary-soft) !important;
}

#root .data-table td :is(button, .mini-button, .status-pill) {
  max-width: 100%;
}

/* ===== Status, compact cards, lists ===== */
#root .status-pill {
  padding: 0.2rem 0.45rem !important;
  border-radius: 999px;
  font-size: 0.5625rem !important;
  line-height: 1.2;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

#root :is(.module-card, .product-card, .organization-card, .reader-card, .activity-list li, .dashboard-action-card, .mini-list, .detail-summary, .empty-state, .credentials-panel, .wizard-panel) {
  min-width: 0;
  padding: 0.5rem 0.625rem !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--enterprise-operational-card-radius) !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025) !important;
}

#root :is(.activity-list, .dashboard-action-list, .module-grid, .product-grid, .detail-stack, .reader-card-grid, .organization-card-list) {
  gap: var(--enterprise-operational-tight-gap) !important;
}

#root :is(.module-card, .product-card, .organization-card, .reader-card, .activity-list li, .dashboard-action-card, .mini-list) :is(strong) {
  color: #0f172a;
  font-size: var(--enterprise-operational-label-size) !important;
  line-height: 1.2;
  font-weight: 800;
}

#root :is(.module-card, .product-card, .organization-card, .reader-card, .activity-list li, .dashboard-action-card, .mini-list) :is(span, small, p, em) {
  color: #64748b !important;
  font-size: var(--enterprise-operational-meta-size) !important;
  line-height: 1.25 !important;
}

#root .summary-chip,
#root .reader-card-metrics span {
  padding: 0.2rem 0.45rem !important;
  border-radius: 999px;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
  font-size: var(--enterprise-operational-meta-size) !important;
  font-weight: 800;
}

#root .status-banner {
  margin: 0 0 0.5rem !important;
  padding: 0.5rem !important;
  border-radius: var(--enterprise-operational-panel-radius) !important;
  box-shadow: none;
  font-size: var(--enterprise-operational-label-size) !important;
  line-height: 1.3;
}

#root .empty-state {
  border-style: dashed !important;
}

#root .empty-state-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
}

/* ===== Modal / onboarding ===== */
#root .modal-backdrop {
  padding: 0.75rem !important;
  background: rgba(15, 23, 42, 0.36) !important;
}

#root .modal {
  width: min(1080px, calc(100vw - 1.5rem)) !important;
  max-width: calc(100vw - 1.5rem) !important;
  max-height: 94dvh !important;
  padding: 0.625rem !important;
  overflow-x: hidden;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: var(--enterprise-operational-panel-radius) !important;
  background: #fff !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18) !important;
}

#root .modal-head {
  margin-bottom: 0.5rem !important;
}

#root .modal-actions {
  margin-top: 0.25rem !important;
  padding: 0.5rem 0 max(0.125rem, env(safe-area-inset-bottom)) !important;
  border-top: 1px solid var(--enterprise-border) !important;
  background: rgba(255, 255, 255, 0.97) !important;
}

#root .wizard-panel {
  gap: var(--enterprise-operational-tight-gap) !important;
}

/* ===== Login / activation surfaces ===== */
#root .login-shell,
#root .invite-accept-page {
  padding: 1rem !important;
  background:
    radial-gradient(circle at top right, rgba(15, 42, 94, 0.16), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, var(--enterprise-bg) 100%) !important;
}

#root .login-card,
#root .invite-accept-card {
  width: min(460px, 100%) !important;
  padding: 0.75rem !important;
  gap: 0.625rem !important;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: var(--enterprise-operational-panel-radius) !important;
  background: #fff !important;
  box-shadow: var(--enterprise-shadow) !important;
}

#root .login-card .brand,
#root .invite-accept-card .brand {
  margin: 0;
  padding: 0 !important;
}

#root .login-card .brand-mark,
#root .invite-accept-card .brand-mark {
  background: var(--enterprise-primary) !important;
  color: #fff !important;
}

#root .login-card h1,
#root .invite-accept-card h1 {
  margin: 0 !important;
  color: #0f172a;
  font-size: var(--enterprise-operational-title-size) !important;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#root .login-card p,
#root .invite-accept-card p {
  margin: 0 !important;
  color: #64748b !important;
  font-size: var(--enterprise-operational-label-size) !important;
  line-height: 1.35 !important;
}

/* ===== Static Owner mobile shell styled to Enterprise bottom-nav contract ===== */
.owner-mobile-shell {
  display: none;
}

.owner-mobile-more-backdrop[hidden] {
  display: none !important;
}

@media (max-width: 960px) {
  body.owner-shell-ready .owner-mobile-shell {
    display: block;
  }

  #root .platform-shell {
    display: block;
    grid-template-columns: 1fr !important;
  }

  #root .sidebar {
    display: none !important;
  }

  #root .content {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    padding: 0 0.625rem calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  #root .topbar {
    width: auto;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 -0.625rem 0.5rem !important;
    padding: 0 0.5rem !important;
  }

  #root .topbar h1 {
    font-size: 0.8125rem !important;
  }

  #root .topbar-actions :is(button, a) {
    min-width: 30px;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 0.5rem !important;
  }

  #root :is(.workspace, .page-grid, .reader-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #root .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }

  #root :is(.form-grid, .module-grid.modal-grid, .product-grid, .quick-links.compact, .organization-card-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }

  #root .wizard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }

  #root .toolbar-row,
  #root .reader-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }

  #root .page-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 0.375rem !important;
  }

  #root .panel,
  #root .metric-card,
  #root :is(.module-card, .product-card, .organization-card, .reader-card, .activity-list li, .dashboard-action-card, .mini-list, .detail-summary, .empty-state, .credentials-panel, .wizard-panel) {
    padding: 0.5rem !important;
  }

  #root :is(.primary-button, .secondary-button, .ghost-button, .back-button, .link-button, .filter-pill, .pagination-button, .mini-button, .detail-tab) {
    min-height: var(--enterprise-operational-mobile-control-height) !important;
    height: var(--enterprise-operational-mobile-control-height);
    padding: 0 0.625rem !important;
    font-size: 0.6875rem !important;
    line-height: 28px !important;
  }

  #root :is(.field input, .field select, .toolbar-field input, .toolbar-field select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select) {
    min-height: var(--enterprise-operational-mobile-control-height) !important;
    height: var(--enterprise-operational-mobile-control-height);
    padding: 0 0.5rem !important;
  }

  #root .table-wrap {
    overflow-x: hidden !important;
  }

  #root .data-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 0.6875rem !important;
  }

  #root .data-table th,
  #root .data-table td {
    padding: 0.35rem 0.3rem !important;
    font-size: 0.625rem !important;
    line-height: 1.2 !important;
  }

  .owner-mobile-bottom-nav {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 48;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-rows: 60px;
    gap: 0 !important;
    width: 100%;
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
    border: 0 !important;
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: visible;
  }

  .owner-mobile-bottom-nav::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1;
    height: 2px;
    background: #2563eb;
    pointer-events: none;
  }

  .owner-mobile-bottom-nav .owner-mobile-nav-item {
    position: relative;
    display: flex !important;
    min-width: 0;
    min-height: 0 !important;
    height: auto !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 4px !important;
    margin: 4px !important;
    padding: 0 4px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #64748b !important;
    box-shadow: none !important;
    font-size: 10px !important;
    line-height: 1;
    text-align: center;
    text-decoration: none;
  }

  .owner-mobile-bottom-nav .owner-mobile-nav-item:hover {
    background: #f8fafc !important;
    color: #64748b !important;
  }

  .owner-mobile-bottom-nav .owner-mobile-nav-item.active {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    box-shadow: inset 0 0 0 1px #bfdbfe !important;
  }

  .owner-mobile-bottom-nav .owner-mobile-nav-item svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    flex: 0 0 24px !important;
    stroke-width: 1.7;
  }

  .owner-mobile-bottom-nav .owner-mobile-nav-item span {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: currentColor !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1;
    text-align: center;
  }

  .owner-mobile-bottom-nav .owner-mobile-nav-item.active span {
    color: #1d4ed8 !important;
    font-weight: 900 !important;
  }

  .owner-mobile-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(15, 23, 42, 0.32) !important;
  }

  .owner-mobile-more-sheet {
    width: 100%;
    max-height: min(78dvh, 640px);
    overflow-y: auto;
    padding: 0.625rem 0.625rem calc(0.625rem + env(safe-area-inset-bottom, 0px)) !important;
    border: 1px solid var(--enterprise-border) !important;
    border-bottom: 0 !important;
    border-radius: 0.875rem 0.875rem 0 0 !important;
    background: #fff !important;
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.18) !important;
  }

  .owner-mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .owner-mobile-more-brand strong {
    display: block;
    color: #0f172a;
    font-size: 0.8125rem;
    line-height: 1.1;
  }

  .owner-mobile-more-brand span {
    display: block;
    margin-top: 0.125rem;
    color: #64748b;
    font-size: 0.625rem;
  }

  .owner-mobile-more-close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--enterprise-border);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 18px;
    line-height: 1;
  }

  .owner-mobile-more-grid,
  .owner-mobile-more-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }

  .owner-mobile-more-actions {
    margin-top: 0.5rem;
  }

  .owner-mobile-more-link,
  .owner-mobile-more-action {
    box-sizing: border-box;
    min-height: 36px !important;
    padding: 0.5rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--enterprise-border) !important;
    border-radius: 0.5rem !important;
    background: #fff !important;
    color: #334155 !important;
    box-shadow: none !important;
    font-size: 0.6875rem !important;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
  }

  .owner-mobile-more-link.active,
  .owner-mobile-more-link:hover,
  .owner-mobile-more-action:hover {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
  }
}

@media (max-width: 480px) {
  #root .content {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  #root .topbar {
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
  }

  #root .metric-grid,
  #root :is(.form-grid, .module-grid.modal-grid, .product-grid, .quick-links.compact, .organization-card-grid),
  #root .wizard-grid,
  #root .toolbar-row,
  #root .reader-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #root .topbar-actions :is(button, a) {
    padding: 0 0.375rem !important;
  }

  #root .topbar-actions :is(button, a) svg {
    width: 14px;
    height: 14px;
  }

  #root .modal {
    width: calc(100vw - 0.75rem) !important;
    max-width: calc(100vw - 0.75rem) !important;
    padding: 0.5rem !important;
  }
}
