:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #eef1f4;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef1f4;
}

.login-page {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 69% 48%, rgba(255, 222, 166, 0.95) 0 2%, transparent 8%),
    radial-gradient(circle at 74% 45%, rgba(255, 255, 255, 0.14), transparent 13%),
    linear-gradient(115deg, rgba(9, 16, 29, 0.98), rgba(19, 30, 88, 0.94) 52%, rgba(5, 44, 65, 0.96)),
    linear-gradient(340deg, rgba(195, 145, 26, 0.86), transparent 42%);
  overflow: hidden;
}

.login-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 420px);
  align-items: center;
  gap: 42px;
  width: min(940px, calc(100% - 36px));
  min-height: 460px;
  padding: 44px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(6, 11, 22, 0.78), rgba(9, 29, 57, 0.42)),
    radial-gradient(circle at 75% 48%, rgba(255, 231, 180, 0.28), transparent 14%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.login-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(100deg, transparent 0 58%, rgba(255, 255, 255, 0.12) 58% 59%, transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 45%);
  pointer-events: none;
}

.login-copy {
  position: relative;
  color: #ffffff;
}

.login-copy p {
  margin: 0 0 8px;
  color: #9fd2ff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1;
}

.login-copy span {
  display: block;
  max-width: 360px;
  color: #d8e4ef;
  font-size: 16px;
  line-height: 1.55;
}

.login-box {
  position: relative;
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 28px;
  border-radius: 4px;
  background: rgba(8, 14, 25, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
}

.login-box h2 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.login-field {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0;
  align-items: stretch;
}

.login-field span {
  display: grid;
  place-items: center;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.78);
  color: #20344f;
  font-weight: 800;
}

.login-box .login-field input {
  min-height: 42px;
  border-left: 0;
  border-radius: 0;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.login-box button {
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #274362;
}

.login-box button:hover {
  background: #ffffff;
}

.app-shell {
  min-height: 100vh;
}

.side-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 82px;
  height: calc(100vh - 40px);
  overflow: hidden auto;
  padding: 18px 10px;
  border: 1px solid #cfd5db;
  border-radius: 20px;
  background: #f5f6f7;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  transition: width 0.25s ease, box-shadow 0.25s ease;
}

.side-menu:hover {
  width: 230px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
}

.menu-items {
  display: grid;
  gap: 10px;
}

.side-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #707981;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.side-menu a:hover {
  transform: translateX(5px);
}

.side-menu a.active {
  background: #78a800;
  color: #111111;
}

