/*
 * FacturaProRD enterprise interface
 * Presentation-only layer loaded after the historical stylesheet.
 * Business logic, routes and data-action contracts remain unchanged.
 */

:root {
  --sidebar-width: 248px;
  --sidebar-collapsed-width: 68px;
  --topbar-height: 80px;
  --content-max-width: 1408px;

  --color-bg: #faf9f6;
  --color-bg-soft: #fdfcf9;
  --color-surface: #fffefa;
  --color-surface-soft: #fbfaf7;
  --color-surface-muted: #f5f3ee;
  --color-text: #263345;
  --color-text-strong: #142235;
  --color-text-muted: #718096;
  --color-text-soft: #929baa;
  --color-border: #e7e2d8;
  --color-border-strong: #dcd6ca;
  --color-primary: #187f6b;
  --color-primary-strong: #116856;
  --color-primary-soft: #e8f2ee;
  --color-primary-faint: #f2f7f4;
  --color-blue: #2563a9;
  --color-blue-soft: #edf4fb;
  --color-warning: #b86b16;
  --color-warning-soft: #fff4e5;
  --color-danger: #c33b4b;
  --color-danger-soft: #fff0f1;
  --color-success: #16836d;
  --color-success-soft: #e7f5ee;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-xs: 0 1px 2px rgb(41 34 25 / 3%);
  --shadow-sm: 0 8px 24px rgb(41 34 25 / 5%);
  --shadow-md: 0 18px 48px rgb(27 35 45 / 11%);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --control-height: 38px;
  --control-height-sm: 32px;
  --control-height-lg: 42px;
  --page-gutter: clamp(20px, 1.9vw, 36px);
}

* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

*:hover,
*:focus-within {
  scrollbar-color: #c8c4ba transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: transparent;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  min-width: 40px;
  min-height: 40px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: transparent !important;
  background-clip: content-box !important;
}

*:hover::-webkit-scrollbar-thumb,
*:focus-within::-webkit-scrollbar-thumb {
  background: #c8c4ba !important;
  background-clip: content-box !important;
}

*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html {
  color-scheme: light;
  background: var(--color-bg);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

.app-background {
  background: var(--color-bg);
}

.app-shell {
  min-height: 100dvh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--color-bg);
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.app-workspace {
  min-width: 0;
  background: var(--color-bg);
}

.view-root {
  min-width: 0;
  padding: var(--page-gutter);
  background: var(--color-bg);
}

.app-shell.is-terminal-route .view-root,
.app-shell.is-auth-route .view-root {
  padding: 0;
}

/* Sidebar */
.sidebar-host {
  width: var(--sidebar-width);
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-soft);
}

.sidebar,
.sidebar__surface {
  width: var(--sidebar-width);
  background: var(--color-bg-soft);
}

.sidebar__surface {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - (2 * var(--space-6)));
  padding: 0 16px 16px;
  border: 0;
  box-shadow: none;
}

.sidebar__brand {
  min-height: 82px;
  margin: 0 -16px 12px;
  justify-content: center;
  padding: 4px 16px;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar__logo-full {
  display: block;
  width: min(100%, 154px);
  height: 76px;
  flex: 0 1 154px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.sidebar__logo-mark {
  display: none;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar__logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.sidebar__logo-copy strong {
  color: var(--color-text-strong);
  font-size: 15px;
  font-weight: 800;
}

.sidebar__logo-copy small {
  margin-top: 1px;
  color: var(--color-text-soft);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar__nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  padding: 2px 0;
  overflow: auto;
}

.sidebar__group {
  display: grid;
  gap: 4px;
}

.sidebar__section-label {
  padding: 0 12px 5px;
  color: var(--color-text-soft);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.sidebar__group-links {
  display: grid;
  gap: 3px;
}

.sidebar__link {
  min-height: 40px;
  padding: 8px 12px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #334052;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.sidebar__link:hover {
  border-color: #ede8df;
  background: #f6f4ef;
  color: var(--color-text-strong);
  transform: none;
}

.sidebar__link.is-active {
  border-color: #e0ece7;
  background: var(--color-primary-faint);
  color: var(--color-primary-strong);
  box-shadow: 0 8px 22px rgb(24 127 107 / 8%);
}

.sidebar__icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
}

.sidebar__icon-svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}

.sidebar__link:hover .sidebar__icon,
.sidebar__link.is-active .sidebar__icon {
  background: transparent;
  color: currentColor;
  box-shadow: none;
}

.sidebar__link-copy strong {
  font-size: 12.5px;
  font-weight: 650;
}

.sidebar__subnav {
  margin: 2px 0 4px 29px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--color-border);
}

.sidebar__sublink {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 11.5px;
}

.sidebar__footer {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  margin-top: 10px;
  min-width: 0;
  min-height: 0;
  align-content: start;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid #d9e4f2;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 111, 226, 0.11), transparent 36%),
    linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 24px rgba(37, 61, 96, 0.07);
}

.sidebar__footer::after {
  position: absolute;
  top: -27px;
  right: -24px;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(45, 113, 218, 0.1);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.sidebar__footer .sidebar__plan {
  position: relative;
  z-index: 1;
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1763be;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1.35;
  text-transform: uppercase;
}

.sidebar__footer strong {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-strong);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sidebar__branch {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: #718198;
  font-size: 9.5px;
  line-height: 1.3;
}

.sidebar__branch svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: #4b78b5;
  stroke-width: 1.8;
}

.sidebar__branch span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell.is-sidebar-collapsed .sidebar-host,
.app-shell.is-sidebar-collapsed .sidebar,
.app-shell.is-sidebar-collapsed .sidebar__surface {
  width: var(--sidebar-collapsed-width);
}

.app-shell.is-sidebar-collapsed .sidebar__surface {
  padding-inline: 9px;
}

.app-shell.is-sidebar-collapsed .sidebar__brand {
  width: auto;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  margin-inline: -9px;
  justify-content: center;
  padding: 0 10px;
}

.app-shell.is-sidebar-collapsed .sidebar__logo-full {
  display: none;
}

.app-shell.is-sidebar-collapsed .sidebar__logo-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  padding: 0;
}

.app-shell.is-sidebar-collapsed .sidebar__nav {
  padding: 0;
}

.app-shell.is-sidebar-collapsed .sidebar__group {
  gap: 2px;
}

.app-shell.is-sidebar-collapsed .sidebar__section-label,
.app-shell.is-sidebar-collapsed .sidebar__logo-copy,
.app-shell.is-sidebar-collapsed .sidebar__link-copy,
.app-shell.is-sidebar-collapsed .sidebar__subnav,
.app-shell.is-sidebar-collapsed .sidebar__footer {
  display: none;
}

@media (max-height: 760px) and (min-width: 961px) {
  .sidebar__footer {
    gap: 5px;
    margin-top: 7px;
    padding: 10px 12px;
  }
}

.app-shell.is-sidebar-collapsed .sidebar__link {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.is-sidebar-collapsed .sidebar__icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
}

.app-shell.is-sidebar-collapsed .sidebar__icon-svg {
  width: 16px;
  height: 16px;
}

/* Topbar */
.topbar-host {
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--color-border);
  background: rgb(255 254 250 / 97%);
  box-shadow: none;
}

.topbar {
  min-height: var(--topbar-height);
  padding: 10px var(--page-gutter);
  background: transparent;
}

.topbar__start,
.topbar__actions {
  gap: 10px;
}

.topbar__brand-logo,
.topbar__summary > span {
  display: none;
}

.topbar__summary {
  gap: 0;
}

.topbar__summary strong {
  color: var(--color-text-strong);
  font-size: 16px;
  font-weight: 750;
}

.topbar__summary small {
  max-width: 520px;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__date {
  color: var(--color-text-soft);
  font-size: 10.5px;
}

.topbar__plan {
  padding: 3px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: 9.5px;
  font-weight: 700;
}

.icon-btn {
  width: var(--control-height);
  min-width: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: none;
}

.icon-btn:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-soft);
  color: var(--color-primary-strong);
  transform: none;
}

.icon-btn__svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-pill {
  min-height: 40px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: none;
}

.user-pill__avatar {
  width: 30px;
  height: 30px;
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  font-size: 10px;
}

.user-pill__copy strong {
  font-size: 11.5px;
}

.user-pill__copy span {
  font-size: 9.5px;
}

/* Page composition */
.page,
[class$="-page"],
[class*="-page "] {
  width: min(100%, var(--content-max-width));
  margin-inline: auto;
}

.page {
  display: grid;
  gap: 18px;
}

