:root {
  --app-bg: var(--corp-bg, #f5f7fb);
  --app-surface: var(--corp-surface, #ffffff);
  --app-surface-soft: var(--corp-surface-soft, #f8fafc);
  --app-border: var(--corp-border, #dde4ee);
  --app-border-strong: #c7d2e1;
  --app-text: var(--corp-text, #182230);
  --app-heading: var(--corp-text, #182230);
  --app-muted: var(--corp-muted, #64748b);
  --app-primary: var(--corp-primary, #167a4a);
  --app-primary-dark: var(--corp-primary-dark, #0f5f3a);
  --app-primary-soft: var(--corp-primary-soft, #e8f6ef);
  --app-info: var(--corp-info, #0f6cbd);
  --app-success: #167a4a;
  --app-success-soft: #e8f6ef;
  --app-success-text: #0f5f3a;
  --app-warning: #b7791f;
  --app-danger: #b42318;
  --app-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --app-shadow: var(--app-shadow-sm);
  --app-shadow-soft: var(--app-shadow-sm);
  --app-shadow-md: 0 10px 24px rgba(16, 24, 40, 0.08);
  --app-focus-ring: rgba(22, 122, 74, 0.14);
  --app-table-border: #edf1f6;
  --app-table-head: var(--corp-table-head, #f1f5f9);
  --app-table-head-text: #334155;
  --app-table-hover: var(--corp-table-hover, #f8fbfd);
  --app-link-hover: #094b84;
  --app-warning-soft: #fff1c2;
  --app-warning-text: #7a4b00;
  --app-danger-soft: #fef3f2;
  --app-danger-border: #f1b8b2;
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: 22, 122, 74;
  --bs-link-color: var(--app-primary);
  --bs-link-hover-color: var(--app-primary-dark);
  --app-radius: 8px;
  --app-radius-sm: 6px;
  --app-header-height: 76px;
  --app-sidebar-width: 292px;
  --app-sidebar-collapsed-width: 84px;
  --app-topbar-height: 68px;
}

.b2b-public-page {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--app-primary-soft) 60%, transparent), transparent 32rem),
    var(--app-bg);
  color: var(--app-text);
  min-height: 100vh;
}

.b2b-public-hero {
  position: relative;
  overflow: hidden;
  padding: 18px clamp(18px, 4vw, 42px) clamp(42px, 8vw, 78px);
  background:
    linear-gradient(135deg, rgba(8, 16, 45, .92), rgba(22, 122, 74, .72)),
    var(--b2b-banner);
  background-position: center;
  background-size: cover;
  color: #fff;
}

.b2b-public-nav {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-inline: auto;
  max-width: 1180px;
}

.b2b-public-brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.b2b-public-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  padding: 5px;
}

.b2b-public-brand span {
  display: block;
  max-width: min(46vw, 360px);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.05;
}

.b2b-public-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.b2b-logout-form {
  margin: 0;
}

.b2b-public-hero-copy {
  display: grid;
  gap: 10px;
  margin: clamp(42px, 8vw, 82px) auto 0;
  max-width: 1180px;
}

.b2b-public-hero-copy span {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  padding: 8px 14px;
  font-weight: 850;
}

.b2b-public-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: .98;
}

.b2b-public-hero-copy p {
  max-width: 640px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 1.08rem;
}

.b2b-public-main {
  margin-inline: auto;
  max-width: 1180px;
  padding: clamp(18px, 4vw, 44px);
}

.b2b-cart-link {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.b2b-cart-link strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--app-primary);
  font-size: .86rem;
  font-weight: 950;
  padding-inline: 7px;
}

.citas-shell {
  display: grid;
  gap: 20px;
}

.citas-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--app-primary) 18%, var(--app-border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--app-primary-soft) 78%, var(--app-surface)), var(--app-surface) 62%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--app-info) 16%, transparent), transparent 34%);
}

.citas-hero h1 {
  max-width: 12ch;
}

.citas-hero p {
  max-width: 58ch;
}

.citas-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.citas-metric {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 3px 12px;
  align-items: center;
  min-height: 118px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--metric-color, var(--app-primary)) 18%, var(--app-border));
  border-radius: var(--app-radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--metric-color, var(--app-primary)) 8%, var(--app-surface)), var(--app-surface));
  color: var(--app-text);
  text-decoration: none;
  box-shadow: var(--app-shadow-sm);
}

.citas-metric:hover,
.citas-metric:focus {
  color: var(--app-text);
  border-color: color-mix(in srgb, var(--metric-color, var(--app-primary)) 42%, var(--app-border));
  box-shadow: var(--app-shadow-md);
  transform: translateY(-1px);
}

.citas-metric.tone-info { --metric-color: var(--app-info); }
.citas-metric.tone-warning { --metric-color: var(--app-warning); }
.citas-metric.tone-success { --metric-color: var(--app-primary); }
.citas-metric.tone-danger { --metric-color: var(--app-danger); }

.citas-metric-icon {
  grid-row: span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--metric-color, var(--app-primary)) 12%, var(--app-surface));
  color: var(--metric-color, var(--app-primary));
  font-size: 1.1rem;
}

.citas-metric-label,
.citas-section-kicker {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.citas-metric strong {
  color: var(--app-text);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1;
}

.citas-metric small {
  color: var(--app-muted);
}

.citas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 20px;
  align-items: start;
}

.citas-side {
  display: grid;
  gap: 16px;
}

.citas-layout-main {
  grid-template-columns: minmax(0, 1fr);
}

.citas-maintenance-layout,
.citas-portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 20px;
  align-items: start;
}

.citas-calendar-card,
.citas-config-card {
  border-color: color-mix(in srgb, var(--app-primary) 12%, var(--app-border));
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.citas-dynamic-calendar {
  overflow: visible;
}

.citas-calendar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--app-muted);
  font-weight: 750;
}

.citas-calendar-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: var(--app-border);
  color: var(--app-text);
  font-weight: 800;
}

body.citas-calendar-expanded {
  overflow: hidden;
}

body.citas-calendar-expanded .modal-backdrop {
  z-index: 2070;
}

body.citas-calendar-expanded .modal {
  z-index: 2080;
}

.citas-dynamic-calendar.is-expanded {
  position: fixed;
  inset: 10px;
  z-index: 2060;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  max-height: calc(100dvh - 20px);
  padding: clamp(14px, 2vw, 22px);
  overflow: hidden;
  border-radius: 22px;
  background: var(--app-surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.citas-dynamic-calendar.is-expanded:fullscreen {
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
}

.citas-dynamic-calendar.is-expanded .app-card-header {
  margin-bottom: 12px;
}

.citas-dynamic-calendar.is-expanded .citas-calendar-filter {
  margin-bottom: 10px;
}

.citas-dynamic-calendar.is-expanded .citas-calendar-legend {
  margin-bottom: 10px;
}

.citas-dynamic-calendar.is-expanded #citasCalendar {
  min-height: 0;
  overflow: hidden;
}

.citas-dynamic-calendar.is-expanded #citasCalendar .fc {
  height: 100%;
}

.citas-dynamic-calendar.is-expanded #citasCalendar .fc-view-harness {
  min-height: 0;
}

.citas-calendar-filter {
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(260px, 1.6fr) auto auto;
}

.citas-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.citas-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--app-primary);
}

.legend-dot.disponible { background: #22c55e; }
.legend-dot.pendiente { background: #b7791f; }
.legend-dot.confirmado { background: var(--app-primary); }
.legend-dot.reprogramado { background: var(--app-info); }
.legend-dot.cancelado { background: var(--app-danger); }
.legend-dot.bloqueado { background: color-mix(in srgb, var(--app-danger) 70%, var(--app-surface)); }

#citasCalendar {
  --fc-border-color: var(--app-border);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--app-surface-soft);
  --fc-today-bg-color: color-mix(in srgb, var(--app-primary-soft) 58%, transparent);
  --fc-now-indicator-color: var(--app-danger);
}

#citasCalendar .fc-toolbar {
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

#citasCalendar .fc-toolbar-title {
  color: var(--app-text);
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  font-weight: 850;
  letter-spacing: 0;
}

#citasCalendar .fc-button {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: none;
  text-transform: none;
}

#citasCalendar .fc-button:hover,
#citasCalendar .fc-button:focus,
#citasCalendar .fc-button-primary:not(:disabled).fc-button-active {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

#citasCalendar .fc-scrollgrid,
#citasCalendar .fc-theme-standard td,
#citasCalendar .fc-theme-standard th {
  border-color: var(--app-border);
}

#citasCalendar .fc-col-header-cell,
#citasCalendar .fc-timegrid-axis,
#citasCalendar .fc-list-day-cushion {
  background: var(--app-surface-soft);
}

#citasCalendar .fc-col-header-cell-cushion,
#citasCalendar .fc-daygrid-day-number,
#citasCalendar .fc-timegrid-slot-label,
#citasCalendar .fc-list-day-text,
#citasCalendar .fc-list-day-side-text {
  color: var(--app-text);
  text-decoration: none;
}

#citasCalendar .fc-timegrid-slot {
  height: 42px;
}

#citasCalendar .fc-timegrid-slot-lane:hover,
#citasCalendar .fc-daygrid-day-frame:hover {
  background: color-mix(in srgb, var(--app-primary-soft) 46%, transparent);
}

#citasCalendar .fc-event {
  border-radius: 6px;
  border-width: 0;
  padding: 3px 5px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

#citasCalendar .fc-event-main {
  color: #fff;
}

.fc-cita-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
  line-height: 1.15;
}

.fc-cita-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
  font-size: 0.76rem;
}

#citasCalendar .cita-calendar-blocked {
  opacity: 1;
}

.citas-service-list {
  display: grid;
  gap: 12px;
}

.citas-service-card {
  --cita-color: var(--app-primary);
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.citas-service-card strong,
.citas-service-card small,
.citas-service-card p {
  display: block;
}

.citas-service-card strong {
  color: var(--app-text);
}

.citas-service-card small,
.citas-service-card p {
  color: var(--app-muted);
}

.citas-service-card p {
  margin: 6px 0 0;
}

.citas-service-swatch {
  width: 14px;
  height: 48px;
  border-radius: 999px;
  background: var(--cita-color);
}

.citas-service-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.citas-portal-grid > .app-card {
  min-width: 0;
}

.citas-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) minmax(150px, 1fr) minmax(150px, 1fr) minmax(220px, 1.4fr) auto;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-soft);
}

.citas-filter .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.citas-timeline {
  display: grid;
  gap: 12px;
}

.cita-row {
  --cita-color: var(--app-primary);
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-left: 5px solid var(--cita-color);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--app-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cita-row:hover {
  border-color: color-mix(in srgb, var(--cita-color) 44%, var(--app-border));
  box-shadow: 0 12px 28px rgba(17, 24, 39, .08);
  transform: translateY(-1px);
}

.cita-date,
.cita-main {
  display: grid;
  min-width: 0;
}

.cita-date {
  justify-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cita-color) 10%, var(--app-surface-soft));
}

.cita-date strong,
.cita-main strong {
  color: var(--app-text);
}

.cita-date strong {
  font-size: 1.08rem;
}

.cita-date small,
.cita-main small {
  color: var(--app-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.citas-status-bar {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.cita-selected-client {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--app-primary) 18%, var(--app-border));
  border-radius: var(--app-radius);
  background: color-mix(in srgb, var(--app-primary-soft) 58%, var(--app-surface));
}

.cita-selected-client > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-primary);
}

.cita-selected-client div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cita-selected-client strong {
  color: var(--app-text);
}

.cita-selected-client small {
  color: var(--app-muted);
}

.cita-contact-field-locked {
  opacity: 0.72;
}

.cita-create-shell {
  gap: 18px;
}

.cita-create-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.cita-create-hero h1 {
  max-width: none;
}

.cita-create-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cita-create-form {
  min-width: 0;
}

.cita-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.cita-create-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.cita-create-card,
.cita-create-summary {
  padding: clamp(16px, 2.2vw, 22px);
  border-color: color-mix(in srgb, var(--app-primary) 12%, var(--app-border));
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.cita-create-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.cita-create-card-head h2,
.cita-create-summary h2 {
  margin: 0;
  color: var(--app-text);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0;
}

.cita-create-card-head p {
  margin: 3px 0 0;
  color: var(--app-muted);
}

.cita-step {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--app-primary) 12%, var(--app-surface));
  color: var(--app-primary);
  font-weight: 950;
}

.cita-service-picker,
.cita-client-selector {
  margin-bottom: 16px;
}

.cita-schedule-grid {
  display: grid;
  grid-template-columns: minmax(140px, .75fr) minmax(130px, .6fr) minmax(220px, 1.15fr);
  gap: 12px;
  align-items: start;
}

.cita-modality-panel {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.cita-modality-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cita-modality-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: var(--app-text);
  font-weight: 800;
}

.cita-modality-chip:hover,
.cita-modality-chip:focus,
.cita-modality-chip.active {
  border-color: color-mix(in srgb, var(--app-primary) 42%, var(--app-border));
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.cita-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cita-contact-grid .cita-contact-field:nth-child(3),
.cita-contact-grid .cita-contact-field:nth-child(4),
.cita-contact-grid .cita-contact-field:nth-child(5) {
  grid-column: span 1;
}

.cita-create-side {
  position: sticky;
  top: 82px;
  min-width: 0;
}

.cita-create-summary {
  display: grid;
  gap: 14px;
}

.cita-summary-list {
  display: grid;
  gap: 10px;
}

.cita-summary-list > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.cita-summary-list i {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-primary);
}

.cita-summary-list span {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 850;
}

.cita-summary-list strong {
  min-width: 0;
  overflow: hidden;
  color: var(--app-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cita-create-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.cita-create-actions .btn {
  justify-content: center;
}

.cita-details-shell {
  gap: 18px;
}

.cita-details-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.cita-details-hero h1 {
  max-width: none;
}

.cita-details-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cita-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--app-primary) 28%, var(--app-border));
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  font-weight: 900;
}

.cita-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
  gap: 18px;
  align-items: start;
}

.cita-details-main,
.cita-details-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.cita-details-side {
  position: sticky;
  top: 82px;
}

.cita-details-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.cita-details-overview article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 10px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.cita-details-overview i {
  grid-row: span 3;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-primary);
}

.cita-details-overview span,
.cita-details-overview small {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 800;
}

.cita-details-overview strong {
  min-width: 0;
  overflow: hidden;
  color: var(--app-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cita-details-card {
  padding: clamp(16px, 2.2vw, 22px);
  border-color: color-mix(in srgb, var(--app-primary) 12%, var(--app-border));
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.cita-details-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.cita-details-card-head h2 {
  margin: 0;
  color: var(--app-text);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  font-weight: 900;
  letter-spacing: 0;
}

.cita-details-card-head > span {
  color: var(--app-muted);
  font-weight: 800;
}

.cita-status-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.cita-status-panel .btn {
  min-height: 48px;
  white-space: nowrap;
}

.cita-quick-states {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cita-quick-states form {
  margin: 0;
}

.cita-quick-states .btn {
  border-color: var(--app-border);
  font-weight: 800;
}

.cita-quick-states .btn.active {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.cita-details-timeline {
  display: grid;
  gap: 12px;
}

.cita-details-timeline article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
}

.cita-details-timeline time {
  display: grid;
  justify-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface-soft));
}

.cita-details-timeline time strong,
.cita-details-timeline article div > strong {
  color: var(--app-text);
  font-weight: 900;
}

.cita-details-timeline time span,
.cita-details-timeline article div > span,
.cita-details-timeline p {
  color: var(--app-muted);
}

.cita-details-timeline p {
  margin: 6px 0 0;
}

.cita-empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px;
  border: 1px dashed var(--app-border);
  border-radius: var(--app-radius-sm);
  color: var(--app-muted);
  text-align: center;
}

.cita-empty-state i {
  color: var(--app-primary);
  font-size: 1.45rem;
}

.cita-empty-state strong {
  color: var(--app-text);
}

.cita-details-dl {
  grid-template-columns: 96px minmax(0, 1fr);
}

.cita-contact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.cita-contact-actions .btn {
  justify-content: center;
}

.cita-reschedule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.citas-dashboard-shell {
  gap: 18px;
}

.citas-dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.citas-dashboard-hero h1 {
  max-width: none;
}

.citas-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.citas-dashboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.citas-dashboard-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.citas-dashboard-strip article {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.citas-dashboard-strip span,
.citas-dashboard-strip small {
  color: var(--app-muted);
  font-weight: 800;
}

.citas-dashboard-strip strong {
  color: var(--app-text);
  font-size: 1.45rem;
  font-weight: 950;
  line-height: 1;
}

.citas-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 18px;
  align-items: start;
}

.citas-dashboard-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.citas-dashboard-card {
  padding: clamp(16px, 2.2vw, 22px);
  border-color: color-mix(in srgb, var(--app-primary) 12%, var(--app-border));
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.citas-dashboard-list {
  display: grid;
  gap: 10px;
}

.cita-dashboard-item {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: inherit;
  text-decoration: none;
}

.cita-dashboard-item:hover,
.cita-dashboard-item:focus {
  border-color: color-mix(in srgb, var(--app-primary) 38%, var(--app-border));
  box-shadow: var(--app-shadow-sm);
  color: inherit;
}

.cita-dashboard-item.is-closed {
  opacity: .78;
}

.cita-dashboard-date {
  display: grid;
  justify-items: center;
  padding: 8px;
  border-radius: 8px;
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.cita-dashboard-date strong,
.cita-dashboard-main strong {
  color: var(--app-text);
  font-weight: 900;
}

.cita-dashboard-date small,
.cita-dashboard-main small {
  color: var(--app-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cita-dashboard-main {
  display: grid;
  min-width: 0;
}

.cita-dashboard-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: .82rem;
  font-weight: 850;
  white-space: nowrap;
}

.citas-dashboard-list.compact .cita-dashboard-item {
  grid-template-columns: 76px minmax(0, 1fr);
}

.citas-dashboard-shortcuts {
  display: grid;
  gap: 10px;
}

.citas-dashboard-shortcuts .btn {
  justify-content: flex-start;
}

.cita-dl {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.cita-dl dt {
  color: var(--app-muted);
}

.cita-dl dd {
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.cita-public-body {
  min-height: 100vh;
  background: #f5f7fb;
  color: #151326;
}

.cita-public-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

.cita-public-hero {
  min-height: 520px;
  border-radius: 12px;
  padding: 32px;
  background:
    linear-gradient(145deg, rgba(16, 33, 63, .9), rgba(13, 125, 139, .74)),
    var(--cita-banner);
  background-position: center;
  background-size: cover;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
}

.cita-public-hero img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  padding: 8px;
  margin-bottom: auto;
}

.cita-public-hero span {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0;
  opacity: .85;
}

.cita-public-hero h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  margin: 0;
}

.cita-public-hero p {
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0;
  opacity: .92;
}

.cita-public-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cita-public-meta span {
  text-transform: none;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  padding: 8px 12px;
}

.cita-public-card {
  background: #fff;
  border: 1px solid #e6e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, .08);
}

@media (max-width: 1100px) {
  .citas-layout,
  .citas-maintenance-layout,
  .citas-portal-grid,
  .cita-public-shell {
    grid-template-columns: 1fr;
  }

  .citas-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .citas-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .citas-calendar-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .citas-dynamic-calendar.is-expanded {
    inset: 6px;
    max-height: calc(100dvh - 12px);
    padding: 12px;
    border-radius: 16px;
  }
}

@media (max-width: 680px) {
  .citas-overview,
  .citas-filter,
  .citas-calendar-filter,
  .citas-status-bar,
  .cita-row,
  .citas-service-card {
    grid-template-columns: 1fr;
  }

  #citasCalendar .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #citasCalendar .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }

  .citas-metric {
    min-height: auto;
  }

  .cita-date {
    justify-items: start;
  }

  .cita-status {
    justify-self: start;
  }

  .citas-service-actions {
    justify-content: flex-start;
  }

  .citas-service-swatch {
    width: 100%;
    height: 6px;
  }

  .citas-calendar-actions {
    justify-content: stretch;
    width: 100%;
  }

  .citas-calendar-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .citas-dynamic-calendar.is-expanded {
    inset: 0;
    max-height: 100dvh;
    border-radius: 0;
  }

  .citas-dynamic-calendar.is-expanded .app-card-header {
    align-items: stretch;
  }

  .citas-dynamic-calendar.is-expanded .citas-calendar-legend {
    max-height: 58px;
    overflow: auto;
  }

  .cita-public-shell {
    width: min(100% - 20px, 1120px);
    padding: 16px 0;
  }

  .cita-public-hero {
    min-height: 360px;
    padding: 22px;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #0f172a;
  --app-surface: #182235;
  --app-surface-soft: #111a2c;
  --app-border: #2c3a50;
  --app-border-strong: #3f5068;
  --app-text: #e6edf6;
  --app-heading: #f8fbff;
  --app-muted: #9badc4;
  --app-primary: var(--corp-primary, #42c986);
  --app-primary-dark: color-mix(in srgb, var(--corp-primary, #42c986) 62%, white);
  --app-primary-soft: color-mix(in srgb, var(--corp-primary, #42c986) 18%, transparent);
  --app-info: var(--corp-info, #7ab8ff);
  --app-success: #42c986;
  --app-success-soft: rgba(66, 201, 134, 0.16);
  --app-success-text: #8fe3b8;
  --app-warning: #f5c76b;
  --app-danger: #ff8a7d;
  --app-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --app-shadow: var(--app-shadow-sm);
  --app-shadow-soft: var(--app-shadow-sm);
  --app-shadow-md: 0 16px 34px rgba(0, 0, 0, 0.36);
  --app-focus-ring: rgba(66, 201, 134, 0.22);
  --app-table-border: #29364a;
  --app-table-head: #202d42;
  --app-table-head-text: #cbd7e8;
  --app-table-hover: #1f2b3e;
  --app-link-hover: #9dccff;
  --app-warning-soft: rgba(245, 199, 107, 0.16);
  --app-warning-text: #ffd78a;
  --app-danger-soft: rgba(255, 138, 125, 0.14);
  --app-danger-border: rgba(255, 138, 125, 0.38);

  /* Varias vistas usan las variables --corp-* directamente (branding por empresa) en vez de --app-*.
     Sin este bloque, esas vistas quedan con colores de modo claro fijos aunque el tema sea oscuro.
     Necesita !important: --corp-* se define como atributo style="" en <html>, que tiene mas
     prioridad que cualquier regla de hoja de estilos sin !important. */
  --corp-bg: var(--app-bg) !important;
  --corp-surface: var(--app-surface) !important;
  --corp-surface-soft: var(--app-surface-soft) !important;
  --corp-border: var(--app-border) !important;
  --corp-text: var(--app-text) !important;
  --corp-muted: var(--app-muted) !important;
  --corp-primary-soft: var(--app-primary-soft) !important;
  --corp-table-head: var(--app-table-head) !important;
  --corp-table-hover: var(--app-table-hover) !important;
}

.palette-company-form + .palette-company-form {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border);
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.palette-option {
  position: relative;
  display: grid;
  gap: 0.55rem;
  min-height: 92px;
  padding: 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  cursor: pointer;
}

.palette-option:hover {
  border-color: var(--app-primary);
  background: var(--app-surface-soft);
}

.palette-option:has(input:checked) {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px var(--app-primary-soft);
}

.palette-option input {
  position: absolute;
  opacity: 0;
}

.palette-preview {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
}

.palette-name {
  padding-right: 1.25rem;
  color: var(--app-text);
  font-size: 0.86rem;
  font-weight: 600;
}

.palette-check {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  color: var(--app-primary);
  opacity: 0;
}

.palette-option:has(input:checked) .palette-check {
  opacity: 1;
}

html {
  min-height: 100%;
  font-size: 14px;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(22, 122, 74, 0.05), transparent 260px),
    var(--app-bg);
  color: var(--app-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--app-info);
  text-decoration: none;
}

a:hover {
  color: var(--app-link-hover);
}

.app-layout {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}

.app-layout.sidebar-collapsed {
  grid-template-columns: var(--app-sidebar-collapsed-width) minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
  transition: width 0.18s ease, transform 0.2s ease;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--app-topbar-height);
  padding: 12px 16px;
  border-bottom: 1px solid var(--app-border);
}

.app-sidebar-brand.has-company-banner {
  background: linear-gradient(90deg, color-mix(in srgb, var(--app-surface) 92%, transparent), color-mix(in srgb, var(--app-surface) 72%, transparent)), var(--company-banner) center/cover no-repeat;
}

.app-sidebar-brand.has-company-banner-color {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--company-banner-color, #fff) 88%, #ffffff), var(--company-banner-color, #fff));
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  padding: 0;
  color: var(--app-text);
}

.app-brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}

.app-brand-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
  color: var(--app-primary);
  font-size: 1.5rem;
}

.app-brand-text {
  display: grid;
  line-height: 1.1;
}

.app-brand-text strong {
  color: var(--app-primary);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.app-brand-text small {
  color: var(--app-muted);
  font-size: 0.76rem;
}

.app-sidebar-user {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--app-border);
  text-align: center;
}

.app-sidebar-avatar-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  text-decoration: none;
  outline: none;
}

.app-sidebar-avatar-link:focus-visible {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-primary) 22%, transparent);
}

.app-sidebar-user img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 2px solid var(--app-primary-soft);
  border-radius: 50%;
  box-shadow: var(--app-shadow-sm);
}

.app-sidebar-avatar {
  width: 72px;
  height: 72px;
  border: 2px solid var(--app-primary-soft);
  box-shadow: var(--app-shadow-sm);
  font-size: 2rem;
}

.app-user-notification-badge {
  position: absolute;
  top: 2px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid var(--app-surface);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--app-shadow-sm);
}

.app-sidebar-user-info {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.app-sidebar-user-info strong,
.app-sidebar-user-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-user-info strong {
  color: var(--app-text);
  font-size: 0.94rem;
  font-weight: 800;
}

.app-sidebar-user-info span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.app-sidebar-role {
  justify-self: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--app-primary-dark) !important;
  background: var(--app-primary-soft);
}

.app-content {
  min-width: 0;
}

.app-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: var(--app-primary);
}

.app-icon-button:hover,
.app-icon-button:focus {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
}

.app-mobile-menu-button {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1032;
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: var(--app-primary);
  box-shadow: var(--app-shadow-md);
}

.app-main {
  padding: 28px clamp(18px, 2.2vw, 32px) 48px;
}

.app-main > .container,
.app-main > .container-fluid {
  width: min(100%, 1280px);
  padding-inline: 0;
  margin-inline: auto;
}

.app-menu-search {
  position: relative;
  padding: 14px 14px 10px;
}

.app-menu-search i {
  position: absolute;
  top: 27px;
  left: 28px;
  color: var(--app-muted);
}

.app-menu-search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 38px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  outline: none;
  color: var(--app-text);
  background: var(--app-surface-soft);
}

