/* ==========================================================================
   Phase 1 ERP — components.css
   Reusable UI: cards, buttons, badges, tables, dialogs, toasts, skeletons.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  font: 600 14px/1.2 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease,
    opacity 120ms ease;
}

.btn:hover {
  background: var(--surface-4);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--primary-400);
  outline-offset: 2px;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

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

.btn--danger {
  background: #b42318;
  color: #fff;
}

.btn--danger:hover {
  background: #912018;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--surface-3);
}

.btn--quiet {
  background: transparent;
  color: var(--muted);
}

.btn--quiet:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn--sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  min-width: 34px;
  padding: 6px;
}

.btn__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

/* --------------------------------------------------------------------------
   Cards / panels
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card__title {
  font-size: 15px;
  font-weight: 700;
}

.card__subtitle {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.card__body {
  padding: 20px;
}

.card__body--flush {
  padding: 0;
}

/* Stat cards / Top tiles (Unified 74px height, padding & 3px left border across all screens) */
.stat-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}

.stat-grid--dashboard {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  gap: 10px !important;
}

.stat,
.stat-card,
.kpi-card,
.stat-grid>.card,
.stat-grid>.stat,
.kpi-grid>.card,
.kpi-grid>.stat,
.kpis>.kpi {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  padding: 8px 14px !important;
  min-height: 74px !important;
  justify-content: center !important;
  background: var(--surface-2, var(--panel2, #f8fafc)) !important;
  border: 1px solid var(--border, var(--line, #e2e8f0)) !important;
  border-left: 3px solid var(--ink, var(--primary, var(--accent, #1f5fbf))) !important;
  border-radius: var(--r, 6px) !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease !important;
  overflow: hidden !important;
}

.card.stat,
.stat.card {
  padding: 8px 14px !important;
  min-height: 74px !important;
  gap: 2px !important;
  border: 1px solid var(--border, var(--line, #e2e8f0)) !important;
  border-left: 3px solid var(--primary, var(--accent, #1f5fbf)) !important;
}

.stat:hover,
.stat-card:hover,
.kpi-card:hover,
.kpi-grid>.card:hover {
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08) !important;
}

.stat__label,
.stat-card .stat__label {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--muted, #64748b) !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-bottom: 2px !important;
}

.stat__value,
.stat-card .stat__value {
  font-size: 19px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em !important;
  color: var(--text, #18212f) !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

.stat__value--text,
.stat-card .stat__value--text {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.stat__hint,
.stat-card .stat__hint,
.stat__sub {
  font-size: 10.5px !important;
  line-height: 1.2 !important;
  color: var(--muted, #64748b) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: 2px !important;
}

/* Unified Left Border across all tiles (Matching Financial Setup) */
.stat--accent,
.stat-card--accent,
.kpi-card--primary,
.stat--info,
.stat-card--info,
.kpi-card--info,
.stat--warning,
.stat-card--warning,
.kpi-card--warning,
.stat--success,
.stat-card--success,
.kpi-card--success,
.stat--danger,
.stat-card--danger,
.kpi-card--danger {
  border-left-color: var(--primary, var(--accent, #1f5fbf)) !important;
}

/* Proportional entity card & compact metric blocks (dashboard) */
.stat--entity,
.stat--2col {
  grid-column: span 2;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  padding: 8px 14px;
  min-height: 66px;
  gap: 2px;
  justify-content: center;
}

.stat--entity .stat__label {
  font-size: 10.5px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.stat--entity .stat__value,
.stat__value--entity {
  font-size: clamp(15px, 0.85vw + 7px, 17px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stat--entity .stat__hint {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat--compact {
  padding: 8px 12px;
  gap: 2px;
  min-height: 66px;
  justify-content: center;
}

.stat--compact .stat__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.stat--compact .stat__value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.stat--compact .stat__value--text {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat--compact .stat__hint {
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard panels & compact activity/entity grids */
.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.card--dashboard-panel {
  display: flex;
  flex-direction: column;
}

.card--dashboard-panel .card__header {
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.card--dashboard-panel .card__title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.table--dashboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.table--dashboard td {
  padding: 5px 12px;
  border-bottom: 1px solid var(--border-soft, var(--border));
  vertical-align: middle;
  line-height: 1.25;
}

.table--dashboard tbody tr:last-child td {
  border-bottom: 0;
}

.table--dashboard tbody tr:hover {
  background: var(--surface-1);
}

.table--dashboard .cell-primary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.table--dashboard .cell-secondary {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.table--dashboard .col-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.table--dashboard .badge {
  padding: 1.5px 7px;
  font-size: 10.5px;
  line-height: 1.2;
}

.table--dashboard .badge__dot {
  width: 5px;
  height: 5px;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  background: var(--surface-4);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge--ok {
  background: #e7f6ec;
  color: #146c43;
  border-color: #b7e4c7;
}

.badge--warn {
  background: #fff5e0;
  color: #92600a;
  border-color: #ffe1a8;
}

.badge--danger {
  background: #fdecea;
  color: #b42318;
  border-color: #f6c6c2;
}

.badge--info {
  background: var(--primary-50, #e8f1fe);
  color: var(--primary-700);
  border-color: var(--primary-100, #c8dcfb);
}

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

.badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* --------------------------------------------------------------------------
   Tables & Data Grids (Unified Across All Screens)
   -------------------------------------------------------------------------- */
.table-wrap,
.table-responsive,
.gridbox,
.gscroll,
.table-container {
  overflow-x: auto !important;
  max-width: 100% !important;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.table,
.grid,
table.grid,
.tax-table,
.wizard-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs, 13px);
  color: var(--text, #0f172a);
  letter-spacing: var(--track, 0);
}

.table th {
  position: sticky;
  top: 0;
  border-bottom: 2px solid var(--accent, var(--primary));
}

.table th,
.grid th,
table.table th,
table.grid th,
.table-responsive table th,
.table-wrap table th,
.tax-table th,
.wizard-table th,
.data-table th,
.gridbox th,
.gscroll th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--head, var(--surface-3, #f1f5f9));
  text-align: left;
  font-size: calc(var(--fs, 13px) * 0.92);
  font-weight: 600;
  letter-spacing: var(--track, 0.05em);
  text-transform: var(--upper, uppercase);
  color: var(--muted, #475569);
  padding: var(--py, 7px) var(--px, 12px);
  line-height: 1.35;
  border-top: none;
  border-bottom: 2px solid var(--accent, var(--primary));
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Table Column Resizer */
.table th.is-resizable,
.grid th.is-resizable,
table th.is-resizable {
  position: relative;
}

.table-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 10;
}

.table-col-resizer::after {
  content: '';
  position: absolute;
  top: 25%;
  bottom: 25%;
  right: 2px;
  width: 2px;
  background: var(--border, #cbd5e1);
  transition: background 120ms ease, opacity 120ms ease;
  opacity: 0.45;
}

.table-col-resizer:hover::after,
.table-col-resizer.is-resizing::after {
  background: var(--primary, #2563eb);
  opacity: 1;
  top: 10%;
  bottom: 10%;
  width: 3px;
}

body.is-col-resizing,
body.is-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.table th:hover,
.grid th:hover,
table th:hover {
  color: var(--text, #0f172a);
}

/* Sortable column headers */
.table th.is-sortable,
.grid th.is-sortable,
table th.is-sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.table th.is-sortable:hover,
.grid th.is-sortable:hover,
table th.is-sortable:hover {
  background: var(--surface-2, #eef3fb);
  color: var(--primary, #1f5fbf);
}

.table th .sort-indicator,
.grid th .sort-indicator,
table th .sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.35;
  transition: opacity 140ms ease;
  vertical-align: middle;
}

.table th.is-sortable:hover .sort-indicator,
.grid th.is-sortable:hover .sort-indicator,
table th.is-sortable:hover .sort-indicator {
  opacity: 0.8;
}

.table th.is-sorted-asc,
.table th.is-sorted-desc,
.grid th.is-sorted-asc,
.grid th.is-sorted-desc,
table th.is-sorted-asc,
table th.is-sorted-desc {
  background: var(--surface-2, #eef3fb);
  color: var(--primary, #1f5fbf);
}

.table th.is-sorted-asc .sort-indicator,
.table th.is-sorted-desc .sort-indicator,
.grid th.is-sorted-asc .sort-indicator,
.grid th.is-sorted-desc .sort-indicator,
table th.is-sorted-asc .sort-indicator,
table th.is-sorted-desc .sort-indicator {
  opacity: 1;
  color: var(--primary, #1f5fbf);
  font-weight: 800;
}

/* Filter Row */
.table-filter-row th {
  position: sticky;
  top: 30px;
}

.table-filter-row th,
.grid-filter-row th {
  background: var(--surface-2, #f8fafc);
  padding: 6px 10px;
  border-bottom: 2px solid var(--border);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  position: sticky;
  top: 30px;
  z-index: 1;
}

.table-filter-row th.col-actions {
  text-align: right;
}

.grid-col-filter {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  font-weight: normal;
  color: var(--text);
  background: var(--surface, #ffffff);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.grid-col-filter:focus {
  border-color: var(--primary, #1f5fbf);
  box-shadow: 0 0 0 2px var(--primary-soft, #e8f0fc);
}

.grid-col-filter::placeholder {
  color: var(--text-faint, #8b98a7);
  font-size: 11.5px;
}

.grid-col-filter-clear {
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 4px);
}

.grid-col-filter-clear:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* Filter Row Toggle Button */
.btn-toggle-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle-filters.is-active {
  background: var(--primary-soft, #e8f0fc);
  color: var(--primary, #1f5fbf);
  border-color: var(--primary, #1f5fbf);
  font-weight: 600;
}

.btn-toggle-filters .filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--primary, #1f5fbf);
  color: #fff;
}

.table td {
  padding: var(--py, 6px) var(--px, 12px);
  border-bottom: 1px solid var(--line, var(--border));
  vertical-align: middle;
  color: var(--text);
  font-size: var(--fs, 13px);
}

.table tbody tr:nth-child(even) {
  background: var(--alt, var(--surface-2));
}

.table tbody tr:hover {
  background: var(--hover, var(--surface-1));
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Pin column & Pinned row styling */
.col-pin {
  width: 38px;
  min-width: 38px;
  max-width: 42px;
  text-align: center;
  padding: 4px 6px !important;
  vertical-align: middle;
}

.table th.col-pin {
  text-align: center;
  padding: 4px 6px !important;
  color: var(--muted);
  width: 38px;
  user-select: none;
}

/* Accounting screen compact table headers */
#acct-content .table th,
#acct-ledgers .table th,
#acct-periods .table th,
#acct-rates .table th {
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.35;
}

.pin-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.btn-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 140ms ease;
  line-height: 1;
}

.btn-pin:hover {
  background: var(--surface-3, #e2e8f0);
  color: var(--primary, #1f5fbf);
}

.btn-pin.is-pinned {
  background: var(--primary-soft, #e8f0fc);
  color: var(--primary, #1f5fbf);
  border-color: var(--primary-border, #bfdbfe);
  box-shadow: 0 1px 2px rgba(31, 95, 191, 0.15);
}

.btn-pin.is-pinned .pin-icon {
  fill: currentColor;
}

.table tbody tr.is-pinned,
.table tbody tr.is-selected {
  background: var(--primary-soft, #f0f6ff) !important;
}

.table tbody tr.is-pinned {
  box-shadow: inset 3px 0 0 var(--primary, #1f5fbf);
}

.table tbody tr.is-pinned td,
.table tbody tr.is-selected td {
  border-bottom-color: var(--primary-border, #bfdbfe);
}

.table tbody tr.is-pinned:hover,
.table tbody tr.is-selected:hover {
  background: var(--primary-soft-hover, #e6f0fd) !important;
}

/* Toolbar Edit, Print and Delete buttons */
.btn-toolbar-edit,
.btn-toolbar-print,
.btn-toolbar-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 140ms ease;
}

/* --------------------------------------------------------------------------
   Grid Action Buttons & Tiny Legend Tooltips
   -------------------------------------------------------------------------- */
.col-actions,
.row-actions {
  text-align: right;
  white-space: nowrap;
}

.table th.col-actions,
.grid th.col-actions,
table th.col-actions {
  text-align: right;
  z-index: 4;
}

/* Sticky right actions column so action buttons stay visible without extreme horizontal scroll */
.table-wrap .table th.col-actions,
.table-wrap .table td.col-actions,
.table-responsive .table th.col-actions,
.table-responsive .table td.col-actions {
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--surface, #ffffff);
  box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.08);
}

.table-wrap .table th.col-actions,
.table-responsive .table th.col-actions {
  z-index: 6;
  background: var(--head, var(--surface-3, #f1f5f9));
}

.table-wrap .table tr:hover td.col-actions,
.table-responsive .table tr:hover td.col-actions {
  background: var(--surface-hover, #f8fafc);
}

.table-wrap .table tr.is-pinned td.col-actions,
.table-responsive .table tr.is-pinned td.col-actions,
.table-wrap .table tr.is-selected td.col-actions,
.table-responsive .table tr.is-selected td.col-actions {
  background: #eff6ff;
}

.btn-action-icon,
.col-actions .btn,
.row-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 3px 6px !important;
  min-width: 26px !important;
  height: 26px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  border-radius: 4px !important;
  position: relative !important;
  transition: all 0.14s ease !important;
}

.btn-action-icon svg,
.col-actions .btn svg,
.row-actions .btn svg {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0 !important;
}

.btn-action-icon .btn-legend {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

/* Tiny legend popup on hover (grid and action buttons, excluding navigation and ribbon) */
[data-tooltip]:not(.nav-item):not(.erp-ribbon-btn) {
  position: relative;
}

[data-tooltip]:not(.nav-item):not(.erp-ribbon-btn)::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  right: 50%;
  transform: translateX(50%) translateY(-4px);
  padding: 3px 7px;
  border-radius: 4px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
}

[data-tooltip]:not(.nav-item):not(.erp-ribbon-btn)::after {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 50%;
  transform: translateX(50%) translateY(2px);
  border: 4px solid transparent;
  border-top-color: #0f172a;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease;
  pointer-events: none;
  z-index: 10000;
}

[data-tooltip]:not(.nav-item):not(.erp-ribbon-btn):hover::before,
[data-tooltip]:not(.nav-item):not(.erp-ribbon-btn):hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(50%) translateY(-2px);
}

.btn-toolbar-edit.is-ready,
.btn-toolbar-print.is-ready {
  color: var(--primary, #1f5fbf);
  font-weight: 600;
  background: var(--primary-soft, #e8f0fc);
  border-color: var(--primary-border, #bfdbfe);
}

.btn-toolbar-delete.is-ready {
  color: var(--danger, #dc2626);
  font-weight: 600;
  background: var(--danger-soft, #fef2f2);
  border-color: var(--danger-border, #fca5a5);
}

@media (max-width: 768px) {
  .table--stack td.col-pin {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 6px 0 !important;
    justify-content: flex-start;
    gap: 8px;
  }

  .table--stack td.col-pin::before {
    content: 'Pin Record';
  }
}

.cell-primary {
  font-weight: 600;
  color: var(--text);
}

.cell-secondary {
  font-size: 12px;
  color: var(--muted);
}

.cell-mono {
  font-family: var(--mono);
  font-size: 13px;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}

.empty__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
}

.empty__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.empty__hint {
  font-size: 14px;
  max-width: 44ch;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
      var(--surface-3) 25%,
      var(--surface-4) 50%,
      var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
  min-height: 14px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Inline loading overlay for panels/tables */
.loading {
  position: relative;
  min-height: 120px;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(1px);
}

/* --------------------------------------------------------------------------
   Tabs (segmented look)
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.tabs__btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--font);
  padding: 8px 14px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  white-space: nowrap;
}

.tabs__btn:hover {
  color: var(--text);
}

.tabs__btn.is-active {
  background: var(--surface-1);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* --------------------------------------------------------------------------
   Toolbar (search + filters + actions above a table)
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--gap, 12px);
  flex-wrap: wrap;
  padding: calc(var(--py, 6px) + 6px) var(--px, 16px);
  border-bottom: 1px solid var(--toolbar-border, var(--line, var(--border)));
  background: var(--toolbar-bg, var(--panel, var(--surface)));
  color: var(--toolbar-text, var(--text));
}

.toolbar__grow {
  flex: 1 1 220px;
  min-width: 180px;
}

.toolbar__spacer {
  flex: 1;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
  font: 400 14px var(--font);
  color: var(--text);
}

.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 96, 196, 0.15);
}

/* --------------------------------------------------------------------------
   Dialog / modal (confirm, discard-changes)
   -------------------------------------------------------------------------- */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-dialog);
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.dialog {
  width: min(460px, 100%);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  padding: 22px;
}

.dialog__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dialog__message {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 20px;
  line-height: 1.55;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  animation: toast-in 180ms ease;
}

.toast--success {
  border-left-color: #16a34a;
}

.toast--error {
  border-left-color: #dc2626;
}

.toast--warning {
  border-left-color: #d97706;
}

.toast__body {
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
}

.toast__title {
  font-weight: 700;
  margin-bottom: 2px;
}

.toast__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Universal Sticky Screen Heading & Dedicated Compact Button Strip
   Sticking directly to dedicated 1-row menu path strip.
   Row 1: Main Heading (28px Calibri Light) + Sub-heading / Description
   Row 2: Dedicated Button Strip below Heading (Compact height: 26px)
   -------------------------------------------------------------------------- */
.page-header,
.content-header,
.workspace-header,
.module-header:not(.modal-header) {
  position: sticky !important;
  top: 0 !important;
  z-index: 35 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 4px !important;
  min-height: 42px !important;
  margin-top: -22px !important;
  /* Sticks flush against the dedicated 1-row menu path strip */
  margin-left: -26px !important;
  /* Full-bleed span matching .main padding */
  margin-right: -26px !important;
  margin-bottom: 16px !important;
  padding: 6px 26px 8px !important;
  background: var(--toolbar-bg, var(--panel, var(--surface, #ffffff))) !important;
  border-bottom: 1px solid var(--toolbar-border, var(--line, #e2e8f0)) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Row 1: Screen Heading Row (Heading + Sub-heading / Description alongside) */
.page-header>div:first-child:not(.page-header__actions):not(.page-actions),
.workspace-header>.workspace-header__title,
.workspace-header>div:first-child,
.content-header>div:first-child,
.module-header>div:first-child {
  position: relative !important;
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 8px 16px !important;
  width: 100% !important;
  min-height: 32px !important;
  overflow: visible !important;
}

/* Main Heading — unified across all screens in 28px Calibri Light */
.page-header__title,
.page-title,
.content-title,
.workspace-header__title h1,
.workspace-header__title h2,
.workspace-header h1,
.workspace-header h2,
.module-header h1,
.wiki-hero__title,
.ai-hub-header__title,
.page-header h1,
.page-header h2,
.content-header h1,
.content-header h2 {
  font-family: 'Calibri Light', Calibri, 'Segoe UI Light', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  font-size: 28px !important;
  font-weight: 300 !important;
  letter-spacing: -0.01em !important;
  color: var(--heading-color, var(--primary, var(--accent, #1f5fbf))) !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
  order: 1 !important;
  position: relative !important;
  cursor: help !important;
}

/* In-Page Headings, Section Titles, Card Titles, Dialogs & Modals follow Theme Colors */
.card__title,
.section-title,
.section-header h2,
.section-header h3,
.panel-title,
.panel h3,
.modal__header h3,
.modal-title,
.dialog__title,
.widget__title,
.wizard-card__title,
.wizard-summary-card__title,
.hub-domain-card__title,
.sliding-panel__title,
.page-section-title,
.box-title {
  color: var(--heading-color, var(--primary, var(--accent, #1f5fbf)));
}

/* Contrast safety: When accent toolbar is active, header heading uses light accent text */
:root[data-toolbar="accent"] .page-header .page-header__title,
:root[data-toolbar="accent"] .content-header .page-title,
:root[data-toolbar="accent"] .workspace-header h1,
:root[data-toolbar="accent"] .module-header h1 {
  color: var(--accent-t, #ffffff) !important;
}

:root[data-toolbar="accent"] .page-header__subtitle,
:root[data-toolbar="accent"] .page-subtitle,
:root[data-toolbar="accent"] .page-desc {
  color: var(--balloon-text, #f8fafc) !important;
}

/* --------------------------------------------------------------------------
   Hover Balloon for Heading Informative Descriptions / Subtitles
   Hidden from normal layout flow (0 space on heading row).
   Displays as an interactive floating balloon when user hovers over the heading.
   -------------------------------------------------------------------------- */
.page-header__subtitle,
.page-subtitle,
.page-desc,
.page-header p:not(.page-header__title):not(.page-header__actions *):not(.page-actions *),
.content-eyebrow,
.workspace-header p:not(.workspace-header__actions *),
.workspace-header .text-muted,
.workspace-header__title p,
.module-header p:not(.module-header__actions *),
.acct-context-tag,
.ai-hub-header__pill,
.wiki-hero__subtitle {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  z-index: 1000 !important;
  max-width: 520px !important;
  min-width: 200px !important;
  width: max-content !important;
  padding: 8px 14px 9px !important;
  border-radius: var(--r, 6px) !important;
  background: var(--balloon-bg, #0f172a) !important;
  color: var(--balloon-text, #f8fafc) !important;
  box-shadow: var(--balloon-shadow, 0 10px 25px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.2)) !important;
  border: 1px solid var(--balloon-border, rgba(255, 255, 255, 0.15)) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: break-word !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-4px) scale(0.98) !important;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s !important;
  order: 2 !important;
  flex: 0 1 auto !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Hover balloon upward pointer arrow */
.page-header__subtitle::before,
.page-subtitle::before,
.page-desc::before,
.content-eyebrow::before,
.workspace-header p::before,
.module-header p::before,
.acct-context-tag::before,
.wiki-hero__subtitle::before {
  content: "" !important;
  position: absolute !important;
  bottom: 100% !important;
  left: 20px !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 6px solid transparent !important;
  border-right: 6px solid transparent !important;
  border-bottom: 6px solid var(--balloon-bg, #0f172a) !important;
  pointer-events: none !important;
}

/* Hover & Focus Triggers for Heading Balloon */
.page-header__title:hover~.page-header__subtitle,
.page-header__title:hover~.page-subtitle,
.page-header__title:hover~.page-desc,
.page-header__title:hover~p,
.page-header__title:focus-visible~.page-header__subtitle,
.page-header__title:focus-visible~.page-subtitle,
.page-header__title:focus-visible~.page-desc,
.page-header__title:focus-visible~p,

.page-title:hover~.page-header__subtitle,
.page-title:hover~.page-subtitle,
.page-title:hover~.page-desc,
.page-title:hover~p,
.page-title:focus-visible~.page-header__subtitle,
.page-title:focus-visible~.page-subtitle,
.page-title:focus-visible~.page-desc,
.page-title:focus-visible~p,

.content-title:hover~.content-eyebrow,
.content-title:hover~p,
.content-title:focus-visible~.content-eyebrow,
.content-title:focus-visible~p,

h1:hover~.page-header__subtitle,
h1:hover~.page-subtitle,
h1:hover~.page-desc,
h1:hover~p,
h1:focus-visible~.page-header__subtitle,
h1:focus-visible~.page-subtitle,
h1:focus-visible~.page-desc,
h1:focus-visible~p,

h2:hover~.page-header__subtitle,
h2:hover~.page-subtitle,
h2:hover~.page-desc,
h2:hover~p,

:has(> .page-header__title:hover)>.page-header__subtitle,
:has(> .page-header__title:hover)>.page-subtitle,
:has(> .page-header__title:hover)>.page-desc,
:has(> .page-header__title:hover)>p,
:has(> .page-title:hover)>.page-header__subtitle,
:has(> .page-title:hover)>.page-subtitle,
:has(> .page-title:hover)>.page-desc,
:has(> .page-title:hover)>p,
:has(> .content-title:hover)>.content-eyebrow,
:has(> .content-title:hover)>p,
:has(> h1:hover)>.page-header__subtitle,
:has(> h1:hover)>.page-subtitle,
:has(> h1:hover)>.page-desc,
:has(> h1:hover)>p,

.page-header__subtitle:hover,
.page-subtitle:hover,
.page-desc:hover,
.content-eyebrow:hover,
.workspace-header p:hover,
.module-header p:hover,
.wiki-hero__subtitle:hover,

.page-header__subtitle.is-balloon-active,
.page-subtitle.is-balloon-active,
.page-desc.is-balloon-active,
.content-eyebrow.is-balloon-active,
.is-balloon-active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

/* Row 2: Dedicated Button Strip below the Screen Heading */
.page-header__actions,
.page-actions,
.workspace-header__actions,
.content-actions,
.content-header__actions,
.content-header>div:last-child:not(:first-child),
.module-header>div:last-child:not(:first-child) {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 6px 8px !important;
  width: 100% !important;
  min-height: 28px !important;
  padding-top: 5px !important;
  margin-top: 2px !important;
  border-top: 1px solid var(--border-light, rgba(226, 232, 240, 0.6)) !important;
  box-sizing: border-box !important;
}

/* Hide empty action strips */
.page-header__actions:empty,
.page-actions:empty,
.workspace-header__actions:empty,
.content-actions:empty,
.content-header__actions:empty {
  display: none !important;
}

/* Compact button height in dedicated action strip below heading */
.page-header__actions .btn,
.page-actions .btn,
.workspace-header__actions .btn,
.content-actions .btn,
.content-header__actions .btn,
.content-header .btn,
.module-header .btn {
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  line-height: 24px !important;
  border-radius: var(--radius-sm, 4px) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.page-header__actions .btn svg,
.page-actions .btn svg,
.workspace-header__actions .btn svg,
.content-header .btn svg,
.module-header .btn svg {
  width: 13px !important;
  height: 13px !important;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Page headers delegate breadcrumbs to the dedicated sticky menu path strip under the ribbon */
.page-header .breadcrumb,
.content-header .breadcrumb,
.workspace-header .breadcrumb {
  display: none !important;
}

.breadcrumb span[aria-hidden] {
  opacity: 0.6;
}

.breadcrumb .current {
  color: var(--text-2);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Vertical Module Spine (Optimized module header layout)
   -------------------------------------------------------------------------- */
.acct-spine-zone,
.module-spine-zone {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 18px;
}

.module-vertical-spine {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  user-select: none;
}

.module-vertical-spine__text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary-dark, #0b3b60);
  line-height: 1;
  white-space: nowrap;
  max-height: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acct-spine-content,
.module-spine-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-header--compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.page-header--compact .breadcrumb {
  margin-bottom: 2px;
  font-size: 12.5px;
}

.page-header--compact .page-header__title,
.page-header--compact .page-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 2px 0;
  line-height: 1.25;
}

.page-header--compact .page-header__subtitle,
.page-header--compact .page-subtitle {
  font-size: 13px;
  color: var(--muted, #61707f);
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.35;
}

.page-header--compact .page-actions,
.page-header--compact .page-header__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.acct-context-tag {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2, #3f4c5a);
  margin-top: 1px;
}

@media (max-width: 768px) {

  .acct-spine-zone,
  .module-spine-zone {
    flex-direction: column;
    gap: 8px;
  }

  .module-vertical-spine {
    width: auto;
    justify-content: flex-start;
  }

  .module-vertical-spine__text {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 22px;
    max-height: none;
  }
}

/* --------------------------------------------------------------------------
   Filter Bar (Single-Row Horizontal Filter Controls)
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface-1, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 8px);
  box-sizing: border-box;
}

.filter-bar .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter-bar .filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #61707f);
  line-height: 1.2;
  white-space: nowrap;
}

.filter-bar .filter-group select,
.filter-bar .filter-group input {
  height: 36px;
  min-height: 36px;
  font-size: 13px;
  box-sizing: border-box;
}

.filter-bar .filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .filter-bar {
    flex-wrap: wrap;
  }

  .filter-bar .filter-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.pagination__info {
  font-size: 13px;
  color: var(--text-muted, #61707f);
}

.pagination__controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pagination__size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted, #61707f);
}

.pagination__size-label {
  font-size: 12.5px;
  white-space: nowrap;
}

.pagination__size select {
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  background: var(--surface, #ffffff);
  color: var(--text);
  cursor: pointer;
}

.pagination__current {
  font-size: 12.5px;
  padding: 0 4px;
  white-space: nowrap;
}

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

/* Definition list (detail views) */
.dl {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 10px 20px;
  font-size: 14px;
}

.dl dt {
  color: var(--muted);
  font-weight: 600;
}

.dl dd {
  color: var(--text);
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   Drawers (side overlays for detailed inspectors like Vendor 360)
   -------------------------------------------------------------------------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-panel, 210);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: flex-end;
  animation: fade-in 150ms ease;
}

.drawer {
  width: min(560px, 100vw);
  height: 100%;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-drawer 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer--wide {
  width: min(780px, 100vw);
}

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.drawer__close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius);
  transition: background 120ms ease, color 120ms ease;
}

.drawer__close:hover {
  background: var(--surface-4);
  color: var(--text);
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--surface-1);
}

.drawer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   Modals (centered popups for actions like Create Vendor, Bank Change)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-dialog, 250);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  animation: fade-in 150ms ease;
}

.modal {
  width: min(640px, 100%);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scale-modal 180ms cubic-bezier(0.16, 1, 0.3, 1);
  max-height: calc(100vh - 40px);
}

.modal--wide {
  width: min(840px, 100%);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.modal__header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.modal__close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius);
  transition: background 120ms ease, color 120ms ease;
}

.modal__close:hover {
  background: var(--surface-4);
  color: var(--text);
}

.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   Sub-tabs & segment buttons
   -------------------------------------------------------------------------- */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--font);
  padding: 8px 14px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active,
.tab-btn.is-active {
  background: var(--surface-1);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* --------------------------------------------------------------------------
   Panels, Grid & Form controls in modals/drawers
   -------------------------------------------------------------------------- */
.panel {
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.form-control {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius);
  background: var(--surface-1);
  color: var(--text);
  font: 400 14px var(--font);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 96, 196, 0.15);
}

.form-control:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert--info {
  background: #e8f1fe;
  color: #1a4f9c;
  border-color: #c8dcfb;
}

.alert--warn {
  background: #fff8eb;
  color: #92600a;
  border-color: #ffe1a8;
}

.alert--danger {
  background: #fdecea;
  color: #b42318;
  border-color: #f6c6c2;
}

.alert--ok {
  background: #e7f6ec;
  color: #146c43;
  border-color: #b7e4c7;
}

/* Utility classes */
.btn--secondary {
  background: var(--surface-3);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--surface-4);
}

.text-ok {
  color: #146c43;
}

.text-info {
  color: var(--primary);
}

.text-accent {
  color: #7c3aed;
}

.text-danger {
  color: #b42318;
}

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

.font-bold {
  font-weight: 700;
}

.mono {
  font-family: var(--mono);
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mt-16 {
  margin-top: 16px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slide-drawer {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes scale-modal {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }

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

/* ==========================================================================
   Legal Entity Guided Setup Wizard
   ========================================================================== */
.wizard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease-out forwards;
}

.wizard-modal {
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: scale-modal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.wizard-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border-soft, #f1f5f9);
  background: var(--surface-1, #f8fafc);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.wizard-header__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-header__badge {
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
}

.wizard-header__subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted, #64748b);
}

.wizard-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--muted, #64748b);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.wizard-close-btn:hover {
  background: var(--surface-2, #e2e8f0);
  color: var(--text, #0f172a);
}

/* Stepper Bar */
.wizard-stepper {
  display: flex;
  background: var(--surface-0, #ffffff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding: 12px 24px;
  overflow-x: auto;
  gap: 16px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted, #94a3b8);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  cursor: default;
}

.wizard-step__circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2, #f1f5f9);
  color: var(--muted, #64748b);
  border: 1px solid var(--border, #cbd5e1);
  transition: all 0.2s ease;
}

.wizard-step.is-active {
  color: var(--primary, #1e40af);
  font-weight: 600;
}

.wizard-step.is-active .wizard-step__circle {
  background: var(--primary, #1e40af);
  color: #ffffff;
  border-color: var(--primary, #1e40af);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

.wizard-step.is-done {
  color: #15803d;
}

.wizard-step.is-done .wizard-step__circle {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

/* Wizard Body */
.wizard-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.wizard-pane {
  display: none;
  animation: fade-in 0.2s ease;
}

.wizard-pane.is-active {
  display: block;
}

/* Option Cards (Grid Selectable) */
.wizard-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.wizard-card-option {
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface-0, #ffffff);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard-card-option:hover {
  border-color: var(--primary-light, #93c5fd);
  background: var(--surface-1, #f8fafc);
  transform: translateY(-1px);
}

.wizard-card-option.is-selected {
  border-color: var(--primary, #2563eb);
  background: #eff6ff;
}

.wizard-card-option__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-card-option__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.wizard-card-option__radio {
  accent-color: var(--primary, #2563eb);
  width: 16px;
  height: 16px;
}

.wizard-card-option__desc {
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.4;
}

/* Feature checklist box */
.wizard-feature-box {
  background: var(--surface-1, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 12px;
}

.wizard-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft, #f1f5f9);
}

.wizard-feature-item:last-child {
  border-bottom: none;
}

/* Review Summary */
.wizard-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.wizard-summary-card {
  background: var(--surface-1, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 14px;
}

.wizard-summary-card__title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted, #64748b);
  margin-bottom: 8px;
}

.wizard-summary-card__item {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-soft, #e2e8f0);
}

.wizard-summary-card__item:last-child {
  border-bottom: none;
}

/* Launchpad / Success */
.wizard-success-panel {
  text-align: center;
  padding: 24px 12px;
}

.wizard-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}

.wizard-success-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin-bottom: 6px;
}

.wizard-success-desc {
  font-size: 13.5px;
  color: var(--muted, #64748b);
  max-width: 540px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.wizard-success-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  text-align: left;
}

.wizard-metric-tile {
  background: var(--surface-1, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px 14px;
}

.wizard-metric-tile__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-transform: uppercase;
}

.wizard-metric-tile__value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #0f172a);
  margin-top: 4px;
}

.wizard-success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Wizard Footer */
.wizard-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface-1, #f8fafc);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   Enterprise Setup & Maturity Hub Styles
   ========================================================================== */
.hub-score-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
  margin-bottom: 20px;
}

.hub-score-meter {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hub-score-number {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  color: #38bdf8;
}

.hub-score-pct {
  font-size: 18px;
  font-weight: 600;
  color: #94a3b8;
}

.hub-score-grade {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
}

.hub-score-grade--ok {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.hub-score-grade--warn {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.hub-score-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 10px;
}

.hub-score-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #4ade80 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.hub-safeguard-banner {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.hub-safeguard-banner--live {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.hub-safeguard-banner--pre {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.hub-safeguard-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}

.hub-domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.hub-domain-card {
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  position: relative;
}

.hub-domain-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
  border-color: var(--primary, #0284c7);
}

.hub-domain-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hub-domain-card__icon {
  font-size: 24px;
  line-height: 1;
}

.hub-domain-card__title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin-top: 6px;
}

.hub-domain-card__summary {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin: 6px 0 12px;
  line-height: 1.4;
  flex: 1;
}

.hub-domain-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-soft, #f1f5f9);
  padding-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
}

.hub-statutory-note {
  background: #f8fafc;
  border-left: 4px solid #0284c7;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
}

.hub-statutory-note strong {
  color: #0f172a;
}

.hub-statutory-note.note-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
  color: #78350f;
}

.hub-nav-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin-bottom: 20px;
  overflow-x: auto;
}

.hub-nav-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #64748b);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hub-nav-tab.is-active {
  color: var(--primary, #0284c7);
  border-bottom-color: var(--primary, #0284c7);
}

.hub-nav-tab:hover:not(.is-active) {
  color: var(--text, #0f172a);
}

/* ==========================================================================
   Excel-like Editable Data Grid (.table--excel / .excel-grid)
   ========================================================================== */
.table--excel {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  table-layout: fixed;
}

.table--excel thead th {
  background: #f1f5f9;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-top: none;
  line-height: 1.25;
  white-space: nowrap;
  user-select: none;
}

.table--excel thead th.col-num {
  width: 38px;
  text-align: center;
  background: #e2e8f0;
  color: #64748b;
}

.table--excel tbody tr {
  background: #ffffff;
  transition: background 0.1s ease;
}

.table--excel tbody tr:nth-child(even) {
  background: #fafafa;
}

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

.table--excel tbody tr.is-active-row {
  background: #eff6ff !important;
}

.table--excel td {
  padding: 0 !important;
  border: 1px solid #cbd5e1 !important;
  height: 32px;
  vertical-align: middle;
  position: relative;
  background: transparent;
}

.table--excel td.line-num {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc !important;
  user-select: none;
  cursor: default;
  width: 38px;
  padding: 0 4px !important;
}

.table--excel tbody tr:hover td.line-num,
.table--excel tbody tr.is-active-row td.line-num {
  background: #e2e8f0 !important;
  color: #1e293b;
}

/* Seamless Excel cell inputs & dropdowns */
.table--excel td input.excel-cell,
.table--excel td select.excel-cell,
.table--excel td input.line-desc,
.table--excel td input.line-hsn,
.table--excel td input.line-qty,
.table--excel td input.line-price,
.table--excel td select.line-item-code {
  width: 100% !important;
  height: 100% !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 4px 8px !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-family: inherit !important;
  font-size: 13px !important;
  color: var(--text, #0f172a) !important;
  box-sizing: border-box !important;
}

/* Cell active focus box (Excel Green outline) */
.table--excel td:focus-within {
  outline: 2px solid #16a34a !important;
  outline-offset: -2px !important;
  z-index: 5 !important;
  background: #f0fdf4 !important;
}

.table--excel td:focus-within input,
.table--excel td:focus-within select {
  background: transparent !important;
}

/* Formatted calculated cell */
.table--excel td.line-calc-total {
  padding: 4px 10px !important;
  font-weight: 600;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #1e293b;
  background: #f8fafc;
  cursor: default;
  user-select: text;
}

.table--excel td.col-action {
  text-align: center;
  width: 36px;
  padding: 0 !important;
  background: #fafafa;
}

.table--excel .btn-remove-line {
  border: none;
  background: transparent;
  color: #94a3b8;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  transition: all 0.15s ease;
}

.table--excel .btn-remove-line:hover {
  background: #fee2e2;
  color: #dc2626;
}

.excel-grid-hint {
  color: #64748b;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.excel-grid-hint kbd {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10.5px;
  font-family: monospace;
  color: #334155;
}

/* ============================================================
   TRYERP Executive Dashboards (Chart.js + CMYK Palette)
   ============================================================ */

.strip {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 16px;
}

.strip i {
  flex: 1;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi b {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mu, var(--muted, #5d667a));
}

.kpi strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
  color: var(--tx, var(--text, #18212f));
}

.kpi span {
  font-size: 12px;
  color: var(--mu, var(--muted, #5d667a));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.dash-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sf, var(--surface, #fff));
  color: var(--tx, var(--text, #1a2030));
  border: 1px solid var(--ln, var(--border, #dfe3ea));
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dash-nav button i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
}

.dash-nav button[aria-selected="true"],
.dash-nav button.is-active {
  border-color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--ink);
  font-weight: 600;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.dash-card {
  background: var(--sf, var(--surface, #fff));
  border: 1px solid var(--ln, var(--border, #dfe3ea));
  border-radius: 8px;
  padding: 14px 16px;
  grid-column: span 6;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dash-card.w4 {
  grid-column: span 4;
}

.dash-card.w8 {
  grid-column: span 8;
}

.dash-card.w12 {
  grid-column: span 12;
}

.dash-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--tx, var(--text, #1a2030));
}

.dash-card p {
  margin: 0 0 10px;
  color: var(--mu, var(--muted, #5d667a));
  font-size: 12.5px;
}

.dash-cv {
  position: relative;
  height: 250px;
}

.dash-scroll {
  overflow-x: auto;
}

table.dash-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

table.dash-tbl th {
  text-align: left;
  font-weight: 600;
  color: var(--mu, var(--muted, #5d667a));
  border-bottom: 1px solid var(--ln, var(--border, #dfe3ea));
  padding: 6px 10px 6px 0;
}

table.dash-tbl td {
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--grid, #e6e9ef);
  color: var(--tx, var(--text, #1a2030));
}

table.dash-tbl .n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  border: 1px solid var(--ln, var(--border, #dfe3ea));
  font-weight: 500;
}

.chip.good {
  color: var(--ok, #1f8f5f);
  border-color: var(--ok, #1f8f5f);
  background: rgba(31, 143, 95, 0.08);
}

.chip.warn {
  color: var(--y, #e0a000);
  border-color: var(--y, #e0a000);
  background: rgba(224, 160, 0, 0.08);
}

.chip.risk {
  color: var(--bad, #c93a3a);
  border-color: var(--bad, #c93a3a);
  background: rgba(201, 58, 58, 0.08);
}

.dash-bar {
  height: 10px;
  background: var(--grid, #e6e9ef);
  border-radius: 5px;
  overflow: hidden;
  margin: 6px 0 4px;
}

.dash-bar i {
  display: block;
  height: 100%;
  background: var(--ink, var(--primary, #0a8fc2));
  border-radius: 5px;
}

.dash-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  gap: 10px;
}

@media (max-width: 860px) {

  .dash-card,
  .dash-card.w4,
  .dash-card.w8 {
    grid-column: span 12;
  }

  .dash-cv {
    height: 230px;
  }
}