.page__header {
  min-height: auto;
  padding: 0 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.page__header::after {
  display: none;
}

.page__title-group {
  max-width: 760px;
  gap: 5px;
}

.page__eyebrow {
  color: var(--color-primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.page__title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: clamp(25px, 1.8vw, 30px);
  font-weight: 780;
  line-height: 1.12;
}

.page__description {
  max-width: 720px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.page__toolbar,
.toolbar,
.filter-actions,
.table-actions,
.modal__header-actions {
  gap: 8px;
}

.highlight-list {
  gap: 6px;
}

.info-strip,
.alert,
.notice,
[class*="-alert"],
[class*="-notice"] {
  border-width: 1px;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.content-grid,
.table-grid {
  gap: 12px;
}

.card,
.table-card,
.panel,
.filter-card,
.form-card,
.detail-card,
.settings-card,
[class$="__card"] {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

.card {
  padding: 16px;
}

.stats-grid > .card {
  min-height: 108px;
  padding: 14px 16px;
}

.card__header {
  gap: 10px;
  margin-bottom: 10px;
}

.card__title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: 13px;
  font-weight: 750;
}

.card__subtitle,
.card__meta {
  color: var(--color-text-muted);
  font-size: 10.5px;
}

.card__value {
  color: var(--color-text-strong);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 750;
  letter-spacing: 0;
}

.card-list {
  gap: 7px;
  font-size: 12px;
}

.card-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
}

/* Controls */
.btn {
  min-height: var(--control-height);
  padding: 0 14px;
  gap: 7px;
  border-width: 1px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn:hover {
  transform: none;
  box-shadow: none;
}

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

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

.btn--secondary,
.btn--neutral {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.btn--secondary:hover,
.btn--neutral:hover,
.btn--ghost:hover {
  border-color: #c9c4b9;
  background: var(--color-surface-soft);
}

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

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

.btn--sm,
.table-actions .btn,
.table-actions--compact .btn {
  min-height: var(--control-height-sm);
  padding-inline: 10px;
  font-size: 11px;
}

.field {
  gap: 5px;
}

.field__label,
label:not(.switch):not(.checkbox):not(.radio) {
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
}

.field__input,
.field__select,
.field__textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
select,
textarea {
  min-height: var(--control-height);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  font-size: 12.5px;
  box-shadow: none;
}

.field__input,
.field__select,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
select {
  height: var(--control-height);
  padding: 0 11px;
}

.field__textarea,
textarea {
  min-height: 82px;
  padding: 10px 11px;
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  outline: 3px solid rgb(24 127 107 / 10%);
  box-shadow: none;
}

.field__hint,
.field__error,
.form-hint,
.help-text {
  font-size: 10px;
}

.field__error,
.is-error {
  color: var(--color-danger);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-primary);
}

input[type="search"] {
  border-radius: 999px;
  padding-inline: 14px;
}

.switch,
[class*="switch"] {
  --switch-accent: var(--color-primary);
}

.badge,
.status-badge,
[class*="badge--"],
[class*="status--"] {
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 750;
  box-shadow: none;
}

.badge--primary,
.badge--success,
.status-badge.is-active,
.status-badge.is-success {
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

.badge--warning,
.status-badge.is-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge--danger,
.status-badge.is-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

/* Filters, tabs and tables */
.filters,
.filter-bar,
.toolbar,
[class$="__filters"],
[class*="filter-panel"] {
  padding: 12px;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

.filters,
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}

.filters > .field,
.filter-bar > .field {
  min-width: 0;
}

.filters > .filter-actions,
.filter-bar > .filter-actions {
  align-self: end;
}

/* Filter sections use the inner form as their only visual container. */
.card.reports-filter-card,
.card.cash-history-filters-card,
.card.reports-table-card:has([data-supplier-filters-slot]) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.card.cash-history-filters-card .card__header {
  padding-bottom: 0;
  border-bottom: 0;
}

.tabs,
[class$="__tabs"] {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.tab,
[class$="__tab"] {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11.5px;
  font-weight: 700;
}

.tab.is-active,
[class$="__tab"].is-active {
  background: var(--color-surface);
  color: var(--color-primary-strong);
  box-shadow: var(--shadow-xs);
}

.table-card {
  overflow: hidden;
}

.table,
table {
  width: 100%;
  border-collapse: collapse;
  color: var(--color-text);
  font-size: 11.5px;
}

.table th,
.table td,
table th,
table td {
  padding: 12px 18px;
  border-color: var(--color-border);
  vertical-align: middle;
}

.table th,
table th {
  height: 40px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.table tbody tr,
table tbody tr {
  transition: background-color 120ms ease;
}

.table tbody tr:hover,
table tbody tr:hover {
  background: #f8f7f2;
}

.table td[data-label="Total"],
.table .amount,
.money,
[class*="amount"] {
  font-variant-numeric: tabular-nums;
}

.pagination,
[class*="pagination"] {
  gap: 4px;
}

.pagination button,
[class*="pagination"] button {
  min-width: 32px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

/* Modals, drawers, toasts and loading */
.modal-overlay {
  padding: 20px;
  background: rgb(20 34 53 / 38%);
  backdrop-filter: blur(3px);
}

.modal {
  max-height: calc(100dvh - 40px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.modal--md {
  width: min(520px, 100%);
}

.modal--lg {
  width: min(760px, 100%);
}

.modal--xl {
  width: min(1040px, 100%);
}

.modal--xxl {
  width: min(1380px, 100%);
}

.modal__header {
  min-height: 62px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.modal__title {
  color: var(--color-text-strong);
  font-size: 17px;
  font-weight: 780;
}

.modal__subtitle {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 11px;
}

.modal__body {
  padding: 16px 18px;
}

.modal__footer {
  min-height: 60px;
  padding: 10px 18px;
  gap: 8px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.toast-root {
  top: 74px;
  right: 18px;
  gap: 8px;
}

.toast {
  width: min(330px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.global-loader {
  background: rgb(250 249 246 / 88%);
  backdrop-filter: blur(5px);
}

.loader-card {
  min-width: 260px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.loader-card__mark {
  width: 34px;
  height: 34px;
}

/* Common domain surfaces */
[class*="dashboard"] .card,
[class*="accounting"] .card,
[class*="report"] .card,
[class*="settings"] .card,
[class*="customer"] .card,
[class*="supplier"] .card,
[class*="purchase"] .card,
[class*="inventory"] .card,
[class*="product"] .card,
[class*="repair"] .card,
[class*="warrant"] .card {
  border-radius: var(--radius-md);
}

[class*="metric"],
[class*="stat-card"],
[class*="summary-card"] {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

[class*="hero"] {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

/* POS terminal keeps its specialized workflow, with the same density system. */
.pos-terminal,
.pos-terminal-shell,
.page--pos {
  --pos-border: var(--color-border);
  --pos-surface: var(--color-surface);
  --pos-bg: var(--color-bg);
  --pos-accent: var(--color-primary);
  color: var(--color-text);
  background: var(--pos-bg);
}

.pos-terminal button,
.pos-terminal input,
.pos-terminal select,
.pos-checkout-modal button,
.pos-checkout-modal input,
.pos-checkout-modal select {
  font-family: inherit;
}

.pos-terminal__topbar,
.pos-terminal__header,
.pos-terminal__toolbar,
.pos-cart__header,
.pos-cart__footer {
  border-color: var(--pos-border);
  background: var(--pos-surface);
  box-shadow: none;
}

.pos-product-card,
.pos-catalog-card,
[class*="pos-product-card"] {
  border: 1px solid var(--pos-border);
  border-radius: var(--radius-md);
  background: var(--pos-surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.pos-product-card:hover,
.pos-catalog-card:hover,
[class*="pos-product-card"]:hover {
  border-color: #c9c4b9;
  box-shadow: var(--shadow-sm);
  transform: none;
}

.pos-checkout-modal__content,
.pos-payment-panel,
.pos-checkout-summary,
[class*="pos-checkout"] [class*="card"] {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

.pos-checkout-modal__actions {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.pos-payment-keypad button,
[class*="pos-keypad"] button {
  min-height: 40px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: none;
}

.pos-payment-keypad button:hover,
[class*="pos-keypad"] button:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-faint);
}

/* Authentication and onboarding */
.auth-screen,
.auth-shell,
[class*="onboarding"] {
  background: var(--color-bg);
}

.login-card,
.auth-card,
.auth-panel,
[class*="onboarding"] .card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.login-card,
.auth-card {
  padding: 24px;
}

/* Responsive structure */
@media (max-width: 1180px) {
  :root {
    --sidebar-width: 216px;
    --page-gutter: 18px;
  }

  .topbar__date {
    display: none;
  }

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

@media (max-width: 920px) {
  :root {
    --topbar-height: 56px;
    --page-gutter: 14px;
  }

  .app-shell,
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar-host {
    position: fixed;
    z-index: 80;
    inset: 0 auto 0 0;
    width: min(276px, 86vw);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .app-shell.is-mobile-menu-open .sidebar-host {
    transform: translateX(0);
  }

  .sidebar,
  .sidebar__surface {
    width: min(276px, 86vw);
  }

  .sidebar__surface {
    box-shadow: 18px 0 46px rgb(23 34 49 / 16%);
  }

  .topbar {
    padding-inline: 12px;
  }

  .topbar__plan,
  .user-pill__copy,
  .topbar__summary small {
    display: none;
  }

  .view-root {
    padding: 14px;
  }

  .page__header {
    gap: 12px;
  }

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

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

  .modal-overlay {
    padding: 10px;
  }

  .modal {
    max-height: calc(100dvh - 20px);
  }
}

/* Customers workspace: compact commercial directory */
.customers-page {
  --customers-line: #d9e3ee;
  --customers-soft: #f7f9fc;
  --customers-ink: #132238;
  --customers-muted: #718096;
  width: min(100%, 1420px);
  min-width: 0;
  margin-inline: auto;
  padding: 26px 28px 38px;
  gap: 18px;
}

.customers-page > .page__header {
  width: 100%;
  max-width: none;
  padding: 0;
}

.customers-page > .page__header .page__eyebrow {
  margin-bottom: 8px;
  color: #0766c9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.customers-page > .page__header .page__title {
  margin: 0;
  color: var(--customers-ink);
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.customers-page > .page__header .page__description {
  margin-top: 6px;
  color: var(--customers-muted);
  font-size: 13px;
}

.customers-page > .inventory-tabs {
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--customers-line);
  border-radius: 7px;
  background: #f2f5f9;
  box-shadow: none;
}

.customers-page > .inventory-tabs .inventory-tab {
  min-height: 34px;
  padding: 7px 17px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #526176;
  font-size: 12px;
  font-weight: 700;
}

.customers-page > .inventory-tabs .inventory-tab.is-active {
  background: #fff;
  color: #0866c6;
  box-shadow: 0 1px 3px rgba(22, 43, 72, .08);
}

.customers-page .inventory-tab-panels,
.customers-page .inventory-tab-panel,
.customers-page .customers-section,
.customers-page .customer-list-content {
  min-width: 0;
}

.customers-page .customers-section,
.customers-page .customer-list-content,
.customers-page .customers-section > [data-customers-results] {
  gap: 16px;
}

.customers-page .customers-toolbar--actions-only {
  min-height: 40px;
  margin-top: -58px;
  padding: 0 0 18px;
  pointer-events: none;
}

.customers-page .customers-new-button {
  min-width: 142px;
  min-height: 40px;
  gap: 8px;
  border-radius: 8px;
  box-shadow: 0 7px 16px rgba(8, 102, 198, .14);
  pointer-events: auto;
}

.customers-page .customers-new-button > span {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.customers-page .reports-filter-card {
  padding: 14px 16px;
  border: 1px solid var(--customers-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(32, 52, 78, .035);
}

.customers-page .customers-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(150px, 190px)) auto;
  align-items: end;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.customers-page .customers-filters .field {
  min-width: 0;
  gap: 7px;
}

.customers-page .customers-filters .field__label {
  color: #253650;
  font-size: 11px;
  font-weight: 700;
}

.customers-page .customers-filters .field__input,
.customers-page .customers-filters .field__select {
  width: 100%;
  min-height: 39px;
  border-color: #d5e0ec;
  border-radius: 7px;
  background-color: #fff;
  font-size: 12px;
}

.customers-page .customers-filter-field--compact {
  width: 100%;
  max-width: 190px;
}

.customers-page .customers-filters__clear {
  min-width: 96px;
  min-height: 39px;
  padding-inline: 14px;
  border-color: #d5e0ec;
  border-radius: 7px;
  background: #fff;
  color: #36506e;
  white-space: nowrap;
}

.customers-page .customers-filters__clear:hover {
  border-color: #a9c8e9;
  background: #f2f7fc;
  color: #075fb7;
}

.customers-page .customers-filters__clear-icon {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.customers-page .customers-filter-search {
  position: relative;
  display: block;
  min-width: 0;
}

.customers-page .customers-filter-search .field__input {
  box-sizing: border-box;
  padding-inline-start: 42px !important;
}

.customers-page .customers-filter-search__icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 11px;
  height: 11px;
  border: 1.7px solid #73839a;
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.customers-page .customers-filter-search__icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.7px;
  border-radius: 2px;
  background: #73839a;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.customers-page .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.customers-page .customers-metric-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 96px;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid var(--customers-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(32, 52, 78, .04);
}

.customers-page .customers-metric-card__icon {
  display: inline-flex;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f1ff;
  color: #176bd1;
}

.customers-page .customers-metric-card__icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customers-page .customers-metric-card--green .customers-metric-card__icon {
  background: #e4f8e9;
  color: #159244;
}

.customers-page .customers-metric-card--amber .customers-metric-card__icon {
  background: #fff2d9;
  color: #b8790c;
}

.customers-page .customers-metric-card--purple .customers-metric-card__icon {
  background: #f1e7ff;
  color: #7c3bd1;
}

.customers-page .customers-metric-card--violet .customers-metric-card__icon {
  background: #ecebff;
  color: #5146e5;
}

.customers-page .receivables-stats .customers-metric-card--blue .card__value {
  color: #176bd1;
}

.customers-page .receivables-stats .customers-metric-card--amber .card__value {
  color: #d97706;
}

.customers-page .receivables-stats .customers-metric-card--purple .card__value {
  color: #8a3fd1;
}

.customers-page .receivables-stats .customers-metric-card--violet .card__value {
  color: #5146e5;
}

.customers-page .customers-metric-card__content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.customers-page .customers-metric-card .card__title {
  overflow: hidden;
  margin: 0;
  color: var(--customers-ink);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customers-page .customers-metric-card .card__meta {
  overflow: hidden;
  margin: 0;
  color: var(--customers-muted);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customers-page .customers-metric-card .card__value {
  margin-top: 7px;
  color: var(--customers-ink);
  font-size: 20px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0;
}

.customers-page .customers-summary-card {
  position: relative;
  overflow: visible;
  padding: 0;
  border: 1px solid var(--customers-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(32, 52, 78, .045);
}

.customers-page .customers-summary-card .catalog-table-wrap {
  overflow: visible;
  border-radius: 8px 8px 0 0;
}

.customers-page .customers-table--summary {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.customers-page .customers-table--summary th,
.customers-page .customers-table--summary td {
  min-width: 0;
  border-color: #e3e9f0;
}

.customers-page .customers-table--summary th {
  height: 40px;
  padding: 10px 16px;
  background: #fbfcfe;
  color: #66778e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  white-space: nowrap;
}

.customers-page .customers-table--summary td {
  height: 64px;
  padding: 10px 16px;
  color: #26364c;
  font-size: 11px;
}

.customers-page .customers-table--summary th:nth-child(1) { width: 28%; }
.customers-page .customers-table--summary th:nth-child(2) { width: 20%; }
.customers-page .customers-table--summary th:nth-child(3) { width: 16%; }
.customers-page .customers-table--summary th:nth-child(4) { width: 16%; }
.customers-page .customers-table--summary th:nth-child(5) { width: 16%; }
.customers-page .customers-table--summary th:nth-child(6) { width: 4%; }

.customers-page .receivables-table--summary th:nth-child(1) { width: 25%; }
.customers-page .receivables-table--summary th:nth-child(2) { width: 27%; }
.customers-page .receivables-table--summary th:nth-child(3) { width: 17%; }
.customers-page .receivables-table--summary th:nth-child(4) { width: 15%; }
.customers-page .receivables-table--summary th:nth-child(5) { width: 12%; }
.customers-page .receivables-table--summary th:nth-child(6) { width: 4%; }

.customers-page .receivables-table__sale {
  min-width: 0;
}

.customers-page .receivables-table__sale strong,
.customers-page .receivables-table__sale small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customers-page .customers-table__row {
  height: 64px;
}

.customers-page .customers-table__row:hover {
  background: #f7faff;
  box-shadow: inset 3px 0 #2f7fde;
}

.customers-page .customers-table__identity {
  gap: 12px;
}

.customers-page .customers-table__avatar {
  flex-basis: 36px;
  width: 36px;
  height: 36px;
  background: #e8f2f1;
  color: #207e73;
  font-size: 10px;
}

.customers-page .customers-table__avatar--blue {
  background: #e7f0fb;
  color: #1766b7;
}

.customers-page .customers-table__avatar--orange {
  background: #fff0d9;
  color: #9a6116;
}

.customers-page .customers-table__avatar--teal {
  background: #e5f3ef;
  color: #267c70;
}

.customers-page .customers-table__avatar--yellow {
  background: #fff3d8;
  color: #9b6715;
}

.customers-page .customers-table__identity strong {
  color: #253348;
  font-size: 11px;
  font-weight: 750;
}

.customers-page .customers-table__identity small {
  margin-top: 2px;
  color: #7b8ba0;
  font-size: 9px;
}

.customers-page .customers-table__segment {
  color: #718096;
  font-size: 11px;
}

.customers-page .customers-table__purchases,
.customers-page .customers-table__balance {
  color: #27364b;
  font-size: 11px;
  font-weight: 700;
}

.customers-page .customers-table__balance--due {
  color: #e23c32;
}

.customers-page .customers-table--summary .badge {
  width: max-content;
  min-width: 0;
  max-width: 150px;
  min-height: 22px;
  justify-content: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
}

.customers-page .customers-table__menu-cell {
  position: relative;
  overflow: visible;
  padding-inline: 4px 10px;
  text-align: right;
}

.customers-page .customers-table__menu {
  position: relative;
  display: inline-flex;
}

.customers-page .customers-table__menu-trigger {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #66788f;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.customers-page .customers-table__menu-trigger:hover,
.customers-page .customers-table__menu-trigger:focus-visible {
  background: #eaf2fd;
  color: #0a66c2;
  outline: none;
}

.customers-page .customers-table__menu-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  width: 150px;
  padding: 5px;
  border: 1px solid var(--customers-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(25, 45, 72, .16);
}

.customers-page .customers-table__menu-popover[hidden] {
  display: none;
}

.customers-page .customers-table__menu-popover button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #26364c;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.customers-page .customers-table__menu-popover button:hover,
.customers-page .customers-table__menu-popover button:focus-visible {
  background: #edf4fd;
  color: #075fb8;
  outline: none;
}

.customers-page .customers-pagination {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  border-top: 1px solid #e3e9f0;
  color: #718096;
  font-size: 10px;
}

.customers-page .customers-pagination__controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.customers-page .customers-pagination__size select,
.customers-page .customers-pagination__controls button,
.customers-page .customers-pagination__current {
  min-height: 32px;
  border: 1px solid var(--customers-line);
  border-radius: 6px;
  background: #fff;
  color: #43536a;
  font: inherit;
}

.customers-page .customers-pagination__size select {
  padding: 6px 28px 6px 10px;
}

.customers-page .customers-pagination__controls button,
.customers-page .customers-pagination__current {
  display: inline-flex;
  min-width: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
}

.customers-page .customers-pagination__controls button {
  cursor: pointer;
}

.customers-page .customers-pagination__controls button:disabled {
  cursor: default;
  opacity: .42;
}

.customers-page .customers-pagination__current {
  border-color: #0b67c9;
  background: #0b67c9;
  color: #fff;
  font-weight: 800;
}

.customers-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .customers-page {
    padding-inline: 22px;
  }

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

  .customers-page .customers-filter-field--compact {
    max-width: none;
  }

  .customers-page .customers-filters__clear {
    width: 100%;
  }

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

  .customers-page .customers-table--summary th,
  .customers-page .customers-table--summary td {
    padding-inline: 10px;
  }
}

@media (max-width: 760px) {
  .customers-page {
    width: 100%;
    padding: 18px 14px 30px;
    gap: 14px;
  }

  .customers-page > .page__header .page__title {
    font-size: 25px;
  }

  .customers-page .customers-toolbar--actions-only {
    min-height: 0;
    margin-top: 0;
    padding-bottom: 0;
  }

  .customers-page .customers-new-button {
    width: 100%;
  }

  .customers-page .customers-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  .customers-page .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .customers-page .customers-metric-card {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 86px;
    gap: 10px;
    padding: 12px;
  }

  .customers-page .customers-metric-card__icon {
    width: 40px;
    height: 40px;
  }

  .customers-page .customers-metric-card__icon svg {
    width: 19px;
    height: 19px;
  }

  .customers-page .customers-metric-card .card__value {
    font-size: 17px;
  }

  .customers-page .customers-summary-card .catalog-table-wrap {
    overflow: visible;
  }

  .customers-page .customers-table--summary,
  .customers-page .customers-table--summary tbody,
  .customers-page .customers-table--summary tr {
    display: block;
    width: 100%;
  }

  .customers-page .customers-table--summary thead {
    display: none;
  }

  .customers-page .customers-table--summary tbody {
    display: grid;
    gap: 0;
    padding: 0 12px;
  }

  .customers-page .customers-table--summary .customers-table__row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    padding: 13px 38px 13px 0;
  }

  .customers-page .customers-table--summary td {
    display: flex;
    width: auto;
    height: auto;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border: 0;
  }

  .customers-page .customers-table--summary td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 9px;
  }

  .customers-page .customers-table--summary td:not(:first-child):not(.customers-table__menu-cell)::before {
    content: attr(data-label);
    color: #7b899b;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .customers-page .customers-table__menu-cell {
    position: absolute;
    top: 15px;
    right: 0;
    display: block;
    padding: 0;
  }

  .customers-page .customers-table__menu-popover {
    position: fixed;
    top: auto;
    right: 18px;
    bottom: 18px;
    width: min(220px, calc(100vw - 36px));
  }

  .customers-page .customers-table--summary .badge {
    width: auto;
  }

  .customers-page .customers-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .customers-page .customers-pagination__controls {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 430px) {
  .customers-page .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customers-page .customers-table--summary .customers-table__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .customers-page .customers-table--summary td:first-child {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .topbar__summary strong {
    font-size: 13px;
  }

  .topbar__logout-btn {
    display: none;
  }

  .page__title {
    font-size: 22px;
  }

  .page__header {
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    width: 100%;
  }

  .page__title-group,
  .page__toolbar {
    min-width: 0;
    max-width: 100%;
  }

  .page__toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .page__toolbar .btn {
    min-width: 0;
    width: 100%;
  }

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

  .stats-grid > .card {
    min-height: 94px;
    padding: 12px;
  }

  .stats-grid .card__value {
    font-size: clamp(18px, 6.5vw, 24px);
  }

  .card {
    padding: 13px;
  }

  .filters,
  .filter-bar,
  [class$="__filters"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-card {
    overflow-x: auto;
  }

  .table,
  table {
    min-width: 680px;
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding-inline: 14px;
  }

  .modal__footer {
    flex-wrap: wrap;
  }

  .modal__footer .btn {
    flex: 1 1 140px;
  }
}

/* Accounts receivable detail */
.modal:has(.receivable-detail-modal__body) {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100dvh - 24px);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: #d6e0ec;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgb(15 33 58 / 24%);
}

.modal:has(.receivable-detail-modal__body) .modal__header {
  min-height: 76px;
  padding: 16px 22px 14px;
  align-items: flex-start;
  border-bottom: 1px solid #dbe4ee;
}

.modal:has(.receivable-detail-modal__body) .modal__title {
  color: #14243a;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.18;
}

.modal:has(.receivable-detail-modal__body) .modal__subtitle {
  margin-top: 4px;
  color: #697a91;
  font-size: 12.5px;
  line-height: 1.35;
}

.modal:has(.receivable-detail-modal__body) .modal__header .icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid #cfdae7;
  border-radius: 50%;
  background: #ffffff;
  color: #14243a;
  font-size: 15px;
  text-transform: uppercase;
}

.receivable-detail-modal__body {
  max-height: calc(100dvh - 126px);
  padding: 12px 22px 10px;
  color: #14243a;
}

.receivable-detail {
  display: grid;
  gap: 10px;
}

.receivable-detail__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(245px, 0.85fr);
  min-height: 132px;
  overflow: hidden;
  border: 1px solid #bdd6f8;
  border-radius: 10px;
  background: linear-gradient(120deg, #fbfdff 0%, #f1f7ff 100%);
}

.receivable-detail__identity,
.receivable-detail__balance {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px;
}

.receivable-detail__status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  margin-bottom: 9px;
  padding: 0 11px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff1df;
  color: #cf5d0c;
  font-size: 12px;
  font-weight: 760;
}

.receivable-detail__status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb923c;
  box-shadow: 0 0 0 4px rgb(251 146 60 / 10%);
}

.receivable-detail__status--paid {
  border-color: #bbebcf;
  background: #eaf9f0;
  color: #168444;
}

.receivable-detail__status--paid > span {
  background: #22a65a;
}

.receivable-detail__status--partial {
  border-color: #bed7fb;
  background: #eaf3ff;
  color: #075fc3;
}

.receivable-detail__status--partial > span {
  background: #1473e6;
}

.receivable-detail__status--overdue {
  border-color: #fecaca;
  background: #fff0f0;
  color: #c92e3c;
}

.receivable-detail__status--overdue > span {
  background: #e5484d;
}

.receivable-detail__identity h4 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #0d5fd3;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.15;
}

.receivable-detail__identity > strong {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: #18283d;
  font-size: 14px;
  line-height: 1.35;
}

.receivable-detail__identity > p {
  margin: 9px 0 0;
  overflow-wrap: anywhere;
  color: #718097;
  font-size: 12.5px;
  line-height: 1.35;
}

.receivable-detail__balance {
  align-items: flex-end;
  border-left: 1px solid #cdddf2;
  text-align: right;
}

.receivable-detail__balance > span {
  color: #66758c;
  font-size: 13px;
}

.receivable-detail__balance > strong {
  margin-top: 7px;
  color: #0d5fd3;
  font-size: clamp(25px, 2.7vw, 31px);
  font-weight: 800;
  line-height: 1.08;
}

.receivable-detail__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.receivable-detail__metric {
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border: 1px solid #d8e1ec;
  border-radius: 9px;
  background: #ffffff;
}

.receivable-detail__metric-icon,
.receivable-detail__empty-icon {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #edf5ff;
  color: #075fc3;
}

.receivable-detail__metric-icon svg,
.receivable-detail__empty-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receivable-detail__metric-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.receivable-detail__metric-copy > span {
  color: #66758c;
  font-size: 11.5px;
}

.receivable-detail__metric-copy > strong {
  overflow-wrap: anywhere;
  color: #17273d;
  font-size: 13.5px;
  font-weight: 760;
  line-height: 1.35;
}

.receivable-detail__payments {
  padding: 10px 12px;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #ffffff;
}

.receivable-detail__payments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receivable-detail__payments-header h2 {
  margin: 0;
  color: #17273d;
  font-size: 14.5px;
  font-weight: 800;
}

.receivable-detail__payments-header p {
  margin: 2px 0 0;
  color: #708096;
  font-size: 11.5px;
}

.receivable-detail__payments-header .btn {
  min-height: 34px;
  padding-inline: 13px;
  border-radius: 8px;
  font-size: 12px;
}

.receivable-detail__button-plus {
  margin-right: 5px;
  font-size: 19px;
  font-weight: 400;
  line-height: 0;
  vertical-align: -2px;
}

.receivable-detail__empty {
  display: grid;
  min-height: 82px;
  margin-top: 8px;
  place-items: center;
  align-content: center;
  padding: 9px;
  border: 1px dashed #c8daef;
  border-radius: 9px;
  text-align: center;
}

.receivable-detail__empty h3 {
  margin: 6px 0 0;
  color: #17273d;
  font-size: 13px;
}

.receivable-detail__empty p {
  margin: 2px 0 0;
  color: #708096;
  font-size: 11.5px;
}

.receivable-detail__payments-table-wrap {
  max-height: 130px;
  margin-top: 8px;
  overflow-y: auto;
  border: 1px solid #d8e1ec;
  border-radius: 9px;
}

.modal:has(.receivable-detail-modal__body) .modal__footer {
  min-height: 42px;
  padding: 4px 22px 8px;
  border-top: 1px solid #dbe4ee;
}

.modal:has(.receivable-detail-modal__body) .modal__footer .btn {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #075fc3;
  font-size: 13px;
  font-weight: 760;
  box-shadow: none;
}

@media (max-width: 760px) {
  .modal:has(.receivable-detail-modal__body) {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .modal:has(.receivable-detail-modal__body) .modal__header {
    min-height: 96px;
    padding: 20px;
  }

  .modal:has(.receivable-detail-modal__body) .modal__title {
    font-size: 21px;
  }

  .modal:has(.receivable-detail-modal__body) .modal__subtitle {
    padding-right: 8px;
    font-size: 13px;
  }

  .modal:has(.receivable-detail-modal__body) .modal__header .icon-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .receivable-detail-modal__body {
    max-height: calc(100dvh - 188px);
    padding: 18px 20px;
  }

  .receivable-detail__hero {
    grid-template-columns: 1fr;
  }

  .receivable-detail__identity,
  .receivable-detail__balance {
    padding: 22px;
  }

  .receivable-detail__balance {
    align-items: flex-start;
    border-top: 1px solid #cdddf2;
    border-left: 0;
    text-align: left;
  }

  .receivable-detail__metrics {
    grid-template-columns: 1fr;
  }

  .receivable-detail__payments-header {
    align-items: stretch;
    flex-direction: column;
  }

  .receivable-detail__payments-header .btn {
    width: 100%;
  }

  .modal:has(.receivable-detail-modal__body) .modal__footer {
    padding: 12px 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* --------------------------------------------------------------------------
 * Module families
 * These overrides flatten the historical showcase layouts into operational
 * workspaces while retaining every existing class and interaction contract.
 * -------------------------------------------------------------------------- */

/* Dashboard */
.dashboard-exec-page,
.dashboard-business-page,
.accounting-financial-dashboard {
  display: grid;
  gap: 14px;
}

.dashboard-exec-hero,
.dashboard-business-hero,
.accounting-financial-dashboard-hero {
  min-height: 0;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-exec-hero::before,
.dashboard-exec-hero::after,
.dashboard-business-hero::before,
.dashboard-business-hero::after,
.accounting-financial-dashboard-hero::before,
.accounting-financial-dashboard-hero::after,
.dashboard-exec-kpi::after,
.accounting-financial-kpi::after {
  display: none;
}

.dashboard-exec-hero__eyebrow {
  color: var(--color-primary);
  font-size: 9px;
  letter-spacing: .13em;
}

.dashboard-exec-hero__title,
.dashboard-business-hero h1 {
  color: var(--color-text-strong);
  font-size: clamp(23px, 2vw, 29px);
  letter-spacing: 0;
}

.dashboard-exec-hero__description,
.dashboard-business-hero p {
  color: var(--color-text-muted);
  font-size: 12px;
}

.dashboard-exec-hero__filters,
.dashboard-business-toolbar,
.accounting-financial-dashboard-filters {
  gap: 8px;
}

.dashboard-exec-kpi-grid,
.accounting-financial-dashboard-kpi-grid,
.dashboard-business-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
  gap: 10px;
}

.dashboard-exec-kpi,
.accounting-financial-kpi,
.dashboard-business-summary-card,
.dashboard-exec-card,
.accounting-financial-dashboard-card,
.dashboard-business-chart {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.dashboard-exec-kpi,
.accounting-financial-kpi,
.dashboard-business-summary-card {
  min-height: 104px;
  padding: 14px;
}

.dashboard-exec-kpi__icon,
.accounting-financial-kpi__icon,
.accounting-financial-dashboard-card__icon,
.accounting-financial-health-tile__icon {
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  box-shadow: none;
}

.dashboard-exec-kpi__value,
.accounting-financial-dashboard .accounting-financial-kpi__value,
.dashboard-business-summary-card > strong {
  color: var(--color-text-strong);
  font-size: clamp(20px, 1.8vw, 28px);
  letter-spacing: 0;
}

.dashboard-exec-layout-row,
.dashboard-exec-layout-row--top,
.dashboard-exec-layout-row--middle,
.dashboard-exec-layout-row--bottom,
.dashboard-business-charts,
.dashboard-business-secondary,
.accounting-financial-dashboard__secondary {
  gap: 12px;
}

.dashboard-exec-card,
.accounting-financial-dashboard-card,
.dashboard-business-chart {
  padding: 15px;
}

.dashboard-exec-card__header,
.accounting-financial-dashboard-card__header,
.dashboard-business-chart > header {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--color-border);
}

.dashboard-exec-metric,
.dashboard-exec-featured-row,
.dashboard-exec-sequence-row,
.dashboard-exec-row,
.dashboard-exec-alert,
.dashboard-exec-activity,
.dashboard-exec-balance-row,
.dashboard-business-ranking__row,
.accounting-financial-health-tile {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.dashboard-exec-card__title,
.dashboard-business-section-header h2,
.dashboard-business-chart h3 {
  font-size: 13px;
  letter-spacing: 0;
}

/* Catalog, products and inventory */
.catalog-layout,
.inventory-layout {
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, .82fr);
  gap: 14px;
  align-items: start;
}

.catalog-layout__main,
.catalog-layout__side,
.inventory-layout__side {
  min-width: 0;
}

.catalog-layout__side,
.inventory-layout__side {
  display: grid;
  gap: 10px;
}

.catalog-side-tabs,
.inventory-tabs,
.reports-subtabs,
.settings-admin-tabs,
.supplier-detail-tabs,
.accounting-bank-reconciliation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.catalog-side-tabs__button,
.inventory-tab,
.reports-subtab,
.supplier-detail-tab,
.accounting-bank-reconciliation-tab {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.catalog-side-tabs__button.is-active,
.inventory-tab.is-active,
.reports-subtab.is-active,
.supplier-detail-tab.is-active,
.accounting-bank-reconciliation-tab.is-active {
  background: var(--color-surface);
  color: var(--color-primary-strong);
  box-shadow: var(--shadow-xs);
}

.catalog-filters,
.inventory-filters,
.purchase-module__filters,
.customers-filters,
.repairs-filters,
.supplier-module__filters,
.reports-filters,
.accounting-filters {
  padding: 11px;
  gap: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.catalog-product,
.inventory-product,
.serial-product-media,
.purchase-detail-product {
  gap: 10px;
}

.catalog-product__media,
.inventory-product__media,
.serial-product-media,
.purchase-detail-product__media {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.catalog-product__name,
.inventory-product__name {
  color: var(--color-text-strong);
  font-size: 12px;
  line-height: 1.25;
}

.catalog-inline-badges,
.catalog-product__refs,
.inventory-product__refs {
  gap: 4px;
}

.catalog-list {
  display: grid;
  gap: 7px;
}

.catalog-list__item,
.base-catalog-row,
.inventory-history-serial-card {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: none;
}

.inventory-tab-panels,
.reports-tab-panels,
.settings-admin-panels,
.supplier-detail-tab-panels {
  display: grid;
  gap: 12px;
}

.inventory-tab-panel,
.reports-tab-panel,
.settings-admin-tab-panel,
.supplier-detail-tab-panel {
  gap: 12px;
}

.inventory-preview,
.inventory-count-summary,
.inventory-history-summary,
.serial-batch-summary {
  gap: 8px;
}

.inventory-preview__item,
.inventory-history-summary__item,
.inventory-count-summary > * {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  box-shadow: none;
}

/* Customers, suppliers and record detail views */
.customers-page,
.customers-section,
.detail-stack,
.repair-detail {
  gap: 14px;
}

.customers-toolbar,
.repairs-toolbar,
.inventory-history__toolbar {
  gap: 10px;
}

.customers-page > .page__header {
  max-width: 760px;
  padding-bottom: 2px;
}

.customers-page > .inventory-tabs {
  width: max-content;
  max-width: 100%;
}

.customers-section {
  min-width: 0;
}

.customers-toolbar {
  align-items: center;
  padding-block: 2px;
}

.customers-toolbar--actions-only {
  justify-content: flex-end;
}

.customers-toolbar .btn--primary {
  min-width: 138px;
}

.customers-section > [data-customers-results],
.customers-section > [data-receivables-results] {
  display: grid;
  gap: 12px;
}

.customer-list-content {
  display: grid;
  gap: 12px;
}

.customer-list-content[hidden],
.customer-inline-detail[hidden] {
  display: none;
}

.customers-section .stats-grid > .card {
  min-height: 82px;
  padding: 12px 14px;
}

.customers-section .stats-grid .card__value {
  font-size: 21px;
}

.customers-section .reports-table-card {
  padding: 14px 0 0;
  overflow: hidden;
}

.customers-section .reports-table-card > .card__header {
  padding-inline: 16px;
}

.customers-section .customers-summary-card {
  padding-top: 0;
}

.customers-table tbody tr {
  height: 62px;
}

.customers-table--summary {
  table-layout: fixed;
}

.customers-table--summary th:nth-child(1) {
  width: 30%;
}

.customers-table--summary th:nth-child(2) {
  width: 18%;
}

.customers-table--summary th:nth-child(3),
.customers-table--summary th:nth-child(4) {
  width: 17%;
}

.customers-table--summary th:nth-child(5) {
  width: 18%;
}

.customers-table__row {
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.customers-table__row:hover {
  background: var(--color-primary-soft);
}

.customers-table__row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.customers-table__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.customers-table__identity .catalog-table__stack {
  min-width: 0;
}

.customers-table__identity strong,
.customers-table__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customers-table__avatar {
  display: inline-flex;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
}

.customers-table__row:nth-child(even) .customers-table__avatar {
  background: #fff0d9;
  color: #9a6116;
}

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

.customers-table__purchases,
.customers-table__balance {
  font-variant-numeric: tabular-nums;
}

.customers-table .badge {
  width: 100%;
  min-width: 88px;
  max-width: 180px;
  justify-content: flex-start;
}

.customers-table__balance {
  color: var(--color-text-strong);
}

.customers-table__balance--due {
  color: var(--color-danger);
}

.customer-inline-detail {
  min-width: 0;
  animation: customer-inline-detail-enter 180ms ease-out;
}

.customer-inline-detail__toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--color-border);
}

.customer-inline-detail__heading {
  min-width: 0;
}

.customer-inline-detail__heading span {
  display: block;
  margin-bottom: 2px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.customer-inline-detail__heading h2 {
  overflow: hidden;
  margin: 0;
  color: var(--color-text-strong);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail__loading {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-text-muted);
}

.customer-inline-detail__loading > div {
  display: grid;
  gap: 3px;
}

.customer-inline-detail__loading strong {
  color: var(--color-text-strong);
}

.customer-inline-detail__loading .loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: customer-inline-spinner 700ms linear infinite;
}

@keyframes customer-inline-detail-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

@keyframes customer-inline-spinner {
  to {
    transform: rotate(360deg);
  }
}

.detail-hero {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.detail-hero::before,
.detail-hero::after {
  display: none;
}

.detail-grid,
.customer-detail-metrics,
.customer-financial-grid,
.settings-admin-info-grid {
  gap: 9px;
}

.detail-grid__item,
.customer-detail-metric,
.receivable-payment-form__hero,
.detail-price__item {
  padding: 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.customer-financial-groups {
  gap: 12px;
  margin-bottom: 14px;
}

.customer-financial-block {
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

.customer-timeline {
  gap: 10px;
}

.customer-timeline__item {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
}

.customer-timeline__rail::before {
  width: 1px;
  background: var(--color-border-strong);
}

.customer-timeline__dot {
  width: 10px;
  height: 10px;
  margin-top: 13px;
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--timeline-soft);
}

.customer-timeline__content {
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.customer-timeline__content::before {
  display: none;
}

.customer-timeline__item:hover .customer-timeline__content {
  border-color: var(--color-border-strong);
  background: var(--color-surface-soft);
  box-shadow: none;
  transform: none;
}

.customer-timeline__amount {
  min-width: 128px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
}

/* Accounting and reports */
.reports-page,
.accounting-page,
.accounting-panel {
  gap: 14px;
}

.reports-grid,
.accounting-grid,
.accounting-balance-sheet-grid,
.accounting-visual-grid,
.accounting-rule-grid {
  gap: 12px;
}

.accounting-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, .8fr);
}

.accounting-toolbar-card,
.accounting-table-card,
.accounting-form-card,
.accounting-form-side,
.reports-filter-card,
.reports-table-card {
  gap: 11px;
}

.accounting-filters__result,
.accounting-form-summary__item,
.accounting-manual-entry-summary__card,
.accounting-ledger-summary,
.accounting-ledger-balance,
.accounting-trial-balance-status {
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.accounting-financial-health-grid {
  gap: 8px;
}

.accounting-financial-health-tile {
  padding: 10px;
}

.accounting-balance-sheet-row,
.accounting-treasury-history__item,
.accounting-rule-card,
.accounting-visual-card__row {
  border-color: var(--color-border);
  background: transparent;
  box-shadow: none;
}

.accounting-visual-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.accounting-visual-card__header {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.accounting-visual-card__body,
.accounting-visual-card__footer {
  padding: 10px 12px;
}

.accounting-visual-card--asset,
.accounting-visual-card--liability,
.accounting-visual-card--equity,
.accounting-visual-card--income,
.accounting-visual-card--cost,
.accounting-visual-card--expense,
.accounting-visual-card--asset .accounting-visual-card__header,
.accounting-visual-card--liability .accounting-visual-card__header,
.accounting-visual-card--equity .accounting-visual-card__header,
.accounting-visual-card--income .accounting-visual-card__header,
.accounting-visual-card--cost .accounting-visual-card__header,
.accounting-visual-card--expense .accounting-visual-card__header {
  background: var(--color-surface);
}

/* Settings and platform administration */
.settings-admin-page,
.platform-admin-page,
.platform-client-detail,
.fiscal-admin-page {
  display: grid;
  gap: 14px;
}

.settings-admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.settings-admin-card,
.settings-form-section,
.settings-permission-group,
.settings-theme-block,
.settings-modules-row,
.platform-catalog-access-row,
.platform-danger-zone {
  padding: 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

.settings-modules-list,
.settings-permission-editor,
.settings-permission-group__list,
.settings-admin-list,
.platform-catalog-access-list {
  gap: 8px;
}

.settings-modules-row:hover,
.platform-catalog-access-row:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-soft);
  transform: none;
}

.settings-theme-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.settings-theme-card {
  padding: 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

.settings-theme-card:hover,
.settings-theme-card.is-active {
  border-color: var(--color-primary);
  box-shadow: none;
  transform: none;
}

.settings-theme-card__preview,
.settings-logo-preview,
.settings-invitation-result {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  box-shadow: none;
}

/* Forms and large operational modals */
.catalog-form,
.catalog-form__section,
.form-grid,
.form-row {
  gap: 11px;
}

.catalog-form__section,
.accounting-entry-modal__section {
  padding: 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.purchase-form-modal {
  width: min(1320px, calc(100vw - 30px));
  max-width: min(1320px, calc(100vw - 30px));
  height: min(860px, calc(100dvh - 30px));
  max-height: calc(100dvh - 30px);
  border-radius: var(--radius-lg);
}

.purchase-form-modal .modal__header {
  min-height: 76px;
  padding: 12px 18px;
}

.purchase-form-modal__heading {
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 11px;
}

.purchase-form-modal__icon {
  width: 42px;
  height: 42px;
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

.purchase-form-modal__icon svg {
  width: 22px;
  height: 22px;
}

.purchase-form-modal .modal__title {
  font-size: 18px;
}

.purchase-form-modal .modal__subtitle {
  margin-top: 1px;
  font-size: 11px;
}

.purchase-form-modal .modal__header .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
}

.purchase-form-modal .modal__body {
  padding: 14px 16px 16px;
  background: var(--color-bg-soft);
}

.purchase-form__workspace {
  grid-template-columns: minmax(0, 2.15fr) minmax(310px, .85fr);
  gap: 14px;
}

.purchase-form__main,
.purchase-form__aside {
  gap: 12px;
}

.purchase-form__panel {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.purchase-form__information,
.purchase-form__information-grid {
  gap: 12px;
}

.purchase-form__new-supplier,
.purchase-form__date-display,
.purchase-form__status-control,
.purchase-form__product-search,
.purchase-form__product-tools .btn {
  min-height: var(--control-height);
  height: var(--control-height);
}

.purchase-form__more-options > summary,
.purchase-form__note > summary {
  min-height: 40px;
}

.purchase-form__items-header {
  padding-bottom: 11px;
}

.purchase-form__table-header {
  min-height: 38px;
  background: var(--color-surface-soft);
}

.purchase-line__grid {
  min-height: 76px;
}

.purchase-line__grid > * {
  padding: 9px 10px;
}

/* Bulk product import */
.bulk-import-workspace,
.bulk-import-review,
.bulk-import-source {
  gap: 12px;
}

.bulk-import-source__grid,
.bulk-import-review__layout {
  gap: 12px;
}

.bulk-import-dropzone,
.bulk-import-source__aside,
.bulk-import-document,
.bulk-import-review__heading,
.bulk-import-stats,
.bulk-import-toolbar,
.bulk-import-unsaved {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: none;
}

.bulk-import-row,
.bulk-import-page,
.bulk-import-duplicate,
.bulk-import-new-entity {
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

/* Current independent POS */
.pos-terminal {
  --pos-topbar-height: 46px;
  background: var(--color-bg);
}

.pos-terminal-topbar {
  min-height: 46px;
  height: 46px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

.pos-terminal-topbar__left,
.pos-terminal-topbar__right {
  gap: 7px;
}

.pos-terminal-plan-chip,
.pos-terminal-status {
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: none;
}

.pos-terminal-icon-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--pos-border);
  border-radius: var(--radius-sm);
  background: var(--pos-surface);
  box-shadow: none;
}

.pos-terminal-user {
  min-height: 34px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--pos-border);
  border-radius: 999px;
  background: var(--pos-surface);
  box-shadow: none;
}

.pos-terminal-body {
  grid-template-columns: minmax(0, 1fr) clamp(390px, 25vw, 455px);
  background: var(--color-bg);
}

.pos-terminal-catalog {
  padding: 10px;
  gap: 10px;
  background: var(--color-bg);
}

.pos-terminal-searchbar {
  gap: 7px;
}

.pos-terminal-searchbar input,
.pos-terminal-searchbar .btn,
.pos-terminal-scan-btn {
  min-height: 38px;
  height: 38px;
  border-radius: var(--radius-md);
}

.pos-terminal-products-grid {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 9px;
}

.pos-terminal-product-card__button {
  min-height: 168px;
  min-width: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--pos-border);
  border-radius: var(--radius-md);
  background: var(--pos-surface);
  box-shadow: var(--shadow-xs);
}

.pos-terminal-product-card__button:hover:not(:disabled) {
  border-color: #c9c4b9;
  box-shadow: var(--shadow-sm);
  transform: none;
}

.pos-terminal-product-card__image {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
}

.pos-terminal-product-card__body {
  min-width: 0;
  gap: 3px;
}

.pos-terminal-product-card__body strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.pos-terminal-product-card__body small,
.pos-terminal-product-card__body span {
  font-size: 9.5px;
}

.pos-terminal-product-card b {
  font-size: 14px;
}

.pos-terminal-invoice {
  border-left: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

.pos-terminal-invoice__header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--pos-border);
}

.pos-terminal-invoice__header h2 {
  font-size: 15px;
}

.pos-terminal-invoice__fields {
  padding: 9px 14px 11px;
  gap: 8px;
  border-bottom: 1px solid var(--pos-border);
}

.pos-terminal-invoice__fields select,
.pos-terminal-invoice__fields .btn {
  min-height: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.pos-terminal-cart {
  padding-inline: 14px;
}

.pos-terminal-cart-line {
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid var(--pos-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pos-terminal-cart-line:hover,
.pos-terminal-cart-line:focus-visible,
.pos-terminal-cart-line.is-editing {
  background: var(--color-surface-soft);
  box-shadow: none;
}

.pos-terminal-invoice__footer {
  padding: 10px 14px;
  border-top: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

.pos-terminal-totals {
  padding: 9px 10px;
  border: 1px solid var(--pos-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.pos-terminal-sell-btn {
  min-height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
}

.pos-terminal-sell-btn:hover:not(:disabled) {
  background: var(--color-primary-strong);
}

.pos-terminal-sale-meta {
  min-height: 34px;
  border-radius: var(--radius-sm);
}

.pos-terminal-tabs {
  min-height: 36px;
  border-top: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

/* POS checkout */
.pos-checkout-modal__overlay {
  background: rgb(20 34 53 / 42%);
}

.pos-checkout-modal {
  width: min(960px, calc(100vw - 28px));
  max-width: min(960px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.pos-checkout-modal__header {
  min-height: 62px;
  padding: 10px 16px;
}

.pos-checkout-modal__body {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  min-height: 0;
}

.pos-checkout-summary,
.pos-checkout-payment {
  padding: 14px;
  gap: 10px;
  background: var(--color-surface);
}

.pos-checkout-summary__items {
  gap: 7px;
}

.pos-checkout-summary__item {
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: none;
}

.pos-checkout-summary__image {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
}

.pos-checkout-condition,
.pos-checkout-payment__entry,
.pos-checkout-summary__totals,
.pos-checkout-payment__totals,
.pos-checkout-keypad {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  box-shadow: none;
}

.pos-checkout-payment__lines {
  max-height: 132px;
  gap: 5px;
}

.pos-checkout-payment-line {
  min-height: 36px;
  gap: 5px;
}

.pos-checkout-payment-line select,
.pos-checkout-payment-line input,
.pos-checkout-payment-line > button:last-child {
  min-height: 36px;
  height: 36px;
}

.pos-checkout-keypad__quick {
  gap: 5px;
}

.pos-checkout-keypad__grid {
  gap: 5px;
}

.pos-checkout-keypad__grid button {
  min-height: 36px;
  border-radius: var(--radius-sm);
}

.pos-checkout-modal__footer {
  padding: 10px 14px;
  gap: 10px;
  background: var(--color-surface);
}

.pos-checkout-modal__secondary,
.pos-checkout-modal__primary {
  min-height: 40px;
  border-radius: var(--radius-sm);
}

/* Module-family responsive behavior */
@media (max-width: 1240px) {
  .catalog-layout,
  .inventory-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  }

  .accounting-grid,
  .purchase-form__workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .purchase-form__aside {
    overflow: visible;
  }

  .pos-terminal-body {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
}

@media (max-width: 920px) {
  .catalog-layout,
  .inventory-layout,
  .customer-financial-groups,
  .accounting-grid,
  .bulk-import-source__grid,
  .bulk-import-review__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .reports-filters,
  .reports-filters--inventory,
  .reports-filters--purchases,
  .reports-filters--serials,
  .customers-filters,
  .customers-filters--receivables,
  .accounting-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-terminal-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .pos-checkout-modal__body {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }
}

@media (max-width: 640px) {
  .reports-filters,
  .reports-filters--inventory,
  .reports-filters--purchases,
  .reports-filters--serials,
  .customers-filters,
  .customers-filters--receivables,
  .accounting-filters {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .customer-timeline__meta {
    justify-items: stretch;
  }

  .customer-timeline__amount {
    min-width: 0;
    text-align: left;
  }

  .customers-table--summary,
  .customers-table--summary tbody,
  .customers-table--summary tr {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .customers-table--summary thead {
    display: none;
  }

  .customers-table--summary tbody {
    padding: 4px 10px;
  }

  .customers-table--summary .customers-table__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    padding: 10px 0;
  }

  .customers-table--summary .customers-table__row:last-child {
    border-bottom: 0;
  }

  .customers-table--summary td {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 0;
  }

  .customers-table--summary td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 10px;
  }

  .customers-table--summary td:not(:first-child)::before {
    content: attr(data-label);
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .customers-table--summary .badge {
    width: auto;
    min-width: 82px;
    max-width: 110px;
  }

  .customer-inline-detail__toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .customer-inline-detail__back {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .purchase-form-modal {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .purchase-form-modal .modal__header,
  .purchase-form-modal .modal__body {
    padding-inline: 12px;
  }

  .pos-terminal-topbar__right .pos-terminal-plan-chip,
  .pos-terminal-user small {
    display: none;
  }

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

  .pos-terminal-product-card,
  .pos-terminal-product-card__button {
    min-width: 0;
    max-width: 100%;
  }

  .pos-checkout-modal {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }
}

/* Module introductions remain unframed across every primary workspace. */
.page > .page__header,
.platform-admin-page > .platform-admin-hero,
.dashboard-exec-page > .dashboard-exec-hero,
.dashboard-business-page > .dashboard-business-hero {
  padding: 0 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  overflow: visible;
}

.page > .page__header::before,
.page > .page__header::after,
.platform-admin-page > .platform-admin-hero::before,
.platform-admin-page > .platform-admin-hero::after,
.dashboard-exec-page > .dashboard-exec-hero::before,
.dashboard-exec-page > .dashboard-exec-hero::after,
.dashboard-business-page > .dashboard-business-hero::before,
.dashboard-business-page > .dashboard-business-hero::after {
  display: none;
}

/* Module summaries stay focused on the title, description and primary actions. */
.page__header > .page__title-group > .highlight-list {
  display: none;
}

/* Inventory prioritizes the operational product table without horizontal scrolling. */
.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table-wrap {
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: 0;
  scrollbar-gutter: auto;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table th,
.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table td {
  min-width: 0;
  padding: 10px 6px;
}

/* Panel Comercial: directorio SaaS compacto y aislado del resto de modulos. */
.platform-admin-page.platform-admin-page--directory {
  --platform-directory-blue: #1167d8;
  --platform-directory-border: #dce5ef;
  --platform-directory-muted: #718096;
  --platform-directory-text: #172338;
  width: min(100%, 1440px);
  min-width: 0;
  max-width: none;
  margin-inline: auto;
  padding: 20px 24px 32px;
  box-sizing: border-box;
  gap: 14px;
  color: var(--platform-directory-text);
  overflow-x: clip;
}

.platform-admin-page--directory > *,
.platform-admin-page--directory .platform-admin-hero,
.platform-admin-page--directory .platform-summary-grid,
.platform-admin-page--directory .platform-admin-tools,
.platform-admin-page--directory .platform-client-directory,
.platform-admin-page--directory .platform-client-directory__header,
.platform-admin-page--directory .platform-client-directory__filters,
.platform-admin-page--directory .platform-client-table,
.platform-admin-page--directory .platform-client-list,
.platform-admin-page--directory .platform-client-pagination {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.platform-admin-page--directory .platform-admin-hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.platform-admin-page--directory .platform-admin-hero::before,
.platform-admin-page--directory .platform-admin-hero::after {
  display: none;
}

.platform-admin-page--directory .platform-admin-hero .eyebrow {
  margin: 0 0 7px;
  color: var(--platform-directory-blue);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.platform-admin-page--directory .platform-admin-hero h1 {
  margin: 0;
  color: var(--platform-directory-text);
  font-size: 28px;
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: 0;
}

.platform-admin-page--directory .platform-admin-hero p:last-child {
  margin: 6px 0 0;
  color: var(--platform-directory-muted);
  font-size: 13px;
  line-height: 1.4;
}

.platform-admin-page--directory .platform-admin-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-admin-page--directory .platform-admin-hero__actions .btn,
.platform-admin-page--directory .platform-client-directory__header .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.platform-admin-page--directory .platform-admin-hero__actions .btn svg,
.platform-admin-page--directory .platform-client-directory__header .btn svg,
.platform-admin-page--directory .platform-client-row__arrow svg,
.platform-admin-page--directory .platform-page-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.platform-admin-page--directory .platform-admin-hero__actions .btn--ghost,
.platform-admin-page--directory .platform-client-directory__header .btn--ghost {
  border-color: var(--platform-directory-border);
  color: #1c3555;
  background: #ffffff;
}

.platform-admin-page--directory .platform-admin-hero__actions .btn--primary {
  border-color: var(--platform-directory-blue);
  color: #ffffff;
  background: var(--platform-directory-blue);
}

.platform-admin-page--directory .platform-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.platform-admin-page--directory .platform-kpi-card {
  min-width: 0;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--platform-directory-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 7px 20px rgba(30, 55, 85, 0.035);
}

.platform-admin-page--directory .platform-kpi-card__icon,
.platform-admin-page--directory .platform-admin-tools__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.platform-admin-page--directory .platform-kpi-card__icon svg,
.platform-admin-page--directory .platform-admin-tools__icon svg {
  width: 22px;
  height: 22px;
}

.platform-admin-page--directory .platform-kpi-card--registered .platform-kpi-card__icon {
  color: #1668d8;
  background: #e9f2ff;
}

.platform-admin-page--directory .platform-kpi-card--active .platform-kpi-card__icon {
  color: #16965b;
  background: #e8f8ef;
}

.platform-admin-page--directory .platform-kpi-card--trial .platform-kpi-card__icon {
  color: #7c43de;
  background: #f2eaff;
}

.platform-admin-page--directory .platform-kpi-card--suspended .platform-kpi-card__icon {
  color: #dd771e;
  background: #fff0df;
}

.platform-admin-page--directory .platform-kpi-card__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.platform-admin-page--directory .platform-kpi-card__copy > span {
  color: var(--platform-directory-muted);
  font-size: 12px;
  line-height: 1.25;
}

.platform-admin-page--directory .platform-kpi-card__copy > strong {
  color: var(--platform-directory-text);
  font-size: 22px;
  font-weight: 780;
  line-height: 1;
  letter-spacing: 0;
}

.platform-admin-page--directory .platform-admin-tools {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 16px;
  border: 1px solid var(--platform-directory-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(30, 55, 85, 0.025);
}

.platform-admin-page--directory .platform-system-health {
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(210px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: linear-gradient(105deg, #f8fbff, #ffffff 70%);
  box-shadow: 0 7px 20px rgba(30, 55, 85, 0.03);
}

.platform-admin-page--directory .platform-system-health--critical {
  border-color: #f0c6cf;
  background: linear-gradient(105deg, #fff7f8, #ffffff 70%);
}

.platform-admin-page--directory .platform-system-health__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #1769db;
  background: #e8f2ff;
}

.platform-admin-page--directory .platform-system-health--critical .platform-system-health__icon {
  color: #cf2d4c;
  background: #ffe9ee;
}

.platform-admin-page--directory .platform-system-health__icon svg {
  width: 22px;
  height: 22px;
}

.platform-admin-page--directory .platform-system-health__identity,
.platform-admin-page--directory .platform-system-health--loading > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.platform-admin-page--directory .platform-system-health__identity strong,
.platform-admin-page--directory .platform-system-health--loading strong {
  color: var(--platform-directory-text);
  font-size: 13px;
}

.platform-admin-page--directory .platform-system-health__identity span,
.platform-admin-page--directory .platform-system-health--loading span {
  overflow: hidden;
  color: var(--platform-directory-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-admin-page--directory .platform-system-health__metrics {
  display: flex;
  align-items: center;
}

.platform-admin-page--directory .platform-system-health__metrics > span {
  min-width: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 14px;
  border-left: 1px solid #e1e8f1;
}

.platform-admin-page--directory .platform-system-health__metrics strong {
  color: #17314f;
  font-size: 15px;
}

.platform-admin-page--directory .platform-system-health__metrics small {
  color: #7b899d;
  font-size: 9px;
}

.platform-admin-page--directory .platform-system-health .btn {
  min-height: 34px;
  color: #1261c7;
  border-color: #cddcf0;
  background: #fff;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .platform-admin-page--directory .platform-system-health {
    grid-template-columns: 42px minmax(190px, 1fr) auto;
  }

  .platform-admin-page--directory .platform-system-health__metrics {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .platform-admin-page--directory .platform-system-health {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .platform-admin-page--directory .platform-system-health__metrics {
    display: none;
  }
}

.platform-admin-page--directory .platform-admin-tools__content {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-admin-page--directory .platform-admin-tools__icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  color: #16885b;
  background: #e9f8f1;
}

.platform-admin-page--directory .platform-admin-tools__icon svg {
  width: 19px;
  height: 19px;
}

.platform-admin-page--directory .platform-admin-tools__content > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.platform-admin-page--directory .platform-admin-tools strong {
  color: var(--platform-directory-text);
  font-size: 13px;
  font-weight: 720;
}

.platform-admin-page--directory .platform-admin-tools span span {
  overflow: hidden;
  color: var(--platform-directory-muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-admin-page--directory .platform-switch {
  flex: 0 0 auto;
}

.platform-admin-page--directory .platform-client-directory {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--platform-directory-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(30, 55, 85, 0.035);
}

.platform-admin-page--directory .platform-client-directory__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px 12px;
}

.platform-admin-page--directory .platform-client-directory__header h2 {
  margin: 0;
  color: var(--platform-directory-text);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
}

.platform-admin-page--directory .platform-client-directory__header p {
  margin: 4px 0 0;
  color: var(--platform-directory-muted);
  font-size: 12px;
  line-height: 1.35;
}

.platform-admin-page--directory .platform-client-directory__header .btn {
  min-height: 34px;
  padding-inline: 12px;
  color: var(--platform-directory-blue);
  font-size: 12px;
}

.platform-admin-page--directory .platform-client-directory__filters {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(190px, 250px);
  align-items: end;
  gap: 18px;
  padding: 0 20px 16px;
}

.platform-admin-page--directory .platform-client-directory__filters .field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.platform-admin-page--directory .platform-client-directory__filters .field__label {
  color: #52647a;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.platform-admin-page--directory .platform-client-directory__filters .field__input {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #cfdae8;
  border-radius: 7px;
  color: var(--platform-directory-text);
  background: #ffffff;
  font-size: 12px;
}

.platform-admin-page--directory .platform-client-search__control {
  position: relative;
  min-width: 0;
  display: block;
}

.platform-admin-page--directory .platform-client-search__control > svg {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: #74869c;
  transform: translateY(-50%);
  pointer-events: none;
}

.platform-admin-page--directory .platform-client-search__control .field__input {
  padding-right: 38px;
}

.platform-admin-page--directory .platform-client-table {
  min-width: 0;
  border-top: 1px solid #e5ebf2;
}

.platform-admin-page--directory .platform-client-table__header,
.platform-admin-page--directory .platform-client-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) minmax(190px, 1fr) minmax(230px, 1.15fr) 108px minmax(150px, 0.8fr) 24px;
  align-items: center;
  column-gap: 16px;
}

.platform-admin-page--directory .platform-client-table__header {
  min-height: 36px;
  padding: 0 20px;
  border-bottom: 1px solid #e2e8f0;
  color: #607289;
  background: #fbfcfe;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.platform-admin-page--directory .platform-client-list {
  min-width: 0;
  display: grid;
}

.platform-admin-page--directory .platform-client-row {
  min-width: 0;
  width: 100%;
  min-height: 62px;
  padding: 8px 20px;
  border: 0;
  border-bottom: 1px solid #e5ebf2;
  color: inherit;
  text-align: left;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  transition: background 140ms ease;
}

.platform-admin-page--directory .platform-client-row:hover {
  background: #f6f9fd;
}

.platform-admin-page--directory .platform-client-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--platform-directory-blue);
  outline-offset: -2px;
  background: #f5f9ff;
}

.platform-admin-page--directory .platform-client-row__company {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.platform-admin-page--directory .platform-client-row__avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1763c1;
  background: #eaf2ff;
  font-size: 11px;
  font-weight: 780;
}

.platform-admin-page--directory .platform-client-row__identity,
.platform-admin-page--directory .platform-client-row__owner,
.platform-admin-page--directory .platform-client-row__plan,
.platform-admin-page--directory .platform-client-row__status {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.platform-admin-page--directory .platform-client-row strong {
  overflow: hidden;
  color: var(--platform-directory-text);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-admin-page--directory .platform-client-row small,
.platform-admin-page--directory .platform-client-row__updated {
  overflow: hidden;
  color: var(--platform-directory-muted);
  font-size: 10.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-admin-page--directory .platform-client-row__status {
  justify-items: start;
}

.platform-admin-page--directory .platform-client-row__status .badge {
  min-width: 0;
  min-height: 24px;
  padding: 4px 11px;
  border: 0;
  border-radius: 999px;
  font-size: 10.5px;
  line-height: 1;
}

.platform-admin-page--directory .platform-client-row__status .badge--success {
  color: #167549;
  background: #e5f6ec;
}

.platform-admin-page--directory .platform-client-row__status .badge--warning {
  color: #b85c0d;
  background: #fff0df;
}

.platform-admin-page--directory .platform-client-row__status .badge--info {
  color: #5c37a8;
  background: #f0e9ff;
}

.platform-admin-page--directory .platform-client-row__arrow {
  display: grid;
  place-items: center;
  color: var(--platform-directory-blue);
}

.platform-admin-page--directory .platform-client-row:last-child {
  border-bottom: 0;
}

.platform-admin-page--directory .platform-client-row--loading {
  grid-template-columns: 34px minmax(0, 1fr);
  pointer-events: none;
}

.platform-admin-page--directory .platform-client-row--loading .platform-client-row__skeleton {
  width: min(520px, 70%);
  height: 14px;
}

.platform-admin-page--directory .platform-client-list-state {
  min-height: 170px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  padding: 24px;
  color: var(--platform-directory-muted);
  text-align: center;
}

.platform-admin-page--directory .platform-client-list-state strong {
  color: var(--platform-directory-text);
  font-size: 14px;
}

.platform-admin-page--directory .platform-client-list-state span {
  font-size: 12px;
}

.platform-admin-page--directory .platform-client-pagination {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 20px;
  border-top: 1px solid #e2e8f0;
  color: var(--platform-directory-muted);
  background: #ffffff;
  font-size: 11px;
}

.platform-admin-page--directory .platform-client-pagination__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-admin-page--directory .platform-client-pagination select {
  width: auto;
  min-width: 112px;
  min-height: 34px;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid #d6e0eb;
  border-radius: 7px;
  color: #30445f;
  background-color: #ffffff;
  font-size: 11px;
}

.platform-admin-page--directory .platform-page-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dce5ef;
  border-radius: 7px;
  color: #50708f;
  background: #ffffff;
  font: inherit;
}

.platform-admin-page--directory button.platform-page-button:not(:disabled) {
  cursor: pointer;
}

.platform-admin-page--directory button.platform-page-button:hover:not(:disabled) {
  border-color: #b8cbe2;
  color: var(--platform-directory-blue);
  background: #f5f9ff;
}

.platform-admin-page--directory button.platform-page-button:disabled {
  opacity: 0.38;
}

.platform-admin-page--directory .platform-page-button--current {
  border-color: var(--platform-directory-blue);
  color: #ffffff;
  background: var(--platform-directory-blue);
  font-weight: 750;
}

@media (max-width: 1180px) {
  .platform-admin-page.platform-admin-page--directory {
    padding-inline: 18px;
  }

  .platform-admin-page--directory .platform-client-table__header,
  .platform-admin-page--directory .platform-client-row {
    grid-template-columns: minmax(230px, 1.35fr) minmax(175px, 1fr) minmax(210px, 1.1fr) 104px 22px;
  }

  .platform-admin-page--directory .platform-client-table__header > :nth-child(5),
  .platform-admin-page--directory .platform-client-row__updated {
    display: none;
  }
}

@media (max-width: 900px) {
  .platform-admin-page--directory .platform-admin-hero {
    align-items: start;
  }

  .platform-admin-page--directory .platform-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-admin-page--directory .platform-client-directory__filters {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 210px);
  }

  .platform-admin-page--directory .platform-client-table__header,
  .platform-admin-page--directory .platform-client-row {
    grid-template-columns: minmax(230px, 1.35fr) minmax(200px, 1.05fr) 100px 22px;
  }

  .platform-admin-page--directory .platform-client-table__header > :nth-child(2),
  .platform-admin-page--directory .platform-client-row__owner {
    display: none;
  }
}

@media (max-width: 680px) {
  .platform-admin-page.platform-admin-page--directory {
    width: 100%;
    max-width: 100%;
    padding: 14px 12px 24px;
    gap: 12px;
    overflow-x: hidden;
  }

  .platform-admin-page--directory .platform-admin-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .platform-admin-page--directory .platform-admin-hero h1 {
    font-size: 24px;
  }

  .platform-admin-page--directory .platform-admin-hero__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-admin-page--directory .platform-admin-hero__actions .btn {
    width: auto;
    min-width: 0;
    padding-inline: 10px;
  }

  .platform-admin-page--directory .platform-admin-tools {
    align-items: center;
    flex-direction: row;
  }

  .platform-admin-page--directory .platform-admin-tools span span {
    white-space: normal;
  }

  .platform-admin-page--directory .platform-client-directory__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    padding: 14px 14px 10px;
  }

  .platform-admin-page--directory .platform-client-directory__header p {
    max-width: 250px;
  }

  .platform-admin-page--directory .platform-client-directory__header .btn span {
    display: none;
  }

  .platform-admin-page--directory .platform-client-directory__header .btn {
    width: 36px;
    min-height: 36px;
    padding: 0;
  }

  .platform-admin-page--directory .platform-client-directory__filters {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 14px 14px;
  }

  .platform-admin-page--directory .platform-client-table__header {
    display: none;
  }

  .platform-admin-page--directory .platform-client-row {
    grid-template-columns: minmax(0, 1fr) auto 20px;
    grid-template-areas:
      "company status arrow"
      "plan status arrow";
    gap: 4px 10px;
    padding: 10px 14px;
  }

  .platform-admin-page--directory .platform-client-row__company { grid-area: company; }
  .platform-admin-page--directory .platform-client-row__plan { grid-area: plan; padding-left: 45px; }
  .platform-admin-page--directory .platform-client-row__status { grid-area: status; align-self: center; }
  .platform-admin-page--directory .platform-client-row__arrow { grid-area: arrow; align-self: center; }

  .platform-admin-page--directory .platform-client-row__identity,
  .platform-admin-page--directory .platform-client-row__plan {
    overflow: hidden;
  }

  .platform-admin-page--directory .platform-client-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-inline: 14px;
  }

  .platform-admin-page--directory .platform-client-pagination__controls {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 440px) {
  .platform-admin-page--directory .platform-client-row {
    grid-template-columns: minmax(0, 1fr) 20px;
    grid-template-areas:
      "company arrow"
      "plan arrow"
      "status arrow";
  }

  .platform-admin-page--directory .platform-client-row__status {
    justify-self: start;
    padding-left: 45px;
  }

  .platform-admin-page--directory .platform-summary-grid {
    gap: 9px;
  }

  .platform-admin-page--directory .platform-kpi-card {
    min-height: 76px;
    gap: 9px;
    padding: 10px;
  }

  .platform-admin-page--directory .platform-kpi-card__icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .platform-admin-page--directory .platform-kpi-card__icon svg {
    width: 18px;
    height: 18px;
  }

  .platform-admin-page--directory .platform-kpi-card__copy > span {
    font-size: 10px;
  }

  .platform-admin-page--directory .platform-kpi-card__copy > strong {
    font-size: 19px;
  }

  .platform-admin-page--directory .platform-client-row__status .badge {
    padding-inline: 8px;
  }
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__col--product {
  width: 25%;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__col--branch {
  width: 12%;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__col--qty {
  width: 7%;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__col--status {
  width: 10%;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__col--movement {
  width: 14%;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__col--actions {
  width: 11%;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table th {
  overflow: hidden;
  font-size: 9px;
  letter-spacing: 0;
  text-overflow: clip;
  white-space: nowrap;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--product,
.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--branch,
.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--qty,
.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--status,
.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--movement,
.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--actions,
.inventory-tab-panel[data-tab-panel="products"] .inventory-product__body {
  min-width: 0;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--branch,
.inventory-tab-panel[data-tab-panel="products"] .inventory-product__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--qty {
  text-align: center;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--movement {
  overflow-wrap: anywhere;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--actions .table-actions {
  gap: 4px;
}

.inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--actions .btn {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 10px;
}

@media (min-width: 1401px) {
  .inventory-tab-panel[data-tab-panel="products"] > .inventory-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 260px);
  }

  .inventory-tab-panel[data-tab-panel="products"] > .inventory-layout > .inventory-layout__side {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
}

@media (min-width: 921px) and (max-width: 1400px) {
  .inventory-tab-panel[data-tab-panel="products"] > .inventory-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-tab-panel[data-tab-panel="products"] > .inventory-layout > .inventory-layout__side {
    width: 100%;
    max-width: none;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-alerts-card .movement-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 920px) {
  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table-wrap {
    max-height: none;
    overflow: visible;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table,
  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody {
    display: block;
    width: 100%;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table thead {
    display: none;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody {
    display: grid;
    gap: 10px;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    border: 1px solid var(--border-subtle, #d8e1eb);
    border-radius: 8px;
    background: var(--surface, #fff);
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td {
    display: flex;
    width: auto;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 5px;
    border: 0;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td::before {
    flex: 0 0 auto;
    color: var(--text-muted, #718096);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td:nth-child(2)::before {
    content: "Sucursal";
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td:nth-child(3)::before {
    content: "Existencia";
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td:nth-child(4)::before {
    content: "Reservado";
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td:nth-child(5)::before {
    content: "Disponible";
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td:nth-child(6)::before {
    content: "Minimo";
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td:nth-child(7)::before {
    content: "Estado";
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table tbody td:nth-child(8)::before {
    content: "Ultimo movimiento";
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--product,
  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--movement,
  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--actions {
    grid-column: 1 / -1;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--product {
    display: block;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle, #d8e1eb);
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--branch,
  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--movement {
    overflow: visible;
    white-space: normal;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--movement .inventory-stock-table__movement {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--movement .inventory-stock-table__movement strong,
  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--movement .inventory-stock-table__movement small {
    white-space: nowrap;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--actions {
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle, #d8e1eb);
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--actions .table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .inventory-tab-panel[data-tab-panel="products"] .inventory-stock-table__cell--actions .btn {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--border-subtle, #d8e1eb);
  }
}

/* Customers directory: keep the final visual contract isolated from legacy rules. */
.customers-page > .page__header {
  width: 100%;
  max-width: none;
  padding: 0;
}

.customers-page .customers-section .customers-summary-card {
  padding: 0;
  overflow: visible;
}

.customers-page .customers-section .customers-summary-card > .catalog-table-wrap {
  overflow: visible;
}

.customers-page .customers-section .stats-grid > .customers-metric-card {
  min-height: 96px;
  padding: 15px 16px;
}

.customers-page .customers-table__row .customers-table__avatar--blue {
  color: #1668c7;
  background: #e8f2ff;
}

.customers-page .customers-table__row .customers-table__avatar--orange {
  color: #9a6116;
  background: #fff0d9;
}

.customers-page .customers-table__row .customers-table__avatar--teal {
  color: #267c70;
  background: #e5f3ef;
}

.customers-page .customers-table__row .customers-table__avatar--yellow {
  color: #9b6715;
  background: #fff3d8;
}

@media (max-width: 760px) {
  .customers-page .customers-section .stats-grid > .customers-metric-card {
    min-height: 86px;
    padding: 12px;
  }
}

/* Customer profile: visual scope ends before .customer-timeline-card. */
.customer-inline-detail > .customer-inline-detail__toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.customer-inline-detail > .customer-inline-detail__toolbar .customer-inline-detail__back {
  align-self: center;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #334155;
}

.customer-inline-detail > .customer-inline-detail__toolbar .customer-inline-detail__back:hover {
  color: #0b63b8;
  background: transparent;
}

.customer-inline-detail > .customer-inline-detail__toolbar .customer-inline-detail__heading span {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.customer-inline-detail > .customer-inline-detail__toolbar .customer-inline-detail__heading h2 {
  margin: 3px 0 0;
  color: #10233f;
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 750;
  letter-spacing: 0;
}

.customer-inline-detail > .customer-inline-detail__toolbar > .btn--primary {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(16, 98, 184, 0.15);
}

.customer-inline-detail .customer-profile-overview {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.customer-inline-detail .customer-profile-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.customer-inline-detail .customer-profile-hero {
  display: grid;
  grid-template-columns: minmax(290px, 0.85fr) minmax(0, 1.65fr);
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 55, 83, 0.06);
}

.customer-inline-detail .customer-profile-identity {
  min-width: 0;
  padding-right: 20px;
  border-right: 1px solid #e4eaf1;
}

.customer-inline-detail .customer-profile-identity__summary {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.customer-inline-detail .customer-profile-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: #1768c7;
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
}

.customer-inline-detail .customer-profile-identity__main {
  min-width: 0;
}

.customer-inline-detail .customer-profile-identity__main h2 {
  overflow: hidden;
  margin: 0 0 8px;
  color: #10233f;
  font-size: 17px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-inline-detail .customer-profile-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.customer-inline-detail .customer-profile-badge--blue {
  border-color: #d4e5fa;
  background: #edf5ff;
  color: #1768c7;
}

.customer-inline-detail .customer-profile-badge--success {
  border-color: #cfead8;
  background: #edf9f1;
  color: #148447;
}

.customer-inline-detail .customer-profile-badge--warning {
  border-color: #f4dfb8;
  background: #fff7e9;
  color: #ad6800;
}

.customer-inline-detail .customer-profile-badge--danger {
  border-color: #f3d1d7;
  background: #fff1f3;
  color: #c73549;
}

.customer-inline-detail .customer-profile-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: #64748b;
  font-size: 12px;
}

.customer-inline-detail .customer-profile-contact > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.customer-inline-detail .customer-profile-contact .customer-profile-icon {
  width: 15px;
  height: 15px;
  color: #718096;
}

.customer-inline-detail .customer-profile-primary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

.customer-inline-detail .customer-profile-kpi {
  --profile-accent: #334155;
  --profile-icon-bg: #eef2f7;
  min-width: 0;
}

.customer-inline-detail .customer-profile-kpi--blue {
  --profile-accent: #1768c7;
  --profile-icon-bg: #eaf3ff;
}

.customer-inline-detail .customer-profile-kpi--success {
  --profile-accent: #148b49;
  --profile-icon-bg: #e9f8ee;
}

.customer-inline-detail .customer-profile-kpi--danger {
  --profile-accent: #d43a48;
  --profile-icon-bg: #fff0f2;
}

.customer-inline-detail .customer-profile-kpi--warning {
  --profile-accent: #d97706;
  --profile-icon-bg: #fff5e8;
}

.customer-inline-detail .customer-profile-kpi--neutral {
  --profile-accent: #334155;
  --profile-icon-bg: #eef2f7;
}

.customer-inline-detail .customer-profile-primary-metrics > .customer-profile-kpi {
  display: grid;
  grid-template-areas:
    "label"
    "icon"
    "value"
    "meta";
  grid-template-rows: auto 38px auto auto;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 4px 18px;
  text-align: center;
}

.customer-inline-detail .customer-profile-primary-metrics > .customer-profile-kpi + .customer-profile-kpi {
  border-left: 1px solid #e4eaf1;
}

.customer-inline-detail .customer-profile-primary-metrics .customer-profile-kpi__icon,
.customer-inline-detail .customer-profile-kpis .customer-profile-kpi__icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--profile-icon-bg);
  color: var(--profile-accent);
}

.customer-inline-detail .customer-profile-primary-metrics .customer-profile-kpi__icon {
  grid-area: icon;
  width: 38px;
  height: 38px;
}

.customer-inline-detail .customer-profile-primary-metrics .customer-profile-kpi__copy {
  display: contents;
}

.customer-inline-detail .customer-profile-primary-metrics .customer-profile-kpi__copy > span {
  grid-area: label;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.customer-inline-detail .customer-profile-primary-metrics .customer-profile-kpi__copy > strong {
  grid-area: value;
  overflow: hidden;
  max-width: 100%;
  color: var(--profile-accent);
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-profile-primary-metrics .customer-profile-kpi__copy > small {
  grid-area: meta;
  overflow: hidden;
  max-width: 100%;
  color: #758399;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-profile-financial-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.customer-inline-detail .customer-profile-financial-block {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(31, 55, 83, 0.045);
}

.customer-inline-detail .customer-profile-financial-block__header {
  margin: 0 0 12px;
}

.customer-inline-detail .customer-profile-financial-block__header h3 {
  margin: 0;
  color: #10233f;
  font-size: 15px;
  font-weight: 750;
}

.customer-inline-detail .customer-profile-financial-block__header p {
  margin: 3px 0 0;
  color: #718096;
  font-size: 12px;
}

.customer-inline-detail .customer-profile-financial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.customer-inline-detail .customer-profile-mini-stat {
  --profile-accent: #334155;
  --profile-icon-bg: #eef2f7;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #ffffff;
}

.customer-inline-detail .customer-profile-mini-stat--blue {
  --profile-accent: #1768c7;
  --profile-icon-bg: #eaf3ff;
}

.customer-inline-detail .customer-profile-mini-stat--success {
  --profile-accent: #148b49;
  --profile-icon-bg: #e9f8ee;
}

.customer-inline-detail .customer-profile-mini-stat--danger {
  --profile-accent: #d43a48;
  --profile-icon-bg: #fff0f2;
}

.customer-inline-detail .customer-profile-mini-stat--warning {
  --profile-accent: #d97706;
  --profile-icon-bg: #fff5e8;
}

.customer-inline-detail .customer-profile-mini-stat__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--profile-icon-bg);
  color: var(--profile-accent);
}

.customer-inline-detail .customer-profile-mini-stat__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.customer-inline-detail .customer-profile-mini-stat__copy span {
  color: #718096;
  font-size: 11px;
}

.customer-inline-detail .customer-profile-mini-stat__copy strong {
  overflow: hidden;
  color: #10233f;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-profile-mini-stat__copy small {
  overflow: hidden;
  color: var(--profile-accent);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-profile-overview > .customer-detail-alerts {
  gap: 8px;
}

.customer-inline-detail .customer-profile-overview > .customer-detail-alerts .customer-detail-alert {
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: none;
}

.customer-inline-detail .customer-profile-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  background: #e4eaf1;
  gap: 1px;
  box-shadow: 0 6px 18px rgba(31, 55, 83, 0.045);
}

.customer-inline-detail .customer-profile-kpis > .customer-profile-kpi {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 74px;
  padding: 11px 12px;
  background: #ffffff;
}

.customer-inline-detail .customer-profile-kpis .customer-profile-kpi__icon {
  width: 36px;
  height: 36px;
}

.customer-inline-detail .customer-profile-kpis .customer-profile-kpi__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.customer-inline-detail .customer-profile-kpis .customer-profile-kpi__copy span {
  color: #718096;
  font-size: 10px;
}

.customer-inline-detail .customer-profile-kpis .customer-profile-kpi__copy strong {
  overflow: hidden;
  color: #10233f;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-profile-kpis .customer-profile-kpi__copy small {
  overflow: hidden;
  color: #718096;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .customer-inline-detail .customer-profile-hero {
    grid-template-columns: 1fr;
  }

  .customer-inline-detail .customer-profile-identity {
    padding: 0 0 16px;
    border-right: 0;
    border-bottom: 1px solid #e4eaf1;
  }

  .customer-inline-detail .customer-profile-primary-metrics {
    padding-top: 16px;
  }

  .customer-inline-detail .customer-profile-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .customer-inline-detail .customer-profile-financial-groups {
    grid-template-columns: 1fr;
  }

  .customer-inline-detail .customer-profile-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .customer-inline-detail > .customer-inline-detail__toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .customer-inline-detail > .customer-inline-detail__toolbar .customer-inline-detail__back {
    grid-column: 1 / -1;
  }

  .customer-inline-detail > .customer-inline-detail__toolbar > .btn--primary {
    padding-inline: 12px;
  }

  .customer-inline-detail .customer-profile-hero {
    padding: 14px;
  }

  .customer-inline-detail .customer-profile-identity__summary {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .customer-inline-detail .customer-profile-avatar {
    width: 54px;
    height: 54px;
    font-size: 21px;
  }

  .customer-inline-detail .customer-profile-contact {
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-inline-detail .customer-profile-primary-metrics {
    grid-template-columns: 1fr;
  }

  .customer-inline-detail .customer-profile-primary-metrics > .customer-profile-kpi {
    grid-template-areas:
      "icon label"
      "icon value"
      "icon meta";
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: repeat(3, auto);
    justify-items: start;
    padding: 11px 0;
    text-align: left;
  }

  .customer-inline-detail .customer-profile-primary-metrics > .customer-profile-kpi + .customer-profile-kpi {
    border-top: 1px solid #e4eaf1;
    border-left: 0;
  }

  .customer-inline-detail .customer-profile-primary-metrics .customer-profile-kpi__copy {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .customer-inline-detail .customer-profile-financial-grid,
  .customer-inline-detail .customer-profile-kpis {
    grid-template-columns: 1fr;
  }
}

/* Customer timeline: compact CRM presentation, isolated from the profile and history. */
.customer-inline-detail .customer-timeline-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(31, 55, 83, 0.045);
}

.customer-inline-detail .customer-timeline-card > .card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid #e3e9f0;
}

.customer-inline-detail .customer-timeline-card__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.customer-inline-detail .customer-timeline-card__icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #eef5ff;
  color: #1768c7;
}

.customer-inline-detail .customer-timeline-card__icon .customer-profile-icon {
  width: 20px;
  height: 20px;
}

.customer-inline-detail .customer-timeline-card__heading .card__title {
  margin: 0;
  color: #10233f;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.customer-inline-detail .customer-timeline-card__heading .card__subtitle {
  overflow: hidden;
  margin: 3px 0 0;
  color: #718096;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline-card .customer-detail-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.customer-inline-detail .customer-timeline-card .customer-detail-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #34435a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline-card .customer-detail-actions .btn:hover {
  border-color: #dbe5f0;
  background: #f5f8fc;
  transform: none;
}

.customer-inline-detail .customer-timeline-card .customer-detail-actions .btn--primary {
  border-color: #bcd5f3;
  background: #eef5ff;
  color: #1768c7;
}

.customer-inline-detail .customer-timeline-card .customer-detail-actions > .badge {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1768c7;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline-card > .customer-timeline {
  display: grid;
  gap: 0;
  padding: 0 18px 8px;
}

.customer-inline-detail .customer-timeline__item {
  --timeline-accent: #1768c7;
  --timeline-soft: #eef5ff;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.customer-inline-detail .customer-timeline__item--payment {
  --timeline-accent: #159447;
  --timeline-soft: #eaf8ef;
}

.customer-inline-detail .customer-timeline__item--receivable,
.customer-inline-detail .customer-timeline__item--repair {
  --timeline-accent: #dd7200;
  --timeline-soft: #fff5e8;
}

.customer-inline-detail .customer-timeline__item--warranty {
  --timeline-accent: #7045cf;
  --timeline-soft: #f3efff;
}

.customer-inline-detail .customer-timeline__item--return {
  --timeline-accent: #d43a48;
  --timeline-soft: #fff0f2;
}

.customer-inline-detail .customer-timeline__rail {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100%;
}

.customer-inline-detail .customer-timeline__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #dce5ef;
}

.customer-inline-detail .customer-timeline__item:first-child .customer-timeline__rail::before {
  top: 50%;
}

.customer-inline-detail .customer-timeline__item:last-child .customer-timeline__rail::before {
  bottom: 50%;
}

.customer-inline-detail .customer-timeline__dot {
  position: absolute;
  z-index: 1;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--timeline-accent);
  box-shadow: 0 0 0 3px var(--timeline-soft);
}

.customer-inline-detail .customer-timeline__content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(132px, 0.78fr) minmax(230px, 2.15fr) minmax(170px, 0.95fr) minmax(136px, 0.82fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 78px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #e3e9f0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  overflow: visible;
  transition: background-color 140ms ease;
}

.customer-inline-detail .customer-timeline__content::before {
  display: none;
}

.customer-inline-detail .customer-timeline__item:last-child .customer-timeline__content {
  border-bottom: 0;
}

.customer-inline-detail .customer-timeline__item:hover .customer-timeline__content {
  border-color: #e3e9f0;
  background: #f9fbfd;
  box-shadow: none;
  transform: none;
}

.customer-inline-detail .customer-timeline__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.customer-inline-detail .customer-timeline .customer-timeline__badges > .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--timeline-accent) 25%, #dce5ef);
  border-radius: 7px;
  background: color-mix(in srgb, var(--timeline-soft) 72%, #ffffff);
  color: var(--timeline-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: center;
}

.customer-inline-detail .customer-timeline__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.customer-inline-detail .customer-timeline__copy h3 {
  overflow: hidden;
  margin: 0;
  color: #10233f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline__copy p {
  overflow: hidden;
  margin: 0;
  max-width: none;
  color: #718096;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline__date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline__date-icon {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #64748b;
}

.customer-inline-detail .customer-timeline__date-icon .customer-profile-icon {
  width: 16px;
  height: 16px;
}

.customer-inline-detail .customer-timeline__meta {
  display: grid;
  gap: 6px;
  min-width: 0;
  justify-items: stretch;
}

.customer-inline-detail .customer-timeline__amount {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--timeline-accent) 25%, #dce5ef);
  border-radius: 7px;
  background: color-mix(in srgb, var(--timeline-soft) 45%, #ffffff);
  text-align: right;
}

.customer-inline-detail .customer-timeline__amount span {
  color: #718096;
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.customer-inline-detail .customer-timeline__amount strong {
  overflow: hidden;
  color: var(--timeline-accent);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline__action {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--timeline-accent) 27%, #dce5ef) !important;
  border-radius: 7px;
  background: color-mix(in srgb, var(--timeline-soft) 45%, #ffffff) !important;
  box-shadow: none;
  color: var(--timeline-accent) !important;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-inline-detail .customer-timeline__action:hover {
  border-color: color-mix(in srgb, var(--timeline-accent) 45%, #dce5ef) !important;
  background: var(--timeline-soft) !important;
  box-shadow: none;
  transform: none;
}

@media (max-width: 1180px) {
  .customer-inline-detail .customer-timeline-card > .card__header {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-inline-detail .customer-timeline-card .customer-detail-actions {
    justify-content: flex-start;
  }

  .customer-inline-detail .customer-timeline__content {
    grid-template-columns: minmax(125px, 0.8fr) minmax(200px, 1.8fr) minmax(160px, 0.95fr) minmax(128px, 0.8fr);
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .customer-inline-detail .customer-timeline__content {
    grid-template-columns: minmax(120px, 0.75fr) minmax(0, 1.7fr) minmax(130px, 0.8fr);
  }

  .customer-inline-detail .customer-timeline__meta {
    grid-column: 2 / 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .customer-inline-detail .customer-timeline-card > .card__header {
    padding: 13px 14px;
  }

  .customer-inline-detail .customer-timeline-card__heading {
    align-items: flex-start;
  }

  .customer-inline-detail .customer-timeline-card__heading .card__subtitle {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .customer-inline-detail .customer-timeline-card .customer-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .customer-inline-detail .customer-timeline-card .customer-detail-actions > .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .customer-inline-detail .customer-timeline-card > .customer-timeline {
    padding-inline: 10px;
  }

  .customer-inline-detail .customer-timeline__item {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 6px;
  }

  .customer-inline-detail .customer-timeline__content {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-height: 0;
    padding: 12px 8px;
  }

  .customer-inline-detail .customer-timeline__badges {
    grid-column: 1 / -1;
  }

  .customer-inline-detail .customer-timeline__copy {
    grid-column: 1 / -1;
  }

  .customer-inline-detail .customer-timeline__copy h3,
  .customer-inline-detail .customer-timeline__copy p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .customer-inline-detail .customer-timeline__date {
    align-self: center;
    white-space: normal;
  }

  .customer-inline-detail .customer-timeline__meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-inline-detail .customer-timeline__amount {
    text-align: left;
  }
}
/* --------------------------------------------------------------------------
   Theme Studio v2 · semantic visual bridge
   These rules intentionally live at the end of the enterprise layer so the
   versioned theme tokens can progressively cover legacy module styles.
   -------------------------------------------------------------------------- */
:root {
  --theme-primary: var(--color-primary, #2563eb);
  --theme-primary-hover: var(--color-primary-strong, #1d4ed8);
  --theme-primary-active: #1e40af;
  --theme-primary-soft: var(--color-primary-soft, #eff6ff);
  --theme-module-accent: var(--theme-primary);
  --theme-module-button: var(--theme-primary);
  --theme-module-button-hover: var(--theme-primary-hover);
  --theme-module-button-active: var(--theme-primary-active);
  --theme-module-soft: var(--theme-primary-soft);
  --theme-module-on-button: #fff;
  --theme-app-bg: var(--color-bg, #f5f7fb);
  --theme-section-bg: var(--color-bg-soft, #f8faff);
  --theme-card-bg: var(--color-surface, #fff);
  --theme-sidebar-bg: #fff;
  --theme-topbar-bg: #fff;
  --theme-input-bg: #fff;
  --theme-text: var(--color-text, #0f172a);
  --theme-text-muted: var(--color-text-muted, #52627a);
  --theme-text-soft: var(--color-text-soft, #708198);
  --theme-border: var(--color-border, #dbe3ef);
  --theme-border-strong: var(--color-border-strong, #cbd5e1);
  --theme-focus: #93b4ff;
  --theme-radius: 12px;
  --theme-field-radius: 9px;
  --theme-button-radius: 9px;
  --theme-shadow: 0 12px 32px rgb(15 23 42 / 12%);
  --theme-font-family: Inter, system-ui, sans-serif;
  --theme-font-size: 14px;
}

html,
body {
  background: var(--theme-app-bg);
  color: var(--theme-text);
  font-family: var(--theme-font-family);
  font-size: var(--theme-font-size);
}
html[data-theme-reduced-motion="true"] *,
html[data-theme-reduced-motion="true"] *::before,
html[data-theme-reduced-motion="true"] *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
html[data-theme-high-contrast="true"] .card,
html[data-theme-high-contrast="true"] .field__input,
html[data-theme-high-contrast="true"] .field__select,
html[data-theme-high-contrast="true"] .btn { border-color: var(--theme-text-muted); }

::selection { background: var(--theme-selection); }
* { scrollbar-color: var(--theme-scrollbar) transparent; }

.app-shell,
.app-main,
.page,
.view-root { background-color: var(--theme-app-bg); color: var(--theme-text); }

.sidebar,
.sidebar-host,
.sidebar__surface { background: var(--theme-sidebar-bg); color: var(--theme-text); border-color: var(--theme-border); }
.topbar,
.topbar-host { background: var(--theme-topbar-bg); color: var(--theme-text); border-color: var(--theme-border); }

.card,
.modal,
.table-shell,
.dropdown-menu,
.popover,
.settings-admin-card {
  background-color: var(--theme-card-bg);
  color: var(--theme-text);
  border-color: var(--theme-border);
  border-radius: var(--theme-radius);
}

.card__subtitle,
.card__meta,
.page__subtitle,
.field__help { color: var(--theme-text-muted); }

.field__input,
.field__select,
.field__textarea,
input,
select,
textarea {
  background-color: var(--theme-input-bg);
  color: var(--theme-text);
  border-color: var(--theme-border);
  border-radius: var(--theme-field-radius);
}
.field__input:focus,
.field__select:focus,
.field__textarea:focus,
input:focus,
select:focus,
textarea:focus { border-color: var(--theme-module-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-focus) 35%, transparent); }

.btn { border-radius: var(--theme-button-radius); }
.btn--primary {
  background: var(--theme-module-button);
  border-color: var(--theme-module-button);
  color: var(--theme-module-on-button);
}
.btn--primary:hover { background: var(--theme-module-button-hover); border-color: var(--theme-module-button-hover); }
.btn--primary:active { background: var(--theme-module-button-active); border-color: var(--theme-module-button-active); }
.btn--ghost { background: var(--theme-card-bg); border-color: var(--theme-border); color: var(--theme-module-accent); }
.btn--ghost:hover { background: var(--theme-module-soft); border-color: var(--theme-module-accent); }

.tabs__button.is-active,
.module-tab.is-active,
.settings-admin-tab.is-active { color: var(--theme-module-accent); border-color: var(--theme-module-accent); background: var(--theme-module-soft); }
.data-table thead,
.table__head { background: var(--theme-section-bg); }
.data-table th,
.data-table td,
.table__cell { border-color: var(--theme-divider); }

html[data-theme-preview="true"] body::after {
  content: "VISTA PREVIA · SOLO LECTURA";
  position: fixed;
  z-index: 99999;
  right: 14px;
  bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--theme-text);
  color: var(--theme-card-bg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  box-shadow: var(--theme-shadow);
  pointer-events: none;
}
html[data-theme-preview="true"][data-preview-component-state="disabled"] .btn--primary { opacity: .45; filter: grayscale(.35); }
html[data-theme-preview="true"][data-preview-component-state="hover"] .btn--primary { background: var(--theme-module-button-hover); }
html[data-theme-preview="true"][data-preview-component-state="active"] .btn--primary { background: var(--theme-module-button-active); transform: translateY(1px); }
html[data-theme-preview="true"][data-preview-component-state="focus"] .btn--primary { box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-focus) 50%, transparent); }

.theme-studio {
  overflow: hidden;
  min-height: min(920px, calc(100vh - 178px));
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-border);
  border-radius: calc(var(--theme-radius) + 4px);
  box-shadow: var(--theme-shadow);
}
.theme-studio__header,
.theme-studio__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: var(--theme-card-bg);
  border-bottom: 1px solid var(--theme-border);
}
.theme-studio__title { display: flex; align-items: center; gap: 13px; }
.theme-studio__title > span {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px; background: var(--theme-gradient-primary); color: #fff; font-size: 18px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--theme-primary) 25%, transparent);
}
.theme-studio__title > span svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-studio__title > span svg circle { fill: currentColor; stroke: none; }
.theme-studio__title h2 { margin: 0; color: var(--theme-text); font-size: 20px; line-height: 1.25; }
.theme-studio__title p,
.theme-studio__library p,
.theme-editor-section__heading p,
.theme-live-preview__header p { margin: 4px 0 0; color: var(--theme-text-muted); font-size: 12px; }
.theme-studio__status { display: flex; align-items: center; gap: 10px; color: var(--theme-text-muted); font-size: 12px; }

.theme-studio__workspace { display: grid; grid-template-columns: minmax(270px, 330px) minmax(0, 1fr); align-items: stretch; }
.theme-studio__library { padding: 20px; background: var(--theme-section-bg); border-right: 1px solid var(--theme-border); }
.theme-studio__library h3 { margin: 0; color: var(--theme-text); font-size: 14px; }
.theme-studio__preset-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.theme-studio__preset {
  min-width: 0; padding: 12px; border: 1px solid var(--theme-border); border-radius: 11px;
  background: var(--theme-card-bg); color: var(--theme-text); text-align: left; cursor: pointer; transition: .18s ease;
}
.theme-studio__preset:hover { border-color: var(--theme-module-accent); transform: translateY(-1px); }
.theme-studio__preset.is-active { border-color: var(--theme-module-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-module-accent) 14%, transparent); }
.theme-studio__preset-title { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; font-weight: 750; }
.theme-studio__preset-title > span { display: flex; align-items: center; min-width: 0; }
.theme-studio__preset-title i { width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--swatch); }
.theme-studio__preset-title small { padding: 3px 6px; border-radius: 99px; background: var(--theme-module-soft); color: var(--theme-module-accent); font-size: 8px; }
.theme-studio__preset-description { display: block; min-height: 28px; margin-top: 6px; color: var(--theme-text-muted); font-size: 9px; line-height: 1.35; }
.theme-studio__preset-preview { display: grid; grid-template-columns: 18% 1fr; grid-template-rows: repeat(3, 8px); gap: 3px; height: 38px; margin-top: 9px; padding: 5px; overflow: hidden; border-radius: 6px; background: var(--preset-bg); }
.theme-studio__preset-preview i:first-child { grid-row: 1 / -1; background: var(--preset-sidebar); }
.theme-studio__preset-preview i:nth-child(2) { background: var(--preset-card); }
.theme-studio__preset-preview i:nth-child(3) { background: var(--preset-primary); }
.theme-studio__preset-preview i:nth-child(4) { background: var(--preset-card); }
.theme-studio__preset-preview i:nth-child(5) { background: var(--preset-secondary); }
.theme-studio__custom-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.theme-studio__custom-heading span { color: var(--theme-text-muted); font-size: 11px; }
.theme-studio__preset-list--custom { grid-template-columns: 1fr; }
.theme-studio__new-theme { width: 100%; margin-top: 14px; }
.theme-studio__custom-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 7px; }
.theme-studio__custom-tools button { padding: 6px 3px; border: 0; border-radius: 6px; background: transparent; color: var(--theme-text-muted); font-size: 8px; cursor: pointer; }
.theme-studio__custom-tools button:hover { background: var(--theme-module-soft); color: var(--theme-module-accent); }

.theme-studio__main { min-width: 0; background: var(--theme-card-bg); }
.theme-studio__tabs { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; border-bottom: 1px solid var(--theme-border); }
.theme-studio__tabs button { flex: 0 0 auto; padding: 15px 14px 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--theme-text-muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.theme-studio__tabs button:hover { color: var(--theme-module-accent); }
.theme-studio__tabs button.is-active { color: var(--theme-module-accent); border-color: var(--theme-module-accent); }
.theme-editor-section { min-height: 330px; padding: 18px; border-bottom: 1px solid var(--theme-border); }
.theme-editor-section__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.theme-editor-section__heading h4,
.theme-gradient-section h4,
.theme-live-preview__header h4 { margin: 0; color: var(--theme-text); font-size: 13px; }
.theme-color-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.theme-color-field { min-width: 0; }
.theme-color-field > span:first-child { display: block; margin: 0 0 6px 2px; color: var(--theme-text); font-size: 10px; font-weight: 700; }
.theme-color-field__control { display: flex; align-items: center; height: 36px; overflow: hidden; border: 1px solid var(--theme-border); border-radius: var(--theme-field-radius); background: var(--theme-input-bg); }
.theme-color-field__control:focus-within { border-color: var(--theme-module-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-focus) 28%, transparent); }
.theme-color-field__control input[type="color"] { width: 38px; height: 100%; padding: 5px; border: 0; border-right: 1px solid var(--theme-border); border-radius: 0; cursor: pointer; }
.theme-color-field__control input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px 6px; }
.theme-color-field__control input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.theme-color-field__control input[type="color"]::-moz-color-swatch { border: 0; border-radius: 4px; }
.theme-color-field__control input[type="text"] { width: 100%; min-width: 0; height: 100%; padding: 0 8px; border: 0; border-radius: 0; background: transparent; color: var(--theme-text-muted); font-size: 10px; font-family: ui-monospace, monospace; }
.theme-gradient-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--theme-divider); }
.theme-gradient-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.theme-gradient-grid div { display: grid; gap: 6px; color: var(--theme-text-muted); font-size: 9px; }
.theme-gradient-grid i { height: 24px; border: 1px solid var(--theme-border); border-radius: 7px; }
.theme-module-select { max-width: 320px; margin-bottom: 16px; }
.theme-component-sample,
.theme-effect-samples { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding: 16px; border-radius: var(--theme-radius); background: var(--theme-section-bg); }
.theme-login-sample { min-height: 170px; display: grid; place-items: center; margin-top: 18px; padding: 20px; border-radius: var(--theme-radius); background: var(--login-sample-bg); }
.theme-login-sample > div { display: grid; gap: 7px; width: min(270px, 100%); padding: 18px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius); background: var(--login-sample-card); box-shadow: var(--theme-shadow); }
.theme-login-sample span { color: var(--theme-text-muted); font-size: 10px; }
.theme-login-sample input { height: 34px; padding: 0 9px; }
.theme-login-sample button { height: 34px; border: 0; border-radius: var(--theme-button-radius); background: var(--theme-primary); color: var(--theme-module-on-button); font-weight: 700; }
.theme-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.theme-control-grid input[type="range"] { width: 100%; accent-color: var(--theme-module-accent); }
.theme-type-sample { margin-top: 20px; padding: 20px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius); background: var(--theme-section-bg); }
.theme-type-sample h3 { margin: 0 0 8px; }
.theme-type-sample p { margin: 0 0 14px; color: var(--theme-text-muted); }
.theme-type-sample strong { color: var(--theme-module-accent); font-size: 22px; }
.theme-effect-samples article { min-width: 180px; padding: 16px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius); background: var(--theme-card-bg); box-shadow: var(--theme-shadow); }
.theme-effect-samples article span { display: block; color: var(--theme-text-muted); font-size: 10px; }
.theme-advanced-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-advanced-switches { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.theme-accessibility { margin-top: 18px; padding: 16px; border: 1px solid color-mix(in srgb, var(--theme-success) 32%, var(--theme-border)); border-radius: var(--theme-radius); background: color-mix(in srgb, var(--theme-success) 7%, var(--theme-card-bg)); }
.theme-accessibility.has-warnings { border-color: color-mix(in srgb, var(--theme-warning) 38%, var(--theme-border)); background: color-mix(in srgb, var(--theme-warning) 8%, var(--theme-card-bg)); }
.theme-accessibility > div { display: grid; gap: 3px; }
.theme-accessibility > div span { color: var(--theme-text-muted); font-size: 10px; }
.theme-accessibility ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.theme-accessibility li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--theme-card-bg); font-size: 9px; }
.theme-accessibility li em { padding: 2px 5px; border-radius: 99px; background: var(--theme-module-soft); color: var(--theme-module-accent); font-style: normal; }
.theme-schema-note { margin-top: 14px; padding: 14px; border-radius: var(--theme-radius); background: var(--theme-section-bg); }
.theme-schema-note p { margin: 4px 0 0; color: var(--theme-text-muted); font-size: 10px; }

.theme-live-preview { padding: 18px; background: var(--theme-section-bg); }
.theme-live-preview__header { display: flex; justify-content: space-between; gap: 14px; }
.theme-switch { display: flex; align-items: center; gap: 8px; color: var(--theme-text-muted); font-size: 10px; }
.theme-switch input { position: absolute; opacity: 0; }
.theme-switch i { width: 34px; height: 19px; padding: 2px; border-radius: 99px; background: var(--theme-border-strong); transition: .2s; }
.theme-switch i::before { content: ""; display: block; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 22%); transition: .2s; }
.theme-switch input:checked + i { background: var(--theme-module-accent); }
.theme-switch input:checked + i::before { transform: translateX(15px); }
.theme-preview-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 15px 0 10px; }
.theme-preview-toolbar label { display: grid; gap: 4px; color: var(--theme-text-muted); font-size: 9px; }
.theme-preview-toolbar select { height: 32px; padding: 0 28px 0 9px; border: 1px solid var(--theme-border); }
.theme-preview-segment { display: flex; padding: 3px; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-card-bg); }
.theme-preview-segment button { padding: 6px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--theme-text-muted); font-size: 9px; cursor: pointer; }
.theme-preview-segment button.is-active { background: var(--theme-module-soft); color: var(--theme-module-accent); font-weight: 700; }
.theme-preview-stage { position: relative; width: 100%; height: 410px; margin: auto; overflow: hidden; border: 1px solid var(--theme-border); border-radius: calc(var(--theme-radius) + 2px); background: #dce4f0; box-shadow: 0 10px 30px rgb(15 23 42 / 10%); transition: width .24s ease; }
.theme-preview-stage--tablet { width: min(78%, 820px); }
.theme-preview-stage--mobile { width: min(42%, 430px); }
.theme-preview-stage iframe { width: 1440px; height: 900px; border: 0; background: var(--theme-app-bg); transform: scale(.61); transform-origin: top left; }
.theme-preview-stage--tablet iframe { width: 1024px; transform: scale(.65); }
.theme-preview-stage--mobile iframe { width: 390px; height: 840px; transform: scale(.69); }
.theme-preview-readonly { position: absolute; z-index: 2; right: 8px; top: 8px; padding: 5px 8px; border-radius: 99px; background: rgb(15 23 42 / 82%); color: #fff; font-size: 8px; font-weight: 800; pointer-events: none; }
.theme-studio__footer { position: sticky; z-index: 3; bottom: 0; border-top: 1px solid var(--theme-border); border-bottom: 0; box-shadow: 0 -8px 24px rgb(15 23 42 / 5%); }
.theme-studio__footer > span { color: var(--theme-text-muted); font-size: 10px; }
.theme-studio__footer > div { display: flex; gap: 9px; }

@media (max-width: 1220px) {
  .theme-studio__workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .theme-studio__preset-list { grid-template-columns: 1fr; }
  .theme-color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .theme-studio__workspace { grid-template-columns: 1fr; }
  .theme-studio__library { border-right: 0; border-bottom: 1px solid var(--theme-border); }
  .theme-studio__preset-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .theme-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-preview-stage--mobile { width: min(70%, 430px); }
}
@media (max-width: 640px) {
  .theme-studio__header,
  .theme-studio__footer { align-items: stretch; flex-direction: column; padding: 16px; }
  .theme-studio__status { display: none; }
  .theme-studio__library { max-height: 500px; overflow-y: auto; }
  .theme-studio__preset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-color-grid,
  .theme-control-grid,
  .theme-accessibility ul { grid-template-columns: 1fr; }
  .theme-preview-toolbar { align-items: stretch; flex-direction: column; }
  .theme-preview-segment { justify-content: center; }
  .theme-preview-stage,
  .theme-preview-stage--tablet,
  .theme-preview-stage--mobile { width: 100%; height: 480px; }
  .theme-studio__footer > div { display: grid; grid-template-columns: 1fr; }
}

/* Theme Studio v3 · composición fiel al diseño aprobado, sin vista previa. */
.theme-studio {
  --theme-module-accent: #2563eb;
  --theme-module-button: #2563eb;
  --theme-module-button-hover: #1d4ed8;
  --theme-module-button-active: #1e40af;
  --theme-module-soft: #eff6ff;
  --theme-module-on-button: #ffffff;
  min-height: 0;
  border-color: #dbe5f1;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 28px rgb(34 63 105 / 8%);
}
.theme-studio__header {
  min-height: 76px;
  padding: 17px 18px;
  background: #ffffff;
  border-color: #dbe5f1;
}
.theme-studio__title > span {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  box-shadow: 0 7px 15px rgb(124 58 237 / 20%);
}
.theme-studio__title h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.theme-studio__title p { margin-top: 3px; font-size: 11px; }
.theme-studio__workspace { grid-template-columns: minmax(390px, 31.5%) minmax(0, 1fr); height: 740px; }
.theme-studio__library {
  padding: 18px 16px 20px;
  overflow-y: auto;
  background: #ffffff;
  border-color: #dbe5f1;
}
.theme-studio__library > div:first-child { padding: 0 1px; }
.theme-studio__library h3 { font-size: 13px; font-weight: 800; }
.theme-studio__library p { font-size: 10px; }
.theme-studio__preset-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}
.theme-studio__preset {
  min-height: 134px;
  padding: 11px;
  border-color: #dbe5f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}
.theme-studio__preset:hover { border-color: #8bb1ff; transform: none; box-shadow: 0 5px 14px rgb(37 99 235 / 8%); }
.theme-studio__preset.is-active { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.theme-studio__preset-title { font-size: 10.5px; }
.theme-studio__preset-title > span > i { width: 7px; height: 7px; }
.theme-studio__preset-title small { padding: 3px 7px; background: #eaf2ff; color: #1d4ed8; font-size: 7.5px; }
.theme-studio__preset-description { min-height: 24px; margin-top: 7px; font-size: 8.5px; }
.theme-studio__preset-preview {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 20px 48px;
  gap: 4px;
  height: 72px;
  margin-top: 5px;
  padding: 0;
  overflow: hidden;
  border-radius: 5px;
  background: transparent;
}
.theme-studio__preset-swatches { display: flex; gap: 5px; align-items: center; }
.theme-studio__preset-swatches i { width: 25px; height: 17px; border: 1px solid #dbe5f1; border-radius: 3px; }
.theme-studio__preset-swatches i:nth-child(1) { background: var(--preset-primary); }
.theme-studio__preset-swatches i:nth-child(2) { background: var(--preset-secondary); }
.theme-studio__preset-swatches i:nth-child(3) { background: var(--preset-card); }
.theme-studio__preset-swatches i:nth-child(4) { background: var(--preset-sidebar); }
.theme-studio__preset-scene {
  position: relative;
  display: grid;
  grid-template-columns: 30% 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--preset-primary) 13%, #e5eaf1);
  border-radius: 4px;
  background: var(--preset-bg);
}
.theme-studio__preset-scene i:first-child { grid-row: 1 / -1; border-radius: 2px; background: var(--preset-sidebar); }
.theme-studio__preset-scene i:nth-child(2),
.theme-studio__preset-scene i:nth-child(3),
.theme-studio__preset-scene i:nth-child(4) { border-radius: 2px; background: var(--preset-card); }
.theme-studio__preset-scene i:nth-child(3) { width: 76%; background: var(--preset-primary); }
.theme-studio__preset-list--custom { grid-template-columns: 1fr; }
.theme-studio__custom-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed #91b5ff;
  border-radius: 8px;
  background: #f9fbff;
  color: #27436e;
  text-align: left;
  cursor: pointer;
}
.theme-studio__custom-card > span:first-child { display: grid; place-items: center; color: #6d4df2; font-size: 22px; font-weight: 800; }
.theme-studio__custom-card > span:nth-child(2) { display: grid; gap: 3px; }
.theme-studio__custom-card strong { font-size: 10px; }
.theme-studio__custom-card small { color: #71809a; font-size: 8.5px; }
.theme-studio__custom-card em { padding: 7px 10px; border: 1px solid #cadcf9; border-radius: 6px; background: #eef4ff; color: #2563eb; font-size: 8.5px; font-style: normal; font-weight: 700; }
.theme-studio__main { min-height: 0; overflow-y: auto; background: #ffffff; }
.theme-studio__tabs { min-height: 42px; padding: 0 8px; border-color: #dbe5f1; background: #fbfcff; }
.theme-studio__tabs button { padding: 14px 14px 11px; font-size: 10px; }
.theme-editor-section { min-height: 535px; padding: 17px 16px 22px; border-bottom: 0; }
.theme-editor-section__heading { margin-bottom: 16px; }
.theme-editor-section__heading h4,
.theme-gradient-section h4 { font-size: 12px; font-weight: 800; }
.theme-editor-section__heading p { font-size: 9px; }
.theme-editor-section__heading .btn { min-height: 30px; padding: 5px 10px; font-size: 9px; }
.theme-color-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px 14px; }
.theme-color-field > span:first-child { margin-bottom: 7px; font-size: 9px; }
.theme-color-field__control { position: relative; height: 36px; border-color: #d5e0ee; border-radius: 6px; background: #ffffff; }
.theme-color-field__control::before { content: ""; width: 22px; height: 22px; margin-left: 7px; flex: 0 0 22px; border: 1px solid #d5e0ee; border-radius: 3px; background: var(--theme-field-color); }
.theme-color-field__control input[type="color"] { position: absolute; z-index: 2; left: 0; width: 38px; padding: 5px; border: 0; opacity: 0; cursor: pointer; }
.theme-color-field__control input[type="text"] { padding: 0 8px; color: #53627a; font-size: 9px; }
.theme-color-field__control > i { display: grid; place-items: center; width: 30px; height: 100%; flex: 0 0 30px; color: #53627a; font-size: 12px; font-style: normal; }
.theme-gradient-section { margin-top: 14px; padding: 15px 0 0; border-color: #dbe5f1; }
.theme-gradient-grid { gap: 14px; }
.theme-gradient-grid div { font-size: 8.5px; }
.theme-gradient-grid i { height: 24px; border-radius: 5px; }
.theme-studio__footer {
  position: static;
  min-height: 67px;
  padding: 13px 16px;
  border-color: #dbe5f1;
  background: #ffffff;
  box-shadow: none;
}
.theme-studio__footer-note { display: flex !important; align-items: center; gap: 14px; }
.theme-studio__footer-note > span { color: #71809a; font-size: 9px; }
.theme-studio__footer .btn { min-height: 36px; padding: 8px 14px; font-size: 10px; }

@media (max-width: 1240px) {
  .theme-studio__workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .theme-color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .theme-studio__workspace { grid-template-columns: 1fr; height: auto; }
  .theme-studio__library { max-height: none; border-right: 0; border-bottom: 1px solid #dbe5f1; }
  .theme-studio__preset-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .theme-editor-section { min-height: 0; }
}
@media (max-width: 640px) {
  .theme-studio__header { min-height: 0; padding: 14px; }
  .theme-studio__library { max-height: 510px; padding: 14px; overflow-y: auto; }
  .theme-studio__preset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-studio__preset { min-height: 126px; }
  .theme-studio__preset-preview { grid-template-rows: 18px 42px; height: 64px; }
  .theme-color-grid { grid-template-columns: 1fr; }
  .theme-studio__footer-note { align-items: stretch; flex-direction: column; }
}