.app-menu-search input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(22, 122, 74, 0.12);
}

.app-menu {
  display: grid;
  gap: 10px;
  flex: 1;
  padding: 8px 12px 18px;
}

.app-menu-group {
  display: grid;
  gap: 7px;
}

.app-menu-toggle,
.app-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--app-radius-sm);
  background: transparent;
  color: var(--app-text);
  font-weight: 700;
  text-align: left;
}

.app-menu-toggle {
  justify-content: space-between;
}

.app-menu-toggle span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.app-menu-link i,
.app-menu-toggle i:not(.app-menu-chevron) {
  width: 20px;
  color: var(--app-primary);
  text-align: center;
}

.app-menu-chevron {
  color: var(--app-muted);
  transition: transform 0.18s ease;
}

.app-menu-toggle:not(.collapsed) .app-menu-chevron {
  transform: rotate(180deg);
}

.app-menu-link:hover,
.app-menu-link:focus,
.app-menu-toggle:hover,
.app-menu-toggle:focus,
.app-menu-link.active {
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.app-submenu {
  display: grid;
  gap: 2px;
  padding: 3px 0 6px 14px;
  border-left: 1px solid var(--app-border);
  margin-left: 20px;
}

.app-submenu .app-menu-link {
  min-height: 36px;
  padding-block: 7px;
  color: var(--app-muted);
  font-weight: 650;
}

.app-submenu-group {
  display: grid;
  gap: 2px;
}

.app-submenu-toggle {
  min-height: 36px;
  padding-block: 7px;
  color: var(--app-muted);
  font-weight: 750;
}

.app-submenu-level-3 {
  margin-left: 14px;
  padding-left: 10px;
}

.app-submenu-level-3 .app-menu-link {
  font-size: 0.91rem;
  font-weight: 620;
}

.app-sidebar-footer {
  display: grid;
  gap: 14px;
  padding: 18px 14px 20px;
  border-top: 1px solid var(--app-border);
  background: color-mix(in srgb, var(--app-surface) 94%, var(--app-primary-soft));
}

.app-sidebar-version,
.app-sidebar-actions {
  display: grid;
}

.app-sidebar-actions {
  gap: 8px;
}

.app-sidebar-actions form {
  margin: 0;
}

.app-logout-link {
  color: var(--app-danger);
}

.app-logout-link i {
  color: var(--app-danger) !important;
}

.app-theme-toggle {
  color: var(--app-text);
}

.app-theme-toggle i {
  color: var(--app-primary) !important;
}

.app-tour-launcher i {
  color: var(--app-info) !important;
}

.app-tour {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
}

.app-tour.is-active {
  display: block;
  pointer-events: auto;
}

.app-tour-overlay {
  position: absolute;
  inset: 0;
  z-index: 2147483001;
  background: transparent;
}

.app-tour.no-spotlight .app-tour-overlay {
  background: rgba(15, 23, 42, .68);
  backdrop-filter: blur(2px);
}

.app-tour-spotlight {
  position: absolute;
  z-index: 2147483002;
  border-radius: 16px;
  border: 2px solid #fff;
  background: transparent;
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, .72),
    0 18px 52px rgba(15, 23, 42, .35),
    0 0 0 6px color-mix(in srgb, var(--app-primary) 30%, transparent);
  transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease;
  pointer-events: none;
}

.app-tour-card {
  position: fixed;
  z-index: 2147483004;
  max-width: calc(100vw - 32px);
  border: 1px solid color-mix(in srgb, var(--app-primary) 18%, var(--app-border));
  border-radius: 18px;
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 24px 64px rgba(2, 6, 23, .34);
  padding: 20px;
  transition: left .22s ease, top .22s ease;
}

.app-tour-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--app-surface-soft);
  color: var(--app-muted);
}

.app-tour-close:hover,
.app-tour-close:focus {
  color: var(--app-primary-dark);
}

.app-tour-kicker {
  display: inline-flex;
  margin-right: 38px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
  color: var(--app-primary-dark);
  font-size: .78rem;
  font-weight: 850;
}

.app-tour-card h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 900;
  letter-spacing: 0;
}

.app-tour-card p {
  margin: 0;
  color: var(--app-muted);
  line-height: 1.55;
}

.app-tour-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface-soft));
  margin: 18px 0;
}

.app-tour-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--app-primary), var(--app-info));
  transition: width .22s ease;
}

.app-tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.app-tour-highlight {
  position: relative;
  z-index: auto !important;
}

html[data-theme="dark"] .app-tour-card {
  background: var(--app-surface);
  color: var(--app-text);
}

@media (max-width: 760px) {
  .app-tour-card {
    left: 16px !important;
    right: 16px;
    top: auto !important;
    bottom: 16px;
    width: auto !important;
  }

  .app-tour-spotlight {
    border-radius: 12px;
  }
}

.app-cart-sidebar-link {
  position: relative;
}

@media (min-width: 992px) {
  .app-layout.sidebar-collapsed .app-sidebar {
    overflow-x: hidden;
  }

  .app-layout.sidebar-collapsed .app-sidebar-brand {
    flex-direction: column;
    justify-content: center;
    min-height: 116px;
    padding: 12px 8px;
  }

  .app-layout.sidebar-collapsed .app-brand {
    min-width: 0;
    justify-content: center;
  }

  .app-layout.sidebar-collapsed .app-brand-text,
  .app-layout.sidebar-collapsed .app-sidebar-user-info,
  .app-layout.sidebar-collapsed .app-menu-search input,
  .app-layout.sidebar-collapsed .app-menu-link span,
  .app-layout.sidebar-collapsed .app-menu-toggle .app-menu-text,
  .app-layout.sidebar-collapsed .app-menu-chevron,
  .app-layout.sidebar-collapsed .app-sidebar-footer .badge {
    display: none;
  }

  .app-layout.sidebar-collapsed .app-sidebar-user {
    padding: 12px 8px;
  }

  .app-layout.sidebar-collapsed .app-sidebar-avatar-link {
    width: 50px;
    height: 50px;
  }

  .app-layout.sidebar-collapsed .app-sidebar-user img,
  .app-layout.sidebar-collapsed .app-sidebar-avatar {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }

  .app-layout.sidebar-collapsed .app-user-notification-badge {
    top: -1px;
    right: -3px;
  }

  .app-layout.sidebar-collapsed .app-menu-search {
    display: flex;
    justify-content: center;
    padding: 10px 8px;
  }

  .app-layout.sidebar-collapsed .app-menu-search i {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface-soft);
  }

  .app-layout.sidebar-collapsed .app-menu,
  .app-layout.sidebar-collapsed .app-sidebar-footer {
    padding-inline: 10px;
  }

  .app-layout.sidebar-collapsed .app-menu-toggle,
  .app-layout.sidebar-collapsed .app-menu-link {
    justify-content: center;
    padding-inline: 0;
  }

  .app-layout.sidebar-collapsed .app-sidebar .app-submenu,
  .app-layout.sidebar-collapsed .app-sidebar .collapse {
    display: none !important;
  }
}

.app-sidebar-backdrop {
  display: none;
}

.dropdown-menu {
  padding: 8px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-md);
}

.dropdown-header {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  font-weight: 500;
}

.dropdown-item i {
  width: 18px;
  color: var(--app-primary);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.app-user-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.app-login-link {
  white-space: nowrap;
}

.app-cart-link {
  padding-right: 18px !important;
}

.app-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 280px;
}

.app-user-toggle img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid var(--app-border);
  border-radius: 50%;
}

.app-user-nav .nav-link,
.app-user-nav .dropdown-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-user-nav .nav-link {
  min-height: 40px;
  padding: 7px 10px;
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  font-weight: 650;
}

.app-user-nav .nav-link:hover,
.app-user-nav .nav-link:focus {
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.app-user-name {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--app-text);
  font-weight: 750;
}

.text-success {
  color: var(--app-success) !important;
}

.text-primary {
  color: var(--app-primary) !important;
}

.text-info {
  color: var(--app-info) !important;
}

.text-warning {
  color: var(--app-warning) !important;
}

.text-danger {
  color: var(--app-danger) !important;
}

.text-muted {
  color: var(--app-muted) !important;
}

.card {
  border-color: var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--app-shadow-sm) !important;
}

.card.shadow-lg,
.card.shadow-sm {
  box-shadow: var(--app-shadow-sm) !important;
}

.card-body {
  padding: 16px;
}

.bg-light {
  background-color: var(--app-surface) !important;
}

.rounded-4,
.rounded-3 {
  border-radius: var(--app-radius) !important;
}

.rounded-pill {
  border-radius: var(--app-radius-sm) !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: var(--app-radius-sm) !important;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none !important;
}

.btn-sm {
  min-height: 30px;
  padding-inline: 9px;
}

.btn-lg {
  min-height: 42px;
}

.btn-gradient,
.btn-success,
.btn-primary {
  border-color: var(--app-primary) !important;
  background: var(--app-primary) !important;
  color: #fff !important;
}

.btn-gradient:hover,
.btn-success:hover,
.btn-primary:hover {
  border-color: var(--app-primary-dark) !important;
  background: var(--app-primary-dark) !important;
  color: #fff !important;
  transform: none !important;
}

.btn-outline-success,
.btn-outline-primary,
.btn-outline-info {
  border-color: var(--app-border-strong) !important;
  color: var(--app-primary-dark) !important;
  background: var(--app-surface) !important;
}

.btn-outline-success:hover,
.btn-outline-primary:hover,
.btn-outline-info:hover {
  border-color: var(--app-primary) !important;
  background: var(--app-primary-soft) !important;
  color: var(--app-primary-dark) !important;
}

.btn-warning {
  border-color: var(--app-warning) !important;
  background: var(--app-warning-soft) !important;
  color: var(--app-warning-text) !important;
}

.btn-outline-danger,
.btn-danger {
  border-color: var(--app-danger-border) !important;
  background: var(--app-surface) !important;
  color: var(--app-danger) !important;
}

.btn-outline-danger:hover,
.btn-danger:hover {
  border-color: var(--app-danger) !important;
  background: var(--app-danger-soft) !important;
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 42px;
  border-color: var(--app-border);
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  background-color: var(--app-surface);
}

.form-control-lg,
.form-select-lg {
  min-height: 46px;
  font-size: 1rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px var(--app-focus-ring);
}

.form-label {
  color: var(--app-text) !important;
  font-size: 0.9rem;
  font-weight: 700 !important;
}

.form-check-input:checked {
  border-color: var(--app-primary);
  background-color: var(--app-primary);
}

.input-group-text {
  border-color: var(--app-border);
  background: var(--app-surface-soft);
  color: var(--app-muted);
}

.table-responsive {
  border-radius: var(--app-radius);
}

.table {
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-table-border);
  --bs-table-striped-bg: var(--app-surface-soft);
  --bs-table-striped-color: var(--app-text);
  --bs-table-hover-bg: var(--app-table-hover);
  --bs-table-hover-color: var(--app-text);
  margin-bottom: 0;
  color: var(--app-text);
}

.table > :not(caption) > * > * {
  padding: 13px 14px;
  border-bottom-color: var(--app-table-border);
}

.table thead th,
.table tfoot th,
.table-success th,
.table-primary th,
.table-light th {
  border-bottom: 1px solid var(--app-border) !important;
  background: var(--app-table-head) !important;
  color: var(--app-table-head-text) !important;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.table-hover > tbody > tr:hover > * {
  background-color: var(--app-table-hover);
}

.badge {
  min-height: 24px;
  padding: 6px 9px;
  border-radius: var(--app-radius-sm);
  font-weight: 700;
}

.bg-success {
  background-color: var(--app-success) !important;
}

.bg-primary {
  background-color: var(--app-primary) !important;
}

.bg-info {
  background-color: var(--app-info) !important;
}

.bg-warning {
  background-color: var(--app-warning-soft) !important;
  color: var(--app-warning-text) !important;
}

.bg-secondary,
.bg-dark {
  background-color: var(--app-surface-soft) !important;
  color: var(--app-muted) !important;
}

.bg-danger {
  background-color: var(--app-danger-soft) !important;
  color: var(--app-danger) !important;
}

.alert {
  border-radius: var(--app-radius);
  border-width: 1px;
}

.alert-success {
  border-color: #b7e4ca;
  background: #effaf4;
  color: #14532d;
}

.alert-danger {
  border-color: #f3beb8;
  background: #fff3f2;
  color: #7a271a;
}

html[data-theme="dark"] .alert-success {
  border-color: rgba(66, 201, 134, 0.34);
  background: rgba(66, 201, 134, 0.13);
  color: #baf4d3;
}

html[data-theme="dark"] .alert-danger {
  border-color: rgba(255, 138, 125, 0.38);
  background: rgba(255, 138, 125, 0.13);
  color: #ffc2ba;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-body,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .accordion-item {
  color: var(--app-text) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .dropdown-menu {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-end,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start {
  border-color: var(--app-border) !important;
}

html[data-theme="dark"] .form-control::placeholder {
  color: #71839c;
  opacity: 1;
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled {
  background-color: #202b3d;
  color: var(--app-muted);
}

.dataTables_wrapper {
  padding: 16px;
  color: var(--app-text);
}

.dataTables_wrapper .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  min-height: 36px;
  margin-left: 6px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  background: var(--app-surface);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid transparent !important;
  border-radius: var(--app-radius-sm) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  border-color: var(--app-primary) !important;
  background: var(--app-primary) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--app-text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  border-color: var(--app-border-strong) !important;
  background: var(--app-surface-soft) !important;
  color: var(--app-text) !important;
}

/* Compact tables (see initDataTables): fixed-height, scrollable body with a header that stays
   in view while scrolling, instead of search + pagination chrome for short reference lists. */
.dataTables_wrapper .dataTables_scroll {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
}

.dataTables_wrapper .dataTables_scrollHead {
  background: var(--app-table-head);
}

.dataTables_wrapper .dataTables_scrollHead th {
  color: var(--app-table-head-text);
  border-bottom: 1px solid var(--app-border) !important;
}

.dataTables_wrapper .dataTables_scrollBody {
  border-top: none !important;
}

.dataTables_wrapper .dataTables_scrollBody table {
  margin-top: 0 !important;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar {
  width: 10px;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: var(--app-border-strong);
  border-radius: 999px;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
  background: transparent;
}

.select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px;
  color: var(--app-text);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  min-height: 40px;
}

.select2-dropdown,
.select2-container--default .select2-search--dropdown .select2-search__field {
  border-color: var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
}

.select2-container--default .select2-results__option {
  color: var(--app-text);
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--app-primary);
  color: #fff;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  border-color: var(--app-border);
  background: var(--app-primary-soft);
  color: var(--app-text);
}

.kpi-card {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--app-radius) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

html.login-root {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

html.login-root body {
  width: 100%;
  height: var(--login-vh, 100dvh);
  margin: 0;
  overflow: hidden;
}

.login-page {
  display: grid;
  height: 100vh;
  height: 100dvh;
  height: var(--login-vh, 100dvh);
  min-height: 0;
  background: #f4f7fb;
  overflow: hidden;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  height: 100vh;
  height: 100dvh;
  height: var(--login-vh, 100dvh);
  min-height: 0;
  overflow: hidden;
}

.login-brand-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(18px, 3vw, 48px);
  background: #07141b;
  color: #fff;
}

.login-brand-content {
  display: grid;
  place-items: center;
  width: 100%;
}

.login-logo {
  width: min(100%, 680px);
  max-width: 48vw;
  max-height: min(78vh, 760px);
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.login-eyebrow {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand-panel h1 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.login-copy {
  max-width: 430px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(14px, 3vw, 32px);
  overflow: hidden;
}

.login-card {
  width: min(100%, 430px);
  max-height: calc(var(--login-vh, 100dvh) - 28px);
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: var(--app-shadow-md);
}

.login-card-wide {
  width: min(100%, 560px);
}

.login-card h2 {
  margin-bottom: 6px;
  font-size: 1.7rem;
}

.manage-avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--app-border);
  border-radius: 50%;
}

.identity-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 120px;
  border: 1px dashed var(--app-border, #ced4da);
  border-radius: 8px;
  background: var(--app-surface-soft, #f8f9fa);
}

.identity-preview-logo { aspect-ratio: 3 / 2; }
.identity-preview-banner { aspect-ratio: 16 / 5; }
.identity-preview img { width: 100%; height: 100%; object-fit: contain; }
.identity-preview-banner img { object-fit: cover; }
.identity-placeholder { color: var(--app-muted, #6c757d); text-align: center; }
.identity-placeholder i { display: block; margin-bottom: .35rem; font-size: 1.75rem; }
.identity-avatar-placeholder {
  display: grid;
  gap: 8px;
  place-items: center;
}

.identity-avatar-placeholder span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 2rem;
}

.identity-avatar-placeholder small {
  color: var(--app-muted);
  font-weight: 700;
}

.identity-color-banner {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--identity-banner-color, #fff) 86%, #ffffff), var(--identity-banner-color, #fff));
}

.company-avatar-grid {
  padding: 10px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
}

.company-banner-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
}

.company-banner-color-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.company-banner-color-option > span {
  width: 38px;
  height: 32px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}

.company-banner-color-option strong {
  min-width: 0;
  color: var(--app-text);
  font-size: .84rem;
  font-weight: 850;
}

.company-banner-color-option i {
  position: absolute;
  top: -7px;
  right: -7px;
  display: none;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--app-primary);
  color: #fff;
  font-size: .78rem;
}

.company-banner-color-option:hover,
.company-banner-color-option:focus-visible {
  border-color: var(--app-primary);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .1);
  outline: none;
  transform: translateY(-1px);
}

.company-banner-color-option.is-selected {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary) 18%, transparent);
}

