/* Modern CSS Architecture for Cargo Progress & Smart Allocation System */
:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-accent-soft: #eff6ff;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-fg: #ffffff;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --rose: #e11d48;
  --rose-bg: #fff1f2;
  --rose-border: #fecdd3;
  --violet: #7c3aed;
  --violet-bg: #f5f3ff;
  --violet-border: #ddd6fe;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Canonical visually-hidden recipe per forms guide */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.excel-upload-zone {
  border: 2px dashed #93c5fd;
  background: #eff6ff;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

/* Top Header & Navigation */
.app-header {
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.brand-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Main Navigation Tabs */
.main-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-list {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  list-style: none;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

.nav-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.85rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.nav-btn:hover {
  color: var(--primary);
  background: var(--bg-subtle);
}

.nav-btn.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-accent-soft);
}

.nav-pill-hot {
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}

/* Layout Containers & Containment Regions (interactions-in-complex-layouts) */
.app-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.containment-region {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px auto 520px;
}

@supports not (content-visibility: auto) {
  .containment-region {
    contain: layout style paint;
  }
}

.view-panel {
  display: none;
}

.view-panel.is-visible {
  display: block;
}

/* KPI Strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Cards & Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-desc {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* Workbench Grid */
.workbench-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--bg-subtle);
  border-color: #94a3b8;
}

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

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

.btn-success {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.btn-success:hover {
  background: #047857;
  border-color: #047857;
}

.btn-warning {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.3);
}

.btn-warning:hover {
  background: #b45309;
  border-color: #b45309;
}

/* PWA Offline Banner */
.offline-banner {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  padding: 0.5rem 1rem;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideDown 0.3s ease-out;
}

.offline-icon {
  font-size: 1rem;
}

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 0.9rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Search & Filter Bar (<search>) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-pill {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.search-inputs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-inputs .form-input {
  width: 210px;
}

/* Data Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-emerald {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.badge-rose {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.badge-violet {
  background: var(--violet-bg);
  color: var(--violet);
  border: 1px solid var(--violet-border);
}

.badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Dynamic Progress Bar driven by CSS Custom Property (--progress-pct & --brand-hue) */
.progress-track {
  width: 100%;
  min-width: 110px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.progress-fill {
  height: 100%;
  width: min(100%, calc(var(--progress-pct, 0) * 1%));
  background: hsl(var(--brand-hue, 215) 82% 46%);
  border-radius: 999px;
  transition: width 0.25s ease, background-color 0.25s ease;
}

/* Customer Allocation Pills & Mini Grid */
.customer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cust-chip {
  background: #f8fafc;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 135px;
}

.cust-chip-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--text-main);
  gap: 0.4rem;
}

.cust-chip-ratio {
  color: var(--primary);
  font-size: 0.72rem;
}

.cust-chip-stats {
  color: var(--text-secondary);
  font-size: 0.74rem;
}

/* Editable Allocation Input inside Preview Table */
.alloc-edit-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  margin: 0.2rem 0.35rem 0.2rem 0;
}

.alloc-qty-input {
  width: 68px;
  padding: 0.2rem 0.35rem;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  font-weight: 700;
  color: #1e3a8a;
  text-align: right;
  font-size: 0.82rem;
}

/* Details / Summary Accordion (HTML guide section 5) */
details.native-disclosure {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #f8fafc;
  margin-top: 0.5rem;
}

details.native-disclosure > summary {
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}

details.native-disclosure[open] > summary {
  border-bottom: 1px solid var(--border-color);
  color: var(--primary);
  background: #eff6ff;
}

.disclosure-body {
  padding: 0.75rem 0.85rem;
}

/* Native Modal Dialog (<dialog>) */
dialog.app-modal {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 680px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.2);
  background: var(--bg-card);
  color: var(--text-main);
}

dialog.app-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* Toast Notifications using Popover API (persistent-toast-notifications guide) */
.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

[popover].toast-item {
  position: fixed;
  inset: auto 1.25rem 1.25rem auto;
  margin: 0;
  border: 1px solid #1e293b;
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transition-behavior: allow-discrete;
  /* Position multiple manual popovers using sibling-index() when supported */
  bottom: calc(1.25rem + (sibling-index() - 1) * 3.5rem);
}

