:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #dfe5ee;
  --border-strong: #c8d1dd;
  --text: #111827;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #2f6fed;
  --accent-dark: #2357c8;
  --accent-soft: #e8f0ff;
  --success: #16895a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .07);
  --radius: 10px;
  --sidebar-width: 236px;
}

.growth-workspace {
  display: grid;
  gap: 18px;
}
.growth-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.growth-heading h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
}
.growth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.growth-filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.growth-module-nav {
  display: flex;
  gap: 4px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.growth-module-nav a {
  color: var(--muted);
  font-weight: 750;
  padding: 10px 12px;
  border-radius: 7px;
}
.growth-module-nav a.active,
.growth-module-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.growth-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(160px, 1fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
}
.growth-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 18px;
}
.growth-chart-card,
.growth-summary-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.growth-print-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}
.growth-donut-wrap {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.growth-donut-wrap canvas {
  width: min(100%, 660px) !important;
  height: min(100%, 660px) !important;
  max-width: 660px;
  max-height: 660px;
  min-height: 560px;
  aspect-ratio: 1 / 1;
}
.growth-summary-panel .table-responsive {
  max-height: none;
  overflow: visible;
}
.growth-summary-panel .growth-table {
  width: 100%;
  table-layout: fixed;
}
.growth-summary-panel .growth-table th,
.growth-summary-panel .growth-table td {
  white-space: normal;
}
.growth-summary-panel .growth-table th:nth-child(1),
.growth-summary-panel .growth-table td:nth-child(1) {
  width: 43%;
}
.growth-summary-panel .growth-table th:nth-child(2),
.growth-summary-panel .growth-table td:nth-child(2) {
  width: 39%;
}
.growth-summary-panel .growth-table th:nth-child(3),
.growth-summary-panel .growth-table td:nth-child(3) {
  width: 18%;
}
.growth-donut-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.growth-donut-center strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}
.growth-donut-center span {
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.growth-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.growth-kpi-row div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
.growth-kpi-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.growth-kpi-row strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}
.growth-table th {
  cursor: pointer;
  white-space: nowrap;
}
.growth-table td {
  vertical-align: middle;
}
.growth-positive {
  color: var(--success);
  font-weight: 800;
}
.growth-missing {
  color: #dc2626;
  font-weight: 800;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}
.status-pill-green {
  color: #047857;
  background: #d1fae5;
}
.status-pill-red {
  color: #b91c1c;
  background: #fee2e2;
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: #f8fafc;
}
.inline-search-form {
  min-width: 220px;
}

.customer-report-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.customer-report-filters {
  min-width: 0;
}
.customer-report-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}
.customer-report-filter-grid > div {
  min-width: 0;
}
.customer-report-filter-grid .form-select,
.customer-report-filter-grid .form-control {
  min-width: 0;
}
.customer-report-actions {
  grid-column: span 2;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.customer-report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.customer-report-summary div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.customer-report-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.customer-report-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}