.company-banner-color-option.is-selected i {
  display: grid;
}

.settings-page {
  display: grid;
  gap: 28px;
}

.settings-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px;
  border-radius: var(--app-radius);
  color: #fff;
  background: linear-gradient(135deg, var(--app-primary), #0f766e);
  box-shadow: var(--app-shadow-sm);
}

.settings-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .78rem;
  opacity: .9;
}

.settings-hero h1 {
  margin: 0 0 6px;
  font-size: 2rem;
  font-weight: 800;
}

.settings-hero p {
  margin: 0;
  max-width: 720px;
  color: rgba(255,255,255,.86);
}

.settings-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.settings-shortcuts a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-text);
  text-decoration: none;
  box-shadow: var(--app-shadow-sm);
}

.settings-shortcuts i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.settings-shortcuts span {
  font-weight: 800;
}

.settings-shortcuts small {
  color: var(--app-muted);
}

.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.settings-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.portal-banner-preview {
  height: 150px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--app-surface-soft);
}

.portal-banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-nav {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--app-text);
  text-decoration: none;
  font-weight: 700;
}

.settings-nav a:hover {
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.settings-content {
  display: grid;
  gap: 30px;
}

.settings-panel {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.settings-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-soft);
}

.settings-panel-head span {
  color: var(--app-primary);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-panel-head h2 {
  margin: 3px 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.settings-panel-head p {
  margin: 0;
  color: var(--app-muted);
}

.settings-panel-head > i {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  height: 46px;
  border-radius: 12px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  font-size: 1.25rem;
}

.settings-grid-form,
.settings-form-grid,
.settings-inline-form,
.settings-split {
  padding: 26px;
}

.settings-grid-form {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr);
  gap: 20px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.settings-form-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.settings-inline-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--app-border);
}

.settings-inline-form > div {
  min-width: min(360px, 100%);
}

.settings-checks {
  display: grid;
  gap: 8px;
}

.settings-checks.single {
  align-self: center;
}

.settings-checks label,
.settings-mini-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  color: var(--app-text);
}

/* ============================================================
   Fila de toggle elegante para ajustes on/off (Configuracion).
   ============================================================ */

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm, 10px);
  background: var(--app-surface-soft);
  transition: border-color .15s ease, background .15s ease;
}

.settings-toggle-row:hover {
  border-color: color-mix(in srgb, var(--app-primary) 30%, var(--app-border));
}

.settings-toggle-row + .settings-toggle-row {
  margin-top: 10px;
}

.settings-toggle-row-text {
  display: grid;
  gap: 2px;
}

.settings-toggle-row-text strong {
  color: var(--app-text);
  font-weight: 800;
  font-size: .92rem;
}

.settings-toggle-row-text small {
  color: var(--app-muted);
  font-size: .8rem;
  line-height: 1.35;
}

.settings-toggle-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
}

.settings-toggle-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.settings-toggle-switch .track {
  position: absolute;
  inset: 0;
  background: var(--app-border);
  border-radius: 999px;
  transition: background .2s ease;
}

.settings-toggle-switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}

.settings-toggle-switch input:checked ~ .track {
  background: var(--app-primary);
}

.settings-toggle-switch input:checked ~ .thumb {
  transform: translateX(20px);
}

.settings-toggle-switch input:focus-visible ~ .track {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

.settings-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.settings-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-mini-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-soft);
}

.settings-mini-form h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
}

.settings-table-wrap {
  margin: 4px 26px 26px;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}

.settings-table-wrap .table {
  margin: 0;
}

.permissions-page {
  display: grid;
  gap: 28px;
}

.permissions-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-radius: var(--app-radius);
  color: #fff;
  background: linear-gradient(135deg, #0f766e, var(--app-primary));
  box-shadow: var(--app-shadow-sm);
}

.permissions-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  opacity: .9;
}

.permissions-hero h1 {
  margin: 0 0 4px;
  font-size: 1.8rem;
  font-weight: 850;
}

.permissions-hero p {
  margin: 0;
  color: rgba(255,255,255,.86);
}

.permissions-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 230px auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.permissions-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-bg);
}

.permissions-search i {
  color: var(--app-muted);
}

.permissions-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--app-text);
  background: transparent;
}

.permissions-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.permissions-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.permissions-summary div {
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.permissions-summary span {
  display: block;
  font-size: 1.65rem;
  font-weight: 850;
  color: var(--app-primary);
}

.permissions-summary small {
  color: var(--app-muted);
  font-weight: 700;
}

.permissions-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.permissions-module-list {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.permissions-module-list button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--app-text);
  background: transparent;
  font-weight: 750;
  text-align: left;
}

.permissions-module-list button:hover,
.permissions-module-list button.active {
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.permissions-module-list span {
  color: var(--app-muted);
}

.permissions-modules {
  display: grid;
  gap: 30px;
}

.permissions-module {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.permissions-module header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-soft);
}

.permissions-module header span {
  color: var(--app-primary);
  font-size: .74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.permissions-module h2 {
  margin: 2px 0;
  font-size: 1.1rem;
  font-weight: 850;
}

.permissions-module p {
  margin: 0;
  color: var(--app-muted);
}

.permissions-module-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  padding: 24px 26px 28px;
}

.permission-card {
  position: relative;
  display: flex;
  gap: 12px;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-bg);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.permission-card:hover {
  border-color: var(--app-primary);
  background: var(--app-surface);
  transform: translateY(-1px);
}

.permission-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-check {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  color: transparent;
  background: var(--app-surface);
}

.permission-card:has(input:checked) {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
}

.permission-card:has(input:checked) .permission-check {
  border-color: var(--app-primary);
  color: #fff;
  background: var(--app-primary);
}

.permission-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--app-text);
}

.permission-body small {
  color: var(--app-muted);
}

.permissions-savebar {
  position: sticky;
  bottom: 14px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: color-mix(in srgb, var(--app-surface) 94%, transparent);
  box-shadow: var(--app-shadow-sm);
  backdrop-filter: blur(12px);
}

.permissions-savebar strong {
  color: var(--app-primary);
  font-size: 1.25rem;
}

.permissions-savebar span {
  color: var(--app-muted);
}

@media (max-width: 1100px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .settings-form-grid,
  .settings-form-grid.compact,
  .settings-grid-form,
  .settings-split {
    grid-template-columns: 1fr 1fr;
  }
  .permissions-toolbar,
  .permissions-shell {
    grid-template-columns: 1fr;
  }
  .permissions-module-list {
    position: static;
    max-height: none;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 700px) {
  .settings-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }
  .settings-hero h1 {
    font-size: 1.55rem;
  }
  .settings-form-grid,
  .settings-form-grid.compact,
  .settings-grid-form,
  .settings-split {
    grid-template-columns: 1fr;
  }
  .settings-panel-head {
    padding: 18px;
  }
  .settings-grid-form,
  .settings-form-grid,
  .settings-inline-form,
  .settings-split {
    padding: 18px;
  }
  .permissions-hero,
  .permissions-module header,
  .permissions-savebar {
    align-items: flex-start;
    flex-direction: column;
  }
  .permissions-summary {
    grid-template-columns: 1fr 1fr;
  }
  .permissions-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

.avatar-emoji {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--app-primary-soft, #e9ecef);
  font-size: 1.45rem;
  line-height: 1;
}

.profile-avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-avatar-option {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--app-shadow-xs, 0 1px 2px rgba(15, 23, 42, .08));
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.profile-avatar-option span {
  font-size: 1.55rem;
  line-height: 1;
}

.profile-avatar-option i {
  position: absolute;
  top: -7px;
  right: -7px;
  display: none;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--app-primary);
  color: #fff;
  font-size: .8rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .18);
}

.profile-avatar-option:hover,
.profile-avatar-option:focus-visible {
  border-color: var(--app-primary);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
  outline: none;
  transform: translateY(-1px);
}

.profile-avatar-option.is-selected {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary) 18%, transparent);
}

.profile-avatar-option.is-selected i {
  display: grid;
}

.manage-nav-card {
  position: sticky;
  top: 82px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.manage-nav-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--app-border);
}

.manage-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--app-success);
  background: rgba(25, 135, 84, 0.1);
}

.manage-nav-header h6 {
  margin: 0;
  color: var(--app-text);
  font-weight: 800;
}

.manage-nav-header p {
  margin: 2px 0 0;
  color: var(--app-muted);
  font-size: 0.84rem;
}

.manage-nav-list {
  display: grid;
  gap: 6px;
}

.manage-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--app-muted);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.manage-nav-link i {
  width: 20px;
  color: var(--app-success);
  text-align: center;
}

.manage-nav-link:hover,
.manage-nav-link:focus {
  color: var(--app-text);
  border-color: var(--app-border);
  background: var(--app-surface-soft);
}

.manage-nav-link.active {
  color: var(--app-success);
  border-color: rgba(25, 135, 84, 0.25);
  background: rgba(25, 135, 84, 0.1);
}

.manage-meta {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-soft);
}

.manage-meta span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.manage-meta strong {
  color: var(--app-text);
  font-size: 0.98rem;
}

.report-nav {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.report-nav-group > span {
  display: block;
  margin-bottom: 8px;
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-nav-list {
  display: grid;
  gap: 5px;
}

.report-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--app-radius-sm);
  color: #344054;
  font-weight: 700;
}

.report-nav-link i {
  width: 20px;
  color: var(--app-primary);
  text-align: center;
}

.report-nav-link:hover,
.report-nav-link:focus,
.report-nav-link.active {
  border-color: rgba(22, 122, 74, 0.18);
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}

.report-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.report-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.report-heading h4 {
  margin: 0;
  font-size: 1.25rem;
}

.report-heading p {
  margin: 2px 0 0;
  color: var(--app-muted);
}

.report-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.report-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-kpi {
  display: grid;
  gap: 4px;
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.report-kpi i {
  color: var(--app-primary);
  font-size: 1.2rem;
}

.report-kpi span {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.report-kpi strong {
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 850;
}

.report-table th {
  white-space: nowrap;
}

.report-table td {
  vertical-align: top;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .app-layout {
    display: block;
  }

  .app-mobile-menu-button {
    display: inline-flex;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: min(86vw, var(--app-sidebar-width));
    transition: transform 0.2s ease;
  }

  .app-layout.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    display: none;
    background: rgba(15, 23, 42, 0.38);
  }

  .app-layout.sidebar-open .app-sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 767.98px) {
  html {
    font-size: 14px;
  }

  .app-main {
    padding: 68px 12px 32px;
  }

  .app-main > .container,
  .app-main > .container-fluid {
    width: min(100%, 1280px);
  }

  .d-flex.justify-content-between.align-items-center,
  .d-flex.align-items-center.justify-content-between {
    align-items: flex-start !important;
  }

  h2 {
    font-size: 1.35rem;
  }

  .card-body {
    padding: 16px;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .table {
    min-width: 720px;
  }

  .dataTables_wrapper {
    padding: 12px;
  }

  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    float: none;
    width: 100%;
    margin-top: 10px;
    text-align: left;
  }

  .btn {
    white-space: normal;
  }

  .app-user-name {
    max-width: 120px;
  }

  .app-user-nav .nav-link.text-success {
    display: none;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 260px;
    padding: 28px 20px;
  }

  .login-brand-content {
    gap: 16px;
  }

  .login-form-panel {
    padding: 20px 12px 32px;
  }

  .login-card {
    padding: 22px;
    box-shadow: var(--app-shadow-sm);
  }

  .manage-nav-card {
    position: static;
  }

  .manage-nav-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .report-nav {
    position: static;
  }

  .report-nav-list {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .report-heading {
    align-items: flex-start;
  }
}
.print-format-modal{border:0;border-radius:8px}.print-format-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:20px}.print-format-option{min-height:150px;border:2px solid var(--app-border,#d9dee3);border-radius:8px;background:var(--app-surface,#fff);color:var(--app-text,#1f2933);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;text-decoration:none;transition:border-color .15s,transform .15s,background .15s}.print-format-option i{font-size:38px;color:var(--app-primary,#176b5b)}.print-format-option strong{font-size:20px}.print-format-option span{font-size:12px;color:var(--app-muted,#68717d)}.print-format-option:hover{border-color:var(--app-primary,#176b5b);background:var(--app-primary-soft,#eef7f5);color:var(--app-text,#1f2933);transform:translateY(-2px)}@media(max-width:480px){.print-format-grid{grid-template-columns:1fr}.print-format-option{min-height:120px}}
.login-signup-shortcut{position:fixed;z-index:10;top:20px;right:24px;display:flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid rgba(255,255,255,.72);border-radius:5px;background:rgba(255,255,255,.92);color:#176b5b;font-weight:700;text-decoration:none;box-shadow:0 6px 20px rgba(23,32,42,.12);backdrop-filter:blur(8px)}.login-signup-shortcut:hover{background:#fff;color:#125447}@media(max-width:700px){.login-signup-shortcut{position:absolute;top:12px;right:12px;padding:8px 10px;font-size:13px}}
.login-version{position:fixed;right:18px;bottom:14px;color:rgba(31,41,55,.48);font-size:12px;font-weight:700;letter-spacing:0;background:rgba(255,255,255,.55);border:1px solid rgba(255,255,255,.5);border-radius:999px;padding:4px 9px;backdrop-filter:blur(6px)}

.mn360-login-page {
  --login-blue: #073783;
  --login-blue-2: #0b8fe8;
  --login-green: #3cab19;
  --login-ink: #071a3d;
  --login-muted: #64748b;
  --login-surface: rgba(255, 255, 255, .92);
  background:
    radial-gradient(circle at 14% 12%, rgba(11, 143, 232, .16), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(60, 171, 25, .18), transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #eef7ff 46%, #f6fff2 100%);
  height: 100vh;
  height: 100dvh;
  height: var(--login-vh, 100dvh);
  overflow: hidden;
}

.mn360-login-page .login-shell {
  grid-template-columns: minmax(430px, 1.08fr) minmax(420px, .92fr);
  position: relative;
  height: 100vh;
  height: 100dvh;
  height: var(--login-vh, 100dvh);
}

.mn360-login-page .login-brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 4vw, 52px);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .98), rgba(240, 248, 255, .94)),
    radial-gradient(circle at 20% 20%, rgba(11, 143, 232, .22), transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(60, 171, 25, .2), transparent 34%);
  color: var(--login-ink);
}

.mn360-login-page .login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(7, 55, 131, .12);
  border-radius: 28px;
  pointer-events: none;
}

.mn360-login-page .login-brand-content {
  gap: clamp(8px, 1.8vh, 18px);
  isolation: isolate;
}

.mn360-login-logo {
  width: min(100%, 700px);
  max-width: min(48vw, 700px);
  max-height: min(70dvh, 680px);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(7, 26, 61, .14);
}

.login-brand-message {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--login-ink);
  text-align: center;
}

.login-brand-message span {
  color: var(--login-green);
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.login-brand-message strong {
  color: var(--login-blue);
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  font-weight: 950;
}

.mn360-login-page .login-form-panel {
  position: relative;
  padding: clamp(14px, 3vw, 38px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.78)),
    radial-gradient(circle at 80% 20%, rgba(60, 171, 25, .1), transparent 26rem);
}

.mn360-login-page .login-card {
  width: min(100%, 430px);
  max-height: calc(var(--login-vh, 100dvh) - clamp(28px, 6vw, 76px));
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(7, 55, 131, .14);
  border-radius: 16px;
  background: var(--login-surface);
  box-shadow: 0 18px 48px rgba(7, 26, 61, .13);
  backdrop-filter: blur(18px);
}

.login-form-heading {
  display: grid;
  gap: clamp(4px, 1vh, 8px);
  justify-items: center;
  text-align: center;
}

.login-form-heading h2 {
  color: var(--login-ink);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0;
}

.login-card-mark {
  width: min(118px, 34vw);
  max-height: clamp(46px, 10dvh, 72px);
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto 6px;
}

.login-device-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  padding: 7px 10px;
  border: 1px solid rgba(60, 171, 25, .2);
  border-radius: 999px;
  background: rgba(60, 171, 25, .1);
  color: #217a11;
  font-size: .78rem;
  font-weight: 900;
}

.mn360-login-page .form-label {
  color: var(--login-ink);
  margin-bottom: .35rem;
  font-weight: 600;
}

.mn360-login-page .input-group-text {
  border-color: rgba(7, 55, 131, .16);
  background: #f5f9ff;
  color: var(--login-blue);
}

.mn360-login-page .form-control {
  min-height: 42px;
  border-color: rgba(7, 55, 131, .16);
  color: var(--login-ink);
}

.mn360-login-page .form-control:focus {
  border-color: var(--login-blue-2) !important;
  box-shadow: 0 0 0 .22rem rgba(11, 143, 232, .13) !important;
}

.mn360-login-page .form-check-input:checked {
  background-color: var(--login-green) !important;
  border-color: var(--login-green) !important;
}

.login-submit {
  min-height: 44px;
  border: 0 !important;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--login-blue), var(--login-blue-2) 58%, var(--login-green)) !important;
  box-shadow: 0 14px 30px rgba(7, 55, 131, .25);
  font-weight: 700;
}

.login-help-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: rgba(7, 26, 61, .42);
  font-size: .91rem;
  font-weight: 600;
  text-align: center;
}

.login-help-links a {
  color: var(--login-blue);
  text-decoration: none;
}

.login-help-links a:hover {
  color: var(--login-green);
  text-decoration: underline;
}

.login-card-version {
  margin-top: 12px;
  text-align: center;
  color: rgba(7, 26, 61, .42);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: 0;
}

.auth-flow-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  padding: 7px 10px;
  border: 1px solid rgba(7, 55, 131, .12);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(7, 55, 131, .08), rgba(60, 171, 25, .1));
  color: var(--login-blue);
  font-size: .78rem;
  font-weight: 900;
}