/* MANDATORY rule from persistent-toast-notifications guide: combine :popover-open and .\:popover-open */
[popover].toast-item:is(:popover-open, .\:popover-open) {
  display: flex;
}

/* Fallback if sibling-index() is not supported */
[popover].toast-item + [popover].toast-item {
  margin-top: 0.75rem;
}

.toast-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Architecture Comparison Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.comp-col {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: #fff;
}

.comp-col.is-recommended {
  border: 2px solid var(--primary);
  background: #f8faff;
}

/* ==========================================================================
   Desktop + Mobile Dual-End Experience (forms guide Section 5 compliance)
   - Single-column layouts for mobile scanning
   - font-size >= 1rem (16px) on mobile inputs to prevent iOS zoom
   - Tap targets >= 48px (52px on coarse pointers)
   - CSS logical properties (margin-block-end, margin-inline-start, padding-inline)
   ========================================================================== */

.device-mode-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.18rem;
  gap: 0.2rem;
}

.device-mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  padding-block: 0.32rem;
  padding-inline: 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.device-mode-btn.is-active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Mobile Preview Shell when user toggles "📱 手机端视图" on a desktop screen */
body.force-mobile-view .app-main {
  max-width: 460px;
  margin-inline: auto;
  background: #f1f5f9;
  border-inline: 1px solid var(--border-strong);
  min-height: calc(100vh - 70px);
  padding-inline: 0.85rem;
  padding-block: 0.85rem 5.5rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

body.force-mobile-view .main-nav {
  display: none;
}

body.force-mobile-view .desktop-only-table {
  display: none !important;
}

body.force-mobile-view .mobile-cards-list {
  display: flex !important;
}

body.force-mobile-view .mobile-bottom-nav {
  display: flex !important;
  max-width: 460px;
  left: 50%;
  transform: translateX(-50%);
  border-inline: 1px solid var(--border-strong);
}

body.force-mobile-view .kpi-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

body.force-mobile-view .workbench-grid {
  grid-template-columns: 1fr;
}

/* Mobile Order Progress Cards (Single-Column Scanning Layout) */
.mobile-cards-list {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
}

.mobile-order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-block-end: 0.15rem;
}

.mobile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-block-end: 0.55rem;
}

.mobile-sku-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
}

.mobile-prod-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-block-start: 0.15rem;
}

.mobile-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.5rem;
  margin-block: 0.65rem;
  text-align: center;
}

.mobile-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.mobile-metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mobile-metric-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.mobile-cust-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-block-start: 0.6rem;
}

.mobile-cust-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding-block: 0.45rem;
  padding-inline: 0.65rem;
  font-size: 0.82rem;
}

.mobile-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-block-start: 0.75rem;
  padding-block-start: 0.65rem;
  border-top: 1px dashed var(--border-color);
}

.mobile-card-actions .btn {
  flex: 1;
  min-height: 44px;
}

/* Mobile Customer Summary Cards (👥 查客户视图) */
.customer-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.customer-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

/* Sticky Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid #1e293b;
  padding-block: 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  padding-inline: 0.5rem;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 48px;
  padding-inline: 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}

.mobile-nav-item .mobile-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.mobile-nav-item.is-active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
}

/* Native Responsive Breakpoint for Mobile Phones & Small Tablets */
@media (max-width: 820px) {
  .header-inner {
    padding: 0.75rem 1rem;
  }

  .brand-subtitle {
    display: none;
  }

  .main-nav {
    display: none;
  }

  .app-main {
    padding: 0.85rem 0.85rem 5.5rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .kpi-card {
    padding: 0.75rem 0.85rem;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .desktop-only-table {
    display: none !important;
  }

  .mobile-cards-list {
    display: flex !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .search-inputs {
    width: 100%;
  }

  .search-inputs .form-input {
    width: 100%;
    font-size: 1rem;
    min-height: 48px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 1rem;
    min-height: 48px;
  }

  .filter-pill {
    min-height: 42px;
    padding-inline: 0.85rem;
  }
}

@media (pointer: coarse) {
  .form-input,
  .form-select,
  .mobile-nav-item,
  .mobile-card-actions .btn {
    min-height: 52px;
  }
}