.menu-icon {
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.menu-text {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.side-menu:hover .menu-text {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto 0 126px;
  padding: 28px 0 40px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.app-header {
  align-items: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: #39736f;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.metric {
  min-width: 190px;
  padding: 16px 18px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.metric-inline {
  width: fit-content;
  margin-bottom: 18px;
}

.metric-label {
  display: block;
  margin-bottom: 4px;
  color: #5d6b78;
  font-size: 13px;
}

.metric strong {
  font-size: 32px;
}

.logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 0;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: #d64045;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.logout:hover {
  background: #b92f34;
}

.logout-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logout-form {
  margin: 0;
}

.session-user {
  color: #435160;
  font-size: 14px;
  font-weight: 700;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr)) repeat(3, minmax(220px, 1.3fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.results-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.results-bar .metric-inline {
  margin-bottom: 0;
}

.results-bar form {
  margin: 0;
}

.export-btn {
  background: #1d4f91;
}

.export-btn:hover {
  background: #173f74;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.clear-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid #c7d0d9;
  border-radius: 6px;
  background: #ffffff;
  color: #34434f;
  font-weight: 700;
  text-decoration: none;
}

.clear-btn:hover {
  background: #f2f5f7;
}

.shortcut-btn {
  background: #eef4f3;
  color: #22665f;
  border: 1px solid #c9d9d6;
}

.shortcut-btn:hover {
  background: #dcebe8;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 18px;
}

.active-filters span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #c9d9d6;
  border-radius: 6px;
  background: #eef4f3;
  color: #22665f;
  font-size: 13px;
  font-weight: 700;
}

.welcome-panel {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: 34px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.welcome-panel h2 {
  margin: 0;
  color: #1f2933;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
}

.review-box {
  max-width: 760px;
  padding: 18px;
  border-left: 4px solid #78a800;
  background: #f6f8fa;
}

.review-box h3 {
  margin: 0 0 8px;
  color: #263342;
  font-size: 18px;
}

.review-box p {
  margin: 0;
  color: #5d6875;
  line-height: 1.55;
}

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}

.endpoint-card {
  display: grid;
  gap: 8px;
  padding: 24px;
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
}

.endpoint-card span {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.endpoint-card strong {
  font-size: 48px;
  line-height: 1;
}

.endpoint-card.online {
  background: #217f72;
}

.endpoint-card.offline {
  background: #c4474c;
}

label {
  display: grid;
  gap: 7px;
  color: #435160;
  font-size: 13px;
  font-weight: 700;
}

.field-help {
  color: #6b7885;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c7d0d9;
  border-radius: 6px;
  padding: 8px 10px;
  color: #1c2733;
  font: inherit;
}

textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid #c7d0d9;
  border-radius: 6px;
  padding: 9px 10px;
  color: #1c2733;
  font: inherit;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c7d0d9;
  border-radius: 6px;
  padding: 8px 10px;
  color: #1c2733;
  background: #ffffff;
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 22px;
  background: #22665f;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #184f4a;
}

.alert,
.empty {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff8e5;
  color: #684b00;
}

.alert {
  background: #fff0f0;
  color: #8f1d1d;
}

.flash {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
}

.flash-success {
  background: #d8f3dc;
  color: #1b4332;
}

.flash-error {
  background: #ffe5e5;
  color: #9d0208;
}

.instance-grid {
  display: grid;
  gap: 18px;
}

.panel {
  overflow: auto;
  padding: 18px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.panel h2 {
  margin: 0 0 14px;
  color: #1c2733;
  font-size: 20px;
}

.form-panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.form-panel h2 {
  margin: 0 0 14px;
  color: #1c2733;
  font-size: 20px;
}

.number-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 18px;
}

.number-form,
.sync-form {
  display: grid;
  gap: 14px;
  align-content: start;
}

.sync-form p {
  margin: 0;
  color: #5d6b78;
  line-height: 1.45;
}

.welcome-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.welcome-title-row h2 {
  margin: 0;
}

.theme-filter {
  width: min(260px, 100%);
}

.theme-filter label {
  gap: 6px;
}

.theme-filter select {
  min-height: 38px;
}

.panel-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title-row h2 {
  margin: 0;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: #5d6b78;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.webhook-panel form {
  margin: 0;
}

.webhook-jid {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.webhook-url {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.number-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.number-search-form label {
  min-width: 220px;
}

.number-search-form input {
  min-height: 38px;
}

.number-search-form button,
.number-search-form .clear-btn {
  min-height: 38px;
  padding: 0 14px;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-label input {
  width: 16px;
  min-height: 16px;
}

.permissions-box {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
}

.permissions-box legend {
  padding: 0 6px;
  color: #435160;
  font-size: 13px;
  font-weight: 700;
}

.permissions-box label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permissions-box input {
  width: 16px;
  min-height: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.secondary-link {
  color: #22665f;
  font-weight: 700;
  text-decoration: none;
}

.secondary-link:hover {
  text-decoration: underline;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions-cell form {
  margin: 0;
}

.actions-cell button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.danger-btn {
  background: #d64045;
}

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

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.badge-online {
  background: #2a9d8f;
}

.badge-offline {
  background: #e63946;
}

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #f8fafc;
}

.bulk-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-actions input,
.chk-instancia {
  width: 16px;
  min-height: 16px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pagination form {
  margin: 0;
}

.pagination button {
  min-width: 42px;
  min-height: 38px;
  padding: 0 12px;
  background: #ffffff;
  color: #22665f;
  border: 1px solid #c9d9d6;
}

.pagination button.active {
  background: #22665f;
  color: #ffffff;
}

.stats-form {
  display: grid;
  gap: 12px;
}

.stats-form .panel {
  padding: 16px;
}

.stats-form .panel h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.stats-tabs {
  display: grid;
  gap: 10px;
}

.stats-tab-dropdown {
  max-width: 320px;
}

.stats-tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-tab-buttons button {
  min-height: 34px;
  padding: 0 12px;
  background: #eef4f3;
  color: #52636f;
  border: 1px solid #c9d9d6;
  font-size: 13px;
}

.stats-tab-buttons button.active {
  background: #22665f;
  color: #ffffff;
}

.stats-tab-panel {
  display: none;
}

.stats-tab-panel.active {
  display: block;
}

.dual-listbox {
  display: grid;
  grid-template-columns: 280px 40px 280px;
  gap: 8px;
  align-items: center;
}

.dual-listbox select {
  min-height: 140px;
  font-size: 13px;
}

.stats-ranges {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(280px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.dual-actions {
  display: grid;
  gap: 6px;
}

.dual-actions button {
  width: 34px;
  min-width: 34px;
  min-height: 28px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.date-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.date-shortcuts button {
  min-height: 32px;
  padding: 0 12px;
  background: #eef4f3;
  color: #22665f;
  border: 1px solid #c9d9d6;
  font-size: 13px;
}

.date-shortcuts button:hover {
  background: #dcebe8;
}

.date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 220px));
  gap: 12px;
}

.time-range {
  grid-template-columns: repeat(2, minmax(120px, 160px));
}

.stats-mode {
  display: flex;
  justify-content: flex-end;
}

.stats-mode label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 8px 12px;
  border: 1px solid #c9d9d6;
  border-radius: 6px;
  background: #ffffff;
  color: #34434f;
  font-weight: 700;
}

.stats-mode input {
  width: auto;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.report-card {
  display: grid;
  gap: 14px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.report-card h3 {
  margin: 0;
  color: #1c2733;
  font-size: 17px;
}

.report-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.report-card-actions button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.report-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-selector button {
  min-height: 34px;
  padding: 0 12px;
  background: #eef4f3;
  color: #52636f;
  border: 1px solid #c9d9d6;
  font-size: 13px;
}

.report-selector button.active {
  background: #22665f;
  color: #ffffff;
}

.report-section {
  display: grid;
  gap: 12px;
}

.report-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-title-row h2 {
  margin: 0;
}

.report-title-row .export-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.stats-summary-row > td {
  padding: 0;
}

.stats-detail summary {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr 0.8fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.stats-detail summary::-webkit-details-marker {
  display: none;
}

.stats-detail summary span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-expand-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #c9d9d6;
  border-radius: 6px;
  color: #22665f;
  font-size: 12px;
  font-weight: 700;
}

.stats-detail[open] .stats-expand-label {
  font-size: 0;
}

.stats-detail[open] .stats-expand-label::before {
  content: "- Detalle";
  font-size: 12px;
}

.stats-detail summary span:first-child,
.stats-detail summary span:nth-child(2),
.stats-detail summary span:nth-child(3),
.stats-detail summary span:nth-child(4),
.stats-detail summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stats-detail-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid #d8e0e6;
  background: #f7fbfa;
}

.stats-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stats-detail-meta span {
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef4f3;
  color: #34434f;
  font-size: 13px;
}

.stats-detail-export {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.stats-detail-table th {
  position: static;
}

.stats-conversation-detail > summary {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.85fr 0.85fr 0.6fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.stats-conversation-detail > summary::-webkit-details-marker {
  display: none;
}

.stats-conversation-detail > summary span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-conversation-expand-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #c9d9d6;
  border-radius: 6px;
  color: #22665f;
  font-size: 12px;
  font-weight: 700;
}

.stats-conversation-detail[open] .stats-conversation-expand-label {
  font-size: 0;
}

.stats-conversation-detail[open] .stats-conversation-expand-label::before {
  content: "- Chat";
  font-size: 12px;
}

.stats-conversation-detail > summary span,
.stats-conversation-detail > summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stats-conversation-detail .stats-detail-table td:last-child {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.stats-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
}

.stats-pagination span {
  color: #536470;
  font-size: 13px;
}

.stats-pagination button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #c9d9d6;
  border-radius: 6px;
  background: #ffffff;
  color: #22665f;
  font-size: 13px;
  font-weight: 700;
}

.stats-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.quick-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.quick-card span {
  color: #677782;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.quick-card strong {
  color: #1c2733;
  font-size: 15px;
}

.quick-card p {
  margin: 0;
  color: #22665f;
  font-size: 20px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.quick-card-small-text p {
  color: #34434f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.quick-card-wide {
  grid-column: span 3;
}

.quick-card-list p {
  color: #34434f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.graph-filter-summary {
  display: grid;
  gap: 10px;
}

.graph-filter-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.graph-filter-line span {
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef4f3;
  color: #34434f;
  font-size: 13px;
}

.graph-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.graph-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.graph-panel {
  min-height: 280px;
}

.graph-wide {
  grid-column: 1 / -1;
}

.line-chart {
  min-height: 230px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: linear-gradient(#ffffff, #f7fbfa);
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 230px;
}

.line-chart polyline {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-total {
  stroke: #22665f;
}

.line-unique {
  stroke: #b9852f;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: #536470;
  font-size: 13px;
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 4px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 999px;
}

.legend-total::before {
  background: #22665f;
}

.legend-unique::before {
  background: #b9852f;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(120px, 1.6fr) minmax(44px, auto);
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #34434f;
}

.bar-row div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf1;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #22665f;
}

.bar-row strong {
  color: #1c2733;
  text-align: right;
}

.hour-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(12px, 1fr));
  gap: 4px;
  align-items: end;
  min-height: 220px;
  padding-top: 12px;
}

.hour-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-height: 210px;
  align-items: end;
}

.hour-bar i {
  display: block;
  min-height: 2px;
  border-radius: 999px 999px 0 0;
  background: #22665f;
}

.hour-bar span {
  color: #677782;
  font-size: 10px;
  text-align: center;
}

.heatmap {
  display: grid;
  grid-template-columns: 42px repeat(24, minmax(18px, 1fr));
  gap: 4px;
  align-items: center;
}

.heatmap-hour,
.heatmap-day {
  color: #677782;
  font-size: 11px;
  text-align: center;
}

.heatmap-day {
  text-align: right;
  padding-right: 4px;
}

.heat-cell {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: rgba(34, 102, 95, calc(0.08 + (var(--heat) * 0.88)));
}

.report-actions {
  display: flex;
  justify-content: flex-end;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e6ebef;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: #eef4f3;
  color: #34434f;
  font-size: 12px;
  text-transform: uppercase;
}

.message {
  min-width: 360px;
  white-space: pre-wrap;
}

.message a {
  color: #0b6fbd;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.whatsapp-text {
  min-width: 360px;
}

.whatsapp-text summary {
  color: #22665f;
  cursor: pointer;
  font-weight: 700;
}

.wa-preview {
  width: min(520px, 80vw);
  max-height: 520px;
  overflow: auto;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #111b21;
  color: #e9edef;
}

.wa-header {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #202c33;
}

.wa-header div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
}

.wa-header strong {
  color: #8696a0;
  font-size: 12px;
}

.wa-header span {
  color: #e9edef;
  overflow-wrap: anywhere;
}

.wa-date {
  width: fit-content;
  margin: 0 auto 10px;
  padding: 5px 12px;
  border-radius: 8px;
  background: #182229;
  color: #d1d7db;
  font-size: 12px;
  font-weight: 700;
}

.wa-bubble {
  max-width: 90%;
  margin-right: auto;
  margin-bottom: 8px;
  padding: 9px 10px 6px;
  border-radius: 8px;
  background: #202c33;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.wa-bubble-out {
  margin-right: 0;
  margin-left: auto;
  background: #005c4b;
}

.wa-bubble-in {
  margin-left: 0;
}

.wa-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  margin-bottom: 9px;
  border-radius: 7px;
  background: #111b21;
}

.wa-message {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wa-message a {
  color: #53bdeb;
  font-weight: 700;
}

.wa-time {
  margin-top: 4px;
  color: #aebac1;
  font-size: 12px;
  text-align: right;
}

.placeholder {
  padding: 28px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.placeholder h2 {
  margin: 0 0 8px;
  color: #1c2733;
}

.placeholder p {
  margin: 0;
  color: #5d6b78;
}

@media (max-width: 820px) {
  .login-stage {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding: 28px;
  }

  .login-copy h1 {
    font-size: 40px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-menu {
    position: static;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(110px, 1fr);
    height: auto;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #cfd5db;
  }

  .side-menu a {
    min-height: 74px;
  }

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

  .filters {
    grid-template-columns: 1fr;
  }

  .results-bar {
    flex-direction: column;
  }

  .number-toolbar {
    grid-template-columns: 1fr;
  }

  .dual-listbox,
  .stats-ranges,
  .quick-grid,
  .graph-kpis,
  .graph-grid,
  .date-range,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .graph-wide {
    grid-column: auto;
  }

  .heatmap {
    min-width: 720px;
  }

  .dual-actions {
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }

  .report-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-detail summary {
    grid-template-columns: 1fr;
  }

  .stats-conversation-detail > summary {
    grid-template-columns: 1fr;
  }

  .quick-card-wide {
    grid-column: auto;
  }

  .user-form {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .pagination button {
    width: auto;
  }

  .endpoint-grid {
    grid-template-columns: 1fr;
  }
}

/* Tema gestion SaaS oscuro */
:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  background: #0b1120;
  color: #dbeafe;
}

body {
  background:
    linear-gradient(180deg, #0b1120 0%, #111827 42%, #0f172a 100%);
  color: #dbeafe;
}

.app-shell {
  background: #0b1120;
}

.side-menu {
  border-color: #1e293b;
  border-right: 1px solid #1e293b;
  background: #0f172a;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.side-menu a {
  border-color: transparent;
  color: #94a3b8;
}

.side-menu a:hover {
  background: #111c31;
  border-color: #243349;
  color: #e2e8f0;
}

.side-menu a.active {
  background: #14b8a6;
  border-color: #2dd4bf;
  color: #04111d;
}

.side-menu a.active .menu-icon,
.side-menu a:hover .menu-icon,
.logout-icon {
  filter: drop-shadow(0 6px 12px rgba(20, 184, 166, 0.18));
}

.page {
  width: min(1440px, calc(100% - 166px));
  transition: margin-left 0.25s ease, width 0.25s ease;
}

body:has(.side-menu:hover) .page {
  width: min(1440px, calc(100% - 310px));
  margin-left: 270px;
}

.header,
.app-header {
  padding: 18px 20px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  color: #5eead4;
}

h1,
.panel h2,
.form-panel h2,
.welcome-panel h2,
.report-card h3 {
  color: #f8fafc;
}

.session-user,
label,
.permissions-box legend {
  color: #cbd5e1;
}

.panel,
.form-panel,
.filters,
.table-wrap,
.welcome-panel,
.placeholder,
.report-card,
.quick-card,
.metric {
  border-color: #1f2a44;
  background: #111827;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
}

.metric-label,
.field-help,
.panel-subtitle,
.sync-form p,
.review-box p,
.placeholder p,
.graph-filter-line span,
.stats-pagination span {
  color: #94a3b8;
}

.metric strong,
.quick-card strong,
.quick-card p,
.bar-row strong {
  color: #f8fafc;
}

.review-box,
.bulk-actions,
.stats-detail-body,
.stats-detail-meta span,
.graph-filter-line span,
.active-filters span {
  border-color: #1f2a44;
  background: #0f172a;
  color: #cbd5e1;
}

.review-box {
  border-left-color: #14b8a6;
}

input,
textarea,
select {
  border-color: #334155;
  background: #0f172a;
  color: #e2e8f0;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(20, 184, 166, 0.28);
  border-color: #14b8a6;
}

button,
.export-btn {
  background: #14b8a6;
  color: #04111d;
}

button:hover,
.export-btn:hover {
  background: #2dd4bf;
}

.clear-btn,
.pagination button,
.stats-pagination button,
.stats-tab-buttons button,
.report-selector button,
.shortcut-btn {
  border-color: #334155;
  background: #0f172a;
  color: #cbd5e1;
}

.clear-btn:hover,
.pagination button:hover,
.stats-pagination button:hover,
.stats-tab-buttons button:hover,
.report-selector button:hover,
.shortcut-btn:hover {
  background: #1e293b;
  color: #f8fafc;
}

.pagination button.active,
.stats-tab-buttons button.active,
.report-selector button.active {
  border-color: #14b8a6;
  background: #14b8a6;
  color: #04111d;
}

.logout,
.danger-btn {
  background: #dc2626;
  color: #ffffff;
}

.logout:hover,
.danger-btn:hover {
  background: #ef4444;
}

.flash-success {
  background: #052e2b;
  color: #99f6e4;
}

.flash-error,
.alert {
  background: #3b1218;
  color: #fecdd3;
}

.empty {
  background: #2f240d;
  color: #fde68a;
}

.badge-online,
.endpoint-card.online {
  background: #0f766e;
}

.badge-offline,
.endpoint-card.offline {
  background: #b91c1c;
}

table {
  color: #cbd5e1;
}

th {
  background: #0f172a;
  color: #e2e8f0;
}

td,
th {
  border-bottom-color: #1f2a44;
}

tr:hover td {
  background: rgba(20, 184, 166, 0.06);
}

.stats-expand-label,
.stats-conversation-expand-label {
  border-color: #334155;
  color: #5eead4;
}

.quick-card span,
.bar-row span,
.hour-bar span,
.heatmap-hour,
.heatmap-day {
  color: #94a3b8;
}

.quick-card-small-text p,
.quick-card-list p {
  color: #cbd5e1;
}

.stats-mode label,
.graph-panel,
.stats-detail,
.stats-conversation-detail,
.stats-conversation-detail > summary,
.stats-detail summary {
  border-color: #1f2a44;
  background: #111827;
  color: #cbd5e1;
}

.stats-detail summary:hover,
.stats-conversation-detail > summary:hover {
  background: #0f172a;
}

.stats-detail-table,
.stats-detail-table table {
  background: #111827;
}

.stats-pagination button:disabled {
  color: #64748b;
}

.line-chart {
  border-color: #1f2a44;
  background: #0f172a;
}

.line-total {
  stroke: #14b8a6;
}

.line-unique {
  stroke: #f59e0b;
}

.legend-total::before,
.bar-row i,
.hour-bar i {
  background: #14b8a6;
}

.legend-unique::before {
  background: #f59e0b;
}

.bar-row div {
  background: #1e293b;
}

.heat-cell {
  background: rgba(20, 184, 166, calc(0.08 + (var(--heat) * 0.88)));
}

.wa-preview {
  border: 1px solid #1f2a44;
  background: #07111a;
}

.wa-header,
.wa-date,
.wa-bubble {
  background: #111827;
}

.wa-bubble-out {
  background: #0f766e;
}

.login-page {
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.96), rgba(8, 13, 25, 0.9)),
    linear-gradient(340deg, rgba(20, 184, 166, 0.2), transparent 48%);
}

.login-stage {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.78);
}

.login-box {
  background: rgba(17, 24, 39, 0.72);
  border-color: rgba(148, 163, 184, 0.24);
}

.login-field span,
.login-box .login-field input,
.login-box button {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

.login-box button {
  background: #14b8a6;
  color: #04111d;
}

@media (max-width: 820px) {
  .side-menu {
    position: static;
    width: auto;
    height: auto;
    margin: 12px;
    padding: 10px;
    border-radius: 16px;
  }

  .side-menu:hover {
    width: auto;
  }

  .menu-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    gap: 8px;
  }

  .side-menu a {
    justify-content: center;
    min-height: 68px;
    padding: 8px;
    text-align: center;
  }

  .side-menu a:hover {
    transform: none;
  }

  .menu-icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .menu-text {
    display: none;
  }

  .side-menu {
    border-bottom-color: #1e293b;
  }

  .page {
    width: min(100% - 24px, 1440px);
    margin: 0 auto;
  }

  .logout {
    width: auto;
  }
}

/* Variantes visuales del dashboard */
body.theme-grey {
  background:
    linear-gradient(180deg, #111827 0%, #1f2937 48%, #273244 100%);
  color: #e5e7eb;
}

body.theme-grey .app-shell {
  background: transparent;
}

body.theme-grey .side-menu,
body.theme-grey .header,
body.theme-grey .app-header,
body.theme-grey .panel,
body.theme-grey .form-panel,
body.theme-grey .filters,
body.theme-grey .table-wrap,
body.theme-grey .welcome-panel,
body.theme-grey .placeholder,
body.theme-grey .report-card,
body.theme-grey .quick-card,
body.theme-grey .metric,
body.theme-grey .graph-panel,
body.theme-grey .stats-detail,
body.theme-grey .stats-conversation-detail,
body.theme-grey .stats-detail summary,
body.theme-grey .stats-conversation-detail > summary {
  border-color: #374151;
  background: #1f2937;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

body.theme-grey .side-menu a,
body.theme-grey .metric-label,
body.theme-grey .field-help,
body.theme-grey .panel-subtitle,
body.theme-grey .sync-form p,
body.theme-grey .review-box p,
body.theme-grey .placeholder p,
body.theme-grey .graph-filter-line span,
body.theme-grey .stats-pagination span,
body.theme-grey .quick-card span,
body.theme-grey .bar-row span,
body.theme-grey .hour-bar span,
body.theme-grey .heatmap-hour,
body.theme-grey .heatmap-day {
  color: #9ca3af;
}

body.theme-grey h1,
body.theme-grey .panel h2,
body.theme-grey .form-panel h2,
body.theme-grey .welcome-panel h2,
body.theme-grey .report-card h3,
body.theme-grey .metric strong,
body.theme-grey .quick-card strong,
body.theme-grey .quick-card p,
body.theme-grey .bar-row strong,
body.theme-grey label,
body.theme-grey .permissions-box legend {
  color: #f9fafb;
}

body.theme-grey .side-menu a:hover,
body.theme-grey .review-box,
body.theme-grey .bulk-actions,
body.theme-grey .stats-detail-body,
body.theme-grey .stats-detail-meta span,
body.theme-grey .graph-filter-line span,
body.theme-grey .active-filters span,
body.theme-grey .line-chart,
body.theme-grey .bar-row div {
  border-color: #4b5563;
  background: #111827;
  color: #e5e7eb;
}

body.theme-grey .side-menu a.active,
body.theme-grey button,
body.theme-grey .export-btn,
body.theme-grey .pagination button.active,
body.theme-grey .stats-tab-buttons button.active,
body.theme-grey .report-selector button.active {
  border-color: #60a5fa;
  background: #3b82f6;
  color: #ffffff;
}

body.theme-grey input,
body.theme-grey textarea,
body.theme-grey select,
body.theme-grey .clear-btn,
body.theme-grey .pagination button,
body.theme-grey .stats-pagination button,
body.theme-grey .stats-tab-buttons button,
body.theme-grey .report-selector button,
body.theme-grey .shortcut-btn {
  border-color: #4b5563;
  background: #111827;
  color: #e5e7eb;
}

body.theme-grey input:focus,
body.theme-grey textarea:focus,
body.theme-grey select:focus {
  outline-color: rgba(96, 165, 250, 0.3);
  border-color: #60a5fa;
}

body.theme-grey th {
  background: #111827;
  color: #f9fafb;
}

body.theme-grey td,
body.theme-grey th {
  border-bottom-color: #374151;
}

body.theme-grey tr:hover td {
  background: rgba(96, 165, 250, 0.08);
}

body.theme-grey .eyebrow,
body.theme-grey .stats-expand-label,
body.theme-grey .stats-conversation-expand-label {
  color: #93c5fd;
}

body.theme-grey .line-total,
body.theme-grey .line-unique {
  stroke: #60a5fa;
}

body.theme-grey .legend-total::before,
body.theme-grey .legend-unique::before,
body.theme-grey .bar-row i,
body.theme-grey .hour-bar i {
  background: #60a5fa;
}

body.theme-white {
  color-scheme: light;
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 52%, #e5e7eb 100%);
  color: #1f2937;
}

body.theme-white .app-shell {
  background: transparent;
}

body.theme-white .side-menu,
body.theme-white .header,
body.theme-white .app-header,
body.theme-white .panel,
body.theme-white .form-panel,
body.theme-white .filters,
body.theme-white .table-wrap,
body.theme-white .welcome-panel,
body.theme-white .placeholder,
body.theme-white .report-card,
body.theme-white .quick-card,
body.theme-white .metric,
body.theme-white .graph-panel,
body.theme-white .stats-detail,
body.theme-white .stats-conversation-detail,
body.theme-white .stats-detail summary,
body.theme-white .stats-conversation-detail > summary {
  border-color: #d8e0e6;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

body.theme-white .side-menu a,
body.theme-white .metric-label,
body.theme-white .field-help,
body.theme-white .panel-subtitle,
body.theme-white .sync-form p,
body.theme-white .review-box p,
body.theme-white .placeholder p,
body.theme-white .graph-filter-line span,
body.theme-white .stats-pagination span,
body.theme-white .quick-card span,
body.theme-white .bar-row span,
body.theme-white .hour-bar span,
body.theme-white .heatmap-hour,
body.theme-white .heatmap-day {
  color: #64748b;
}

body.theme-white h1,
body.theme-white .panel h2,
body.theme-white .form-panel h2,
body.theme-white .welcome-panel h2,
body.theme-white .report-card h3,
body.theme-white .metric strong,
body.theme-white .quick-card strong,
body.theme-white .quick-card p,
body.theme-white .bar-row strong,
body.theme-white label,
body.theme-white .permissions-box legend {
  color: #0f172a;
}

body.theme-white .side-menu a:hover,
body.theme-white .review-box,
body.theme-white .bulk-actions,
body.theme-white .stats-detail-body,
body.theme-white .stats-detail-meta span,
body.theme-white .graph-filter-line span,
body.theme-white .active-filters span,
body.theme-white .line-chart,
body.theme-white .bar-row div {
  border-color: #d8e0e6;
  background: #f8fafc;
  color: #1f2937;
}

body.theme-white .side-menu a.active,
body.theme-white button,
body.theme-white .export-btn,
body.theme-white .pagination button.active,
body.theme-white .stats-tab-buttons button.active,
body.theme-white .report-selector button.active {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

body.theme-white input,
body.theme-white textarea,
body.theme-white select,
body.theme-white .clear-btn,
body.theme-white .pagination button,
body.theme-white .stats-pagination button,
body.theme-white .stats-tab-buttons button,
body.theme-white .report-selector button,
body.theme-white .shortcut-btn {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1f2937;
}

body.theme-white input:focus,
body.theme-white textarea:focus,
body.theme-white select:focus {
  outline-color: rgba(15, 118, 110, 0.18);
  border-color: #0f766e;
}

body.theme-white th {
  background: #f1f5f9;
  color: #0f172a;
}

body.theme-white td,
body.theme-white th {
  border-bottom-color: #e2e8f0;
}

body.theme-white tr:hover td {
  background: rgba(15, 118, 110, 0.06);
}

body.theme-white .eyebrow,
body.theme-white .stats-expand-label,
body.theme-white .stats-conversation-expand-label {
  color: #0f766e;
}

body.theme-white .flash-success {
  background: #dff7ef;
  color: #075f50;
}

body.theme-white .flash-error,
body.theme-white .alert {
  background: #fde2e2;
  color: #8b1d24;
}

body.theme-white .empty {
  background: #fff7d6;
  color: #725300;
}

body.theme-grey .logout,
body.theme-grey .danger-btn,
body.theme-white .logout,
body.theme-white .danger-btn {
  border-color: #dc2626;
  background: #dc2626;
  color: #ffffff;
}

body.theme-grey .logout:hover,
body.theme-grey .danger-btn:hover,
body.theme-white .logout:hover,
body.theme-white .danger-btn:hover {
  background: #ef4444;
}

/* Statistics data sources */
.stats-source-nav{display:flex;gap:10px;margin:0 0 18px;flex-wrap:wrap}
.stats-source-nav a{padding:10px 22px;border:1px solid var(--border,#465268);border-radius:8px;color:inherit;text-decoration:none}
.stats-source-nav a.active{background:#2563eb;color:#fff;border-color:#2563eb}
.menu-items a.stats-submenu{min-height:34px;padding-left:26px;font-size:.85rem}
.stats-form input[type=checkbox]{width:18px;height:18px;accent-color:#2563eb}

/* Statistics section selection and supplied animated icons */
.menu-items a.stats-submenu{padding-left:20px;gap:12px}
.menu-items a.stats-submenu .menu-icon{width:28px;height:28px;flex:0 0 28px;object-fit:contain}
.stats-source-nav a{display:inline-flex;align-items:center;gap:10px}
.stats-source-nav img{width:28px;height:28px;object-fit:contain}
.stats-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:18px;margin-top:22px}
.stats-choice{display:flex;align-items:center;gap:20px;padding:24px;border:1px solid var(--border,#64748b);border-radius:12px;color:inherit;text-decoration:none;background:rgba(127,127,127,.06);transition:background .15s,border-color .15s}
.stats-choice:hover,.stats-choice:focus-visible{background:rgba(37,99,235,.12);border-color:#2563eb}
.stats-choice img{width:76px;height:76px;object-fit:contain;flex:0 0 76px}
.stats-choice strong{display:block;font-size:1.2rem;margin-bottom:8px}
.stats-choice small{display:block;font-size:.92rem;line-height:1.5}

/* WhatsApp delivery confirmations: only outgoing messages */
.wa-time{display:flex;align-items:center;justify-content:flex-end;gap:5px}
.wa-status{display:inline-flex;align-items:center;justify-content:center;color:#8696a0;flex:0 0 auto;line-height:1}
.wa-status svg{display:block;width:24px;height:16px}
.wa-status-enviado svg{width:18px}
.wa-status-leido{color:#53bdeb}

/* Catalog management and agent portal */
.user-form [hidden]{display:none!important}
.catalog-relations{max-height:320px;overflow:auto}
.agent-stage{max-width:1080px;margin:32px auto;padding:0 20px}
.agent-stage>.header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}
.agent-placeholder{padding:48px 24px;text-align:center}
.agent-placeholder img{object-fit:contain;margin-bottom:16px;max-width:72px}