.auth-result-card {
  display: grid;
  gap: 14px;
  text-align: center;
}

.auth-result-card h2 {
  margin: 0;
  color: var(--login-ink);
  font-size: clamp(1.6rem, 2.5vw, 2.15rem);
  font-weight: 950;
}

.auth-result-icon {
  width: 66px;
  height: 66px;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(60, 171, 25, .14), rgba(11, 143, 232, .12));
  color: var(--login-green);
  font-size: 2rem;
}

.auth-result-icon.is-danger {
  background: rgba(220, 53, 69, .1);
  color: #b42318;
}

.mn360-login-page .login-signup-shortcut {
  border-color: rgba(7, 55, 131, .16);
  border-radius: 999px;
  color: var(--login-blue);
}

.mn360-login-page .login-signup-shortcut:hover {
  color: var(--login-green);
}

.mn360-login-page .login-version {
  color: rgba(7, 26, 61, .56);
}

@media (min-width: 701px) and (max-width: 1100px) {
  .mn360-login-page .login-shell {
    grid-template-columns: minmax(280px, .8fr) minmax(390px, 1fr);
  }

  .mn360-login-page .login-brand-panel {
    min-height: 0;
    padding: 18px;
  }

  .mn360-login-page .login-brand-panel::before {
    inset: 16px;
    border-radius: 22px;
  }

  .mn360-login-logo {
    max-width: min(360px, 34vw);
    max-height: 62dvh;
  }

  .mn360-login-page .login-form-panel {
    align-items: center;
    padding: 16px;
  }

  .mn360-login-page .login-card {
    width: min(100%, 430px);
  }

  .login-device-tablet .login-card {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .mn360-login-page {
    background: linear-gradient(180deg, #f8fbff 0%, #eff8ff 58%, #f8fff5 100%);
  }

  .mn360-login-page .login-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    height: var(--login-vh, 100dvh);
    min-height: 0;
  }

  .mn360-login-page .login-brand-panel {
    min-height: auto;
    padding: clamp(8px, 2dvh, 14px) 12px 4px;
    background: transparent;
  }

  .mn360-login-page .login-brand-panel::before {
    display: none;
  }

  .mn360-login-logo {
    width: min(210px, 62vw);
    max-width: 62vw;
    max-height: clamp(58px, 16dvh, 112px);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(7, 26, 61, .1);
  }

  .mn360-login-page .login-form-panel {
    align-items: start;
    padding: 6px 12px 28px;
    min-height: 0;
  }

  .mn360-login-page .login-card {
    width: 100%;
    max-height: calc(var(--login-vh, 100dvh) - clamp(86px, 20dvh, 142px));
    padding: clamp(14px, 3.6dvh, 20px);
    border-radius: 14px;
    overflow: hidden;
  }

  .login-form-heading {
    margin-bottom: clamp(.65rem, 2dvh, 1rem) !important;
  }

  .login-form-heading p {
    font-size: .86rem;
    line-height: 1.35;
  }

  .login-card-mark {
    width: min(96px, 28vw);
    max-height: clamp(38px, 8dvh, 56px);
    margin-bottom: 0;
  }

  .login-form-heading h2 {
    margin: 0;
    font-size: clamp(1.22rem, 5.4vw, 1.45rem);
  }

  .mn360-login-page .form-control,
  .mn360-login-page .input-group-text,
  .login-submit {
    min-height: 40px;
  }

  .mn360-login-page .mb-3 {
    margin-bottom: .7rem !important;
  }

  .mn360-login-page .mb-4 {
    margin-bottom: .8rem !important;
  }

  .mn360-login-page .mb-3.login-submit,
  .login-submit.mb-3 {
    margin-bottom: .7rem !important;
  }

  .mn360-login-page .login-signup-shortcut {
    left: 12px;
    right: 12px;
    justify-content: center;
  }

  .mn360-login-page .login-version {
    right: 12px;
    bottom: 7px;
    font-size: 11px;
  }
}

@media (max-height: 760px) {
  .mn360-login-logo {
    max-height: 58dvh;
  }

  .mn360-login-page .login-card {
    padding: 18px;
  }

  .login-card-mark {
    width: min(96px, 28vw);
    max-height: 52px;
  }

  .login-form-heading h2 {
    font-size: 1.35rem;
  }

  .login-form-heading p {
    font-size: .84rem;
  }

  .mn360-login-page .form-control,
  .mn360-login-page .input-group-text,
  .login-submit {
    min-height: 38px;
  }
}

@media (max-height: 640px) {
  .mn360-login-page .login-brand-panel {
    display: none;
  }

  .mn360-login-page .login-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .mn360-login-page .login-form-panel {
    align-items: center;
    padding: 10px;
  }

  .mn360-login-page .login-card {
    max-height: calc(var(--login-vh, 100dvh) - 20px);
    padding: 14px;
  }

  .login-card-mark {
    max-height: 42px;
  }

  .login-form-heading {
    gap: 3px;
  }

  .login-form-heading p {
    display: none;
  }
}

.lockout-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(37, 99, 235, .16), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(34, 197, 94, .18), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eef5ff 48%, #f4fbf7 100%);
}

.lockout-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.lockout-brand {
  position: fixed;
  top: 22px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-weight: 900;
}

.lockout-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.lockout-card {
  width: min(100%, 620px);
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 24px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
  backdrop-filter: blur(14px);
  text-align: center;
}

.lockout-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 2rem;
}

.lockout-eyebrow {
  color: var(--app-primary);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lockout-card h1 {
  margin: 8px 0 10px;
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 950;
  letter-spacing: 0;
}

.lockout-card p {
  max-width: 520px;
  margin: 0 auto 22px;
  color: #475569;
  font-size: 1rem;
  line-height: 1.6;
}

.lockout-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
  text-align: left;
}

.lockout-help-grid article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 16px;
  background: rgba(248, 250, 252, .78);
}

.lockout-help-grid i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fff;
  color: var(--app-primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.lockout-help-grid strong {
  color: #0f172a;
  font-size: .92rem;
}

.lockout-help-grid span {
  color: #64748b;
  font-size: .84rem;
}

.lockout-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 640px) {
  .lockout-shell {
    align-items: start;
    padding-top: 86px;
  }

  .lockout-brand {
    left: 18px;
    top: 18px;
  }

  .lockout-card {
    border-radius: 18px;
  }

  .lockout-help-grid {
    grid-template-columns: 1fr;
  }

  .lockout-actions .btn {
    width: 100%;
  }
}

/* Corporate palette bridge for Bootstrap and shared components. */
.btn-primary,
.btn-check:checked + .btn-outline-primary,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.show > .btn-outline-primary.dropdown-toggle {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--app-primary-dark) !important;
  border-color: var(--app-primary-dark) !important;
  color: #fff !important;
}

.btn-outline-primary {
  border-color: var(--app-primary) !important;
  color: var(--app-primary) !important;
}

.bg-primary,
.badge.bg-primary,
.progress-bar,
.page-item.active .page-link,
.nav-pills .nav-link.active,
.list-group-item.active {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #fff !important;
}

.text-primary,
a,
.page-link {
  color: var(--app-primary) !important;
}

a:hover,
.page-link:hover {
  color: var(--app-primary-dark) !important;
}

.border-primary {
  border-color: var(--app-primary) !important;
}

.alert-primary,
.bg-primary-subtle,
.text-bg-primary-subtle {
  background-color: var(--app-primary-soft) !important;
  border-color: color-mix(in srgb, var(--app-primary) 28%, var(--app-border)) !important;
  color: var(--app-primary-dark) !important;
}

.form-check-input:checked {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
}