.customer-report-panel {
  min-width: 0;
  overflow: hidden;
}
.customer-report-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 300px);
  min-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.customer-report-table {
  min-width: 2040px;
  margin-bottom: 0;
}
.customer-report-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--border);
}
.customer-report-table td {
  white-space: nowrap;
  color: var(--muted);
}
.customer-report-table td:nth-child(4),
.customer-report-table td:nth-child(5),
.customer-report-table td:nth-child(6),
.customer-report-table td:nth-child(8),
.customer-report-table td:nth-child(18) {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-report-table tbody tr:hover {
  background: #f8fafc;
}

@media (max-width: 1100px) {
  .growth-filters,
  .growth-overview-grid,
  .customer-report-filter-grid,
  .customer-report-summary {
    grid-template-columns: 1fr;
  }
  .customer-report-actions {
    grid-column: auto;
  }
  .growth-module-nav {
    overflow-x: auto;
  }
  .growth-module-nav a {
    white-space: nowrap;
  }
}

@media print {
  body.printing-growth-chart * {
    visibility: hidden !important;
  }
  body.printing-growth-chart .content,
  body.printing-growth-chart .main {
    padding: 0 !important;
    background: #fff !important;
  }
  body.printing-growth-chart [data-print-area] {
    visibility: visible !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 22px !important;
    display: grid !important;
    grid-template-rows: auto auto 1fr !important;
    background: #fff !important;
  }
  body.printing-growth-chart [data-print-area] * {
    visibility: visible !important;
  }
  body.printing-growth-chart [data-print-growth-chart],
  body.printing-growth-chart .growth-kpi-row {
    display: none !important;
  }
  body.printing-growth-chart .growth-donut-wrap {
    min-height: 0 !important;
    height: calc(100vh - 160px) !important;
    page-break-inside: avoid;
  }
  body.printing-growth-chart .growth-donut-wrap canvas {
    width: min(92vw, calc(100vh - 170px)) !important;
    height: min(92vw, calc(100vh - 170px)) !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
  }
  body.printing-growth-chart .panel-header {
    display: block !important;
    margin-bottom: 8px !important;
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
a { text-decoration: none; }

.auth-body {
  background: radial-gradient(circle at top left, #dbe8ff, transparent 28%), #121826;
}
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .25);
  padding: 36px;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-img {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto;
}
.auth-title { font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-copy { color: var(--muted); margin-bottom: 26px; }
.auth-links {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
}
.auth-links a {
  color: var(--accent);
  font-weight: 700;
}
.auth-legal {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--faint);
  font-size: 12px;
}
.auth-legal a {
  color: var(--muted);
  font-weight: 650;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  transition: width .42s ease, min-width .42s ease;
  will-change: width, min-width;
}
body.sidebar-collapsed {
  --sidebar-width: 76px;
}
body.sidebar-collapsed.sidebar-hover-expand {
  --sidebar-width: 236px;
}
body.sidebar-collapsed .sidebar {
  overflow: hidden;
}
body.sidebar-collapsed.sidebar-hover-expand .sidebar {
  overflow: visible;
}
body.sidebar-collapsed .sidebar-logo,
body.sidebar-collapsed .sidebar-nav,
body.sidebar-collapsed .sidebar-footer {
  overflow: hidden;
}
body.sidebar-collapsed .sidebar-nav {
  overflow-y: hidden;
  overflow-x: hidden;
}
body.sidebar-collapsed.sidebar-hover-expand .sidebar-nav {
  overflow-y: auto;
}
body.sidebar-collapsed .brand-lockup {
  justify-content: center;
  gap: 0;
}
body.sidebar-collapsed .brand-lockup > div:not(.brand-mark),
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-group summary,
body.sidebar-collapsed .user-meta,
body.sidebar-collapsed .sidebar-footer .btn {
  width: 0;
  max-width: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .24s ease .05s, visibility 0s linear .29s;
}
body.sidebar-collapsed.sidebar-hover-expand .brand-lockup {
  justify-content: flex-start;
  gap: 10px;
}
body.sidebar-collapsed.sidebar-hover-expand .brand-lockup > div:not(.brand-mark),
body.sidebar-collapsed.sidebar-hover-expand .nav-item span,
body.sidebar-collapsed.sidebar-hover-expand .sidebar-group summary,
body.sidebar-collapsed.sidebar-hover-expand .user-meta,
body.sidebar-collapsed.sidebar-hover-expand .sidebar-footer .btn {
  width: auto;
  max-width: none;
  min-width: 0;
  overflow: visible;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: .16s, 0s;
}
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}
body.sidebar-collapsed.sidebar-hover-expand .nav-item {
  justify-content: flex-start;
  padding: 9px 10px;
}
body.sidebar-collapsed .sidebar-logo,
body.sidebar-collapsed .sidebar-footer {
  padding-left: 10px;
  padding-right: 10px;
}
body.sidebar-collapsed .sidebar-logo {
  display: flex;
  justify-content: center;
}
body.sidebar-collapsed.sidebar-hover-expand .sidebar-logo {
  display: block;
}
body.sidebar-collapsed .user-card {
  justify-content: center;
}
body.sidebar-collapsed.sidebar-hover-expand .user-card {
  justify-content: flex-start;
}
.sidebar-logo { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); }
.brand-lockup { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-lockup:hover { color: var(--text); }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: transparent;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(16, 24, 40, .12);
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}
.brand-name { font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.brand-subtitle { color: var(--faint); font-size: 11px; }
.sidebar-nav { flex: 1; padding: 10px; overflow-y: auto; }
.sidebar-group {
  margin: 3px 0 8px;
}
.sidebar-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 10px;
}
.sidebar-group summary::-webkit-details-marker {
  display: none;
}
.sidebar-group summary::after {
  content: "+";
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}
.sidebar-group[open] summary::after {
  content: "-";
}
.sidebar-group summary:hover {
  background: var(--surface-2);
  color: var(--muted);
}
.sidebar-section {
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px 10px 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 10px;
  margin: 2px 0;
  font-weight: 620;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
}
.nav-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item.active .nav-icon { background: #d6e4ff; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 14px; }
.user-card { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #172033;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}
.user-meta { min-width: 0; }
.user-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--faint); font-size: 11px; }

.main { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 62px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  backdrop-filter: blur(12px);
}
.topbar-title { font-size: 17px; font-weight: 760; letter-spacing: -.02em; }
.topbar-subtitle { color: var(--faint); font-size: 12px; }
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-scope-form {
  min-width: 220px;
}
.admin-scope-form .form-select {
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
}
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.action-icon-btn .nav-icon {
  width: 20px;
  height: 20px;
  background: rgba(37, 99, 235, 0.12);
  color: currentColor;
}
.action-icon-btn .nav-icon svg {
  width: 14px;
  height: 14px;
}
.btn-primary.action-icon-btn .nav-icon {
  background: rgba(255, 255, 255, 0.18);
}
.filter-checkbox-row {
  min-height: 48px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--text);
  font-weight: 650;
}
.filter-checkbox-row input {
  width: 18px;
  height: 18px;
}
.mobile-quick-nav,
.mobile-action-panel,
.sidebar-backdrop {
  display: none;
}
.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.sidebar-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 10px;
  font-weight: 700;
}
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.filter-panel,
.panel,
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-panel { padding: 18px; margin-bottom: 18px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.filter-actions { display: flex; gap: 8px; }
.dashboard-date-quick { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.dashboard-date-quick .form-select-sm { width: auto; min-width: 130px; }
@keyframes btn-pulse-anim { 0%,100% { box-shadow: 0 0 0 0 rgba(47,111,237,0.5); } 50% { box-shadow: 0 0 0 6px rgba(47,111,237,0); } }
.btn-pulse { animation: btn-pulse-anim 0.6s ease 3; }
.dashboard-status-alert {
  display: grid;
  gap: 4px;
}
.dashboard-loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}
.dashboard-loading-state[hidden] {
  display: none !important;
}
.stack-form {
  display: grid;
  gap: 14px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rule-list {
  display: grid;
  gap: 12px;
}
.rule-list div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
}
.rule-list strong {
  display: block;
  margin-bottom: 4px;
}
.rule-list span {
  color: var(--muted);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.snapshot-panel {
  background: linear-gradient(135deg, #111827 0%, #243146 62%, #2f6fed 100%);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.snapshot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.snapshot-header h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}
.snapshot-header p {
  margin: 0;
  color: rgba(255, 255, 255, .7);
}
.snapshot-panel .role-pill {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.snapshot-grid div {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 13px;
}
.snapshot-grid span {
  display: block;
  color: rgba(255, 255, 255, .66);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.snapshot-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  line-height: 1.1;
}
.quick-reminders-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quick-reminders-panel > .panel-header {
  margin-bottom: 0;
}
.quick-reminders-panel > .panel-header > .nav-icon {
  color: var(--accent);
  background: var(--accent-soft);
  flex: 0 0 auto;
}
.quick-reminder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.quick-reminder-list {
  display: grid;
  gap: 8px;
}
.quick-reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.quick-reminder-item:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  transform: translateY(-1px);
}
.quick-reminder-item span {
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.quick-reminder-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.quick-reminder-item .note-icon-button {
  margin-right: 0;
}
.quick-reminder-item .note-icon-button .nav-icon {
  position: static;
  width: 18px;
  height: 18px;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
}
.quick-reminder-item .note-icon-button .nav-icon svg {
  width: 14px;
  height: 14px;
}
.quick-reminder-item.is-removing {
  opacity: .4;
  transform: translateX(6px);
}
.quick-reminder-item.is-editing {
  background: var(--surface);
  border-color: var(--accent);
}
.quick-reminder-edit-input {
  min-width: 0;
  font-weight: 650;
}
.quick-reminder-error {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 650;
}
.home-hero {
  display: grid;
  grid-template-columns: minmax(220px, .45fr) minmax(0, 1.55fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}
.home-hero-metrics {
  grid-template-columns: 1fr;
}
.home-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.home-kpi-strip article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 14px;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-kpi-strip span,
.home-kpi-strip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.18;
  overflow-wrap: anywhere;
}
.home-kpi-strip strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 21px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.task-home-hero {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr);
  gap: 18px;
  margin-bottom: 18px;
}
.task-home-summary {
  min-height: 250px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #111827 0%, #1f3657 56%, #2f6fed 100%);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.task-home-eyebrow {
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.task-home-summary h2 {
  margin: 8px 0 4px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.04em;
  font-weight: 850;
}
.task-home-summary p {
  color: rgba(255, 255, 255, .72);
  margin: 0;
}
.task-home-next {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  background: rgba(255, 255, 255, .1);
  padding: 14px;
}
.task-home-next span,
.task-home-next small {
  display: block;
  color: rgba(255, 255, 255, .7);
}
.task-home-next span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.task-home-next strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.25;
}
.task-home-next em {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  padding: 5px 9px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}
.task-home-next em.overdue {
  background: #fee2e2;
  color: #991b1b;
}
.task-home-next em.today,
.task-home-next em.soon {
  background: #fef3c7;
  color: #92400e;
}
.task-home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.task-home-stat {
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
}
.task-home-stat span,
.task-home-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.task-home-stat strong {
  display: block;
  margin: 9px 0 3px;
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -.04em;
}
.task-home-stat.danger strong { color: #dc2626; }
.task-home-stat.warning strong { color: #d97706; }
.task-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 18px;
}
.task-queue-list {
  display: grid;
  gap: 10px;
}
.task-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  padding: 14px;
}
.task-queue-main {
  min-width: 0;
}
.task-queue-main strong,
.task-queue-main span,
.task-queue-main small {
  display: block;
}
.task-queue-main strong {
  font-size: 15px;
  line-height: 1.25;
}
.task-queue-main span {
  margin-top: 4px;
  color: var(--muted);
}
.task-queue-main small {
  margin-top: 8px;
  color: var(--faint);
  overflow-wrap: anywhere;
}
.task-queue-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 230px;
}
.task-pill,
.task-due {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.task-pill.priority-urgent {
  background: #fee2e2;
  color: #991b1b;
}
.task-pill.priority-high {
  background: #ffedd5;
  color: #9a3412;
}
.task-pill.priority-normal {
  background: var(--accent-soft);
  color: var(--accent);
}
.task-pill.priority-low {
  background: #dcfce7;
  color: var(--success);
}
.task-due.overdue {
  background: #fee2e2;
  color: #991b1b;
}
.task-due.today,
.task-due.soon {
  background: #fef3c7;
  color: #92400e;
}
.task-mix-list {
  display: grid;
  gap: 10px;
}
.task-mix-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  padding: 13px 14px;
}
.task-mix-list span {
  color: var(--muted);
  font-weight: 750;
}
.task-mix-list strong {
  font-size: 21px;
  line-height: 1;
}
.task-home-side-note {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.task-home-side-note span {
  color: var(--muted);
}
.home-task-dashboard {
  overflow: hidden;
}
.home-task-filters {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}
.home-task-board {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}
.home-task-board-header,
.home-task-board-row {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.55fr) minmax(220px, .85fr);
  gap: 14px;
  align-items: stretch;
}
.home-task-board-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 850;
}
.home-task-board-header span {
  display: block;
  padding: 13px 14px;
}
.home-task-board-row {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.home-task-board-row:last-child {
  border-bottom: 0;
}
.home-task-board-row:hover {
  background: #eef4ff;
}
.home-task-board-row > span {
  min-width: 0;
  padding: 14px;
}
.home-task-customer {
  font-weight: 750;
  color: var(--text);
}
.home-task-description strong,
.home-task-description small,
.home-task-description em {
  display: block;
}
.home-task-description strong {
  color: var(--text);
  line-height: 1.25;
}
.home-task-description small {
  margin-top: 4px;
  color: var(--muted);
}
.home-task-description em {
  margin-top: 7px;
  color: var(--faint);
  font-style: normal;
  overflow-wrap: anywhere;
}
.home-task-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.period-picker {
  position: relative;
}
.period-picker summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  font-weight: 750;
}
.period-picker summary::-webkit-details-marker {
  display: none;
}
.period-picker summary::after {
  content: "⌄";
  color: var(--muted);
}
.period-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: 0;
  min-width: 330px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
  padding: 18px;
}
.period-year {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.period-year span {
  font-size: 20px;
  font-weight: 800;
  margin-right: auto;
}
.period-year a,
.period-year button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-weight: 750;
}
.period-months {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.period-months a,
.period-months button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  padding: 12px 8px;
  text-align: center;
  font-weight: 760;
}
.period-months a:hover,
.period-months button:hover,
.period-months .active {
  background: #4b4a8f;
}
.kpi-card { padding: 19px; }
.kpi-label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 29px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.04em;
}
.kpi-card.success .kpi-value { color: var(--success); }
.kpi-card.warning .kpi-value { color: #d97706; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 7px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}
.dashboard-filter-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 16px;
  padding: 10px 14px;
  transition: box-shadow .18s ease;
}
.dashboard-filter-panel:hover,
.dashboard-filter-panel:focus-within {
  box-shadow: 0 8px 28px rgba(16, 24, 40, .14);
}
.dashboard-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}
.dashboard-filter-summary strong {
  font-size: 13px;
}
.dashboard-filter-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  flex: 1;
}
.dashboard-filter-toggle {
  display: none;
}
.dashboard-filter-grid {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height .22s ease, opacity .18s ease, margin-top .18s ease;
}
.dashboard-filter-panel:hover .dashboard-filter-grid,
.dashboard-filter-panel:focus-within .dashboard-filter-grid {
  max-height: 360px;
  opacity: 1;
  margin-top: 12px;
}
.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dashboard-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}
.dashboard-kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.dashboard-kpi-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1;
}
.dashboard-kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.dashboard-kpi-card.good strong { color: var(--success); }
.dashboard-kpi-card.warn strong { color: #b45309; }
.dashboard-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
}
.dashboard-chart-wide {
  grid-column: span 1;
}
.dashboard-full-width {
  grid-column: 1 / -1;
}
.chart-height-wrap {
  position: relative;
  width: 100%;
}
.chart-height-260 { height: 260px; }
.chart-height-340 { height: 340px; }
.chart-height-360 { height: 360px; }
.chart-height-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.dashboard-trend-chart {
  height: 340px;
  max-height: 340px;
}
.dashboard-items-chart {
  height: 360px;
  max-height: 360px;
}
.dashboard-treemap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 360px;
}
.dashboard-treemap-tile {
  flex-grow: 1;
  min-width: min(100%, 190px);
  min-height: 116px;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.dashboard-treemap-tile::after {
  content: "";
  position: absolute;
  inset: auto -24px -34px auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.dashboard-treemap-tile span,
.dashboard-treemap-tile strong,
.dashboard-treemap-tile small {
  position: relative;
  z-index: 1;
}
.dashboard-treemap-tile span {
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.dashboard-treemap-tile strong {
  margin-top: 18px;
  font-size: 24px;
  line-height: 1;
}
.dashboard-treemap-tile small {
  color: rgba(255, 255, 255, .78);
  font-weight: 800;
}
.dashboard-treemap-tile.tile-0 { background: #1d4ed8; }
.dashboard-treemap-tile.tile-1 { background: #0f766e; }
.dashboard-treemap-tile.tile-2 { background: #b45309; }
.dashboard-treemap-tile.tile-3 { background: #6d28d9; }
.dashboard-treemap-tile.tile-4 { background: #be123c; }
.dashboard-treemap-tile.tile-5 { background: #475569; }
.dashboard-detail-panel {
  padding: 0;
  overflow: hidden;
}
.dashboard-detail-panel summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  font-weight: 850;
}
.dashboard-detail-panel summary::-webkit-details-marker {
  display: none;
}
.dashboard-detail-panel summary small {
  color: var(--muted);
  font-weight: 700;
}
.dashboard-detail-actions {
  padding: 0 20px 16px;
}
.dashboard-detail-panel .table-responsive {
  border-width: 1px 0 0;
  border-radius: 0;
}
.dashboard-top12-panel { padding: 0; }
.dashboard-top12-panel .panel-header { padding: 18px 20px 14px; }
.top12-table { margin: 0; }
.top12-table thead th { font-size: 12px; white-space: nowrap; padding-top: 6px; padding-bottom: 6px; }
.top12-table .top12-month-header { border-left: 1px solid var(--border, #e2e8f0); padding-left: 14px; }
.top12-table .top12-current-month { background: rgba(47, 111, 237, 0.05); }
.top12-table thead .top12-current-month { border-top: 2px solid #2f6fed; }
.top12-current-label { color: #2f6fed; font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.top12-table td.top12-rank { width: 32px; color: var(--muted); font-size: 13px; font-weight: 700; }
.top12-table th.top12-rank { width: 32px; }
.top12-row { cursor: pointer; transition: background 0.1s; }
.top12-row:hover { background: var(--surface-alt, #f8fafc); }
.top12-row.top12-active { background: rgba(47, 111, 237, 0.07); }
.top12-row.top12-active td.top12-rank {
  box-shadow: inset 3px 0 0 #2f6fed;
  color: #2f6fed;
}
.top12-gp-low  { color: #dc2626; font-weight: 700; }
.top12-gp-mid  { color: #b45309; font-weight: 700; }
.top12-gp-good { color: var(--success, #16895a); font-weight: 700; }
.home-chart-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr);
}
.panel { padding: 20px; }
.panel.wide { grid-column: span 2; }
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-header h2 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0;
}
.panel-header p { color: var(--muted); margin: 4px 0 0; }
.panel-actions { display: flex; justify-content: flex-end; padding-top: 16px; }
.icon-info-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
}
.icon-info-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.chart-canvas { width: 100%; height: 310px; max-height: 310px; }
.compact-chart { height: 260px; max-height: 260px; }
.dashboard-grid .panel:not(.wide) .chart-canvas { height: 270px; max-height: 270px; }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table-responsive,
.contact-table-wrap,
.notes-table-wrap,
.inventory-table-wrap,
.backorder-table-wrap {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 800;
  border-bottom-color: var(--border);
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--border);
}
.table tbody td { color: var(--text); border-bottom-color: var(--border); }
.backorder-table-wrap .table tbody td { font-size: 14px; }
.backorder-table-wrap .table thead th { font-size: 12px; }
.table tbody tr:hover td { background: #f8fafc; }
.text-strong { color: var(--text) !important; font-weight: 720; }
.muted { color: var(--faint); font-size: 12px; }
.empty-row { color: var(--faint) !important; text-align: center; padding: 40px !important; }
.search-input { max-width: 320px; }
.toast-stack {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.app-toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 13px 14px;
  animation: toastIn .18s ease-out, toastOut .25s ease-in 4.8s forwards;
}
.app-toast.success { border-left-color: var(--success); }
.app-toast.danger { border-left-color: #dc2626; }
.app-toast strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}
.app-toast span {
  color: var(--muted);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); visibility: hidden; }
}
.contact-table-wrap {
  overflow: auto;
}
.contact-card-list {
  display: none;
}
.contact-table {
  min-width: 1700px;
}
.contact-table .sticky-actions {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  min-width: 156px;
  box-shadow: 1px 0 0 var(--border);
}
.contact-table .sticky-contact {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  min-width: 220px;
  box-shadow: 1px 0 0 var(--border);
}
.contact-table .sticky-contact.with-actions {
  left: 156px;
}
.contact-table thead .sticky-actions {
  z-index: 6;
}
.contact-table thead .sticky-contact {
  z-index: 6;
}
.contact-table th,
.contact-table td {
  white-space: nowrap;
  vertical-align: top;
}
.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}
.table-actions form {
  margin: 0;
}
.directory-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 14px;
}
.contact-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.contact-card-head,
.contact-card-customer,
.contact-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.contact-card-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.contact-card-head p,
.contact-card-customer span {
  margin: 3px 0 0;
  color: var(--muted);
}
.contact-card-customer {
  display: block;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}
.contact-card-customer strong,
.contact-card-customer span {
  display: block;
}
.contact-card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}
.contact-card-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 14px 0 0;
}
.contact-card-details div {
  min-width: 0;
}
.contact-card-details .wide {
  grid-column: 1 / -1;
}
.contact-card-details dt {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.contact-card-details dd {
  margin: 2px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.mini-pill {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  padding: 5px 8px;
  white-space: nowrap;
}
.contact-card-delete {
  margin-top: 12px;
}
.contact-note-link {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 720;
  padding: 0;
  text-align: left;
}
.contact-note-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.note-icon-button {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  position: relative;
  margin-right: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  vertical-align: middle;
}
.note-icon-button:hover,
.note-icon-button.has-notes {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.note-icon-button span {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  line-height: 1;
}
.note-icon-button i {
  width: 14px;
  height: 16px;
  display: block;
  position: relative;
  border: 1.7px solid currentColor;
  border-radius: 3px;
}
.note-icon-button i::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 4px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
  opacity: .72;
}
.note-icon-button i::after {
  content: "";
  position: absolute;
  top: -1.7px;
  right: -1.7px;
  width: 6px;
  height: 6px;
  border-left: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  border-radius: 0 3px 0 2px;
  background: var(--surface);
}
.note-icon-button:hover i::after,
.note-icon-button.has-notes i::after {
  background: var(--accent-soft);
}
.global-reminders-fab,
.global-note-fab {
  display: none;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 18;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 11px 16px;
  font-weight: 800;
}
.global-reminders-fab {
  bottom: 118px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
}
.global-task-fab {
  display: none;
  position: fixed;
  right: 22px;
  bottom: 70px;
  z-index: 18;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
  padding: 11px 16px;
  font-weight: 800;
}
.note-modal[hidden] {
  display: none;
}
.note-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}
.note-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .44);
}
.note-modal-panel {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  padding: 20px;
}
.note-history-panel {
  width: min(720px, 100%);
}
.note-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.note-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 820;
}
.note-modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
}
.note-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
.mobile-modal-toggle,
.mobile-modal-close-label {
  display: none;
}
.note-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.task-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.task-recurrence-row {
  display: grid;
  grid-template-columns: auto 92px auto 92px minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  padding: 12px;
  color: var(--muted);
  font-weight: 700;
}
.task-table-form {
  min-width: 420px;
}
.tasks-table {
  min-width: 1520px;
}
.tasks-table .notes-actions-cell {
  min-width: 150px;
}
.tasks-table .note-text-cell {
  min-width: 470px;
}
.tasks-table .task-title-input {
  color: var(--text);
  font-weight: 800;
}
.tasks-table select.form-select-sm {
  min-width: 136px;
}
.tasks-table input[type="date"] {
  min-width: 156px;
}
.note-voice-slot {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}
.voice-note-btn.recording {
  border-color: #dc2626;
  color: #dc2626;
  background: #fff1f2;
}
.note-history-list {
  display: grid;
  gap: 12px;
}
.notes-table-wrap {
  overflow: auto;
}
.notes-table {
  min-width: 1100px;
}
.notes-table .note-text-cell {
  min-width: 420px;
}
.notes-table .notes-actions-cell {
  min-width: 168px;
}
.note-table-form textarea {
  min-height: 64px;
}
.notes-list {
  display: none;
}
.note-card,
.note-history-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  padding: 14px;
}
.note-card-header,
.note-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.note-card-header h3,
.note-history-head strong {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
}
.note-card-header p,
.note-card-meta,
.note-history-head span,
.note-history-item p {
  color: var(--muted);
}
.note-card-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
  font-size: 12px;
  text-align: right;
}
.note-card-meta strong {
  color: var(--muted);
  font-weight: 750;
}
.note-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}
.note-compose-form {
  max-width: 900px;
}
.contact-filter-grid {
  grid-template-columns: minmax(240px, 1.35fr) minmax(280px, 1.65fr) auto;
}
.inventory-filter-grid {
  grid-template-columns: minmax(240px, 1.6fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, .8fr) auto;
}
.backorder-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}
.inventory-card-list {
  display: none;
}
.quote-add-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  padding: 12px;
  margin-bottom: 14px;
}
.quote-add-toolbar-main,
.quote-add-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quote-select-row {
  min-height: 34px;
  padding: 0 10px;
  background: var(--surface);
}
.quote-card-check {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding-top: 2px;
}
.quote-card-check input,
.quote-add-toolbar input[type="checkbox"] {
  width: 17px;
  height: 17px;
}
.inventory-table-wrap {
  overflow: auto;
}
.inventory-table-wrap .table {
  font-size: 16px;
}
.inventory-table-wrap .table thead th {
  color: #687386;
}
.inventory-table-wrap .table tbody td {
  color: #344054;
  font-weight: 620;
  line-height: 1.35;
}
.inventory-table-wrap .table tbody td.text-strong {
  color: var(--text) !important;
  font-weight: 820;
}
.inventory-table-wrap .table th,
.inventory-table-wrap .table td {
  padding-top: 14px;
  padding-bottom: 14px;
}
.inventory-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.inventory-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.inventory-card-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 820;
}
.inventory-card-head p {
  margin: 4px 0 0;
  color: #344054;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.35;
}
.success-pill {
  background: #dcfce7;
  color: var(--success);
}
.inventory-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.inventory-card-meta span {
  border-radius: 999px;
  background: var(--surface-2);
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
}
.inventory-stat-grid,
.inventory-price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.inventory-stat-grid div,
.inventory-price-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}
.inventory-stat-grid span,
.inventory-price-grid span,
.inventory-alt span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.inventory-stat-grid strong,
.inventory-price-grid strong {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-size: 16px;
  font-weight: 780;
}
.inventory-alt {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}
.inventory-alt strong {
  display: block;
  margin-top: 3px;
  color: #344054;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.backorder-card-list {
  display: none;
}
.backorder-table-wrap {
  overflow: auto;
}
.bo-upload-stamp {
  font-size: 13px;
  color: var(--text);
  margin: 4px 0 0;
}
.bo-upload-stamp strong {
  color: var(--primary, #2f6fed);
}
.bo-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.bo-kpi-strip article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}
.bo-kpi-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.bo-kpi-strip strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin: 5px 0 3px;
  color: var(--text);
}
.bo-kpi-strip small {
  color: var(--muted);
  font-size: 12px;
}
.bo-check-col {
  width: 36px;
  padding-left: 12px !important;
  padding-right: 4px !important;
}
.bo-row-check {
  cursor: pointer;
  width: 15px;
  height: 15px;
}
.bo-select-all-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.backorder-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 14px;
}
.backorder-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.backorder-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 820;
}
.backorder-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.backorder-item-line {
  display: grid;
  gap: 3px;
  margin-top: 12px;
}
.backorder-item-line span {
  color: var(--muted);
  line-height: 1.35;
}
.backorder-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}
.backorder-stat-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
  min-width: 0;
}
.backorder-stat-grid dt {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.backorder-stat-grid dd {
  margin: 2px 0 0;
  color: var(--text);
  font-weight: 780;
  overflow-wrap: anywhere;
}
.task-preview-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}
.task-filter-frame {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}
.task-filter-frame span {
  border-radius: 5px;
  background: #dbe7ff;
  padding: 7px 9px;
}
.task-preview-list {
  grid-row: span 2;
  display: grid;
  gap: 10px;
}
.task-preview-list > div {
  display: grid;
  grid-template-columns: minmax(180px, .35fr) minmax(260px, 1fr) minmax(140px, .28fr);
  gap: 12px;
}
.task-preview-list span,
.task-preview-list strong {
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}
.quote-builder-head {
  overflow: hidden;
}
.quote-column-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.quote-gp-input {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-left: 6px;
  padding: 0 10px;
  background: #fff3e0;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  min-height: 34px;
}
.quote-gp-pct-field {
  width: 64px;
  padding: 2px 6px;
}
.quote-column-option {
  min-height: 34px;
  padding: 0 10px;
  background: #f8fafc;
}
.quote-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.quote-export-actions form {
  margin: 0;
}
.quote-table {
  min-width: 1680px;
}
.quote-table .quote-export-excluded {
  background: #f1f5f9;
  color: var(--faint);
  opacity: .62;
}
.quote-table .form-select-sm {
  min-width: 120px;
}
.quote-quantity-input {
  min-width: 84px;
}
.quote-email-preview {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.quote-email-preview table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
.quote-email-preview th,
.quote-email-preview td {
  border: 1px solid var(--border);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}
.quote-email-preview th {
  background: #f8fafc;
  font-weight: 800;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.settings-nav {
  padding: 14px;
  position: sticky;
  top: 0;
}
.settings-nav-title {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.settings-link {
  display: block;
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 11px;
  font-weight: 700;
}
.settings-link:hover,
.settings-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.settings-link.disabled {
  color: var(--faint);
  cursor: default;
  pointer-events: none;
}
.settings-panel {
  min-width: 0;
}
.settings-toolbar {
  max-width: 420px;
  margin-bottom: 16px;
}
.add-option-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  margin-bottom: 14px;
}
.manual-mapping-form {
  grid-template-columns: minmax(160px, .8fr) minmax(240px, 1.2fr) auto;
}
.settings-option-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.mapping-toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.mapping-toolbar form {
  min-width: 220px;
}
.autosave-status {
  margin: -2px 0 10px;
  font-size: 12px;
}
.mapping-table-wrap {
  max-height: 68vh;
  overflow: auto;
}
.mapping-table-wrap table {
  table-layout: fixed;
  width: 100%;
}
.mapping-table-wrap table th:nth-child(1),
.mapping-table-wrap table td:nth-child(1) { width: 130px; }
.mapping-table-wrap table th:nth-child(2),
.mapping-table-wrap table td:nth-child(2) { width: 200px; }
.mapping-table-wrap table th:nth-child(3),
.mapping-table-wrap table td:nth-child(3) { min-width: 0; }
.mapping-table-wrap table th:nth-child(4),
.mapping-table-wrap table td:nth-child(4) { width: 200px; }
.mapping-table-wrap table th:nth-child(5),
.mapping-table-wrap table td:nth-child(5) { width: 88px; }
.mapping-table-wrap table th:nth-child(6),
.mapping-table-wrap table td:nth-child(6) { width: 76px; }
.mapping-table-wrap .form-control,
.mapping-table-wrap .form-select { width: 100%; min-width: 0; }
.sticky-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}

.upload-dropzone {
  border: 1px dashed var(--border-strong);
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: 14px;
}
.upload-dropzone .btn {
  width: 100%;
}
.upload-help { color: var(--muted); font-size: 13px; }
.import-wait {
  display: none;
  align-items: center;
  gap: 12px;
  border: 1px solid #c9dcff;
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 9px;
  padding: 12px 14px;
}
.import-wait[hidden] { display: none !important; }
.import-wait.show { display: flex; }
.import-wait span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.import-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.import-summary div {
  background: var(--accent-soft);
  border: 1px solid #c9dcff;
  border-radius: 9px;
  padding: 13px;
}
.import-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.import-summary strong { display: block; margin-top: 5px; font-size: 17px; }

.item-master-bulk-form {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.item-master-bulk-grid {
  display: grid;
  grid-template-columns: max-content minmax(180px, 1fr) max-content minmax(180px, 1fr) max-content minmax(140px, .7fr);
  gap: 12px;
  align-items: center;
}

.item-master-table-wrap table {
  min-width: 1180px;
}

.item-master-incomplete {
  background: #fffaf0;
}

.missing-field {
  border-color: #f3c969;
  background-color: #fff8e5;
}

.item-master-row-form {
  margin: 0;
}

.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.form-control, .form-select {
  border-color: var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(47, 111, 237, .12);
}
.form-label { color: var(--muted); font-size: 12px; font-weight: 750; }
.readonly-display,
.readonly-display:focus {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero,
  .home-kpi-strip,
  .dashboard-kpi-strip,
  .dashboard-visual-grid,
  .dashboard-filter-grid,
  .task-home-hero,
  .task-home-grid,
  .home-task-filters,
  .task-preview-grid { grid-template-columns: 1fr; }
  .task-home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-preview-list { grid-row: auto; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  .add-option-bar { grid-template-columns: 1fr; }
  .manual-mapping-form { grid-template-columns: 1fr; }
  .settings-option-form { grid-template-columns: 1fr; }
  .item-master-bulk-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-chart-wide,
  .dashboard-full-width {
    grid-column: auto;
  }
  .panel.wide { grid-column: auto; }
  .import-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body.sidebar-collapsed {
    --sidebar-width: 236px;
  }
  body.sidebar-collapsed .brand-lockup > div:not(.brand-mark),
  body.sidebar-collapsed .nav-item span,
  body.sidebar-collapsed .sidebar-group summary,
  body.sidebar-collapsed .user-meta,
  body.sidebar-collapsed .sidebar-footer .btn {
    width: auto;
    max-width: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  body.sidebar-collapsed .nav-item,
  body.sidebar-collapsed .user-card {
    justify-content: flex-start;
  }
  body.sidebar-collapsed .sidebar {
    overflow: visible;
  }
  body.sidebar-collapsed .sidebar-nav {
    overflow-y: auto;
  }
  body.sidebar-open {
    overflow: hidden;
  }
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .18s ease;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    border: 0;
    background: rgba(15, 23, 42, .36);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
  .topbar {
    padding: 0 14px;
    gap: 10px;
  }
  .topbar-title {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-subtitle,
  .topbar-actions {
    display: none;
  }
  .mobile-quick-nav {
    display: flex;
    gap: 7px;
    margin-left: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-quick-nav a {
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    padding: 7px 10px;
    white-space: nowrap;
  }
  .mobile-quick-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .mobile-action-panel {
    display: block;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
  }
  .mobile-action-panel summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 18px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
  }
  .mobile-action-panel summary::-webkit-details-marker {
    display: none;
  }
  .mobile-action-panel summary::after {
    content: "+";
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
  }
  .mobile-action-panel[open] summary::after {
    content: "-";
  }
  .mobile-action-panel-body {
    display: grid;
    gap: 10px;
    padding: 0 18px 14px;
  }
  .mobile-admin-scope-form {
    min-width: 0;
  }
  .mobile-admin-scope-form .form-label {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .mobile-action-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-action-buttons .btn {
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
  }
  .mobile-action-buttons .btn span:not(.nav-icon) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .content { padding: 18px; }
  .content { padding-bottom: 28px; }
  .filter-grid, .kpi-grid, .snapshot-grid, .import-summary, .form-row-2 { grid-template-columns: 1fr; }
  .dashboard-filter-panel {
    position: static;
  }
  .dashboard-filter-toggle {
    display: inline-flex;
  }
  .dashboard-filter-panel[data-filter-open] .dashboard-filter-grid {
    max-height: 1200px;
    opacity: 1;
    margin-top: 12px;
  }
  .dashboard-filter-panel[data-filter-open] .dashboard-date-quick {
    display: flex;
  }
  .dashboard-date-quick {
    display: none;
  }
  .dashboard-kpi-card,
  .dashboard-treemap-tile {
    padding: 14px;
  }
  .dashboard-treemap {
    min-height: 0;
  }
  .dashboard-treemap-tile {
    min-height: 104px;
    min-width: 100%;
  }
  .dashboard-detail-panel summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .quick-reminder-form { grid-template-columns: 1fr; }
  .quick-reminder-form .btn { justify-content: center; }
  .auth-panel { padding: 28px; }
  .dashboard-grid { gap: 12px; }
  .panel { padding: 16px; }
  .panel-header {
    flex-direction: column;
    gap: 8px;
  }
  .mapping-toolbar {
    width: 100%;
    justify-content: stretch;
  }
  .mapping-toolbar form,
  .mapping-toolbar .search-input {
    width: 100%;
    max-width: none;
  }
  .directory-meta {
    justify-content: flex-start;
  }
  .contact-table-wrap {
    display: none;
  }
  .contact-card-list {
    display: grid;
    gap: 12px;
  }
  .period-menu {
    position: static;
    min-width: 0;
    margin-top: 8px;
  }
  .task-home-summary h2 {
    font-size: 28px;
  }
  .task-home-stats {
    grid-template-columns: 1fr;
  }
  .task-queue-item {
    grid-template-columns: 1fr;
  }
  .task-queue-meta {
    justify-content: flex-start;
    max-width: none;
  }
  .home-task-board {
    overflow-x: auto;
  }
  .home-task-board-header,
  .home-task-board-row {
    min-width: 760px;
  }
  .task-preview-list > div {
    grid-template-columns: 1fr;
  }
  .contact-filter-grid,
  .backorder-filter-grid,
  .inventory-filter-grid {
    grid-template-columns: 1fr;
  }
  .inventory-table-wrap {
    display: none;
  }
  .inventory-card-list {
    display: grid;
    gap: 12px;
  }
  .inventory-stat-grid,
  .inventory-price-grid,
  .backorder-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .backorder-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }
  .backorder-table-wrap {
    display: none;
  }
  .contact-card-details {
    grid-template-columns: 1fr;
  }
  .pagination-bar {
    justify-content: space-between;
    margin-bottom: 24px;
  }
  .toast-stack {
    top: 68px;
    right: 16px;
  }
  .global-reminders-fab {
    display: none;
    right: 16px;
    bottom: 108px;
    padding: 10px 14px;
  }
  .global-note-fab {
    display: none;
    right: 16px;
    bottom: 16px;
    padding: 10px 14px;
  }
  .global-task-fab {
    display: none;
    right: 16px;
    bottom: 62px;
    padding: 10px 14px;
  }
  .mobile-modal-toggle {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  #mobile_reminders_toggle:checked ~ [data-reminders-modal],
  #mobile_note_toggle:checked ~ [data-note-modal],
  #mobile_task_toggle:checked ~ [data-task-modal] {
    display: grid !important;
  }
  #mobile_reminders_toggle:checked ~ [data-reminders-modal] .desktop-modal-close,
  #mobile_note_toggle:checked ~ [data-note-modal] .desktop-modal-close,
  #mobile_task_toggle:checked ~ [data-task-modal] .desktop-modal-close {
    display: none;
  }
  #mobile_reminders_toggle:checked ~ [data-reminders-modal] .mobile-modal-close-label,
  #mobile_note_toggle:checked ~ [data-note-modal] .mobile-modal-close-label,
  #mobile_task_toggle:checked ~ [data-task-modal] .mobile-modal-close-label {
    display: inline-grid;
  }
  .note-modal {
    align-items: end;
    padding: 0;
  }
  .note-modal-panel {
    width: 100%;
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
    padding: 18px;
  }
  .note-card-header,
  .note-history-head,
  .note-label-row {
    flex-direction: column;
    align-items: stretch;
  }
  .note-card-meta {
    justify-items: start;
    text-align: left;
  }
  .note-card-actions {
    justify-content: stretch;
  }
  .note-card-actions .btn {
    flex: 1;
  }
  .task-modal-grid,
  .task-recurrence-row {
    grid-template-columns: 1fr;
  }
  .notes-table-wrap {
    display: none;
  }
  .tasks-table-wrap {
    display: block;
  }
  .notes-list {
    display: grid;
    gap: 12px;
  }
}

@media print {
  .sidebar, .topbar, .mobile-action-panel, .global-note-fab, .global-task-fab,
  .global-reminders-fab, .note-modal, .sidebar-backdrop, .quote-export-actions,
  .quote-column-toggles, .quote-clear-btn, .filter-panel, .pagination-bar,
  .btn, form[data-global-note-form], [data-task-modal], [data-note-modal] {
    display: none !important;
  }
  .main { margin: 0 !important; padding: 0 !important; }
  .app-shell { display: block !important; }
  .content { padding: 0 !important; }
  .quote-export-excluded { display: none !important; }
  table { width: 100%; border-collapse: collapse; font-size: 11px; }
  th, td { border: 1px solid #ccc; padding: 4px 6px; }
  th { background: #2f6fed !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .panel { box-shadow: none; border: 1px solid #ddd; }
  @page { margin: 1.5cm; }
}