/* Notification template builder */
.template-builder-shell {
  --template-border: color-mix(in srgb, var(--app-primary, #6f3df4) 22%, var(--app-border, #e5e7eb));
}

.template-builder-hero p {
  max-width: 760px;
}

.template-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.template-builder-main,
.template-builder-side {
  display: grid;
  gap: 18px;
}

.template-builder-side {
  position: sticky;
  top: 18px;
}

.template-builder-card,
.template-guide-card,
.template-preview-card,
.template-test-card {
  border: 1px solid var(--template-border);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(16, 24, 40, .06);
}

.template-builder-section-head,
.template-guide-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.template-builder-section-head span,
.template-guide-head span:first-child {
  display: block;
  color: var(--app-primary, #6f3df4);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.template-builder-section-head h2,
.template-guide-head h2 {
  margin: 2px 0 0;
  color: var(--app-text, #17112f);
  font-size: clamp(1.05rem, 1.4vw, 1.28rem);
  font-weight: 800;
}

.template-active-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--template-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 7%, var(--app-surface, #fff));
  font-weight: 700;
}

.template-body-editor {
  min-height: 310px;
  font-size: .94rem;
  line-height: 1.55;
  resize: vertical;
}

.template-editor-help {
  color: var(--app-muted, #667085);
  font-size: .82rem;
}

.template-channel-pill {
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 10%, var(--app-surface, #fff));
  color: var(--app-primary, #6f3df4);
  font-size: .78rem !important;
  padding: 7px 10px;
  white-space: nowrap;
}

.template-guide-card p,
.template-test-card p {
  color: var(--app-muted, #667085);
  font-size: .92rem;
  margin-bottom: 14px;
}

.template-variable-search {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--template-border);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 12px;
  background: var(--app-surface, #fff);
}

.template-variable-search input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  color: var(--app-text, #17112f);
  background: transparent;
}

.template-variable-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.template-variable-chip {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--app-primary, #6f3df4) 18%, var(--app-border, #e5e7eb));
  border-radius: 8px;
  background: var(--app-surface, #fff);
  color: var(--app-text, #17112f);
  padding: 10px 12px;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.template-variable-chip:hover {
  border-color: var(--app-primary, #6f3df4);
  box-shadow: 0 12px 28px rgba(16, 24, 40, .08);
  transform: translateY(-1px);
}

.template-variable-chip strong {
  display: block;
  color: var(--app-primary, #6f3df4);
  font-size: .87rem;
}

.template-variable-chip span {
  display: block;
  font-weight: 800;
  margin-top: 3px;
}

.template-variable-chip small {
  display: block;
  color: var(--app-muted, #667085);
  margin-top: 2px;
}

.template-variable-chip em {
  display: block;
  color: var(--app-muted, #475467);
  font-size: .78rem;
  font-style: normal;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-preview-device {
  border: 1px solid var(--template-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--app-surface, #fff);
}

.template-preview-subject {
  padding: 13px 15px;
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 9%, var(--app-surface, #fff));
  color: var(--app-text, #17112f);
  font-weight: 800;
}

.template-preview-body {
  min-height: 160px;
  padding: 15px;
  color: var(--app-text, #344054);
  font-size: .94rem;
  line-height: 1.55;
  word-break: break-word;
}

.template-empty-help {
  border: 1px dashed var(--template-border);
  border-radius: 8px;
  padding: 18px;
  color: var(--app-muted, #667085);
  text-align: center;
}

@media (max-width: 1100px) {
  .template-builder-layout {
    grid-template-columns: 1fr;
  }

  .template-builder-side {
    position: static;
  }
}

@media (max-width: 640px) {
  .template-builder-section-head,
  .template-guide-head {
    flex-direction: column;
  }

  .template-active-toggle {
    width: 100%;
    justify-content: center;
  }

  .template-variable-list {
    max-height: 300px;
  }
}

/* Mi Facturacion */
.subscription-modern {
  --billing-surface: color-mix(in srgb, var(--app-surface, #ffffff) 94%, var(--app-primary, #6f3df4) 6%);
}

.billing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: stretch;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--app-border, #ddd6fe);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--app-primary, #6f3df4) 16%, transparent), transparent 38%),
    var(--billing-surface);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .08);
}

.billing-hero h1 {
  max-width: 720px;
  margin: 10px 0;
  font-size: clamp(1.65rem, 4vw, 2.75rem);
  letter-spacing: 0;
}

.billing-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--app-text-muted, #64748b);
}

.billing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-primary, #6f3df4);
}

.billing-balance-card {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--app-border, #e9d5ff);
  border-radius: 14px;
  background: var(--app-surface, #ffffff);
}

.billing-balance-card small {
  color: var(--app-text-muted, #64748b);
  font-weight: 700;
}

.billing-balance-card strong {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: var(--app-text, #171032);
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
}

.billing-plan-grid article {
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--app-border, #e9d5ff);
  border-radius: 14px;
  background: var(--app-surface, #ffffff);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 6px;
  align-content: start;
}

.billing-plan-grid i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--app-primary, #6f3df4);
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 12%, transparent);
  font-size: 1.05rem;
}

.billing-plan-grid span {
  color: var(--app-text-muted, #64748b);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.billing-plan-grid strong {
  color: var(--app-text, #171032);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.billing-plan-grid small {
  color: var(--app-text-muted, #64748b);
  font-weight: 600;
}

.billing-policy-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.billing-policy-card > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--app-primary, #6f3df4) 18%, var(--app-border, #e9d5ff));
  border-radius: 12px;
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 6%, var(--app-surface, #ffffff));
}

.billing-policy-card i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--app-primary, #6f3df4);
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 12%, transparent);
}

.billing-policy-card strong {
  color: var(--app-text, #171032);
  font-weight: 900;
}

.billing-policy-card span {
  color: var(--app-text-muted, #64748b);
  font-size: .88rem;
  line-height: 1.35;
}

.billing-review-card .app-card-header {
  gap: 12px;
}

.billing-payment-modal {
  border-radius: 16px;
  overflow: hidden;
}

.billing-payment-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr);
  gap: 22px;
}

.billing-payment-methods {
  display: grid;
  gap: 10px;
  align-content: start;
}

.billing-payment-methods button {
  min-height: 82px;
  border: 1px solid var(--app-border, #ddd6fe);
  border-radius: 12px;
  background: var(--app-surface, #ffffff);
  color: var(--app-text, #171032);
  text-align: left;
  padding: 12px;
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 10px;
  align-items: center;
}

.billing-payment-methods button i {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--app-primary, #6f3df4);
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 12%, transparent);
}

.billing-payment-methods button span {
  font-weight: 800;
}

.billing-payment-methods button small {
  color: var(--app-text-muted, #64748b);
}

.billing-payment-methods button.active {
  border-color: var(--app-primary, #6f3df4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary, #6f3df4) 14%, transparent);
}

.billing-payment-methods button:disabled {
  opacity: .52;
  cursor: not-allowed;
}

.billing-bank-note {
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--app-primary, #6f3df4) 8%, var(--app-surface, #ffffff));
  color: var(--app-text, #171032);
  display: grid;
  gap: 2px;
}

.billing-bank-note span,
.billing-bank-note small {
  font-size: .82rem;
  color: var(--app-text-muted, #64748b);
}

.billing-payment-form {
  padding: 16px;
  border: 1px solid var(--app-border, #ddd6fe);
  border-radius: 14px;
  background: var(--app-surface, #ffffff);
}

.billing-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  color: #111827;
  white-space: nowrap;
}

.billing-status-success {
  background: rgba(34, 197, 94, .16);
  border-color: rgba(22, 163, 74, .34);
}

.billing-status-info {
  background: rgba(14, 165, 233, .14);
  border-color: rgba(2, 132, 199, .3);
}

.billing-status-warning {
  background: rgba(245, 158, 11, .18);
  border-color: rgba(217, 119, 6, .34);
}

.billing-status-danger {
  background: rgba(239, 68, 68, .14);
  border-color: rgba(220, 38, 38, .3);
}

.billing-status-muted {
  background: rgba(100, 116, 139, .12);
  border-color: rgba(100, 116, 139, .24);
}

html[data-theme="dark"] .billing-status {
  color: #f8fafc;
}

@media (max-width: 900px) {
  .billing-hero,
  .billing-payment-grid {
    grid-template-columns: 1fr;
  }

  .billing-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-policy-card {
    grid-template-columns: 1fr;
  }

  .billing-balance-card {
    align-content: start;
  }
}

@media (max-width: 576px) {
  .subscription-modern {
    padding-top: 12px !important;
  }

  .billing-hero {
    border-radius: 14px;
    padding: 16px;
  }

  .billing-payment-methods button {
    min-height: 70px;
  }

  .billing-plan-grid {
    grid-template-columns: 1fr;
  }

  .billing-plan-grid article {
    min-height: 104px;
  }
}

/* Security role permissions experience */
.permissions-experience {
  gap: 22px;
}

.permissions-hero-copy {
  min-width: 0;
}

.permissions-hero-copy strong {
  color: inherit;
}

.permissions-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.permissions-command-center {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.permissions-command-center .permissions-summary {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.permissions-command-center .permissions-summary article {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 12px;
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.permissions-command-center .permissions-summary article::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app-primary), color-mix(in srgb, var(--app-primary) 44%, var(--app-accent, #22c55e)));
  opacity: .85;
}

.permissions-command-center .permissions-summary i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  font-size: 1.1rem;
}

.permissions-command-center .permissions-summary span {
  color: var(--app-heading);
  font-size: 1.45rem;
  line-height: 1;
}

.permissions-command-center .permissions-summary small {
  align-self: start;
  color: var(--app-muted);
  font-size: .78rem;
}

.permissions-experience .permissions-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(210px, 260px) auto;
  padding: 14px;
  border-radius: var(--app-radius-sm);
}

.permissions-experience .permissions-actions .btn {
  white-space: nowrap;
}

.permissions-experience .permissions-shell {
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 18px;
}

.permissions-experience .permissions-module-list {
  top: 82px;
  gap: 8px;
  padding: 10px;
  border-radius: var(--app-radius-sm);
}

.permissions-experience .permissions-module-list button {
  align-items: center;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.permissions-experience .permissions-module-list button span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  color: inherit;
}

.permissions-experience .permissions-module-list button i {
  color: var(--app-primary);
}

.permissions-experience .permissions-module-list button strong {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--app-muted);
  background: var(--app-surface-soft);
  font-size: .76rem;
  text-align: center;
}

.permissions-experience .permissions-module-list button:hover,
.permissions-experience .permissions-module-list button.active {
  border-color: color-mix(in srgb, var(--app-primary) 26%, var(--app-border));
}

.permissions-experience .permissions-module-list button.active strong {
  color: var(--app-primary);
  background: var(--app-surface);
}

.permissions-experience .permissions-modules {
  gap: 16px;
}

.permissions-experience .permissions-module {
  border-radius: var(--app-radius-sm);
}

.permissions-experience .permissions-module header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px;
  background: linear-gradient(135deg, var(--app-surface), var(--app-surface-soft));
}

.permissions-module-title {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--app-text);
  background: transparent;
  text-align: left;
}

.permissions-module-title > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.permissions-module-title small {
  color: var(--app-primary);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.permissions-module-title strong {
  color: var(--app-heading);
  font-size: 1.03rem;
  font-weight: 800;
}

.permissions-module-title em {
  color: var(--app-muted);
  font-size: .8rem;
  font-style: normal;
}

.permissions-module-title em b {
  color: var(--app-primary);
}

.permissions-module-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.permissions-module-chevron {
  margin-left: auto;
  color: var(--app-muted);
  transition: transform .18s ease;
}

.permissions-module-title[aria-expanded="false"] .permissions-module-chevron {
  transform: rotate(180deg);
}

.permissions-experience .permissions-module-actions {
  align-items: center;
  justify-content: flex-end;
}

.permissions-experience .permissions-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  padding: 16px;
}

.permissions-experience .permission-card {
  min-height: 112px;
  gap: 13px;
  padding: 16px;
  border-radius: 14px;
  background: var(--app-surface);
}

.permissions-experience .permission-card:hover {
  box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
}

.permissions-experience .permission-check {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.permissions-experience .permission-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.permissions-experience .permission-body strong {
  margin: 0;
  color: var(--app-heading);
  font-size: .94rem;
  line-height: 1.2;
}

.permissions-experience .permission-body small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--app-muted);
  font-size: .8rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.permissions-experience .permission-body em {
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--app-muted);
  background: var(--app-surface-soft);
  font-size: .68rem;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.permissions-experience .permission-card:has(input:checked) .permission-body em {
  color: var(--app-primary);
  background: color-mix(in srgb, var(--app-primary-soft) 76%, var(--app-surface));
}

.permissions-empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 28px;
  border: 1px dashed color-mix(in srgb, var(--app-primary) 34%, var(--app-border));
  border-radius: var(--app-radius-sm);
  color: var(--app-muted);
  background: var(--app-surface);
  text-align: center;
}

.permissions-empty-state i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  font-size: 1.35rem;
}

.permissions-empty-state strong {
  color: var(--app-heading);
}

.permissions-experience .permissions-savebar {
  border-radius: 16px;
}

@media (max-width: 1100px) {
  .permissions-experience .permissions-toolbar,
  .permissions-experience .permissions-shell {
    grid-template-columns: 1fr;
  }

  .permissions-command-center .permissions-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permissions-experience .permissions-module-list {
    position: static;
    display: flex;
    overflow-x: auto;
    max-height: none;
  }

  .permissions-experience .permissions-module-list button {
    flex: 0 0 auto;
    min-width: 180px;
  }
}

@media (max-width: 700px) {
  .permissions-hero-actions,
  .permissions-hero-actions .btn,
  .permissions-experience .permissions-actions,
  .permissions-experience .permissions-actions .btn {
    width: 100%;
  }

  .permissions-command-center .permissions-summary {
    grid-template-columns: 1fr;
  }

  .permissions-experience .permissions-module header {
    grid-template-columns: 1fr;
  }

  .permissions-experience .permissions-module-actions {
    width: 100%;
  }

  .permissions-experience .permissions-module-actions .btn {
    flex: 1 1 0;
  }

  .permissions-experience .permissions-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .permissions-experience .permissions-savebar {
    position: static;
  }
}

html[data-theme="dark"] .permissions-empty-state,
html[data-theme="dark"] .permissions-experience .permission-card,
html[data-theme="dark"] .permissions-command-center .permissions-summary article {
  background: color-mix(in srgb, var(--app-surface) 92%, #000);
}

/* Accounts receivable/payable payment modals */
.financial-payment-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 126px;
}

.financial-payment-modal .modal-content {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .24);
}

.financial-payment-modal .modal-header,
.financial-payment-modal .modal-footer {
  border-color: var(--app-border);
  background: linear-gradient(135deg, var(--app-surface), var(--app-surface-soft));
}

.financial-payment-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--app-primary);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.financial-payment-layout {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.financial-payment-summary,
.financial-payment-form {
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.financial-payment-summary {
  display: grid;
  align-content: start;
  gap: 7px;
}

.financial-payment-summary > span {
  color: var(--app-primary);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.financial-payment-summary > strong {
  color: var(--app-heading);
  font-size: 1.18rem;
  line-height: 1.2;
}

.financial-payment-summary > small,
.financial-payment-summary > p {
  margin: 0;
  color: var(--app-muted);
}

.financial-payment-chip {
  width: fit-content;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  font-size: .72rem;
  font-weight: 800;
}

.financial-payment-numbers {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.financial-payment-numbers div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
}

.financial-payment-numbers small {
  color: var(--app-muted);
  font-weight: 700;
}

.financial-payment-numbers b {
  color: var(--app-heading);
  white-space: nowrap;
}

.financial-payment-form {
  background: var(--app-surface);
}

@media (max-width: 768px) {
  .financial-payment-open {
    width: 100%;
  }

  .financial-payment-layout {
    grid-template-columns: 1fr;
  }

  .financial-payment-modal .modal-dialog {
    margin: 10px;
  }
}

html[data-theme="dark"] .financial-payment-modal .modal-content,
html[data-theme="dark"] .financial-payment-form,
html[data-theme="dark"] .financial-payment-numbers div {
  background: color-mix(in srgb, var(--app-surface) 92%, #000);
}

.security-confirm-modal {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.security-confirm-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: color-mix(in srgb, #dc3545 12%, transparent);
  color: #dc3545;
  font-size: 1.35rem;
}

.security-confirm-name {
  display: inline-flex;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
  word-break: break-word;
}

.security-access-form {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.twofactor-setup-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.twofactor-qr-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.twofactor-qr-card img {
  width: 210px;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
}

.twofactor-steps {
  display: grid;
  gap: 14px;
}

.twofactor-steps > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
}

.twofactor-steps > div > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--app-primary) 14%, transparent);
  color: var(--app-primary);
  font-weight: 800;
}

.twofactor-steps strong {
  display: block;
  color: var(--app-text);
}

.twofactor-steps small {
  display: block;
  margin-top: 2px;
  color: var(--app-muted);
}

.twofactor-steps code,
.twofactor-recovery-grid code {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-weight: 800;
  white-space: normal;
  word-break: break-word;
}

.twofactor-code-form {
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.twofactor-recovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .twofactor-setup-grid {
    grid-template-columns: 1fr;
  }

  .twofactor-qr-card {
    justify-items: start;
  }
}

.product-edit-page {
  display: grid;
  gap: 18px;
  padding: 4px 0 28px;
}

.product-edit-hero,
.product-edit-panel {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.product-edit-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 26px);
}

.product-edit-eyebrow,
.product-edit-panel-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--app-primary);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-edit-hero h1 {
  margin: 6px 0 6px;
  color: var(--app-text);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 950;
  letter-spacing: 0;
}

.product-edit-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--app-muted);
}

.product-edit-actions {
  display: flex;
  gap: 8px;
}

.product-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.product-edit-main {
  display: grid;
  gap: 18px;
}

.product-edit-panel {
  padding: clamp(16px, 2.4vw, 22px);
}

.product-edit-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.product-edit-panel-head h2 {
  margin: 4px 0 0;
  color: var(--app-text);
  font-size: 1.18rem;
  font-weight: 950;
}

.product-edit-panel-head > i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1.1rem;
}

.product-edit-readonly {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-weight: 850;
}

.product-edit-readonly i {
  color: var(--app-primary);
}

.product-edit-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--app-primary) 22%, var(--app-border));
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  font-size: .88rem;
  font-weight: 750;
}

.product-edit-toggle,
.product-edit-active {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.product-edit-toggle > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.product-edit-toggle strong,
.product-edit-active strong {
  display: block;
  color: var(--app-text);
  font-size: .92rem;
}

.product-edit-toggle small,
.product-edit-active small {
  display: block;
  color: var(--app-muted);
}

.product-edit-summary {
  min-width: 0;
}

.sticky-summary {
  position: sticky;
  top: 88px;
}

.product-edit-summary-list {
  display: grid;
  gap: 10px;
}

.product-edit-summary-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--app-border);
}

.product-edit-summary-list span {
  color: var(--app-muted);
  font-size: .82rem;
  font-weight: 800;
}

.product-edit-summary-list strong {
  color: var(--app-text);
  text-align: right;
}

.product-type-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-type-selector label {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.product-type-selector label:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--app-primary) 38%, var(--app-border));
  box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

.product-type-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-type-selector span,
.product-create-preview > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1.15rem;
}

.product-type-selector strong {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 950;
}

.product-type-selector small {
  color: var(--app-muted);
  line-height: 1.35;
}

.product-type-selector label:has(input:checked) {
  border-color: var(--app-primary);
  background: color-mix(in srgb, var(--app-primary-soft) 58%, var(--app-surface));
  box-shadow: 0 16px 34px color-mix(in srgb, var(--app-primary) 12%, transparent);
}

.product-type-selector label:has(input:checked)::after {
  content: "\F26A";
  font-family: "bootstrap-icons";
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--app-primary);
  font-size: 1rem;
}

.product-create-preview {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 20px 14px;
  border: 1px dashed color-mix(in srgb, var(--app-primary) 30%, var(--app-border));
  border-radius: var(--app-radius);
  background: var(--app-surface-soft);
  text-align: center;
}

.product-create-preview strong {
  color: var(--app-text);
  font-size: 1.05rem;
  font-weight: 950;
}

.product-create-preview small {
  color: var(--app-muted);
  font-weight: 800;
}

html[data-theme="dark"] .product-edit-hero,
html[data-theme="dark"] .product-edit-panel,
html[data-theme="dark"] .product-edit-readonly,
html[data-theme="dark"] .product-edit-toggle,
html[data-theme="dark"] .product-edit-active {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
}

html[data-theme="dark"] .product-edit-readonly,
html[data-theme="dark"] .product-edit-toggle,
html[data-theme="dark"] .product-edit-active,
html[data-theme="dark"] .product-type-selector label,
html[data-theme="dark"] .product-create-preview {
  background-color: var(--app-surface-soft) !important;
}

@media (max-width: 1100px) {
  .product-edit-layout {
    grid-template-columns: 1fr;
  }

  .product-type-selector {
    grid-template-columns: 1fr;
  }

  .sticky-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .product-edit-hero {
    flex-direction: column;
  }

  .product-edit-actions,
  .product-edit-actions .btn {
    width: 100%;
  }

  .product-edit-panel-head {
    align-items: flex-start;
  }
}

/* Global responsive guardrails */
html,
body {
  max-width: 100%;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

.app-main *,
.app-sidebar *,
.modal * {
  min-width: 0;
}

.app-main :where(.container, .container-fluid, .row, [class*="col-"], .card, .modal-body, .tab-content, .accordion-body) {
  min-width: 0;
}

.app-main :where(.table-responsive, .dataTables_wrapper, .settings-table-wrap, .dashboard-table-wrap, .report-table-wrap) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-main :where(table) {
  max-width: 100%;
}

.app-main :where(.btn-toolbar, .btn-group, .input-group, .d-flex) {
  min-width: 0;
}

.app-main :where(.btn, .form-control, .form-select, .dropdown-item, .nav-link, .list-group-item) {
  max-width: 100%;
}

.app-main :where(.card-title, .card-text, .dropdown-item, .nav-link, .list-group-item, .badge, .alert, td, th) {
  overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
  .app-main :where(
    .dashboard-kpi-grid,
    .personal-kpi-grid,
    .security-users-kpis,
    .ncf-kpis,
    .inventory-kpis,
    .movement-kpis,
    .settings-form-grid.compact,
    .mi-negocio-kpis
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 991.98px) {
  .app-main {
    width: 100%;
    overflow-x: hidden;
  }

  .app-main :where(
    .settings-layout,
    .permissions-shell,
    .dashboard-main-grid,
    .module-analytics-grid,
    .personal-main-grid,
    .security-users-toolbar,
    .settings-grid-form,
    .settings-split,
    .citas-layout,
    .citas-maintenance-layout,
    .citas-portal-grid,
    .cita-public-shell,
    .factura-agendada-layout,
    .factura-create-layout,
    .documento-create-layout
  ) {
    grid-template-columns: 1fr !important;
  }

  .app-main :where(.d-flex.justify-content-between, .d-flex.align-items-center.justify-content-between, .module-dashboard-header, .settings-hero, .permissions-hero) {
    flex-wrap: wrap;
    gap: .75rem;
  }

  .app-main :where(.btn-toolbar, .report-filter-actions, .settings-hero-actions, .permissions-actions, .security-users-actions) {
    justify-content: flex-start !important;
    flex-wrap: wrap;
  }
}

@media (max-width: 767.98px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-main {
    padding-inline: 12px;
  }

  .app-main > :where(.container, .container-fluid) {
    max-width: 100%;
    padding-inline: 0;
  }

  .app-main :where(
    .dashboard-kpi-grid,
    .personal-kpi-grid,
    .security-users-kpis,
    .security-users-toolbar,
    .settings-form-grid,
    .settings-form-grid.compact,
    .settings-grid-form,
    .settings-split,
    .permissions-summary,
    .permissions-grid,
    .ncf-kpis,
    .ncf-form-grid,
    .inventory-kpis,
    .movement-kpis,
    .flow-helper,
    .manual-check-grid,
    .manual-flow-grid,
    .manual-two-col,
    .manual-contact-grid,
    .citas-overview,
    .citas-filter,
    .citas-calendar-filter,
    .report-filter,
    .personal-performance-grid,
    .personal-team-grid,
    .mi-negocio-kpis
  ) {
    grid-template-columns: 1fr !important;
  }

  .app-main :where(.card, .settings-panel, .permissions-module, .dashboard-panel, .personal-panel) {
    border-radius: var(--app-radius-sm) !important;
  }

  .app-main :where(.card-body, .settings-panel-head, .permissions-module header, .dashboard-panel > header, .personal-panel > header) {
    padding: 14px !important;
  }

  .app-main :where(.btn, .btn-group, .btn-toolbar) {
    white-space: normal;
  }

  .app-main :where(.btn-group, .btn-toolbar) {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .app-main :where(.btn-group > .btn, .btn-toolbar .btn) {
    flex: 1 1 auto;
  }

  .app-main :where(.input-group) {
    flex-wrap: nowrap;
  }

  .app-main :where(.table:not(.table-fixed)) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-main :where(.dataTables_wrapper .row) {
    gap: .5rem;
  }

  .app-main :where(.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select) {
    width: 100% !important;
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .app-main {
    padding-inline: 10px;
  }

  .app-main :where(h1) {
    font-size: clamp(1.24rem, 7vw, 1.55rem) !important;
  }

  .app-main :where(.btn, .form-control, .form-select, .input-group-text) {
    min-height: 36px;
    font-size: .86rem;
  }

  .app-main :where(.badge, small, .small) {
    font-size: .7rem;
  }
}

@media (max-width: 767.98px) {
  .security-users-table {
    min-width: 720px;
  }
}

/* Mobile app experience layer */
body.app-device-mobile {
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--app-primary-soft) 58%, transparent), transparent 18rem),
    var(--app-bg);
  -webkit-tap-highlight-color: transparent;
}

body.app-device-mobile .app-layout {
  min-height: var(--app-vh, 100dvh);
}

body.app-device-mobile .app-content {
  min-height: var(--app-vh, 100dvh);
}

body.app-device-mobile .app-main {
  width: 100%;
  min-height: var(--app-vh, 100dvh);
  padding: 66px 12px 34px;
  background: transparent;
}

body.app-device-mobile .app-mobile-menu-button {
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--app-surface) 92%, transparent);
  backdrop-filter: blur(12px);
}

body.app-device-mobile .app-sidebar {
  width: min(88vw, 320px);
  border-radius: 0 18px 18px 0;
}

body.app-device-mobile .app-sidebar-brand {
  min-height: 64px;
  padding: 10px 14px;
}

body.app-device-mobile .app-sidebar-user {
  grid-template-columns: 54px minmax(0, 1fr);
  justify-items: start;
  gap: 10px;
  padding: 14px;
  text-align: left;
}

body.app-device-mobile .app-sidebar-avatar-link {
  width: 58px;
  height: 58px;
}

body.app-device-mobile .app-sidebar-user img,
body.app-device-mobile .app-sidebar-avatar {
  width: 54px;
  height: 54px;
  font-size: 1.35rem;
}

body.app-device-mobile .app-sidebar-role {
  justify-self: start;
}

body.app-device-mobile .app-main > :where(.container, .container-fluid) {
  width: 100%;
  max-width: 100%;
}

body.app-device-mobile .app-main > :where(.container, .container-fluid, .personal-home, .settings-page, .permissions-page, .citas-shell, .module-dashboard, .security-users-page, .mi-negocio-page) {
  display: grid;
  gap: 12px;
}

body.app-device-mobile .app-main :where(
  .citas-hero,
  .cita-create-hero,
  .cita-details-hero,
  .citas-dashboard-hero,
  .settings-hero,
  .permissions-hero,
  .about-product-hero,
  .security-users-hero,
  .manual-hero,
  .ncf-hero,
  .ncf-form-hero,
  .b2b-dashboard-hero,
  .personal-home-hero,
  .module-dashboard-header
) {
  display: grid !important;
  gap: 10px;
  padding: 16px !important;
  border-radius: 14px !important;
}

body.app-device-mobile .app-main :where(
  .citas-hero h1,
  .cita-create-hero h1,
  .cita-details-hero h1,
  .citas-dashboard-hero h1,
  .settings-hero h1,
  .permissions-hero h1,
  .about-product-hero h1,
  .security-users-hero h1,
  .manual-hero h1,
  .ncf-hero h1,
  .ncf-form-hero h1,
  .b2b-dashboard-hero h1,
  .personal-home-hero h1,
  .module-dashboard-header h1
) {
  max-width: 100%;
  font-size: clamp(1.28rem, 7vw, 1.75rem) !important;
  line-height: 1.12 !important;
}

body.app-device-mobile .app-main :where(
  .settings-hero-actions,
  .security-users-actions,
  .permissions-actions,
  .report-filter-actions,
  .personal-panel-actions,
  .module-dashboard-header > div,
  .d-flex.justify-content-between,
  .d-flex.align-items-center.justify-content-between
) {
  align-items: stretch !important;
  justify-content: flex-start !important;
  flex-wrap: wrap;
  width: 100%;
  gap: 8px;
}

body.app-device-mobile .app-main :where(
  .settings-hero-actions .btn,
  .security-users-actions .btn,
  .permissions-actions .btn,
  .report-filter-actions .btn,
  .personal-panel-actions .btn
) {
  flex: 1 1 auto;
}

body.app-device-mobile .app-main :where(
  .card,
  .settings-panel,
  .permissions-module,
  .permissions-savebar,
  .dashboard-panel,
  .module-surface,
  .personal-panel,
  .security-users-panel,
  .cita-card,
  .cita-panel,
  .ncf-panel,
  .factura-agendada-panel,
  .notification-panel,
  .notification-dashboard-card
) {
  border-radius: 14px !important;
  box-shadow: var(--app-shadow-sm) !important;
}

body.app-device-mobile .app-main :where(
  .card-body,
  .settings-panel-head,
  .settings-grid-form,
  .settings-form-grid,
  .settings-inline-form,
  .settings-split,
  .permissions-module header,
  .permissions-grid,
  .dashboard-panel > header,
  .module-surface > header,
  .personal-panel > header,
  .security-panel-head
) {
  padding: 14px !important;
}

body.app-device-mobile .app-main :where(
  .settings-nav,
  .permissions-module-list,
  .report-nav,
  .manual-toc
) {
  position: static !important;
  display: flex !important;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

body.app-device-mobile .app-main :where(
  .settings-nav a,
  .permissions-module-list button,
  .report-nav-link,
  .manual-toc a
) {
  flex: 0 0 auto;
  min-width: max-content;
  scroll-snap-align: start;
}

body.app-device-mobile .app-main :where(
  .settings-form-grid,
  .settings-form-grid.compact,
  .settings-grid-form,
  .settings-split,
  .permissions-summary,
  .permissions-grid,
  .dashboard-kpi-grid,
  .personal-kpi-grid,
  .security-users-kpis,
  .security-users-toolbar,
  .ncf-kpis,
  .ncf-form-grid,
  .inventory-kpis,
  .movement-kpis,
  .flow-helper,
  .citas-overview,
  .citas-filter,
  .citas-calendar-filter,
  .report-filter,
  .personal-performance-grid,
  .personal-team-grid,
  .manual-check-grid,
  .manual-flow-grid,
  .manual-two-col,
  .manual-contact-grid
) {
  grid-template-columns: 1fr !important;
}

body.app-device-mobile .app-main :where(.form-control, .form-select, .select2-selection, .input-group-text) {
  min-height: 42px;
}

body.app-device-mobile .select2-container {
  width: 100% !important;
}

body.app-device-mobile .app-main :where(.btn) {
  min-height: 42px;
  border-radius: 10px !important;
}

body.app-device-mobile .app-main :where(.btn-sm) {
  min-height: 36px;
}

body.app-device-mobile .app-main :where(.table-responsive, .dataTables_wrapper, .settings-table-wrap, .security-users-table-wrap) {
  border-radius: 12px;
  background: var(--app-surface);
}

body.app-device-mobile .app-main :where(.dataTables_wrapper) {
  padding: 10px !important;
}

/* Tables were being squeezed unreadably narrow instead of scrolling: force natural column width so
   .table-responsive's overflow-x:auto actually engages instead of DataTables/Bootstrap shrinking columns. */
body.app-device-mobile .app-main :where(.table-responsive, .dataTables_wrapper) table,
body.app-device-tablet .app-main :where(.table-responsive, .dataTables_wrapper) table {
  min-width: max-content;
}

body.app-device-mobile .app-main :where(.table-responsive, .dataTables_wrapper) table th,
body.app-device-mobile .app-main :where(.table-responsive, .dataTables_wrapper) table td,
body.app-device-tablet .app-main :where(.table-responsive, .dataTables_wrapper) table th,
body.app-device-tablet .app-main :where(.table-responsive, .dataTables_wrapper) table td {
  white-space: nowrap;
}

body.app-device-mobile .app-main :where(.table-responsive, .dataTables_wrapper) table :where(td, th).cdi-account-name,
body.app-device-tablet .app-main :where(.table-responsive, .dataTables_wrapper) table :where(td, th).cdi-account-name {
  white-space: normal;
}

body.app-device-mobile .app-main :where(.dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dt-buttons) {
  float: none !important;
  width: 100%;
  margin: 0 0 8px !important;
  text-align: left;
}

body.app-device-mobile .app-main :where(.dt-buttons) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.app-device-mobile .app-main :where(.dt-button, .paginate_button) {
  border-radius: 10px !important;
}

body.app-device-mobile .app-main :where(.modal-dialog) {
  align-items: flex-end;
  max-width: none;
  min-height: 100%;
  margin: 0;
}

body.app-device-mobile .app-main :where(.modal-content) {
  max-height: calc(var(--app-vh, 100dvh) - 16px);
  border-radius: 18px 18px 0 0 !important;
  overflow: hidden;
}

body.app-device-mobile .app-main :where(.modal-body) {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.app-device-mobile .app-main :where(.modal-footer) {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

body.app-device-mobile .app-main :where(.modal-footer .btn) {
  width: 100%;
}

body.app-device-mobile .app-main :where(.alert) {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
}

body.app-device-mobile.app-compact-height .app-main {
  padding-top: 58px;
}

body.app-device-mobile.app-compact-height .app-mobile-menu-button {
  top: 8px;
}

/* B2B portal corporate palette bridge. */
.b2b-public-page,
.b2b-public-main,
.b2b-compact-shell {
  background: var(--app-bg) !important;
  color: var(--app-text) !important;
}

.b2b-public-hero {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--app-primary-dark) 82%, #0f172a), color-mix(in srgb, var(--app-primary) 68%, transparent)),
    var(--b2b-banner) !important;
  background-position: center !important;
  background-size: cover !important;
}

.b2b-compact-header span,
.b2b-panel-header span,
.b2b-dashboard-card span,
.b2b-detail-category,
.b2b-detail-price,
.b2b-dashboard-list article b {
  color: var(--app-primary) !important;
}

.b2b-compact-header h1,
.b2b-panel-header h2,
.b2b-dashboard-card strong,
.b2b-dashboard-list article strong,
.b2b-store-body h2,
.b2b-detail-summary h2,
.b2b-cart-summary strong,
.b2b-auth-card h1 {
  color: var(--app-heading) !important;
}

.b2b-compact-header p,
.b2b-dashboard-list article span,
.b2b-empty,
.b2b-store-tags span,
.b2b-detail-code,
.b2b-cart-item span,
.b2b-cart-item small,
.b2b-orders span,
.b2b-orders small {
  color: var(--app-muted) !important;
}

.b2b-compact-panel,
.b2b-dashboard-panel,
.b2b-dashboard-card,
.b2b-dashboard-list article,
.b2b-compact-kpi,
.b2b-store-card,
.b2b-product-detail,
.b2b-detail-variants,
.b2b-cart,
.b2b-cart-item,
.b2b-cart-summary,
.b2b-auth-card,
.b2b-orders article {
  background: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.b2b-dashboard-list article:hover,
.b2b-dashboard-card:hover,
.b2b-store-card:hover,
.b2b-variant-row:hover {
  border-color: color-mix(in srgb, var(--app-primary) 34%, var(--app-border)) !important;
  background: var(--app-table-hover) !important;
}

.b2b-empty,
.b2b-type-filter,
.b2b-variant-row,
.b2b-detail-gallery,
.b2b-store-image,
.b2b-compact-filters {
  background: var(--app-surface-soft) !important;
  border-color: var(--app-border) !important;
}

/* Personal home dashboard */
.personal-home {
  display: grid;
  gap: 14px;
  max-width: 1600px;
}

.personal-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
  align-items: stretch;
  padding: clamp(16px, 2.4vw, 22px);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--app-info) 9%, transparent), transparent 24rem),
    linear-gradient(135deg, color-mix(in srgb, var(--app-primary-soft) 44%, var(--app-surface)), var(--app-surface));
  color: var(--app-text);
  box-shadow: var(--app-shadow-sm);
}

.personal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-primary);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.personal-home-hero h1 {
  margin: 7px 0 5px;
  color: var(--app-text);
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 0;
}

.personal-home-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--app-muted);
  font-size: .92rem;
  line-height: 1.55;
}

.personal-home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.personal-home-meta span,
.personal-home-hero aside {
  border: 1px solid var(--app-border);
  background: color-mix(in srgb, var(--app-surface) 76%, transparent);
  color: var(--app-text);
}

.personal-home-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
}

.personal-home-meta i {
  color: var(--app-primary);
}

.personal-home-hero aside {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border-radius: var(--app-radius-sm);
  text-align: right;
}

.personal-home-hero aside span,
.personal-home-hero aside small {
  color: var(--app-muted);
  font-size: .76rem;
  font-weight: 600;
}

.personal-home-hero aside strong {
  color: var(--app-primary);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
}

.personal-support-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--app-primary) 24%, var(--app-border));
  border-radius: var(--app-radius-sm);
  background: color-mix(in srgb, var(--app-primary-soft) 34%, var(--app-surface));
  box-shadow: var(--app-shadow-sm);
}

.personal-support-context-copy {
  display: grid;
  gap: 3px;
}

.personal-support-context-copy span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--app-primary);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.personal-support-context-copy strong {
  color: var(--app-text);
  font-size: .98rem;
  font-weight: 700;
}

.personal-support-context-copy small {
  color: var(--app-muted);
  font-size: .78rem;
}

.personal-support-context-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.personal-support-context-form .form-select {
  min-height: 40px;
  border-color: color-mix(in srgb, var(--app-primary) 22%, var(--app-border));
  background-color: var(--app-surface);
}

.personal-support-context-exit {
  display: flex;
  justify-content: flex-end;
}

.personal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.personal-kpi-link {
  color: inherit;
  text-decoration: none;
}

.personal-kpi {
  display: grid;
  min-height: 108px;
  gap: 4px;
  padding: 13px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--app-shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.personal-kpi-link:hover .personal-kpi {
  transform: translateY(-1px);
  border-color: var(--app-primary);
  box-shadow: var(--app-shadow-md);
}

.personal-kpi > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1rem;
}

.personal-kpi span,
.personal-kpi small {
  color: var(--app-muted);
  font-size: .72rem;
  font-weight: 600;
}

.personal-kpi strong {
  color: var(--app-text);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1;
}

.personal-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 14px;
}

.personal-panel {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--app-shadow-sm);
}

.personal-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}

.personal-panel > header span {
  display: block;
  color: var(--app-primary);
  font-size: .68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.personal-panel > header h2 {
  margin: 2px 0 0;
  color: var(--app-text);
  font-size: .98rem;
  font-weight: 700;
}

.personal-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.personal-agenda,
.personal-task-list,
.personal-notification-list,
.personal-due-list,
.personal-activity-list,
.personal-quick-grid {
  display: grid;
}

.personal-agenda-item,
.personal-task,
.personal-due,
.personal-activity,
.personal-quick-action,
.personal-notification {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-top: 1px solid var(--app-border);
  color: var(--app-text);
  text-decoration: none;
}

.personal-agenda-item:first-child,
.personal-task:first-child,
.personal-due:first-child,
.personal-activity:first-child,
.personal-quick-action:first-child,
.personal-notification:first-child {
  border-top: 0;
}

.personal-agenda-item:hover,
.personal-task:hover,
.personal-due:hover,
.personal-quick-action:hover {
  background: var(--app-table-hover);
  color: var(--app-text);
}

.personal-agenda-item {
  grid-template-columns: 70px minmax(0, 1fr) auto;
}

.personal-agenda-item time {
  color: var(--app-primary);
  font-size: .9rem;
  font-weight: 700;
}

.personal-agenda-item strong,
.personal-task strong,
.personal-due strong,
.personal-activity strong,
.personal-quick-action strong,
.personal-notification strong {
  display: block;
  color: var(--app-text);
  font-size: .9rem;
  font-weight: 600;
}

.personal-agenda-item small,
.personal-task small,
.personal-due small,
.personal-activity small,
.personal-quick-action small,
.personal-notification small,
.personal-notification p {
  color: var(--app-muted);
  font-size: .78rem;
}

.personal-agenda-item em,
.personal-due em {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-style: normal;
  font-weight: 600;
}

.personal-task {
  grid-template-columns: 12px minmax(0, 1fr) auto;
}

.personal-task em {
  color: var(--app-muted);
  font-size: .74rem;
  font-style: normal;
  font-weight: 600;
}

.personal-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--app-primary);
}

.personal-notification {
  grid-template-columns: 36px minmax(0, 1fr);
}

.personal-notification > span,
.personal-activity > i,
.personal-quick-action > i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.personal-notification.is-unread {
  background: color-mix(in srgb, var(--app-primary-soft) 48%, var(--app-surface));
}

.personal-notification p {
  margin: 2px 0;
  overflow-wrap: anywhere;
}

.personal-due {
  grid-template-columns: minmax(0, 1fr) auto;
}

.personal-activity,
.personal-quick-action {
  grid-template-columns: 38px minmax(0, 1fr);
}

.personal-performance {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px;
}

.personal-progress-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--app-surface) 57%, transparent 58%),
    conic-gradient(var(--app-primary) calc(var(--value) * 1%), var(--app-border) 0);
}

.personal-progress-ring strong {
  color: var(--app-text);
  font-size: 1.55rem;
  font-weight: 700;
}

.personal-progress-ring span {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 600;
}

.personal-performance-grid,
.personal-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 15px;
}

.personal-performance-grid {
  padding: 0;
}

.personal-performance-grid article,
.personal-team-grid article {
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.personal-performance-grid span,
.personal-team-grid span {
  display: block;
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 600;
}

.personal-performance-grid strong,
.personal-team-grid strong {
  color: var(--app-text);
  font-size: 1.15rem;
  font-weight: 700;
}

.tone-danger .personal-dot,
.personal-kpi.tone-danger > i {
  background: var(--app-danger-soft);
  color: var(--app-danger);
}

.tone-warning .personal-dot,
.personal-kpi.tone-warning > i {
  background: var(--app-warning-soft);
  color: var(--app-warning);
}

.tone-info .personal-dot,
.personal-kpi.tone-info > i {
  background: color-mix(in srgb, var(--app-info) 12%, var(--app-surface));
  color: var(--app-info);
}

.tone-success .personal-dot,
.personal-kpi.tone-success > i {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.personal-agenda-item em.tone-danger,
.personal-due.tone-danger em {
  background: var(--app-danger-soft);
  color: var(--app-danger);
}

.personal-agenda-item em.tone-success,
.personal-due.tone-success em {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.personal-due.tone-warning em {
  background: var(--app-warning-soft);
  color: var(--app-warning-text);
}

.personal-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 140px;
  padding: 18px;
  color: var(--app-muted);
  text-align: center;
}

.personal-empty.compact {
  min-height: 96px;
}

.personal-empty i {
  color: var(--app-primary);
  font-size: 1.45rem;
}

.personal-empty strong {
  color: var(--app-text);
}

@media (max-width: 1320px) {
  .personal-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .personal-home-hero,
  .personal-main-grid,
  .personal-performance {
    grid-template-columns: 1fr;
  }

  .personal-home-hero aside {
    text-align: left;
  }

  .personal-support-context {
    grid-template-columns: 1fr;
  }

  .personal-support-context-form {
    grid-template-columns: 1fr;
  }

  .personal-support-context-form .btn,
  .personal-support-context-exit .btn {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .personal-kpi-grid,
  .personal-performance-grid,
  .personal-team-grid {
    grid-template-columns: 1fr;
  }

  .personal-panel > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .personal-panel-actions {
    justify-content: flex-start;
  }

  .personal-agenda-item,
  .personal-task,
  .personal-due {
    grid-template-columns: 1fr;
  }

  .personal-task em,
  .personal-due em {
    justify-self: flex-start;
  }
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--app-primary) !important;
  box-shadow: 0 0 0 .2rem var(--app-focus-ring) !important;
}

/* Mature UI calibration: shared administrative views */
.app-main :where(h1) {
  color: var(--app-heading);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.18;
}

.app-main :where(h2) {
  color: var(--app-heading);
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}

.app-main :where(h3) {
  color: var(--app-heading);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}

.app-main :where(p, li, label, .form-label, .text-muted, small) {
  line-height: 1.55;
}

.app-main :where(.display-1, .display-2, .display-3, .display-4, .display-5, .display-6) {
  font-size: clamp(1.55rem, 2.8vw, 2.35rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.app-main :where(
  .citas-hero,
  .cita-create-hero,
  .cita-details-hero,
  .citas-dashboard-hero,
  .settings-hero,
  .permissions-hero,
  .about-product-hero,
  .security-users-hero,
  .manual-hero,
  .ncf-hero,
  .ncf-form-hero,
  .b2b-dashboard-hero
) {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-sm) !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--app-primary-soft) 46%, var(--app-surface)), var(--app-surface)) !important;
  color: var(--app-text) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.app-main :where(
  .citas-hero h1,
  .cita-create-hero h1,
  .cita-details-hero h1,
  .citas-dashboard-hero h1,
  .settings-hero h1,
  .permissions-hero h1,
  .about-product-hero h1,
  .security-users-hero h1,
  .manual-hero h1,
  .ncf-hero h1,
  .ncf-form-hero h1,
  .b2b-dashboard-hero h1
) {
  color: var(--app-heading) !important;
  font-size: clamp(1.45rem, 2.4vw, 2.15rem) !important;
  font-weight: 700 !important;
  line-height: 1.18 !important;
}

.app-main :where(
  .citas-hero p,
  .cita-create-hero p,
  .cita-details-hero p,
  .citas-dashboard-hero p,
  .settings-hero p,
  .permissions-hero p,
  .about-product-hero p,
  .security-users-hero p,
  .manual-hero p,
  .b2b-dashboard-hero p
) {
  color: var(--app-muted) !important;
  font-size: .92rem !important;
  line-height: 1.6 !important;
}

.app-main :where(
  .citas-hero span,
  .cita-create-hero span,
  .cita-details-hero span,
  .citas-dashboard-hero span,
  .settings-hero span,
  .permissions-hero span,
  .about-product-hero span,
  .security-users-hero span,
  .manual-kicker,
  .manual-section-head span,
  .manual-step-card span,
  .ncf-code
) {
  font-size: .72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.app-main :where(
  .manual-toc,
  .manual-section,
  .manual-card,
  .manual-step-card,
  .manual-version-card,
  .settings-card,
  .permissions-panel,
  .permission-card,
  .security-users-card,
  .security-users-panel,
  .cita-card,
  .cita-panel,
  .citas-dashboard-card,
  .ncf-panel,
  .ncf-form-panel,
  .ncf-delete-card,
  .factura-agendada-panel,
  .notification-dashboard-card,
  .notification-panel
) {
  border-color: var(--app-border) !important;
  border-radius: var(--app-radius-sm) !important;
  background: var(--app-surface) !important;
  color: var(--app-text) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.app-main :where(.card, .modal-content, .dropdown-menu, .table-responsive, .dataTables_wrapper) {
  border-radius: var(--app-radius-sm) !important;
}

.app-main :where(.table) {
  color: var(--app-text);
  font-size: .9rem;
}

.app-main :where(.table th) {
  color: var(--app-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-main :where(.table td) {
  vertical-align: middle;
}

.app-main :where(.form-control, .form-select, .input-group-text) {
  min-height: 38px;
  border-radius: var(--app-radius-sm) !important;
  font-size: .9rem;
}

.app-main :where(.badge, .badge-pill, .rounded-pill) {
  font-size: .72rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .app-main :where(h1) {
    font-size: clamp(1.32rem, 6vw, 1.75rem);
  }

  .app-main :where(
    .citas-hero,
    .cita-create-hero,
    .cita-details-hero,
    .citas-dashboard-hero,
    .settings-hero,
    .permissions-hero,
    .about-product-hero,
    .security-users-hero,
    .manual-hero,
    .ncf-hero,
    .ncf-form-hero,
    .b2b-dashboard-hero
  ) {
    padding: 1rem !important;
  }

  .app-main :where(
    .citas-hero h1,
    .cita-create-hero h1,
    .cita-details-hero h1,
    .citas-dashboard-hero h1,
    .settings-hero h1,
    .permissions-hero h1,
    .about-product-hero h1,
    .security-users-hero h1,
    .manual-hero h1,
    .ncf-hero h1,
    .ncf-form-hero h1,
    .b2b-dashboard-hero h1
  ) {
    font-size: clamp(1.35rem, 6vw, 1.8rem) !important;
  }
}

/* Dark mode consistency layer */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background: var(--app-bg) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .app-layout,
html[data-theme="dark"] .app-content,
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .container,
html[data-theme="dark"] .container-fluid {
  background-color: transparent;
  color: var(--app-text);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .scheduled-panel,
html[data-theme="dark"] .scheduled-summary-card,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-table-card,
html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .security-users-panel,
html[data-theme="dark"] .miweb-card {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .card.bg-success {
  background-color: var(--app-success) !important;
}

html[data-theme="dark"] .card.bg-primary {
  background-color: var(--app-primary) !important;
}

html[data-theme="dark"] .card.bg-info {
  background-color: var(--app-info) !important;
}

html[data-theme="dark"] .card.bg-warning {
  background-color: var(--app-warning-soft) !important;
}

html[data-theme="dark"] .card.bg-danger {
  background-color: var(--app-danger-soft) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .offcanvas-header,
html[data-theme="dark"] .accordion-header,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-primary,
html[data-theme="dark"] .table-secondary,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .scheduled-lines-head {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] small,
html[data-theme="dark"] .small,
html[data-theme="dark"] .dataTables_info,
html[data-theme="dark"] .dataTables_length,
html[data-theme="dark"] .dataTables_filter {
  color: var(--app-muted) !important;
}

html[data-theme="dark"] .text-primary {
  color: var(--app-primary-dark) !important;
}

html[data-theme="dark"] .text-success {
  color: #86efac !important;
}

html[data-theme="dark"] .text-danger {
  color: #fca5a5 !important;
}

html[data-theme="dark"] .text-warning {
  color: #fde68a !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input,
html[data-theme="dark"] select {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-border-strong) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-primary-dark) !important;
  box-shadow: 0 0 0 .2rem var(--app-focus-ring) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: color-mix(in srgb, var(--app-muted) 80%, transparent) !important;
}

html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-table-border);
  --bs-table-striped-bg: color-mix(in srgb, var(--app-surface-soft) 78%, transparent);
  --bs-table-striped-color: var(--app-text);
  --bs-table-hover-bg: var(--app-table-hover);
  --bs-table-hover-color: var(--app-text);
  color: var(--app-text) !important;
  border-color: var(--app-table-border) !important;
}

html[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent !important;
  border-color: var(--app-table-border) !important;
  color: inherit !important;
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table thead td,
html[data-theme="dark"] .table tfoot th,
html[data-theme="dark"] .table tfoot td {
  background-color: var(--app-table-head) !important;
  color: var(--app-table-head-text) !important;
}

html[data-theme="dark"] .table tbody tr:hover > * {
  background-color: var(--app-table-hover) !important;
}

html[data-theme="dark"] .dataTables_wrapper,
html[data-theme="dark"] .dataTables_wrapper label,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--app-text) !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #fff !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .select2-dropdown {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-border-strong) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-theme="dark"] .select2-results__option {
  color: var(--app-text) !important;
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[data-selected] {
  background-color: var(--app-primary) !important;
  color: #fff !important;
}

html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-outline-secondary {
  background-color: var(--app-surface-soft);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: var(--app-table-hover);
  color: var(--app-text);
}

html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-lg {
  box-shadow: var(--app-shadow-md) !important;
}

html[data-theme="dark"] hr {
  border-color: var(--app-border);
  opacity: 1;
}
.app-menu-module-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  overflow: hidden;
  border-radius: var(--app-radius-sm);
}

.app-menu-module-link,
.app-menu-module-toggle {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--app-text);
  text-decoration: none;
}

.app-menu-module-link {
  min-width: 0;
  gap: 10px;
  padding: 9px 10px;
  font-weight: 700;
}

.app-menu-module-link i {
  width: 20px;
  color: var(--app-primary);
  text-align: center;
}

.app-menu-module-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cita-status {
  justify-self: end;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--cita-color) 22%, var(--app-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--cita-color) 9%, var(--app-surface));
  color: var(--app-text);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.app-menu-module-toggle {
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.app-menu-module-toggle .app-menu-chevron {
  transition: transform 0.18s ease;
}

.app-menu-module-toggle[aria-expanded="true"] .app-menu-chevron {
  transform: rotate(180deg);
}

.app-menu-module-head:hover,
.app-menu-module-head:focus-within,
.app-menu-module-head:has(.app-menu-module-link.active),
.app-menu-module-head:has(.app-menu-module-toggle[aria-expanded="true"]) {
  background: var(--app-primary-soft);
}

.app-menu-module-head:hover .app-menu-module-link,
.app-menu-module-head:focus-within .app-menu-module-link,
.app-menu-module-head:has(.app-menu-module-link.active) .app-menu-module-link,
.app-menu-module-head:has(.app-menu-module-toggle[aria-expanded="true"]) .app-menu-module-link,
.app-menu-module-head:hover .app-menu-module-toggle,
.app-menu-module-head:focus-within .app-menu-module-toggle,
.app-menu-module-head:has(.app-menu-module-toggle[aria-expanded="true"]) .app-menu-module-toggle {
  color: var(--app-primary-dark);
}

.app-menu-group > .collapse > .app-submenu,
.app-menu-group > .collapsing > .app-submenu {
  margin-top: 4px;
}

@media (min-width: 992px) {
  .app-layout.sidebar-collapsed .app-menu-group {
    justify-items: center;
  }

  .app-layout.sidebar-collapsed .app-menu-module-head {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
  }

  .app-layout.sidebar-collapsed .app-menu-module-toggle {
    display: none !important;
  }

  .app-layout.sidebar-collapsed .app-menu-link,
  .app-layout.sidebar-collapsed .app-menu-toggle,
  .app-layout.sidebar-collapsed .app-menu-module-link {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    justify-content: center;
    gap: 0;
    margin-inline: auto;
    padding: 0 !important;
    overflow: hidden;
    white-space: nowrap;
  }

  .app-layout.sidebar-collapsed .app-menu-toggle-label {
    justify-content: center;
    gap: 0;
  }

  .app-layout.sidebar-collapsed .app-brand-text,
  .app-layout.sidebar-collapsed .app-sidebar-user-info,
  .app-layout.sidebar-collapsed .app-menu-link > span,
  .app-layout.sidebar-collapsed .app-menu-link .badge,
  .app-layout.sidebar-collapsed .app-menu-toggle .app-menu-text,
  .app-layout.sidebar-collapsed .app-menu-module-link span,
  .app-layout.sidebar-collapsed .app-menu-chevron,
  .app-layout.sidebar-collapsed .app-sidebar-footer .badge {
    display: none !important;
  }

  .app-layout.sidebar-collapsed .app-menu-link i,
  .app-layout.sidebar-collapsed .app-menu-toggle i:not(.app-menu-chevron),
  .app-layout.sidebar-collapsed .app-menu-module-link i {
    width: 22px;
    margin: 0;
    text-align: center;
    font-size: 1rem;
  }
}

.app-version-pill {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 750;
  box-shadow: var(--app-shadow-sm);
}

.app-version-pill:hover,
.app-version-pill:focus {
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
}

.app-version-pill i {
  color: var(--app-primary);
  text-align: center;
}

.app-version-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-version-pill strong {
  color: var(--app-primary);
  font-size: 0.76rem;
  letter-spacing: 0;
  white-space: nowrap;
}

@media (min-width: 992px) {
  .app-layout.sidebar-collapsed .app-version-pill {
    display: flex;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    margin-inline: auto;
  }

  .app-layout.sidebar-collapsed .app-sidebar-footer {
    padding-inline: 10px;
  }

  .app-layout.sidebar-collapsed .app-version-pill span,
  .app-layout.sidebar-collapsed .app-version-pill strong {
    display: none !important;
  }
}

.about-product-shell {
  display: grid;
  gap: 18px;
}

.about-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 18px;
  align-items: stretch;
  padding: 26px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: linear-gradient(135deg, var(--app-surface), var(--app-surface-soft));
  box-shadow: var(--app-shadow-soft);
}

.about-kicker,
.about-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-primary);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.about-product-hero h1 {
  margin: 10px 0 8px;
  color: var(--app-text);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
}

.about-product-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--app-muted);
  font-size: 1rem;
}

.about-version-card {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
}

.about-version-card span,
.about-version-card small {
  color: var(--app-muted);
  font-weight: 700;
}

.about-version-card strong {
  color: var(--app-primary);
  font-size: 1.6rem;
  font-weight: 900;
}

.about-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.about-panel {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.about-panel-wide {
  grid-column: 1 / -1;
}

.about-panel-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1.25rem;
}

.about-panel h2 {
  margin: 5px 0 6px;
  color: var(--app-text);
  font-size: 1.2rem;
  font-weight: 850;
}

.about-panel p {
  margin: 0;
  color: var(--app-muted);
}

.about-link,
.about-contact-list a {
  color: var(--app-primary);
  font-weight: 800;
  text-decoration: none;
}

.about-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-contact-list a {
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.notification-shell {
  display: grid;
  gap: 18px;
}

.notification-module-dashboard {
  max-width: 1600px;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.notification-header span,
.notification-panel-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-primary);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.notification-header h1,
.notification-panel-head h2 {
  margin: 6px 0 4px;
  color: var(--app-text);
  font-weight: 900;
}

.notification-header p {
  margin: 0;
  color: var(--app-muted);
}

.notification-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.notification-kpis article,
.notification-panel {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.notification-kpis article {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.notification-kpis span {
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.notification-kpis strong {
  color: var(--app-text);
  font-size: 1.5rem;
  font-weight: 900;
}

.notification-ops-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.notification-ops-strip article {
  display: grid;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
}

.notification-ops-strip span,
.notification-ops-strip small {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 800;
}

.notification-ops-strip strong {
  color: var(--app-text);
  font-size: 1.18rem;
  font-weight: 950;
}

.notification-dashboard-grid {
  margin-bottom: 16px;
}

.notification-dashboard-panel {
  min-width: 0;
}

.notification-scroll-panel {
  max-height: min(460px, 58vh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--app-primary) 45%, transparent) transparent;
  scrollbar-width: thin;
}

.notification-scroll-panel::-webkit-scrollbar,
.notification-table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.notification-scroll-panel::-webkit-scrollbar-thumb,
.notification-table-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary) 42%, transparent);
}

.notification-scroll-panel::-webkit-scrollbar-track,
.notification-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.notification-engine-list {
  display: grid;
}

.notification-engine-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--app-border);
}

.notification-engine-item:hover {
  background: rgba(148, 163, 184, .08);
}

.notification-engine-item > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.notification-engine-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.notification-engine-title strong {
  color: var(--app-text);
  font-size: .9rem;
}

.notification-engine-item small,
.notification-engine-item time,
.notification-engine-meta {
  color: var(--app-muted);
}

.notification-engine-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-engine-item time {
  font-size: .75rem;
}

.notification-engine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: .76rem;
  font-weight: 750;
}

.notification-side-stack {
  display: grid;
  gap: 16px;
  padding: 0 16px 16px;
}

.notification-side-stack h3 {
  margin: 0 0 9px;
  color: var(--app-text);
  font-size: .92rem;
  font-weight: 900;
}

.notification-event-legend {
  padding-top: 8px;
}

.notification-event-legend div > span {
  background: var(--app-primary);
}

.notification-table-scroll {
  max-height: min(640px, 66vh);
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--app-surface-strong) 76%, transparent);
  scrollbar-color: color-mix(in srgb, var(--app-primary) 45%, transparent) transparent;
  scrollbar-width: thin;
}

.notification-table-scroll .notification-data-table {
  min-width: 860px;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.notification-table-scroll .notification-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--app-border);
  background: color-mix(in srgb, var(--app-surface) 88%, var(--app-primary-soft));
  white-space: nowrap;
}

.notification-table-scroll .notification-data-table :where(th, td) {
  padding: 12px 14px;
  border-color: var(--app-border);
}

.notification-table-scroll .notification-data-table tbody tr {
  transition: background .16s ease, box-shadow .16s ease;
}

.notification-table-scroll .notification-data-table tbody tr:hover {
  background: color-mix(in srgb, var(--app-primary-soft) 35%, transparent);
}

.notification-table-scroll .notification-data-table td {
  color: var(--app-text);
  font-size: .86rem;
  white-space: nowrap;
}

.notification-table-scroll .notification-data-table td:first-child,
.notification-table-scroll .notification-data-table td:nth-child(3) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-table-scroll .notification-data-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 120px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--app-surface) 82%, transparent), var(--app-surface) 18%);
  box-shadow: -10px 0 16px color-mix(in srgb, var(--app-surface) 80%, transparent);
}

.notification-recipient-table {
  min-width: 1040px;
}

.notification-recipient-table td:first-child {
  max-width: 280px;
  white-space: normal;
}

.notification-preferences-scroll {
  max-height: min(680px, 70vh);
}

.notification-preferences-table {
  width: 100%;
}

.notification-preferences-table th:first-child,
.notification-preferences-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 260px;
  background: var(--app-surface);
  box-shadow: 10px 0 16px color-mix(in srgb, var(--app-surface) 80%, transparent);
}

.notification-preferences-table thead th:first-child {
  z-index: 4;
  background: color-mix(in srgb, var(--app-surface) 88%, var(--app-primary-soft));
}

.notification-table-scroll .notification-preferences-table td:last-child {
  position: static;
  min-width: 0;
  background: transparent;
  box-shadow: none;
}

.notification-email-activity-list .dashboard-activity-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.notification-email-activity-list .dashboard-activity-item > span:not(.dashboard-activity-icon) {
  min-width: 0;
}

.notification-email-activity-list .dashboard-activity-item strong,
.notification-email-activity-list .dashboard-activity-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-email-activity-list .dashboard-activity-item .btn {
  white-space: nowrap;
}

.business360-dashboard {
  max-width: 1600px;
}

.business360-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.business360-brand img {
  width: 58px;
  height: 58px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  object-fit: contain;
  padding: 6px;
}

.business360-brand h1 {
  overflow-wrap: anywhere;
}

.business360-status {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 160px;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
}

.business360-status span,
.business360-status small,
.business360-strip span,
.business360-strip small {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 800;
}

.business360-status strong {
  color: var(--app-primary);
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
}

.business360-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.business360-strip article {
  display: grid;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
}

.business360-strip strong {
  overflow: hidden;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business360-main-grid {
  margin-bottom: 16px;
}

.business360-panel {
  min-width: 0;
}

.business360-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.business360-health-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-soft);
  color: inherit;
  text-decoration: none;
}

.business360-health-item:hover {
  border-color: color-mix(in srgb, var(--app-primary) 36%, var(--app-border));
  color: inherit;
}

.business360-health-item > span,
.business360-shortcuts i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.business360-health-item.is-ok > i {
  color: var(--app-success);
}

.business360-health-item.is-warning > i {
  color: var(--app-warning);
}

.business360-health-item strong,
.business360-shortcuts strong {
  display: block;
  color: var(--app-text);
  font-weight: 900;
}

.business360-health-item small,
.business360-shortcuts small {
  display: block;
  overflow: hidden;
  color: var(--app-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business360-composition {
  display: grid;
  gap: 8px;
  padding: 0 18px 16px;
}

.business360-composition-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--app-border);
}

.business360-composition-row:last-child {
  border-bottom: 0;
}

.business360-composition-row > span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--app-primary);
}

.business360-composition-row .tone-success { background: #16a34a; }
.business360-composition-row .tone-warning { background: #f59e0b; }
.business360-composition-row .tone-danger { background: #dc2626; }
.business360-composition-row .tone-info { background: #0891b2; }

.business360-composition-row small {
  overflow: hidden;
  color: var(--app-muted);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business360-composition-row strong {
  color: var(--app-text);
  font-weight: 950;
}

.business360-shortcuts {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.business360-shortcuts a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-soft);
  color: inherit;
  text-decoration: none;
}

.business360-shortcuts a:hover {
  border-color: color-mix(in srgb, var(--app-primary) 36%, var(--app-border));
  color: inherit;
}

.notification-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.notification-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: start;
}

.notification-panel-main {
  grid-column: 1;
}

.notification-panel-side {
  grid-column: 2;
}

.notification-panel {
  padding: 18px;
}

.notification-form {
  display: grid;
  gap: 18px;
}

.notification-form-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.notification-form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-form-section-title i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--app-radius-sm);
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.notification-form-section-title strong,
.notification-form-section-title span {
  display: block;
}

.notification-form-section-title strong {
  color: var(--app-text);
  font-weight: 850;
}

.notification-form-section-title span {
  color: var(--app-muted);
  font-size: 0.84rem;
}

.notification-check-card {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  font-weight: 750;
}

.notification-template-editor {
  min-height: 260px;
  font-family: Consolas, "Courier New", monospace;
}

.notification-channel-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.notification-panel-head {
  margin-bottom: 12px;
}

.notification-provider-list {
  display: grid;
  gap: 10px;
}

.notification-provider-list article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.notification-provider-list i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.notification-provider-list strong,
.notification-provider-list span {
  display: block;
}

.notification-provider-list span {
  color: var(--app-muted);
  font-size: 0.82rem;
}

.notification-provider-list em {
  color: var(--app-primary);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
}

.notification-decision-list,
.notification-email-list {
  display: grid;
  gap: 12px;
}

.notification-decision-card,
.notification-email-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.notification-decision-card {
  grid-template-columns: 82px minmax(0, 1fr);
}

.notification-decision-date {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 62px;
  padding: 9px;
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--app-primary);
}

.notification-decision-date strong,
.notification-decision-title strong,
.notification-email-title strong {
  color: var(--app-text);
  font-weight: 900;
}

.notification-decision-date span {
  color: var(--app-muted);
  font-size: .8rem;
  font-weight: 800;
}

.notification-decision-body,
.notification-email-card > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.notification-decision-title,
.notification-email-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.notification-decision-card p,
.notification-email-card p {
  margin: 0;
  color: var(--app-muted);
}

.notification-decision-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--app-muted);
  font-size: .82rem;
  font-weight: 750;
}

.notification-decision-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.notification-email-card {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
}

.notification-email-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.notification-center-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: end;
}

.notification-recipient-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(150px, 180px) auto;
  gap: 12px;
  align-items: end;
}

.notification-recipient-email-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.notification-recipient-missing {
  background: color-mix(in srgb, #f59e0b 8%, var(--app-surface));
}

.notification-inbox-list {
  display: grid;
  gap: 10px;
}

.notification-inbox-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
}

.notification-inbox-item.is-unread {
  border-color: color-mix(in srgb, var(--app-primary) 50%, var(--app-border));
  background: color-mix(in srgb, var(--app-primary-soft) 35%, var(--app-surface));
}

.notification-inbox-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.notification-inbox-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-inbox-title strong {
  color: var(--app-text);
  font-weight: 850;
}

.notification-inbox-title i {
  color: #f59e0b;
}

.notification-inbox-item p,
.notification-inbox-item span {
  margin: 2px 0 0;
  color: var(--app-muted);
}

.notification-inbox-item span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
}

.notification-inbox-actions {
  display: flex;
  gap: 6px;
}

.notification-inbox-actions form {
  margin: 0;
}

.notification-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 42px 18px;
  color: var(--app-muted);
  text-align: center;
}

.notification-empty i {
  color: var(--app-primary);
  font-size: 2rem;
}

.notification-empty strong {
  color: var(--app-text);
}

.notification-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.notification-preferences-table th,
.notification-preferences-table td {
  white-space: nowrap;
}

.notification-preferences-table thead th {
  color: var(--app-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.b2b-page,
.b2b-auth-page {
  min-height: 100vh;
  color: var(--app-text);
  background: var(--app-bg);
}

.b2b-hero {
  min-height: 360px;
  background-size: cover;
  background-position: center;
  color: #fff;
}

.b2b-nav,
.b2b-hero-content,
.b2b-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.b2b-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.b2b-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
}

.b2b-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--app-radius-sm);
  background: #fff;
}

.b2b-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.b2b-hero-content {
  padding: 72px 0 54px;
}

.b2b-hero-content h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 950;
}

.b2b-hero-content p {
  max-width: 580px;
  margin: 10px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 1.08rem;
}

.b2b-container {
  padding: 28px 0 56px;
}

.b2b-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
  gap: 12px;
  margin-bottom: 20px;
}

.b2b-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.b2b-product-card,
.b2b-cart-item,
.b2b-orders article,
.b2b-cart-summary,
.b2b-detail,
.b2b-auth-card,
.b2b-admin-shell .app-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.b2b-product-card {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.b2b-product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.b2b-product-card span,
.b2b-product-card small,
.b2b-cart-item span,
.b2b-cart-item small {
  display: block;
  color: var(--app-muted);
  font-size: .82rem;
}

.b2b-product-card h2 {
  margin: 3px 0;
  font-size: 1rem;
  font-weight: 850;
}

.b2b-product-card strong,
.b2b-price {
  display: block;
  color: var(--app-primary);
  font-size: 1.08rem;
  font-weight: 900;
}

.b2b-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.b2b-card-actions form {
  margin: 0;
}

.b2b-toast {
  align-items: center;
  background: #0f5132;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 18px;
  bottom: 30px;
  box-shadow: 0 22px 58px rgba(15, 23, 42, .26);
  color: #fff;
  display: flex;
  gap: 12px;
  font-size: 1rem;
  font-weight: 800;
  left: 50%;
  max-width: calc(100% - 32px);
  opacity: 0;
  padding: 16px 20px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 18px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1080;
}

.b2b-toast i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-size: 1.25rem;
}

.b2b-toast[data-tone="danger"] {
  background: #b42318;
}

.b2b-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.b2b-compact-shell {
  display: grid;
  gap: 16px;
}

.b2b-compact-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.b2b-compact-header span {
  color: var(--app-primary);
  display: inline-flex;
  font-size: .82rem;
  font-weight: 850;
  gap: 8px;
  text-transform: uppercase;
}

.b2b-compact-header h1 {
  color: var(--app-heading);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 950;
  margin: 4px 0;
}

.b2b-compact-header p {
  color: var(--app-muted);
  margin: 0;
}

.b2b-compact-filters {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto auto;
  padding: 14px;
}

.b2b-type-filter {
  align-items: center;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  white-space: nowrap;
}

.b2b-type-filter .btn {
  border-radius: 6px;
  font-size: .86rem;
  font-weight: 800;
  padding: 8px 12px;
}

.b2b-compact-list {
  display: grid;
  gap: 10px;
}

.b2b-compact-product {
  align-items: center;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 14px;
}

.b2b-compact-product h2 {
  color: var(--app-heading);
  font-size: 1rem;
  font-weight: 900;
  margin: 2px 0;
}

.b2b-compact-product span,
.b2b-compact-product small,
.b2b-compact-product-meta small {
  color: var(--app-muted);
  display: block;
}

.b2b-compact-product-meta {
  min-width: 150px;
  text-align: right;
}

.b2b-compact-product-meta strong {
  color: var(--app-primary);
}

.b2b-compact-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.b2b-compact-actions form {
  margin: 0;
}

.b2b-store-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  transition: opacity .15s ease;
}

.b2b-store-grid.is-loading {
  opacity: .45;
  pointer-events: none;
}

.b2b-store-card {
  align-content: start;
  overflow: hidden;
  padding: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.b2b-store-card:hover {
  border-color: color-mix(in srgb, var(--app-primary) 32%, var(--app-border));
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
  transform: translateY(-2px);
}

.b2b-store-image {
  display: block;
  overflow: hidden;
  background: var(--app-surface-soft);
}

.b2b-store-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .22s ease;
}

.b2b-store-card:hover .b2b-store-image img {
  transform: scale(1.035);
}

.b2b-store-body {
  display: grid;
  gap: 7px;
  padding: 14px 14px 0;
}

.b2b-store-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.b2b-store-tags span {
  background: var(--app-primary-soft);
  border-radius: 999px;
  color: var(--app-primary-dark);
  font-size: .72rem;
  font-weight: 850;
  line-height: 1;
  padding: 6px 9px;
}

.b2b-store-card .b2b-card-actions {
  padding: 0 14px 14px;
}

.b2b-product-detail {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(0, 1.05fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: stretch;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow-md);
  overflow: hidden;
}

.b2b-detail-gallery {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  background: linear-gradient(180deg, var(--app-surface-soft), var(--app-surface));
}

.b2b-detail-gallery > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  background: var(--app-surface-soft);
}

.b2b-detail-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.b2b-detail-thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease;
  background: var(--app-surface-soft);
}

.b2b-detail-summary {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: clamp(22px, 4vw, 36px);
}

.b2b-detail-category {
  width: fit-content;
  border-radius: 999px;
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  font-size: .78rem;
  font-weight: 900;
  padding: 8px 12px;
  text-transform: uppercase;
}

.b2b-detail-summary h2 {
  margin: 0;
  color: var(--app-heading, var(--app-text));
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.b2b-detail-code {
  margin: 0;
  color: var(--app-muted);
  font-weight: 750;
}

.b2b-detail-price {
  color: var(--app-primary);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 950;
}

.b2b-detail-stock {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  width: fit-content;
  margin: 0;
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 850;
}

.b2b-detail-stock.is-available {
  background: #ecfdf3;
  color: #027a48;
}

.b2b-detail-stock.is-empty {
  background: #fef3f2;
  color: #b42318;
}

.b2b-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.b2b-detail-variants {
  display: grid;
  gap: 12px;
}

.b2b-compact-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.b2b-compact-kpi {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--app-text);
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 16px;
  text-decoration: none;
}

.b2b-compact-kpi span {
  align-items: center;
  background: var(--app-primary-soft);
  border-radius: 10px;
  color: var(--app-primary);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.b2b-compact-kpi.tone-info span {
  background: color-mix(in srgb, var(--app-info, #0ea5e9) 16%, transparent);
  color: var(--app-info, #0ea5e9);
}
.b2b-compact-kpi.tone-success span {
  background: color-mix(in srgb, var(--app-success, #16a34a) 16%, transparent);
  color: var(--app-success, #16a34a);
}
.b2b-compact-kpi.tone-warning span {
  background: color-mix(in srgb, var(--app-warning, #d97706) 16%, transparent);
  color: var(--app-warning, #d97706);
}

.b2b-compact-kpi small {
  color: var(--app-muted);
  font-weight: 750;
}

.b2b-compact-kpi strong {
  color: var(--app-heading);
  font-size: 1.8rem;
  line-height: 1;
}

.b2b-compact-panel {
  padding: 18px;
}

.b2b-cart-item-compact {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.b2b-detail {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 22px;
  padding: 18px;
}

.b2b-detail-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.b2b-detail-info h1 {
  font-weight: 950;
}

.b2b-dashboard-hero {
  min-height: 320px;
}

.b2b-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: -42px;
  margin-bottom: 22px;
  position: relative;
  z-index: 2;
}

.b2b-dashboard-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--app-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 138px;
  padding: 18px;
  text-decoration: none;
}

.b2b-dashboard-card span {
  align-items: center;
  background: var(--app-primary-soft);
  border-radius: 12px;
  color: var(--app-primary);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.b2b-dashboard-card small {
  color: var(--app-muted);
  font-weight: 700;
}

.b2b-dashboard-card strong {
  color: var(--app-heading);
  font-size: 2rem;
  line-height: 1;
}

.b2b-dashboard-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 22px;
}

.b2b-panel-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.b2b-panel-header span {
  color: var(--app-primary);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.b2b-panel-header h2 {
  color: var(--app-heading);
  font-size: 1.35rem;
  margin: 0;
}

.b2b-dashboard-list {
  display: grid;
  gap: 10px;
}

.b2b-dashboard-list article {
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  padding: 14px;
}

.b2b-dashboard-list article strong,
.b2b-dashboard-list article b {
  color: var(--app-heading);
}

.b2b-dashboard-list article span {
  color: var(--app-muted);
  display: block;
  font-size: .9rem;
}

.b2b-variants {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.b2b-variant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 90px auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.b2b-cart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}

.b2b-cart-list {
  display: grid;
  gap: 12px;
}

.b2b-cart-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.b2b-cart-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--app-radius-sm);
}

.b2b-cart-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.b2b-cart-summary div {
  display: flex;
  justify-content: space-between;
}

.b2b-cart-summary .total {
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
  font-size: 1.1rem;
}

.b2b-empty {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px dashed var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-muted);
  text-align: center;
}

.b2b-auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.b2b-auth-card {
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
}

.b2b-auth-card h1 {
  margin: 0;
  font-weight: 950;
}

.b2b-auth-back {
  color: var(--app-muted);
  text-decoration: none;
  font-weight: 800;
}

.b2b-auth-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1.5rem;
}

.b2b-auth-input {
  position: relative;
}

.b2b-auth-input i {
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--app-muted);
}

.b2b-auth-input input {
  padding-left: 36px;
}

.b2b-orders {
  display: grid;
  gap: 12px;
}

.b2b-orders article {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.b2b-orders span,
.b2b-orders small {
  display: block;
  color: var(--app-muted);
}

.b2b-admin-shell {
  display: grid;
  gap: 18px;
}

.b2b-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: 18px;
  align-items: start;
}

.b2b-admin-shell .app-card {
  padding: 18px;
}

.b2b-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.b2b-switch {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  font-weight: 750;
}

/* ============================================================
   Catalogo moderno: buscador, chips de categoria/tipo y orden.
   ============================================================ */

.b2b-store-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  margin-bottom: 18px;
}

.b2b-store-search {
  position: relative;
  display: flex;
  align-items: center;
}

.b2b-store-search i {
  position: absolute;
  left: 14px;
  color: var(--app-muted);
  font-size: 1.05rem;
  pointer-events: none;
}

.b2b-store-search input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-size: .95rem;
}

.b2b-store-search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--app-primary) 45%, var(--app-border));
  background: var(--app-surface);
}

.b2b-store-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.b2b-chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.b2b-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-size: .85rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}

.b2b-chip:hover {
  border-color: color-mix(in srgb, var(--app-primary) 40%, var(--app-border));
  transform: translateY(-1px);
}

.b2b-chip.is-active {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: #fff;
}

.b2b-store-sort {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.b2b-store-sort select {
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-soft);
  color: var(--app-text);
  padding: 8px 14px;
  font-size: .85rem;
  font-weight: 750;
}

.b2b-store-card {
  position: relative;
}

.b2b-store-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.b2b-store-badge.is-agotado {
  background: color-mix(in srgb, var(--app-danger, #dc2626) 90%, black 0%);
  color: #fff;
}

.b2b-store-badge.is-nuevo {
  background: var(--app-primary);
  color: #fff;
}

/* ============================================================
   Footer del portal.
   ============================================================ */

.b2b-public-footer {
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
  margin-top: 40px;
  padding: 28px 0;
}

.b2b-public-footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--app-muted);
  font-size: .85rem;
}

.b2b-public-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--app-text);
}

.b2b-public-footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.b2b-public-footer-links a {
  color: var(--app-muted);
  text-decoration: none;
}

.b2b-public-footer-links a:hover {
  color: var(--app-primary);
}

@media (max-width: 720px) {
  .b2b-store-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .b2b-store-sort {
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  .about-product-hero,
  .about-product-grid,
  .notification-ops-strip,
  .business360-strip,
  .business360-health-grid,
  .notification-grid,
  .notification-dashboard-layout,
  .notification-decision-card,
  .notification-center-filters,
  .notification-recipient-filters,
  .notification-recipient-email-form,
  .cita-create-grid,
  .cita-schedule-grid,
  .cita-modality-panel,
  .cita-contact-grid,
  .cita-details-grid,
  .cita-details-overview,
  .cita-status-panel,
  .cita-reschedule-grid,
  .citas-dashboard-kpis,
  .citas-dashboard-strip,
  .citas-dashboard-grid,
  .notification-inbox-item,
  .b2b-filters,
  .b2b-compact-filters,
  .b2b-compact-product,
  .b2b-compact-kpis,
  .b2b-product-detail,
  .b2b-dashboard-grid,
  .b2b-detail,
  .b2b-cart,
  .b2b-admin-grid,
  .b2b-variant-row,
  .b2b-cart-item {
    grid-template-columns: 1fr;
  }

  .notification-header {
    align-items: stretch;
    flex-direction: column;
  }

  .notification-panel-main,
  .notification-panel-side {
    grid-column: auto;
  }

  .notification-decision-date {
    justify-items: start;
  }

  .notification-engine-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .notification-engine-item time {
    grid-column: 2;
  }

  .business360-header {
    align-items: stretch;
  }

  .business360-status {
    justify-items: start;
  }

  .cita-create-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .cita-details-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .citas-dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .cita-create-hero-actions,
  .cita-create-hero-actions .btn,
  .cita-details-hero-actions,
  .cita-details-hero-actions .btn,
  .citas-dashboard-actions,
  .citas-dashboard-actions .btn {
    width: 100%;
  }

  .cita-create-side,
  .cita-details-side {
    position: static;
  }

  .cita-status-pill {
    width: 100%;
  }

  .cita-status-panel .btn {
    width: 100%;
  }

  .cita-dashboard-item,
  .citas-dashboard-list.compact .cita-dashboard-item {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .cita-dashboard-status {
    grid-column: 2;
    justify-self: start;
  }

  .cita-quick-states,
  .cita-quick-states form,
  .cita-quick-states .btn {
    width: 100%;
  }

  .cita-modality-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cita-modality-chip {
    width: 100%;
  }

  .b2b-panel-header,
  .b2b-dashboard-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .b2b-dashboard-grid {
    margin-top: 16px;
  }

  .b2b-compact-header,
  .b2b-compact-product,
  .b2b-cart-item-compact {
    align-items: stretch;
  }

  .b2b-compact-header {
    flex-direction: column;
  }

  .b2b-compact-product-meta {
    text-align: left;
  }

  .b2b-type-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    white-space: normal;
    width: 100%;
  }

  .b2b-public-nav,
  .b2b-public-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .b2b-public-actions,
  .b2b-public-actions .btn,
  .b2b-logout-form {
    width: 100%;
  }

  .b2b-public-brand {
    align-self: flex-start;
  }

  .b2b-detail-actions,
  .b2b-detail-actions .btn {
    width: 100%;
  }
}
/* Seguridad - usuarios */
.security-users-shell {
  display: grid;
  gap: 18px;
  max-width: 1600px;
  margin: 0 auto;
}

.security-users-hero,
.security-users-panel,
.security-users-toolbar,
.security-users-note {
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.security-users-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: var(--app-radius);
}

.security-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-primary);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.security-users-hero h1 {
  margin: 6px 0 6px;
  color: var(--app-text);
  font-size: clamp(2rem, 3vw, 3.1rem);
  font-weight: 950;
  letter-spacing: 0;
}

.security-users-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--app-muted);
}

.security-users-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.security-alert {
  margin: 0;
  border-radius: var(--app-radius-sm);
}

.security-users-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.security-users-kpis article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 5px 12px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.security-users-kpis i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1.25rem;
}

.security-users-kpis span {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 850;
}

.security-users-kpis strong {
  color: var(--app-text);
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
}

.security-users-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(170px, .7fr));
  gap: 12px;
  padding: 14px;
  border-radius: var(--app-radius);
}

.security-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  color: var(--app-muted);
}

.security-search input,
.security-users-toolbar select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  color: var(--app-text);
  font-weight: 750;
}

.security-search input {
  min-height: auto;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.security-users-toolbar select {
  padding: 0 12px;
}

.security-users-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--app-radius-sm);
  color: #92400e;
  background: #fffbeb;
}

.security-users-note i {
  color: #d97706;
}

.security-users-panel {
  overflow: hidden;
  border-radius: var(--app-radius);
}

.security-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--app-border);
}

.security-panel-head span {
  color: var(--app-primary);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.security-panel-head h2 {
  margin: 4px 0 0;
  color: var(--app-text);
  font-size: 1.4rem;
  font-weight: 950;
}

.security-panel-head strong {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: .8rem;
}

.security-users-table-wrap {
  max-height: min(720px, 72vh);
  overflow: auto;
  scrollbar-color: color-mix(in srgb, var(--app-primary) 45%, transparent) transparent;
  scrollbar-width: thin;
}

.security-users-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.security-users-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary) 42%, transparent);
}

.security-users-table {
  width: 100%;
  min-width: 1520px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.security-user-col {
  width: 330px;
}

.security-role-col {
  width: 210px;
}

.security-branch-col {
  width: 300px;
}

.security-status-col {
  width: 150px;
}

.security-rules-col {
  width: 240px;
}

.security-session-col {
  width: 175px;
}

.security-actions-col {
  width: 420px;
}

.security-users-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 13px 18px;
  border-bottom: 1px solid var(--app-border);
  background: color-mix(in srgb, var(--app-surface) 88%, var(--app-primary-soft));
  color: var(--app-muted);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.security-users-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
  vertical-align: middle;
}

.security-users-table thead th:last-child,
.security-users-table tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: linear-gradient(90deg, color-mix(in srgb, var(--app-surface) 82%, transparent), var(--app-surface) 20%);
  box-shadow: -12px 0 18px color-mix(in srgb, var(--app-surface) 82%, transparent);
}

.security-users-table thead th:last-child {
  z-index: 5;
  background: color-mix(in srgb, var(--app-surface) 88%, var(--app-primary-soft));
}

.security-users-table tbody tr:hover td {
  background: color-mix(in srgb, var(--app-primary-soft) 35%, transparent);
}

.security-user-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.security-user-identity > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 950;
}

.security-user-identity strong {
  display: block;
  max-width: 240px;
  overflow: hidden;
  color: var(--app-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-user-identity small,
.security-assignment-list small {
  display: block;
  color: var(--app-muted);
}

.security-chip-list,
.security-state-stack,
.security-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.security-chip-list {
  align-content: flex-start;
  max-width: 180px;
}

.security-chip,
.security-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: nowrap;
}

.security-chip-primary {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.security-assignment-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 270px;
}

.security-assignment-list > span:not(.security-empty-assignment) {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 3px solid var(--app-primary-soft);
}

.security-assignment-list strong {
  display: block;
  overflow: hidden;
  color: var(--app-text);
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-empty-assignment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #92400e;
  font-weight: 850;
  white-space: nowrap;
}

.security-state-success {
  background: #dcfce7;
  color: #166534;
}

.security-state-danger {
  background: #fee2e2;
  color: #991b1b;
}

.security-state-warning {
  background: #fef3c7;
  color: #92400e;
}

.security-state-info {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.security-rule-summary {
  display: block;
  max-width: 210px;
  color: var(--app-muted);
  font-size: .74rem;
  font-weight: 750;
  line-height: 1.3;
}

.security-row-actions {
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}

.security-row-actions form {
  margin: 0;
}

.security-row-actions .btn {
  flex: 0 0 auto;
  min-width: 74px;
}

.security-empty-results {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 34px;
  color: var(--app-muted);
  text-align: center;
}

.security-empty-results i {
  color: var(--app-primary);
  font-size: 1.7rem;
}

.security-empty-results strong {
  color: var(--app-text);
}

.security-access-config {
  margin-top: 16px;
}

.security-access-form {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) 1.25fr .65fr 1.25fr .55fr .55fr;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

.security-toggle-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 13px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  cursor: pointer;
}

.security-toggle-card input {
  grid-row: 1 / span 2;
  margin-top: 4px;
}

.security-toggle-card span {
  display: none;
}

.security-toggle-card strong {
  color: var(--app-text);
  font-size: .9rem;
}

.security-toggle-card small {
  color: var(--app-muted);
}

.security-days {
  grid-column: 1 / -2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.security-days > span {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.security-days label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface);
  color: var(--app-text);
  font-size: .78rem;
  font-weight: 850;
}

.security-access-actions {
  display: flex;
  justify-content: flex-end;
}

.security-access-inheritance {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 18px;
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 800;
}

.security-access-inheritance span,
.security-access-inheritance strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-soft);
}

.security-access-inheritance span {
  color: var(--app-primary);
}

.security-support-context {
  display: grid;
  gap: 14px;
}

.security-support-context .security-panel-head p {
  margin: 4px 0 0;
  color: var(--app-muted);
  font-size: .86rem;
  font-weight: 650;
}

.security-support-context-body,
.security-support-context-form,
.security-support-context-exit {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.security-support-context-body {
  padding: 0 18px 18px;
  justify-content: space-between;
}

.security-support-context-form {
  flex: 1 1 620px;
}

.security-support-context-form > div {
  flex: 1 1 220px;
}

.security-support-context-exit {
  flex: 0 0 auto;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: .82rem;
  font-weight: 800;
}

.security-global-assignment {
  color: var(--app-primary);
}

.tenant-context-shell {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
}

.tenant-context-card {
  width: min(860px, 100%);
  display: grid;
  gap: 22px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--app-primary-soft) 55%, transparent), transparent 48%),
    var(--app-surface);
  box-shadow: var(--app-shadow);
}

.tenant-context-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 1.8rem;
}

.tenant-context-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--app-primary);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tenant-context-card h1 {
  margin: 0;
  color: var(--app-text);
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 0;
}

.tenant-context-card p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--app-muted);
  font-size: .98rem;
}

.tenant-context-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.tenant-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 900px) {
  .tenant-context-form {
    grid-template-columns: 1fr;
  }
}

.security-user-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.security-rules-modal .security-days {
  grid-column: 1 / -1;
}

.security-users-modal {
  z-index: 1085;
}

body.security-users-modal-open .modal-backdrop.show {
  opacity: .32;
  backdrop-filter: blur(2px);
}

body.security-users-modal-open .modal-content {
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.security-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  gap: 18px;
}

.security-company-list,
.security-quick-actions,
.security-compact-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.security-company-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
}

.security-company-card strong,
.security-role-card strong {
  display: block;
  color: var(--app-text);
  font-weight: 900;
}

.security-company-card small,
.security-role-card small {
  color: var(--app-muted);
}

.security-company-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.security-company-usage span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: .76rem;
  font-weight: 850;
}

.security-quick-actions a,
.security-compact-list a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.security-quick-actions a:hover,
.security-compact-list a:hover,
.security-role-card:hover {
  transform: translateY(-1px);
  border-color: var(--app-primary);
  box-shadow: var(--app-shadow-soft);
}

.security-quick-actions i,
.security-compact-list a > span,
.security-role-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.security-quick-actions strong,
.security-compact-list strong {
  display: block;
  color: var(--app-text);
  font-weight: 900;
}

.security-quick-actions small,
.security-compact-list small {
  color: var(--app-muted);
}

.security-role-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

.security-roles-toolbar {
  grid-template-columns: minmax(260px, 1fr);
}

.security-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.security-role-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-soft);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.security-role-card .security-row-actions {
  min-width: 0;
  justify-content: flex-end;
}

@media (max-width: 1100px) {
  .security-users-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .security-users-actions {
    justify-content: flex-start;
  }

  .security-users-kpis,
  .security-users-toolbar,
  .security-access-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .security-search {
    grid-column: 1 / -1;
  }

  .security-days,
  .security-access-actions {
    grid-column: 1 / -1;
  }

  .security-home-grid,
  .security-role-grid {
    grid-template-columns: 1fr;
  }

  .security-company-card,
  .security-role-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .security-company-card > div:first-child {
    grid-column: 1 / -1;
  }

  .security-company-card > .d-flex,
  .security-role-card .security-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .security-users-table-wrap {
    max-height: none;
    overflow: visible;
  }

  .security-users-table,
  .security-users-table thead,
  .security-users-table tbody,
  .security-users-table tr,
  .security-users-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .security-users-table thead {
    display: none;
  }

  .security-users-table tbody tr {
    display: grid;
    gap: 12px;
    margin: 12px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-sm);
  }

  .security-users-table tbody td,
  .security-users-table thead th:last-child,
  .security-users-table tbody td:last-child {
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .security-user-identity,
  .security-assignment-list,
  .security-row-actions {
    min-width: 0;
  }

  .security-row-actions {
    justify-content: flex-start;
  }

  .security-rule-summary {
    max-width: 100%;
  }

  .security-user-rules-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .security-users-hero,
  .security-users-panel,
  .security-users-toolbar {
    border-radius: var(--app-radius-sm);
  }

  .security-users-kpis,
  .security-users-toolbar,
  .security-access-form {
    grid-template-columns: 1fr;
  }

  .security-search {
    grid-column: auto;
  }

  .security-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .security-role-create {
    grid-template-columns: 1fr;
  }

  .security-role-create .btn {
    width: 100%;
  }
}

/* Dark mode final overrides: keep later module styles aligned with the active theme. */
html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .app-layout,
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .app-content {
  background: var(--app-bg) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .app-topbar,
html[data-theme="dark"] .app-menu-module,
html[data-theme="dark"] .app-menu-module-head,
html[data-theme="dark"] .app-menu-submenu,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-table-card,
html[data-theme="dark"] .scheduled-panel,
html[data-theme="dark"] .scheduled-summary-card,
html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .security-users-panel,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .list-group-item {
  background-color: var(--app-surface) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .app-menu-module-link,
html[data-theme="dark"] .app-menu-module-toggle,
html[data-theme="dark"] .app-menu-submenu a,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .table,
html[data-theme="dark"] .table > :not(caption) > * > *,
html[data-theme="dark"] .security-users-table tbody td {
  color: var(--app-text) !important;
}

html[data-theme="dark"] .app-menu-submenu a:hover,
html[data-theme="dark"] .app-menu-submenu a.active,
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .security-users-table tbody tr:hover td {
  background-color: var(--app-table-hover) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .security-users-table thead th {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
  background-color: var(--app-surface-soft) !important;
  border-color: var(--app-border-strong) !important;
  color: var(--app-text) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] small,
html[data-theme="dark"] .dataTables_info,
html[data-theme="dark"] .dataTables_length,
html[data-theme="dark"] .dataTables_filter {
  color: var(--app-muted) !important;
}

/* Final corporate palette bridge for Bootstrap semantic utilities. */
.btn-primary,
.bg-primary,
.badge.bg-primary,
.progress-bar,
.page-item.active .page-link,
.nav-pills .nav-link.active,
.list-group-item.active {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--app-primary-dark) !important;
  border-color: var(--app-primary-dark) !important;
}

.btn-outline-primary {
  border-color: var(--app-primary) !important;
  color: var(--app-primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #fff !important;
}

.text-primary,
.page-link {
  color: var(--app-primary) !important;
}

.border-primary {
  border-color: var(--app-primary) !important;
}

.alert-primary,
.bg-primary-subtle {
  background-color: var(--app-primary-soft) !important;
  border-color: color-mix(in srgb, var(--app-primary) 28%, var(--app-border)) !important;
  color: var(--app-primary-dark) !important;
}

.form-check-input:checked {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
}
