:root {
  --bg-main: #111b21;
  --bg-sidebar: #111b21;
  --bg-panel: #202c33;
  --bg-chat: #0b141a;
  --bg-card: #202c33;
  --bg-input: #2a3942;
  --border: #2f3b43;
  --text: #e9edef;
  --muted: #8696a0;
  --accent: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #7c3aed 100%);
  --bubble-user: #005c4b;
  --bubble-bot: #202c33;
  --bubble-human: #1f3c88;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg-main);
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}
.hidden {
  display: none !important;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #0b141a 0%, #111b21 100%);
}

@media (max-width: 768px) {
  .landing-page {
    padding: 16px;
    place-items: start;
    padding-top: 20px;
  }
}
.landing-card {
  width: min(920px, 100%);
  background: rgba(32, 44, 51, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

@media (max-width: 768px) {
  .landing-card {
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }
}

@media (max-width: 480px) {
  .landing-card {
    padding: 16px;
    border-radius: 12px;
  }
}
.landing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.landing-header h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 46px);
}
.landing-header p {
  margin: 0;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.6;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 28px;
}
.btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.btn-primary:hover {
  background: #0891b2;
}
.btn-primary:disabled {
  background: var(--muted);
  color: #111b21;
}
.btn-small {
  padding: 8px 12px;
  font-size: 13px;
}
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.example-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.example-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}
.example-card h3 {
  margin: 0 0 8px;
}
.example-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.wa-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .wa-layout {
    grid-template-columns: 380px 1fr;
  }
}

@media (max-width: 768px) {
  .wa-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  .wa-layout {
    grid-template-columns: 1fr;
  }
}
.wa-sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #111b21 0%, #07131a 100%);
  border-right: 1px solid var(--border);
  min-height: 0;
}
.wa-sidebar-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(
    180deg,
    rgba(17, 27, 33, 1) 0%,
    rgba(17, 27, 33, 0.98) 100%
  );
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.wa-sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 16px 14px;
}
.wa-sidebar-top h1 {
  margin: 0;
  font-size: 20px;
}
.ghost-link {
  color: var(--muted);
  font-weight: 600;
  transition: 0.2s ease;
}
.ghost-link:hover {
  color: var(--text);
}
.wa-search {
  padding: 0 12px 14px;
}
.wa-search input,
.composer-row input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: none;
  background: var(--bg-input);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 15px;
  transition: all 0.2s ease;
}
.wa-search input::placeholder,
.composer-row input::placeholder {
  color: var(--muted);
}
.wa-search input:focus,
.composer-row input:focus {
  background: var(--bg-input);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}
.wa-search input.error,
.composer-row input.error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.06);
}
.wa-search input.error:focus,
.composer-row input.error:focus {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}
.wa-search input:disabled,
.composer-row input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wa-semaphore-filters,
.wa-read-filters {
  display: flex;
  gap: 10px;
  padding: 0 12px 12px;
  flex-wrap: wrap;
}
.semaphore-filter,
.read-filter {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
  font-weight: 600;
}
.semaphore-filter.active,
.read-filter.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}
.client-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.client-badge:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.55);
}
.wa-client-filters {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.filter-section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 12px 8px;
  display: block;
}
.wa-client-filter-buttons {
  display: flex;
  gap: 10px;
  padding: 0 12px 12px;
  flex-wrap: wrap;
}
.client-filter {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 13px;
  font-weight: 500;
}
.client-filter:hover {
  background: rgba(255, 255, 255, 0.08);
}
.client-filter.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}
.wa-client-label {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0 0;
  font-weight: 500;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.large {
  width: 14px;
  height: 14px;
}
.status-dot.green {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}
.status-dot.yellow {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.15);
}
.status-dot.red {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.wa-chat-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.custom-scroll::-webkit-scrollbar {
  width: 10px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: #0f1a20;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: #32414a;
  border-radius: 999px;
  border: 2px solid #0f1a20;
}
.custom-scroll-chat::-webkit-scrollbar {
  width: 12px;
}
.custom-scroll-chat::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.custom-scroll-chat::-webkit-scrollbar-thumb {
  background: var(--accent-gradient);
  border-radius: 999px;
  border: 2px solid transparent;
}
.wa-chat-item {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: transparent;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
.wa-chat-item:hover,
.wa-chat-item.active {
  background: rgba(255, 255, 255, 0.06);
}
.wa-chat-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.wa-chat-name-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wa-chat-item-top strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.wa-chat-item-top span,
.wa-chat-item-meta,
.wa-chat-item-preview,
.wa-chat-topbar p,
.summary-label,
.wa-no-results,
.wa-empty-state p,
.wa-status-label,
.composer-hint,
.composer-title {
  color: var(--muted);
}
.wa-chat-item-top span {
  font-size: 12px;
  text-transform: capitalize;
}
.wa-chat-item-meta {
  font-size: 13px;
  margin-bottom: 4px;
}
.wa-chat-item-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wa-chat-item-preview {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.wa-status-label {
  font-size: 11px;
  white-space: nowrap;
}

.wa-main {
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
  min-height: 0;
}
.wa-empty-state {
  margin: auto;
  text-align: center;
  max-width: 480px;
  padding: 24px;
}
.wa-empty-state h2 {
  margin: 0 0 10px;
}
.wa-chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  min-height: 0;
}
.wa-main-sticky {
  top: 0;
  background: linear-gradient(
    180deg,
    rgba(17, 27, 33, 1) 0%,
    rgba(17, 27, 33, 0.98) 100%
  );
  backdrop-filter: blur(6px);
}
.wa-chat-topbar {
  padding: 18px 22px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.wa-chat-topbar-main {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.wa-contact-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
.wa-chat-topbar p {
  margin: 6px 0 0;
}
.wa-takeover-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.toggle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
}
.toggle-wrap input {
  appearance: none;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: #3b4a54;
  position: relative;
  cursor: pointer;
  transition: 0.2s ease;
}
.toggle-wrap input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  transition: 0.2s ease;
}
.toggle-wrap input:checked {
  background: var(--accent);
}
.toggle-wrap input:checked::after {
  transform: translateX(22px);
}
.toggle-slider {
  display: none;
}
.wa-summary-card {
  margin: 16px 18px 0;
  background: rgba(32, 44, 51, 0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.summary-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 18px;
}
.summary-label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.summary-grid p {
  margin: 0;
  line-height: 1.5;
}
.wa-messages {
  overflow-y: auto;
  min-height: 0;
  padding: 22px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px
  );
  background-size: 18px 18px;
}
.wa-message-row {
  display: flex;
}
.wa-message-row.user {
  justify-content: flex-end;
}
.wa-message-row.assistant {
  justify-content: flex-start;
}
.wa-bubble {
  max-width: min(720px, 78%);
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}
.wa-bubble.user {
  background: var(--bubble-user);
}
.wa-bubble.assistant {
  background: var(--bubble-bot);
}
.wa-bubble.human {
  background: var(--bubble-human);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-message-timestamp {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  text-align: right;
}
.human-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 8px;
}
.wa-human-composer {
  border-top: 1px solid var(--border);
  background: rgba(17, 27, 33, 0.98);
  padding: 14px 18px 16px;
}
.composer-title {
  font-size: 13px;
  margin-bottom: 10px;
}
.composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
#sendHumanReplyBtn {
  min-width: 120px;
}
.wa-human-composer.manual-active {
  box-shadow: inset 0 1px 0 rgba(250, 204, 21, 0.2);
}
.wa-no-results {
  padding: 18px;
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .wa-chat-topbar-main {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }
  .wa-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .wa-sidebar {
    min-height: 45vh;
  }
  .wa-chat-panel {
    height: auto;
    grid-template-rows: auto auto auto;
  }
  .wa-messages {
    max-height: 50vh;
  }
  .landing-header {
    flex-direction: column;
  }
}

.wa-human-composer.disabled {
  opacity: 0.55;
}
.wa-human-composer.disabled input,
.wa-human-composer.disabled button {
  cursor: not-allowed;
}
#sendHumanReplyBtn:disabled,
#humanReplyInput:disabled {
  opacity: 0.65;
}

.wa-read-filters {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
  flex-wrap: wrap;
}
.read-filter {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.read-filter.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}
.wa-chat-item-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.wa-chat-delete-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.14);
  background: rgba(239, 68, 68, 0.06);
  color: #f87171;
  cursor: pointer;
  transition: 0.18s ease;
  flex-shrink: 0;
}
.wa-chat-delete-btn svg {
  width: 16px;
  height: 16px;
}
.wa-chat-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.24);
  color: #fb7185;
}
.wa-chat-delete-btn:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.35);
  outline-offset: 2px;
}
.ai-badge,
.unread-badge,
.read-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.ai-badge {
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ai-on {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.14);
}
.ai-off {
  color: #d7dde1;
  background: rgba(255, 255, 255, 0.08);
}
.unread-badge {
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}
.read-badge {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}
.wa-chat-item.unread {
  background: rgba(6, 182, 212, 0.04);
}
.wa-chat-item.unread .wa-chat-item-preview {
  color: var(--text);
}

/* --- Dashboard v5 visual refinements --- */
.wa-sidebar-top h1,
.wa-chat-topbar h2 {
  font-size: 22px;
}
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.wa-chat-topbar.compact-topbar {
  padding: 14px 20px;
}
.wa-chat-topbar-main.compact-main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}
.wa-chat-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}
.chat-meta-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 120px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}
.chat-meta-pill .summary-label {
  margin-bottom: 3px;
}
.summary-toggle-btn {
  min-height: 42px;
}
#summaryInline {
  display: none;
}
#summaryInline.visible {
  display: block;
}
#summaryInline p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  max-width: 360px;
}
.wa-chat-panel {
  grid-template-rows: auto 1fr auto;
}
.wa-summary-card {
  display: none !important;
}
.wa-chat-item-preview.preview-unread {
  color: #fff;
  font-weight: 600;
}
.wa-chat-item.unread .wa-chat-item-preview {
  color: #fff;
}
.ai-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.ai-icon.on {
  color: #fff;
}
.ai-icon.off {
  color: var(--muted);
}
.ai-icon.off::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 1.6px;
  background: currentColor;
  transform: rotate(-28deg);
  border-radius: 999px;
}
.read-filter,
.semaphore-filter {
  min-height: 42px;
  justify-content: center;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.read-filter:hover,
.semaphore-filter:hover {
  background: rgba(255, 255, 255, 0.06);
}
.read-filter.active,
.semaphore-filter.active {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1280px) {
  .wa-chat-topbar-main.compact-main {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .wa-chat-topbar-actions {
    justify-content: flex-end;
  }
}

/* === v6 visual polish === */
.wa-semaphore-filters,
.wa-read-filters {
  display: flex;
  gap: 10px;
  padding: 0 12px 12px;
  flex-wrap: wrap;
}

.semaphore-filter,
.read-filter {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.semaphore-filter:hover,
.read-filter:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.read-filter.active,
.semaphore-filter.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 20px rgba(0, 0, 0, 0.18);
}

.wa-chat-item.unread {
  background: rgba(6, 182, 212, 0.06);
}

.wa-chat-item.unread strong,
.wa-chat-item.unread .wa-chat-item-meta,
.wa-chat-item-preview.preview-unread {
  color: #ffffff;
}

.wa-chat-item.unread .wa-status-label {
  color: rgba(255, 255, 255, 0.88);
}

.preview-unread {
  font-weight: 700;
}

.unread-badge {
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  gap: 7px;
  padding: 5px 10px;
}

.unread-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.read-badge {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.ai-state {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.ai-state.ai-on {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.ai-state.ai-off {
  color: #8b98a1;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.ai-state.ai-off::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: currentColor;
  transform: rotate(-34deg);
  border-radius: 999px;
  opacity: 1;
}

.wa-contact-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.wa-contact-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wa-chat-edit-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s ease;
  flex-shrink: 0;
}
.wa-chat-edit-btn svg {
  width: 14px;
  height: 14px;
}
.wa-chat-edit-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(6, 182, 212, 0.18);
  color: var(--text);
}
.wa-chat-edit-btn:focus-visible {
  outline: 2px solid rgba(6, 182, 212, 0.28);
  outline-offset: 2px;
}

.compact-topbar {
  padding: 14px 20px;
}

.wa-chat-topbar-main.compact-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.wa-chat-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.chat-meta-pill {
  min-width: 132px;
  min-height: 42px;
  padding: 8px 14px;
  justify-content: center;
  gap: 2px;
}

.chat-meta-pill strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.summary-toggle-btn {
  height: 42px;
  padding: 0 16px;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .wa-chat-topbar-main.compact-main {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .wa-chat-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* Compact 2×2 grid for actions when below 1360px (iPad + narrow desktop) */
@media (min-width: 821px) and (max-width: 1359px) {
  .wa-chat-topbar-actions {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
      "resumen pills"
      "toggle  pills";
    gap: 6px;
    align-items: stretch;
    justify-content: end;
  }
  #summaryBtn {
    grid-area: resumen;
  }
  .mobile-meta-group {
    grid-area: pills;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .mobile-meta-group .chat-meta-pill {
    flex: 1;
    min-height: 0;
  }
  .desktop-only-toggle {
    grid-area: toggle;
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 760px) {
  .chat-meta-pill {
    min-width: 110px;
  }
  .summary-toggle-btn,
  .semaphore-filter,
  .read-filter {
    min-height: 40px;
    font-size: 13px;
  }
}

/* === v7 left filter layout FIXED === */
.wa-semaphore-section {
  padding: 0 12px 12px;
}

.wa-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px 4px;
}

.filter-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.filter-icon svg {
  width: 16px;
  height: 16px;
}

.wa-semaphore-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0;
  align-items: center;
}

.semaphore-filter {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.semaphore-filter[data-filter="all"] {
  font-size: 13px;
  font-weight: 700;
}

.semaphore-filter[data-filter="green"],
.semaphore-filter[data-filter="yellow"],
.semaphore-filter[data-filter="red"] {
  font-size: 0;
}

.semaphore-filter[data-filter="green"] .status-dot,
.semaphore-filter[data-filter="yellow"] .status-dot,
.semaphore-filter[data-filter="red"] .status-dot {
  width: 14px;
  height: 14px;
}

.wa-read-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 12px 12px;
}

.read-filter {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  justify-content: center;
}

@media (max-width: 420px) {
  .wa-semaphore-filters,
  .wa-read-filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Mi asistente 24 auth + settings UI ===== */
.ghost-button {
  appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ma-mini-account {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}
.ma-mini-account strong {
  font-size: 14px;
}
.ma-mini-account span {
  color: var(--muted);
  font-size: 13px;
}
.ma-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.ma-dashboard-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 27, 33, 0.72);
}
.ma-dashboard-banner h2 {
  margin: 0 0 6px;
  font-size: 28px;
}
.ma-dashboard-banner p:last-child {
  margin: 0;
  color: var(--muted);
  max-width: 700px;
  line-height: 1.6;
}
.ma-dashboard-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.ma-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ma-login-shell {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(
    circle at top left,
    #202938 0%,
    #0d1117 45%,
    #090c10 100%
  );
  color: #1f2328;
}
.ma-login-wrap {
  min-height: 100vh;
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 420px);
  gap: 28px;
  align-items: center;
  padding: 28px;
}
.ma-login-hero,
.ma-login-card {
  border-radius: 24px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.16);
}
.ma-login-hero {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.ma-login-brand {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.ma-login-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ma-login-overline {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}
.ma-login-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02;
}
.ma-login-hero p {
  margin: 0;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
}
.ma-login-feature-grid {
  display: grid;
  gap: 14px;
}
.ma-login-feature-grid article {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 6px;
}
.ma-login-feature-grid span {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  font-size: 14px;
}
.ma-login-card {
  background: #fff;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ma-login-card-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: #111827;
}
.ma-login-card-head p {
  margin: 0 0 22px;
  color: #59636e;
  line-height: 1.6;
}
.ma-form,
.ma-form label {
  display: grid;
  gap: 8px;
}
.ma-form {
  gap: 16px;
}
.ma-form span {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.ma-form input,
.ma-form textarea {
  width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  background: #fff;
  padding: 13px 14px;
  color: #1f2328;
  font: inherit;
}
.ma-form input:focus,
.ma-form textarea:focus {
  outline: 3px solid rgba(9, 105, 218, 0.18);
  border-color: #0969da;
}
.ma-form textarea {
  resize: vertical;
  min-height: 120px;
}
.ma-login-note {
  margin-top: 18px;
  border: 1px solid #d0d7de;
  border-radius: 16px;
  background: #f6f8fa;
  padding: 16px;
  display: grid;
  gap: 6px;
  color: #59636e;
}
.ma-login-note strong {
  color: #111827;
}
.ma-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease;
  font: inherit;
}
.ma-btn:hover {
  transform: translateY(-1px);
}
.ma-btn-dark {
  background: #0d1117;
  color: #fff;
}
.ma-btn-dark:hover {
  background: #202938;
}
.ma-btn-sidebar {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}
.ma-btn-sidebar:hover {
  background: rgba(255, 255, 255, 0.12);
}
.ma-btn-block {
  width: 100%;
}
.ma-alert {
  margin: 18px 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
}
.ma-alert-error {
  background: #fff1f0;
  color: #d1242f;
  border: 1px solid #ffcecb;
}
.ma-alert-success {
  background: #edfdf3;
  color: #1f883d;
  border: 1px solid #b7e3c0;
}
.ma-panel-page {
  background: #f6f8fa;
  color: #1f2328;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
}
.ma-shell {\n  min-height: 100vh;\n  display: grid;\n  grid-template-columns: 270px minmax(0, 1fr);\n}\n\n@media (max-width: 1024px) {\n  .ma-shell {\n    grid-template-columns: 240px minmax(0, 1fr);\n  }\n}\n\n@media (max-width: 768px) {\n  .ma-shell {\n    grid-template-columns: 1fr;\n    min-height: auto;\n  }\n}
.ma-sidebar {
  background: linear-gradient(180deg, #0d1117 0%, #111827 100%);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

@media (max-width: 768px) {
  .ma-sidebar {
    padding: 16px 12px;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}
.ma-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

/* === Loading & State Indicators === */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.btn.loading,
.ma-btn.loading {
  pointer-events: none;
  position: relative;
}

.btn.loading::before,
.ma-btn.loading::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 50%;
  top: 50%;
  margin-left: -7px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.loading,
.ma-btn.loading {
  opacity: 0.8;
}

/* === Form validation states === */
.ma-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.ma-field input,
.ma-field textarea,
.ma-field select {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.ma-field input:focus,
.ma-field textarea:focus,
.ma-field select:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.ma-field.error input,
.ma-field.error textarea {
  border-color: #d1242f;
  background-color: #fff1f0;
}

.ma-field.error input:focus,
.ma-field.error textarea:focus {
  box-shadow: 0 0 0 3px rgba(209, 36, 47, 0.1);
}

.ma-field.success input,
.ma-field.success textarea {
  border-color: #1f883d;
  background-color: #edfdf3;
}

.field-error {
  color: #d1242f;
  font-size: 12px;
  margin-top: 4px;
}

.field-success {
  color: #1f883d;
  font-size: 12px;
  margin-top: 4px;
}

/* === Mobile improvements === */
@media (max-width: 768px) {
  .landing-page {
    padding: 16px;
  }
  
  .landing-card {
    padding: 20px;
    border-radius: 16px;
  }
  
  .landing-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .landing-header h1 {
    font-size: clamp(24px, 6vw, 36px);
  }
  
  .wa-sidebar {
    min-height: auto;
    max-height: 40vh;
    overflow-y: auto;
  }
  
  .wa-chat-list {
    max-height: 35vh;
  }
  
  .wa-chat-panel {
    height: auto;
    min-height: 60vh;
  }
  
  .wa-messages {
    min-height: 300px;
    max-height: 40vh;
  }
  
  .wa-chat-topbar-main.compact-main {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
  
  .wa-chat-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }
  
  .chat-meta-pill,
  .summary-toggle-btn {
    min-height: 38px;
    font-size: 13px;
    padding: 6px 12px;
  }
  
  .composer-row {
    gap: 8px;
  }
  
  .composer-row input {
    font-size: 16px;
  }
  
  .ma-field input,
  .ma-field textarea {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .wa-sidebar-top h1 {
    font-size: 18px;
  }
  
  .wa-chat-item {
    padding: 10px 12px;
  }
  
  .wa-chat-topbar {
    padding: 12px 16px;
  }
  
  .toggle-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .toggle-wrap input {
    width: 44px;
    height: 24px;
  }
  
  .toggle-wrap input::after {
    width: 18px;
    height: 18px;
  }
  
  .toggle-wrap input:checked::after {
    transform: translateX(20px);
  }
  
  .wa-bubble {
    max-width: 85%;
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .ma-form-grid {
    grid-template-columns: 1fr;
  }
  
  .ma-field-wide {
    grid-column: auto;
  }
}
.ma-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}
.ma-brand p {
  margin: 0 0 4px;
  font-weight: 700;
}
.ma-brand span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}
.ma-nav {
  display: grid;
  gap: 8px;
}
.ma-nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}
.ma-nav a.active,
.ma-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.ma-content {
  padding: 24px;
}
.ma-card {
  background: #fff;
  border: 1px solid #e6ebf1;
  border-radius: 24px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.1);
}
.ma-topbar {
  padding: 24px;
}
.ma-topbar h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 38px);
  color: #111827;
}
.ma-topbar p:last-child {
  margin: 0;
  color: #59636e;
  line-height: 1.65;
}
.ma-grid-2 {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.ma-card-pad {
  padding: 20px;
}
.ma-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.ma-section-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #111827;
}
.ma-section-head p {
  margin: 0;
  color: #59636e;
}
.ma-account-list {
  display: grid;
  gap: 12px;
}
.ma-account-row {
  border: 1px solid #e6ebf1;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.ma-account-row p {
  margin: 6px 0 0;
  color: #59636e;
  font-size: 14px;
}
.ma-role-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  color: #59636e;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .ma-login-wrap {
    grid-template-columns: 1fr;
  }
  .ma-grid-2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1000px) {
  .ma-dashboard-banner {
    flex-direction: column;
  }
  .ma-dashboard-pills {
    justify-content: flex-start;
  }
}
@media (max-width: 900px) {
  .ma-shell {
    grid-template-columns: 1fr;
  }
  .ma-sidebar {
    padding: 18px;
  }
  .ma-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ma-content,
  .ma-login-wrap {
    padding: 16px;
  }
  .ma-login-hero,
  .ma-login-card,
  .ma-card {
    border-radius: 20px;
  }
  .ma-top-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 700px) {
  .ma-login-brand {
    flex-direction: column;
  }
  .ma-nav {
    grid-template-columns: 1fr;
  }
  .ma-dashboard-banner {
    padding: 16px;
  }
  .wa-sidebar-top {
    flex-direction: column;
  }
  .ma-top-actions {
    width: 100%;
  }
  .ma-top-actions .ghost-link,
  .ma-top-actions form {
    width: 100%;
  }
  .ma-top-actions .ghost-link,
  .ma-top-actions .ghost-button {
    justify-content: center;
    width: 100%;
  }
}

/* ===== Mi asistente 24 UI v4 ===== */
body.ma-panel-page {
  overflow: auto;
  background: linear-gradient(180deg, #0b141a 0%, #101a20 100%);
  color: var(--text);
}
.ma-panel-page .eyebrow {
  color: var(--accent);
}
.ma-shell-dark {
  min-height: 100vh;
}
.ma-content-dark {
  overflow: auto;
  padding: 28px;
  background:
    radial-gradient(
      circle at top right,
      rgba(59, 130, 246, 0.08),
      transparent 28%
    ),
    linear-gradient(180deg, #0b141a 0%, #111b21 100%);
}
.ma-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.ma-page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.05;
  color: var(--text);
}
.ma-page-header p:last-child {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.65;
}
.ma-page-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.ma-tag,
.ma-soft-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.ma-surface {
  background: linear-gradient(
    180deg,
    rgba(32, 44, 51, 0.96) 0%,
    rgba(17, 27, 33, 0.98) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  padding: 22px;
}
.ma-surface-accent {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.14) 0%,
    rgba(17, 27, 33, 0.98) 55%
  );
}
.ma-surface-hero {
  min-height: 100%;
  background:
    radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.12),
      transparent 38%
    ),
    linear-gradient(
      180deg,
      rgba(32, 44, 51, 0.96) 0%,
      rgba(17, 27, 33, 0.98) 100%
    );
}
.ma-surface-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.ma-surface-head h2,
.ma-surface-hero h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
  color: var(--text);
}
.ma-surface-head p,
.ma-surface-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.ma-hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.ma-hero-points {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}
.ma-hero-points article {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 6px;
}
.ma-hero-points span {
  color: var(--muted);
  line-height: 1.6;
}
.ma-settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  gap: 22px;
}
.ma-settings-stack {
  display: grid;
  gap: 22px;
}
.ma-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  gap: 22px;
}
.ma-modern-form {
  display: grid;
  gap: 18px;
}
.ma-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ma-field {
  display: grid;
  gap: 8px;
}
.ma-field-wide {
  grid-column: 1 / -1;
}
.ma-field span {
  color: rgba(233, 237, 239, 0.92);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ma-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ma-field input,
.ma-field textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
}
.ma-field textarea {
  min-height: 124px;
  resize: vertical;
}
.ma-field input::placeholder,
.ma-field textarea::placeholder {
  color: var(--muted);
}
.ma-field input:focus,
.ma-field textarea:focus {
  outline: none;
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}
.ma-form-actions {
  display: flex;
  justify-content: flex-end;
}
.ma-btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}
.ma-btn-primary:hover {
  background: linear-gradient(90deg, #0891b2, #2563eb);
}
.ma-account-table {
  display: grid;
  gap: 12px;
}
.ma-account-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}
.ma-account-main strong {
  display: block;
  font-size: 16px;
}
.ma-account-main p {
  margin: 6px 0 0;
  color: var(--muted);
}
.ma-account-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.ma-account-meta small {
  color: var(--muted);
}
.ma-role-pill {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.ma-login-shell {
  overflow: auto;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.08), transparent 24%),
    #0d1117;
  color: #c9d1d9;
}
.ma-login-github {
  min-height: 100vh;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 36px 24px;
}
.ma-login-topbar {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.ma-login-topbrand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #f0f6fc;
  font-weight: 700;
}
.ma-login-topbrand .ma-login-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #161b22;
  border: 1px solid #30363d;
}
.ma-login-github-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(360px, 420px);
  gap: 26px;
  align-items: center;
}
.ma-login-sidecard {
  padding: 34px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(
    180deg,
    rgba(22, 27, 34, 0.94) 0%,
    rgba(13, 17, 23, 0.98) 100%
  );
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}
.ma-login-sidecard h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 4.8vw, 60px);
  line-height: 1.02;
  color: #f0f6fc;
}
.ma-login-sidecard p {
  margin: 0;
  color: #8b949e;
  line-height: 1.75;
}
.ma-login-side-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.ma-login-side-list article {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.ma-login-side-list strong {
  color: #f0f6fc;
}
.ma-login-side-list span {
  color: #8b949e;
}
.ma-login-signin-wrap {
  display: grid;
  gap: 18px;
}
.ma-login-signin-header {
  text-align: center;
}
.ma-login-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  background: #161b22;
  border: 1px solid #30363d;
  color: #f0f6fc;
  font-weight: 800;
  font-size: 22px;
}
.ma-login-signin-header h2 {
  margin: 0 0 8px;
  font-size: 30px;
  color: #f0f6fc;
}
.ma-login-signin-header p {
  margin: 0;
  color: #8b949e;
}
.ma-login-form-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 22px;
  background: #161b22;
  border: 1px solid #30363d;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}
.ma-login-form-card .ma-field span {
  color: #f0f6fc;
}
.ma-login-form-card .ma-field input {
  background: #0d1117;
  border-color: #30363d;
  color: #f0f6fc;
}
.ma-login-form-card .ma-field input:focus {
  border-color: #2f81f7;
  box-shadow: 0 0 0 4px rgba(47, 129, 247, 0.16);
}
.ma-login-helper {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #8b949e;
}
.ma-login-helper strong {
  display: block;
  margin-bottom: 8px;
  color: #f0f6fc;
}
.ma-login-helper p {
  margin: 6px 0 0;
}
.ma-login-helper span {
  color: #8b949e;
}

.ma-top-actions {
  gap: 8px;
}
.ma-top-actions .ghost-link,
.ma-top-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.ma-top-actions .ghost-link:hover,
.ma-top-actions .ghost-button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.ma-mini-account {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}
.ma-mini-account strong {
  font-size: 15px;
}
.ma-mini-account span {
  margin-top: 2px;
}
.wa-sidebar-header {
  padding-bottom: 6px;
}
.wa-sidebar-top {
  align-items: flex-start;
  padding: 18px 16px 12px;
}
.wa-filters {
  padding-top: 4px;
}
.wa-chat-list {
  padding: 8px 0 0;
}
.ma-dashboard-banner-tight {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(
    180deg,
    rgba(17, 27, 33, 0.95) 0%,
    rgba(17, 27, 33, 0.85) 100%
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ma-dashboard-banner-tight h2 {
  margin: 0 0 6px;
  font-size: 32px;
}
.ma-dashboard-banner-tight p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.ma-dashboard-pills-top {
  margin-top: 6px;
}

@media (max-width: 1100px) {
  .ma-login-github-grid,
  .ma-settings-grid,
  .ma-admin-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .ma-shell {
    grid-template-columns: 1fr;
  }
  .ma-content-dark {
    padding: 18px;
  }
  .ma-page-header {
    flex-direction: column;
  }
  .ma-page-header-meta {
    justify-content: flex-start;
  }
  .ma-form-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .ma-login-github {
    padding: 20px 14px;
  }
  .ma-login-sidecard {
    padding: 24px;
  }
  .ma-login-form-card {
    padding: 18px;
  }
  .ma-dashboard-banner-tight {
    padding: 16px;
  }
  .ma-top-actions {
    width: 100%;
  }
  .ma-top-actions .ghost-link,
  .ma-top-actions form,
  .ma-top-actions .ghost-button {
    width: 100%;
  }
}

/* Mi asistente 24 refresh */
:root {
  --accent: #06b6d4;
  --accent-2: #3b82f6;
  --accent-3: #7c3aed;
  --bg-main: #030915;
  --bg-sidebar: #07111d;
  --bg-panel: rgba(20, 29, 39, 0.92);
  --bg-input: #111b2a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #edf2f7;
  --muted: #94a3b8;
}
body {
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.1), transparent 18%),
    radial-gradient(
      circle at 75% 12%,
      rgba(124, 58, 237, 0.08),
      transparent 14%
    ),
    #030915;
}
.ma-login-shell,
.ma-panel-page {
  overflow: auto;
}
.centered-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.brand-login-grid {
  width: min(1240px, 100%);
  grid-template-columns: 1.08fr 0.78fr;
  align-items: center;
}
.logo-sidecard,
.login-card-centered,
.ma-surface,
.ma-account-card,
.ma-login-helper,
.ma-login-form-card,
.wa-chat-topbar,
.summary-panel,
.wa-composer,
.ma-mini-account,
.ma-tag,
.ma-soft-pill,
.icon-circle-link {
  background: linear-gradient(
    180deg,
    rgba(23, 33, 45, 0.94),
    rgba(12, 19, 29, 0.96)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}
.ma-login-hero-logo {
  width: min(420px, 80%);
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
}
.ma-login-brand-mini {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 8px;
}
.ma-brand-logo-small {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 14px;
}
.ma-brand-logoized {
  align-items: center;
  gap: 12px;
}
.ma-brand-mark-image {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}
.ma-sidebar-brand-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.icon-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.icon-circle-link {
  width: 46px;
  height: 46px;
  min-width: 46px;
  max-width: 46px;
  border-radius: 14px;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: 0.2s ease;
  padding: 0;
  box-sizing: border-box;
  flex: 0 0 46px;
  line-height: 1;
}
.icon-circle-link svg {
  width: 20px;
  height: 20px;
}
.icon-circle-link[href="/support"] svg,
.icon-circle-link[href="/admin/support"] svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.95;
}
.icon-circle-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}
.refined-top {
  align-items: center;
  padding-bottom: 16px;
}
.wa-layout {
  grid-template-columns: 380px 1fr;
  background: transparent;
}
.wa-sidebar {
  background: linear-gradient(180deg, #07111d 0%, #040a13 100%);
}
.wa-sidebar-header {
  background: linear-gradient(
    180deg,
    rgba(7, 17, 29, 0.98),
    rgba(7, 17, 29, 0.94)
  );
}
.wa-search-wrap.compact {
  padding: 0 14px 12px;
}
input.wa-search {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111b2a;
  color: var(--text);
  border-radius: 0;
  padding: 14px 14px;
  font-size: 15px;
}
.wa-filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.wa-semaphore-filters {
  padding: 0 10px 10px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
}
.semaphore-filter {
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 700;
  color: #dce7f3;
  background: rgba(255, 255, 255, 0.03);
}
.read-filter {
  padding: 10px 14px;
  border-radius: 999px;
}
.semaphore-filter .status-dot {
  width: 12px;
  height: 12px;
}
.wa-main {
  background: linear-gradient(
    180deg,
    rgba(3, 9, 21, 0.82),
    rgba(5, 12, 23, 0.98)
  );
}
.wa-main-sticky.no-banner {
  top: 0;
  padding: 14px 14px 0;
}
.fixed-summary-bar {
  border-radius: 20px;
  padding: 18px 18px 14px;
  margin: 0;
}
.summary-toggle-btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.22);
}
.summary-toggle-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.wa-chat-topbar-actions {
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.chat-meta-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 140px;
}
.toggle-wrap {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 12px;
}
.wa-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  height: 100%;
  padding: 40px;
}
.ma-empty-logo {
  width: 180px;
  opacity: 0.88;
  margin-bottom: 10px;
}
.ma-search-users input,
.ma-field input,
.ma-field textarea {
  background: #0f1826;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  width: 100%;
}
.ma-field textarea {
  min-height: 112px;
  resize: vertical;
}
.ma-btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
}
.ma-btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fecaca;
}
.ma-btn-small {
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 12px;
}
.ma-account-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ma-inline-edit {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.compact-form .ma-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.single-column-settings {
  display: block;
}
.form-inspiration-card {
  position: relative;
  overflow: hidden;
}
.form-inspiration-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1),
    transparent 28%,
    rgba(46, 168, 255, 0.08) 62%,
    rgba(123, 60, 255, 0.08)
  );
  pointer-events: none;
}
.ma-nav a,
.ma-btn-sidebar {
  border-radius: 14px;
}
.ma-nav a.active,
.ma-btn-sidebar {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.04)
  );
}
.ma-login-form-card {
  padding: 20px;
}
.ma-btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #04131a;
  border: none;
}
.ma-btn-primary:hover {
  filter: brightness(1.05);
}
.wa-chat-list .wa-chat-item.active,
.wa-chat-list .wa-chat-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.wa-chat-item {
  padding: 16px 18px;
}
.wa-chat-messages {
  padding: 24px 22px 16px;
  height: calc(100vh - 230px);
  overflow: auto;
}
.wa-composer {
  margin: 0 14px 14px;
  border-radius: 18px;
  padding: 16px;
}
.ma-search-users {
  margin-bottom: 14px;
}
.ma-login-side-list article {
  border-radius: 16px;
}
@media (max-width: 1100px) {
  .brand-login-grid {
    grid-template-columns: 1fr;
  }
  .logo-sidecard {
    text-align: center;
  }
  .wa-layout {
    grid-template-columns: 320px 1fr;
  }
  .compact-form .ma-form-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .wa-layout {
    display: block;
    position: relative;
    height: 100vh;
    overflow: hidden;
  }
  .wa-sidebar {
    position: absolute;
    inset: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
  }
  .wa-sidebar-header {
    flex-shrink: 0;
  }
  .wa-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: none;
  }
  .wa-main {
    position: absolute;
    inset: 0;
    height: 100vh;
    display: flex !important;
    flex-direction: column;
    background: var(--bg-chat);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
  }
  .wa-layout.chat-open .wa-sidebar {
    transform: translateX(-100%);
  }
  .wa-layout.chat-open .wa-main {
    transform: translateX(0);
    z-index: 3;
  }
  .wa-chat-panel {
    flex: 1;
    min-height: 0;
    height: 100%;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
  }
  .wa-chat-messages {
    height: auto !important;
    min-height: 0;
    overflow-y: auto;
  }
  .wa-mobile-back {
    display: inline-flex !important;
  }
  .ma-admin-grid {
    grid-template-columns: 1fr;
  }
  .ma-page-header {
    flex-direction: column;
  }
  .wa-semaphore-filters {
    grid-template-columns: repeat(4, 1fr);
  }
  .ma-top-actions.icon-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* Mobile back button */
.wa-mobile-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: 0.18s ease;
}
.wa-mobile-back:hover {
  background: rgba(255, 255, 255, 0.12);
}
.wa-mobile-back svg {
  width: 20px;
  height: 20px;
}

/* === Icon Topbar — Settings / Users pages === */
.ma-shell-topbar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ma-icon-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 22px 24px;
  background: linear-gradient(180deg, #07111d 0%, #040a13 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.ma-icon-topbar > form {
  display: contents;
}

.ma-icon-topbar .icon-circle-link {
  width: 58px;
  height: 58px;
  min-width: 58px;
  max-width: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(23, 33, 45, 0.94), rgba(12, 19, 29, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
  font: inherit;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
}

.ma-icon-topbar .icon-circle-link svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.ma-icon-topbar .icon-circle-link[href="/support"] svg,
.ma-icon-topbar .icon-circle-link[href="/admin/support"] svg,
.wa-page-topbar .icon-circle-link[href="/support"] svg,
.wa-page-topbar .icon-circle-link[href="/admin/support"] svg {
  width: 29px;
  height: 29px;
  stroke-width: 1.95;
}

.ma-icon-topbar .icon-circle-link.active {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.09));
  border-color: rgba(6, 182, 212, 0.32);
  color: var(--accent);
  box-shadow: 0 8px 28px rgba(6, 182, 212, 0.18);
}

.ma-icon-topbar .icon-circle-link:hover:not(.active) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.ma-content-dark.ma-topbar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* === wa-page: new inbox layout (topbar + layout) === */
body.inbox-body {
  overflow: hidden;
  height: 100vh;
  background: linear-gradient(135deg, #060d15 0%, #0b141a 40%, #0d1520 70%, #090c18 100%);
}
body.inbox-body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(6,182,212,.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(124,58,237,.06) 0%, transparent 60%);
}
.wa-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.wa-page-topbar {
  flex-shrink: 0;
  position: static; /* override sticky from ma-icon-topbar */
}
.wa-page > .wa-layout {
  flex: 1 !important;
  min-height: 0 !important;
  height: auto !important;
  display: grid;
  grid-template-columns: 380px 1fr;
  overflow: hidden;
}
@media (max-width: 1100px) {
  .wa-page > .wa-layout {
    grid-template-columns: 320px 1fr;
  }
}
.wa-page .wa-sidebar {
  height: 100%;
  max-height: none !important;
  min-height: 0 !important;
  overflow: hidden;
}
.wa-page .wa-sidebar-header {
  background: linear-gradient(180deg, rgba(7, 17, 29, 0.98), rgba(7, 17, 29, 0.94));
}
.wa-page .wa-main {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wa-page .wa-chat-panel {
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
.wa-page .wa-chat-messages {
  height: auto !important;
  min-height: 0 !important;
  overflow-y: auto;
}

/* Filter toggle */
.wa-filter-toggle {
  appearance: none;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.wa-filter-toggle .filter-arrow {
  margin-left: auto;
  transition: transform 0.22s ease;
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.wa-filter-toggle[aria-expanded="true"] .filter-arrow {
  transform: rotate(180deg);
}
.wa-filter-panel {
  overflow: hidden;
}
@media (max-width: 820px) {
  .wa-filter-panel {
    max-height: 0;
    transition: max-height 0.25s ease;
  }
  .wa-filter-panel.open {
    max-height: 200px;
  }
  .wa-page > .wa-layout {
    display: block !important;
    position: relative;
    overflow: hidden;
  }
  .wa-page .wa-sidebar {
    position: absolute;
    inset: 0;
    height: 100% !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    overflow: hidden;
  }
  .wa-page .wa-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: none !important;
  }
  .wa-page .wa-main {
    position: absolute;
    inset: 0;
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
  }
  .wa-page .wa-layout.chat-open .wa-sidebar {
    transform: translateX(-100%);
  }
  .wa-page .wa-layout.chat-open .wa-main {
    transform: translateX(0);
    z-index: 3;
  }
}
@media (min-width: 821px) {
  .wa-filter-panel {
    max-height: none !important;
  }
  .wa-filter-toggle .filter-arrow { display: none; }
  .wa-filter-toggle { cursor: default; pointer-events: none; }
}

/* Summary panel border radius */
.summary-panel {
  border-radius: 14px;
  overflow: hidden;
  margin-top: 10px;
  padding: 14px 16px;
}

/* Admin users overflow fix */
body.ma-panel-page {
  overflow-x: hidden;
}
.ma-account-card {
  flex-wrap: wrap;
  overflow: hidden;
}
.ma-account-main {
  min-width: 0;
  flex: 1;
}
.ma-account-main strong,
.ma-account-main p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 540px) {
  .ma-account-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 4px;
  }
  .ma-account-meta {
    justify-items: start;
  }
}

/* Login landing redesign */
.ma-login-landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.ma-login-landing-inner {
  width: min(680px, 100%);
}
.ma-login-landing-inner .ma-login-hero-logo {
  width: min(360px, 70%);
  margin-bottom: 24px;
}
.ma-login-landing-inner h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.06;
  color: #f0f6fc;
}
.ma-login-landing-inner > p {
  margin: 0 0 24px;
  color: #8b949e;
  line-height: 1.75;
  max-width: 560px;
}
.ma-login-cta {
  margin-top: 28px;
  padding: 15px 32px;
  font-size: 16px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ma-login-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.ma-login-fullpage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.ma-signin-card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: linear-gradient(180deg, rgba(23, 33, 45, 0.98), rgba(12, 19, 29, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.ma-signin-header {
  text-align: center;
  margin-bottom: 24px;
}
.ma-signin-header img {
  width: 80px;
  margin-bottom: 14px;
}
.ma-signin-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  color: #f0f6fc;
}
.ma-signin-header p {
  margin: 0;
  color: #8b949e;
  font-size: 14px;
}
.ma-signin-card .ma-field {
  margin-bottom: 14px;
}
.ma-signin-card .ma-field:last-of-type {
  margin-bottom: 18px;
}
.ma-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 10px 0 0;
  transition: color 0.18s;
}
.ma-back-link:hover { color: var(--text); }

/* --- Hotfixes v5 --- */
.summary-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.summary-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: 0.18s ease;
  padding: 0;
}
.summary-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.wa-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
}
.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.composer-row input {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  display: block;
}
#sendHumanReplyBtn {
  height: 48px;
  padding: 0 24px;
  align-self: center;
  white-space: nowrap;
}
.wa-chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}
.wa-chat-messages {
  min-height: 0;
}
.icon-circle-link.ghost-button {
  background: transparent;
}
.ma-brand-logo-small,
.ma-brand-mark-image,
.ma-login-brand-mini {
  background: transparent;
  border-radius: 0;
}
.ma-empty-logo {
  width: 220px;
  opacity: 1;
}
.ma-login-hero-logo {
  width: min(500px, 88%);
}
.login-card-centered {
  justify-self: center;
}
.centered-login .brand-login-grid {
  justify-content: center;
}

/* === Login: match card heights === */
.brand-login-grid,
.ma-login-github-grid {
  align-items: stretch;
}
.ma-login-signin-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 34px;
}
.ma-btn-forgot {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 8px 0 0;
  cursor: pointer;
  transition: color 0.18s ease;
  text-align: center;
}
.ma-btn-forgot:hover {
  color: var(--text);
}

/* === Logout confirmation modal === */
.ma-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ma-modal-overlay.hidden {
  display: none !important;
}
.ma-modal {
  background: linear-gradient(180deg, rgba(23, 33, 45, 0.98), rgba(12, 19, 29, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 28px 24px 22px;
  width: min(360px, 90vw);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ma-modal h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text);
}
.ma-modal p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}
.ma-modal-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  margin: 0 0 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  box-sizing: border-box;
}
.ma-modal-input:focus {
  outline: none;
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}
.ma-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* === Mobile icon topbar for Inbox === */
.wa-mobile-icons {
  display: none;
}

@media (max-width: 820px) {
  .wa-mobile-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 24px;
    background: linear-gradient(180deg, #07111d 0%, #040a13 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }
  .wa-mobile-icons > form {
    display: contents;
  }
.wa-mobile-icons .icon-circle-link {
  width: 52px;
  height: 52px;
  min-width: 52px;
  max-width: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 33, 45, 0.94), rgba(12, 19, 29, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    color: var(--text);
    display: grid;
    place-items: center;
    transition: 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
  font: inherit;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
}
.wa-mobile-icons .icon-circle-link svg {
  width: 22px;
  height: 22px;
}
.wa-mobile-icons .icon-circle-link[href="/support"] svg,
.wa-mobile-icons .icon-circle-link[href="/admin/support"] svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}
  .wa-mobile-icons .icon-circle-link.active {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.09));
    border-color: rgba(6, 182, 212, 0.32);
    color: var(--accent);
    box-shadow: 0 8px 28px rgba(6, 182, 212, 0.18);
  }
  .wa-sidebar-top.refined-top {
    display: none;
  }
  /* Mobile padding & grid fixes */
  .ma-content-dark {
    padding: 16px;
  }
  .ma-form-grid {
    grid-template-columns: 1fr !important;
  }
  .ma-icon-topbar {
    padding: 16px 20px;
    gap: 16px;
  }
  .ma-icon-topbar .icon-circle-link {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
  .ma-icon-topbar .icon-circle-link svg {
    width: 22px;
    height: 22px;
  }
}

/* === v7 polish === */

/* Message bubble spacing */
.wa-message-row { margin-bottom: 8px; }
.wa-message-row:last-child { margin-bottom: 0; }

/* Settings sections gap */
.single-column-settings {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Filter area container with border-radius */
.wa-filter-box {
  margin: 14px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.wa-filter-box .wa-filter-toggle {
  padding: 10px 14px;
  width: 100%;
}
.wa-filter-box .wa-semaphore-section,
.wa-filter-box .wa-read-filters {
  padding-left: 12px;
  padding-right: 12px;
}

/* Desktop: prevent account card wrapping */
@media (min-width: 541px) {
  .ma-account-card { flex-wrap: nowrap; }
}

/* Desktop vs mobile label toggle */
.label-mobile { display: none; }
.label-desktop { display: inline; }

/* Summary modal sizing */
.ma-summary-modal {
  width: min(560px, 90vw);
  max-height: 70vh;
  overflow-y: auto;
}
.ma-summary-modal p {
  margin: 0;
  line-height: 1.75;
  color: var(--muted);
  white-space: pre-wrap;
}
.ma-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ma-modal-head h3 { margin: 0; }
.ma-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.18s;
}
.ma-modal-close:hover { color: var(--text); }

/* Mobile conversation view refinements */
@media (max-width: 820px) {
  #chatHeaderAiBadge { display: none; }
  .wa-contact-title-block { gap: 1px; }
  .label-mobile { display: inline; }
  .label-desktop { display: none; }
  .mobile-meta-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .mobile-meta-group .chat-meta-pill {
    min-width: 0;
    flex: 1;
    padding: 7px 10px;
  }
}

/* === v8 polish === */

/* Fix search input border-radius */
input.wa-search {
  border-radius: 12px !important;
}

/* Desktop: force account card no-wrap */
@media (min-width: 541px) {
  .ma-account-card {
    flex-wrap: nowrap !important;
  }
}

/* Mobile topbar: hide when chat is open */
@media (max-width: 820px) {
  .wa-page.chat-active .wa-page-topbar {
    display: none;
  }
}

/* Mobile chat header: compact mode */
@media (max-width: 820px) {
  .compact-topbar {
    padding: 10px 14px 8px !important;
  }
  .wa-contact-heading {
    gap: 8px;
  }
  .wa-contact-title-block {
    gap: 0 !important;
  }
  .wa-contact-title-block h2,
  #chatHeaderName {
    font-size: 15px;
    line-height: 1.2;
  }
  .wa-contact-title-block p,
  #chatHeaderPhone {
    font-size: 11px !important;
    margin: 0 !important;
    color: var(--muted);
  }
  .wa-chat-topbar-actions {
    padding-top: 4px;
    gap: 5px;
  }
  .summary-toggle-btn {
    min-height: 0 !important;
    padding: 5px 11px !important;
    font-size: 12px !important;
  }
  .chat-meta-pill {
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 4px 9px !important;
    font-size: 12px !important;
  }
  .chat-meta-pill .summary-label {
    font-size: 9px;
    margin-bottom: 1px;
  }
  .chat-meta-pill strong {
    font-size: 12px;
  }
  .toggle-wrap {
    flex-direction: row !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
  }
  .toggle-wrap input {
    width: 36px !important;
    height: 20px !important;
  }
  .toggle-wrap input::after {
    width: 14px !important;
    height: 14px !important;
    top: 3px !important;
    left: 3px !important;
  }
  .toggle-wrap input:checked::after {
    transform: translateX(16px) !important;
  }
}

/* === Login page v2 === */
.ma-login-landing {
  position: relative;
  overflow: hidden;
  background: #0b1120;
  padding: 40px 20px;
}
.ma-login-landing::before {
  content: '';
  position: absolute;
  left: -25%;
  top: 10%;
  width: 65%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(110, 40, 210, 0.22), transparent 60%);
  pointer-events: none;
}
.ma-login-landing::after {
  content: '';
  position: absolute;
  right: -20%;
  bottom: 5%;
  width: 60%;
  height: 75%;
  background: radial-gradient(ellipse, rgba(0, 90, 200, 0.18), transparent 60%);
  pointer-events: none;
}
.ma-login-watermark {
  position: absolute;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}
.ma-login-watermark-left {
  left: -80px;
  bottom: -60px;
  width: 440px;
  filter: hue-rotate(240deg) saturate(1.8) brightness(0.55);
}
.ma-login-watermark-right {
  right: -90px;
  bottom: 20px;
  width: 400px;
  filter: hue-rotate(170deg) saturate(1.6) brightness(0.6);
}
.ma-landing-card {
  position: relative;
  z-index: 1;
  width: min(480px, 92vw);
  background: rgba(13, 18, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}
.ma-landing-logo {
  width: 140px;
  margin-bottom: 10px;
}
.ma-landing-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 14px;
  margin: 4px 0 14px;
}
.ma-landing-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 12px;
  color: #f0f6fc;
}
.ma-landing-gradient {
  background: linear-gradient(90deg, #06b6d4, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ma-landing-desc {
  font-size: 14px;
  color: #8b949e;
  line-height: 1.65;
  margin: 0 0 20px;
  max-width: 380px;
}
.ma-landing-features {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  text-align: left;
}
.ma-landing-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 14px 16px;
}
.ma-feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ma-feature-icon svg {
  width: 20px;
  height: 20px;
}
.ma-feature-purple { background: rgba(120, 80, 220, 0.2); color: #a78bfa; }
.ma-feature-teal   { background: rgba(0,  180, 150, 0.18); color: #34d399; }
.ma-landing-feature-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 2px;
}
.ma-landing-feature-text span {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.5;
}
.ma-landing-cta-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 18px;
  background: linear-gradient(90deg, #06b6d4 0%, #7c3aed 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.2s, transform 0.18s;
}
.ma-landing-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.ma-landing-cta-btn svg {
  width: 18px;
  height: 18px;
}

/* === v9: desktop sidebar nav + mobile header/composer redesign === */

/* Desktop: left-side vertical nav — centered on the viewport */
@media (min-width: 821px) {
  .ma-shell-topbar,
  .wa-page {
    padding-left: 112px;
    box-sizing: border-box;
  }

  .wa-sidebar-inset-nav { display: none; }

  .ma-icon-topbar,
  .wa-page-topbar {
    position: fixed !important;
    top: 50% !important;
    left: 24px !important;
    transform: translateY(-50%) !important;
    width: auto !important;
    padding: 0 !important;
    gap: 18px;
    background: none !important;
    border: none !important;
    z-index: 400;
    display: flex !important;
    flex-direction: column;
    justify-content: center !important;
    align-items: center;
    flex-shrink: 0;
  }
}

/* Sidebar inset nav (desktop only) */
.wa-sidebar-inset-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.wa-sidebar-inset-nav .icon-circle-link.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.wa-sidebar-inset-nav .icon-circle-link.small svg {
  width: 17px;
  height: 17px;
}
.wa-sidebar-inset-nav form { display: contents; }

/* Mobile header row (row 1: contact + toggle) */
.wa-mobile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.wa-mobile-header-row .wa-contact-heading {
  flex: 1;
  min-width: 0;
}

/* Show/hide toggles per viewport */
.mobile-only-toggle { display: none; }
.desktop-only-toggle { display: inline-flex; }

@media (max-width: 820px) {
  .mobile-only-toggle {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 5px 9px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
  }
  .mobile-only-toggle input {
    width: 32px !important;
    height: 18px !important;
  }
  .mobile-only-toggle input::after {
    width: 12px !important;
    height: 12px !important;
    top: 3px !important;
    left: 3px !important;
  }
  .mobile-only-toggle input:checked::after {
    transform: translateX(14px) !important;
  }
  .desktop-only-toggle { display: none; }
  /* Also hide the original toggle-wrap label-mobile span when using the new mobile-only-toggle */
}

/* "Respuesta IA" visual toggle in header (mobile only, far right of name row) */
.header-ia-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
@media (max-width: 820px) {
  .header-ia-toggle {
    display: flex;
  }
}

/* Resumen button icon */
.summary-btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
@media (max-width: 820px) {
  .summary-toggle-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px !important;
    padding: 8px 14px !important;
    min-height: 36px !important;
  }
}

@media (max-width: 430px) {
  .compact-topbar {
    padding: 12px 14px 10px !important;
  }
  .wa-mobile-header-row {
    gap: 12px;
    align-items: flex-start;
  }
  .wa-contact-heading {
    gap: 10px !important;
  }
  .wa-mobile-back {
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
  }
  .wa-mobile-back svg {
    width: 20px !important;
    height: 20px !important;
  }
  .wa-contact-title-block h2,
  #chatHeaderName {
    font-size: 17px !important;
    line-height: 1.15 !important;
  }
  .wa-contact-title-block p,
  #chatHeaderPhone {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
  .header-ia-toggle {
    gap: 8px !important;
    font-size: 13px !important;
  }
  .wa-mci-toggle-visual {
    width: 36px !important;
    height: 20px !important;
  }
  .wa-mci-toggle-visual::after {
    width: 14px !important;
    height: 14px !important;
  }
  .wa-mci-toggle-visual.on::after {
    transform: translateX(16px) !important;
  }
  .wa-chat-topbar-actions {
    padding-top: 8px !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .summary-toggle-btn {
    min-height: 44px !important;
    padding: 10px 14px !important;
    border-radius: 15px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
  }
  .summary-btn-icon {
    width: 16px !important;
    height: 16px !important;
  }
  .mobile-meta-group {
    gap: 8px !important;
  }
  .mobile-meta-group .chat-meta-pill,
  .chat-meta-pill {
    min-height: 44px !important;
    padding: 8px 10px !important;
    border-radius: 15px !important;
    gap: 8px !important;
  }
  .chat-meta-pill .summary-label {
    font-size: 10px !important;
    margin-bottom: 2px !important;
  }
  .chat-meta-pill strong {
    font-size: 13px !important;
    line-height: 1.15 !important;
  }
  .pill-icon {
    width: 15px !important;
    height: 15px !important;
  }
}

/* Meta pill icon + text layout */
.pill-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.65;
}
.pill-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.chat-meta-pill {
  display: inline-flex !important;
  align-items: center !important;
  flex-direction: row !important;
  gap: 8px !important;
}

/* Mobile composer info card */
.wa-mobile-composer-info {
  display: none;
}
@media (max-width: 820px) {
  #humanComposer.disabled .wa-mobile-composer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    text-align: center;
  }
  #humanComposer.disabled .wa-composer-input-wrap {
    display: none;
  }
}
.wa-mci-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.wa-mci-icon svg { width: 30px; height: 30px; }
.wa-mci-body strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.wa-mci-body p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.wa-mci-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
}
.wa-mci-toggle-visual {
  display: inline-block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #3b4a54;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.wa-mci-toggle-visual::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}
.wa-mci-toggle-visual.on {
  background: var(--accent);
}
.wa-mci-toggle-visual.on::after {
  transform: translateX(18px);
}

/* === v10 nav consolidation === */

/* Always hide the old sidebar inset nav (replaced by inline nav) */
.wa-sidebar-inset-nav { display: none !important; }

/* Hide mobile top toggle — it's redundant (bottom card already has toggle) */
.mobile-only-toggle { display: none !important; }

/* Inline nav: always hidden — topbar handles navigation on desktop */
.wa-inline-nav { display: none !important; }
@media (min-width: 821px) {
  .wa-inline-nav {
    display: none !important;
  }
  .wa-inline-nav .icon-circle-link {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  .wa-inline-nav .icon-circle-link svg {
    width: 20px;
    height: 20px;
  }
  /* Chat header nav: centered column, same styling as settings ma-icon-topbar */
  .wa-chat-header-nav {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    gap: 12px;
    justify-content: center;
  }
  .wa-chat-header-nav .icon-circle-link {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(23, 33, 45, 0.94), rgba(12, 19, 29, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    color: var(--text);
    display: grid;
    place-items: center;
    transition: 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    appearance: none;
    font: inherit;
  }
  .wa-chat-header-nav .icon-circle-link svg {
    width: 22px;
    height: 22px;
  }
  .wa-chat-header-nav .icon-circle-link.active {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.09));
    border-color: rgba(6, 182, 212, 0.32);
    color: var(--accent);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.18);
  }
  .wa-chat-header-nav .icon-circle-link:hover:not(.active) {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
  }
  /* Empty state nav: slightly larger, no divider */
  .wa-empty-nav {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    gap: 12px;
    margin-bottom: 24px;
  }
  .wa-empty-nav .icon-circle-link {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }
  .wa-empty-nav .icon-circle-link svg {
    width: 24px;
    height: 24px;
  }
}

/* Compact mobile Atención humana card */
.wa-mobile-composer-info {
  display: none;
}
@media (max-width: 820px) {
  #humanComposer.disabled .wa-mobile-composer-info {
    padding: 14px 16px 12px !important;
    gap: 8px !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
  }
  .wa-mci-icon {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0;
  }
  .wa-mci-icon svg { width: 22px !important; height: 22px !important; }
  .wa-mci-body {
    flex: 1;
    min-width: 0;
  }
  .wa-mci-body strong {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }
  .wa-mci-body p {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }
  .wa-mci-footer {
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0;
    font-size: 11px !important;
  }
  .wa-mci-toggle-visual {
    width: 32px !important;
    height: 18px !important;
  }
  .wa-mci-toggle-visual::after {
    width: 12px !important;
    height: 12px !important;
  }
  .wa-mci-toggle-visual.on::after {
    transform: translateX(14px) !important;
  }
}

/* === Universal background (matches login landing) === */
body,
body.ma-login-shell,
body.ma-panel-page,
body.inbox-body {
  background-color: #0b1120 !important;
  background-image:
    radial-gradient(ellipse 70% 80% at -18% 42%, rgba(100, 30, 210, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 65% 70% at 112% 82%, rgba(0, 80, 200, 0.18) 0%, transparent 58%) !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
}

/* Make main containers semi-transparent so body blobs show through */
.ma-icon-topbar {
  background: rgba(7, 10, 20, 0.82) !important;
  backdrop-filter: blur(14px) !important;
}
@media (min-width: 821px) {
  .ma-icon-topbar,
  .wa-page-topbar {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
  }
}
.ma-content-dark {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.06), transparent 28%),
    rgba(10, 15, 30, 0.72) !important;
}
/* Inbox: sidebar + chat area */
.wa-sidebar {
  background: rgba(13, 20, 33, 0.78) !important;
  backdrop-filter: blur(8px);
}
.wa-sidebar-header {
  background: rgba(13, 20, 33, 0.92) !important;
  backdrop-filter: blur(10px);
}
.wa-chat-messages {
  background: rgba(8, 12, 24, 0.60) !important;
}
.wa-chat-topbar,
.wa-chat-topbar.compact-topbar {
  background: rgba(10, 16, 32, 0.88) !important;
  backdrop-filter: blur(12px) !important;
}
.wa-composer {
  background: rgba(10, 16, 30, 0.90) !important;
  backdrop-filter: blur(10px);
}

/* === v11: filter top spacing + mobile viewport fix === */

/* Use dynamic viewport height so layout fits the visible area on mobile (excludes browser chrome) */
body.inbox-body {
  height: 100dvh !important;
}
.wa-page {
  height: 100dvh !important;
}

/* Give the search input top breathing room on mobile so it's not flush with the top edge */
@media (max-width: 820px) {
  .wa-search-wrap.compact {
    padding-top: 10px !important;
  }
}

/* Match calendar mobile nav sizing/spacing across inbox, settings, dashboard and users */
@media (max-width: 768px) {
  .ma-icon-topbar,
  .wa-page-topbar {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)) !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    padding: 10px 12px !important;
    gap: 6px !important;
    min-height: auto !important;
    justify-content: stretch !important;
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    scrollbar-width: none;
  }
  .ma-icon-topbar::-webkit-scrollbar,
  .wa-page-topbar::-webkit-scrollbar {
    display: none;
  }
  .ma-icon-topbar .icon-circle-link,
  .wa-page-topbar .icon-circle-link {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 16px !important;
    flex: none !important;
  }
  .ma-icon-topbar .icon-circle-link svg,
  .wa-page-topbar .icon-circle-link svg {
    width: 21px !important;
    height: 21px !important;
  }
  .ma-icon-topbar .icon-circle-link[href="/support"] svg,
  .ma-icon-topbar .icon-circle-link[href="/admin/support"] svg,
  .wa-page-topbar .icon-circle-link[href="/support"] svg,
  .wa-page-topbar .icon-circle-link[href="/admin/support"] svg {
    width: 24px !important;
    height: 24px !important;
    stroke-width: 2.05 !important;
  }
}

@media (max-width: 430px) {
  .ma-icon-topbar,
  .wa-page-topbar {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)) !important;
    padding: 10px !important;
    gap: 6px !important;
  }
  .ma-icon-topbar .icon-circle-link,
  .wa-page-topbar .icon-circle-link {
    border-radius: 15px !important;
  }
  .ma-icon-topbar .icon-circle-link svg,
  .wa-page-topbar .icon-circle-link svg {
    width: 20px !important;
    height: 20px !important;
  }
  .ma-icon-topbar .icon-circle-link[href="/support"] svg,
  .ma-icon-topbar .icon-circle-link[href="/admin/support"] svg,
  .wa-page-topbar .icon-circle-link[href="/support"] svg,
  .wa-page-topbar .icon-circle-link[href="/admin/support"] svg {
    width: 23px !important;
    height: 23px !important;
    stroke-width: 2.05 !important;
  }
  .biz-active-strip {
    top: 54px;
  }
}

@media (max-width: 360px) {
  .ma-icon-topbar,
  .wa-page-topbar {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)) !important;
    row-gap: 6px !important;
    column-gap: 5px !important;
    justify-content: stretch !important;
    padding: 10px !important;
  }
  .biz-active-strip {
    top: 92px;
  }
}

/* === User theme toggle + light theme for authenticated pages === */
.ma-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  min-width: 238px;
  padding: 9px 10px 9px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(23, 33, 45, 0.94), rgba(12, 19, 29, 0.96));
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: 0.18s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
.ma-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
}
.ma-theme-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.ma-theme-toggle-label {
  font-size: 15px;
  line-height: 1.1;
}
.ma-theme-toggle-state {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.ma-theme-switch {
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.ma-theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  color: #475569;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.ma-theme-toggle[aria-pressed="true"] .ma-theme-switch {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.84), rgba(59, 130, 246, 0.92));
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 10px 22px rgba(6, 182, 212, 0.2);
}
.ma-theme-toggle[aria-pressed="true"] .ma-theme-switch-thumb {
  transform: translateX(24px);
  color: #0891b2;
}

html[data-ui-theme="light"] {
  --accent: #0891b2;
  --accent-2: #2563eb;
  --accent-3: #7c3aed;
  --bg-main: #edf4fb;
  --bg-sidebar: #f6faff;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-chat: #f2f7fc;
  --bg-input: #eef4fb;
  --border: rgba(148, 163, 184, 0.24);
  --text: #0f172a;
  --muted: #64748b;
  --bubble-user: linear-gradient(180deg, #d7f8e2 0%, #c8f1d7 100%);
  --bubble-bot: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  --bubble-human: linear-gradient(180deg, #e5edff 0%, #dce7ff 100%);
}
html[data-ui-theme="light"] body {
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.08), transparent 22%),
    radial-gradient(circle at 78% 14%, rgba(6, 182, 212, 0.08), transparent 16%),
    #edf4fb;
}
html[data-ui-theme="light"] body.inbox-body,
html[data-ui-theme="light"] body.ma-panel-page {
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.1), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%) !important;
}
html[data-ui-theme="light"] body.inbox-body::before {
  background:
    radial-gradient(ellipse 58% 48% at 10% 18%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 92% 82%, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
}
html[data-ui-theme="light"] .logo-sidecard,
html[data-ui-theme="light"] .login-card-centered,
html[data-ui-theme="light"] .ma-surface,
html[data-ui-theme="light"] .ma-account-card,
html[data-ui-theme="light"] .ma-login-helper,
html[data-ui-theme="light"] .ma-login-form-card,
html[data-ui-theme="light"] .wa-chat-topbar,
html[data-ui-theme="light"] .summary-panel,
html[data-ui-theme="light"] .wa-composer,
html[data-ui-theme="light"] .ma-mini-account,
html[data-ui-theme="light"] .ma-tag,
html[data-ui-theme="light"] .ma-soft-pill,
html[data-ui-theme="light"] .icon-circle-link,
html[data-ui-theme="light"] .chat-meta-pill,
html[data-ui-theme="light"] .toggle-wrap,
html[data-ui-theme="light"] .semaphore-filter,
html[data-ui-theme="light"] .read-filter,
html[data-ui-theme="light"] .ma-theme-toggle {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(241, 245, 249, 0.98)) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08) !important;
  color: var(--text);
}
html[data-ui-theme="light"] .ma-page-header h1,
html[data-ui-theme="light"] .ma-surface-head h2,
html[data-ui-theme="light"] .ma-surface-hero h2,
html[data-ui-theme="light"] .ma-account-main strong {
  color: #0f172a !important;
}
html[data-ui-theme="light"] .ma-page-header p:last-child,
html[data-ui-theme="light"] .ma-surface-head p,
html[data-ui-theme="light"] .ma-surface-hero p,
html[data-ui-theme="light"] .ma-account-main p,
html[data-ui-theme="light"] .ma-account-meta small,
html[data-ui-theme="light"] .ma-field span,
html[data-ui-theme="light"] .ma-hero-points span {
  color: #475569 !important;
}
html[data-ui-theme="light"] .ma-theme-switch {
  background: rgba(148, 163, 184, 0.26);
  border-color: rgba(148, 163, 184, 0.34);
}
html[data-ui-theme="light"] .ma-theme-switch-thumb {
  background: #ffffff;
  color: #0891b2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}
html[data-ui-theme="light"] .ma-theme-toggle[aria-pressed="true"] .ma-theme-switch {
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}
html[data-ui-theme="light"] .icon-circle-link.active {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.16), rgba(6, 182, 212, 0.08)) !important;
  border-color: rgba(8, 145, 178, 0.28) !important;
  color: var(--accent) !important;
  box-shadow: 0 12px 28px rgba(6, 182, 212, 0.14) !important;
}
html[data-ui-theme="light"] .ma-icon-topbar,
html[data-ui-theme="light"] .wa-page-topbar {
  background: rgba(255, 255, 255, 0.78) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(16px) !important;
}
@media (min-width: 821px) {
  html[data-ui-theme="light"] .ma-icon-topbar,
  html[data-ui-theme="light"] .wa-page-topbar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
}
html[data-ui-theme="light"] .ma-icon-topbar .icon-circle-link,
html[data-ui-theme="light"] .wa-page-topbar .icon-circle-link {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98)) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
  color: #172033 !important;
}
html[data-ui-theme="light"] .ma-icon-topbar .icon-circle-link:hover:not(.active),
html[data-ui-theme="light"] .wa-page-topbar .icon-circle-link:hover:not(.active) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(236, 242, 249, 0.98)) !important;
  border-color: rgba(14, 165, 233, 0.22) !important;
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.1) !important;
}
html[data-ui-theme="light"] .wa-sidebar {
  background: linear-gradient(180deg, #f9fbff 0%, #eef4fb 100%) !important;
  border-right-color: var(--border) !important;
}
html[data-ui-theme="light"] .wa-sidebar-header {
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.07), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 255, 0.97)) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
html[data-ui-theme="light"] .wa-main {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.85), rgba(239, 244, 251, 0.96)) !important;
}
html[data-ui-theme="light"] .wa-page,
html[data-ui-theme="light"] .wa-page > .wa-layout,
html[data-ui-theme="light"] .wa-chat-panel {
  background: transparent !important;
}
html[data-ui-theme="light"] .wa-main-sticky,
html[data-ui-theme="light"] .wa-main-sticky.no-banner {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.05), transparent 28%),
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 245, 252, 0.96)) !important;
}
html[data-ui-theme="light"] .wa-chat-messages {
  background: rgba(255, 255, 255, 0.55) !important;
}
html[data-ui-theme="light"] .wa-bubble {
  color: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
html[data-ui-theme="light"] .wa-bubble.assistant {
  border-color: rgba(148, 163, 184, 0.2);
}
html[data-ui-theme="light"] .wa-bubble.user {
  color: #065f46 !important;
  border-color: rgba(16, 185, 129, 0.24);
}
html[data-ui-theme="light"] .wa-bubble.human {
  color: #1e3a8a !important;
  border-color: rgba(59, 130, 246, 0.22);
}
html[data-ui-theme="light"] .wa-message-timestamp {
  color: #64748b !important;
}
html[data-ui-theme="light"] .human-badge {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.16);
}
html[data-ui-theme="light"] .ma-content-dark,
html[data-ui-theme="light"] .wa-page .wa-chat-messages,
html[data-ui-theme="light"] .wa-chat-topbar.compact-topbar {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.06), transparent 26%),
    rgba(255, 255, 255, 0.62) !important;
}
html[data-ui-theme="light"] .wa-chat-topbar,
html[data-ui-theme="light"] .wa-chat-topbar.compact-topbar {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 248, 255, 0.96)) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}
html[data-ui-theme="light"] .wa-chat-topbar h2,
html[data-ui-theme="light"] #chatHeaderName {
  color: #0f172a !important;
}
html[data-ui-theme="light"] .wa-chat-topbar p,
html[data-ui-theme="light"] #chatHeaderPhone,
html[data-ui-theme="light"] .header-ia-toggle,
html[data-ui-theme="light"] .chat-meta-pill .summary-label {
  color: #64748b !important;
}
html[data-ui-theme="light"] .wa-chat-topbar .chat-meta-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98)) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
}
html[data-ui-theme="light"] .wa-chat-topbar .chat-meta-pill strong {
  color: #0f172a !important;
}
html[data-ui-theme="light"] .wa-chat-topbar .toggle-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 255, 0.96)) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #0f172a !important;
}
html[data-ui-theme="light"] .wa-chat-topbar .toggle-wrap input {
  background: rgba(8, 145, 178, 0.22);
}
html[data-ui-theme="light"] .wa-chat-topbar .toggle-wrap input:not(:checked) {
  background: rgba(148, 163, 184, 0.34);
}
html[data-ui-theme="light"] input.wa-search,
html[data-ui-theme="light"] .ma-search-users input,
html[data-ui-theme="light"] .ma-field input,
html[data-ui-theme="light"] .ma-field textarea,
html[data-ui-theme="light"] .composer-row input,
html[data-ui-theme="light"] .ma-modal,
html[data-ui-theme="light"] .summary-close-btn {
  color: var(--text);
}
html[data-ui-theme="light"] input.wa-search,
html[data-ui-theme="light"] .ma-search-users input,
html[data-ui-theme="light"] .ma-field input,
html[data-ui-theme="light"] .ma-field textarea,
html[data-ui-theme="light"] .composer-row input,
html[data-ui-theme="light"] .ma-field select {
  background: #f8fbff !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: var(--text) !important;
}
html[data-ui-theme="light"] .wa-chat-list .wa-chat-item.active,
html[data-ui-theme="light"] .wa-chat-list .wa-chat-item:hover {
  background: rgba(8, 145, 178, 0.08) !important;
}
html[data-ui-theme="light"] .wa-chat-delete-btn {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  color: #dc2626;
}
html[data-ui-theme="light"] .wa-chat-edit-btn {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.22);
  color: #64748b;
}
html[data-ui-theme="light"] .wa-chat-edit-btn:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(8, 145, 178, 0.24);
  color: #0f172a;
}
html[data-ui-theme="light"] .wa-chat-delete-btn:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.24);
  color: #b91c1c;
}
html[data-ui-theme="light"] .wa-chat-item.unread strong,
html[data-ui-theme="light"] .wa-chat-item.unread .wa-chat-item-meta,
html[data-ui-theme="light"] .wa-chat-item.unread .wa-status-label,
html[data-ui-theme="light"] .wa-chat-item.unread .wa-chat-item-preview,
html[data-ui-theme="light"] .wa-chat-item-preview.preview-unread {
  color: #0f172a !important;
}
html[data-ui-theme="light"] .read-badge {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}
html[data-ui-theme="light"] .ai-state.ai-on {
  color: #0891b2;
  background: rgba(8, 145, 178, 0.1);
  border-color: rgba(8, 145, 178, 0.2);
}
html[data-ui-theme="light"] .ai-state.ai-off {
  color: #64748b;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
}
html[data-ui-theme="light"] .ma-btn-primary,
html[data-ui-theme="light"] .summary-toggle-btn {
  color: #ffffff !important;
}
html[data-ui-theme="light"] .ma-btn-outline {
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text);
}
html[data-ui-theme="light"] .ma-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.34);
  color: #b91c1c !important;
}
html[data-ui-theme="light"] .ma-btn-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #991b1b !important;
}
html[data-ui-theme="light"] .ma-alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}
html[data-ui-theme="light"] .ma-alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
}
html[data-ui-theme="light"] .ma-modal {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16);
}
html[data-ui-theme="light"] .ma-modal-input {
  background: #f8fbff;
  border-color: rgba(148, 163, 184, 0.28);
  color: #0f172a;
}
html[data-ui-theme="light"] .summary-close-btn,
html[data-ui-theme="light"] .wa-mobile-back {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--text);
}

@media (max-width: 820px) {
  .ma-theme-toggle {
    min-width: 100%;
  }
}

/* ──────────────────────────────────────────────────────────
   Business Switcher Button  (biz-sw-trigger)
   ────────────────────────────────────────────────────────── */
.biz-sw-trigger {
  width: 44px !important;
  min-width: 44px;
  height: 44px;
  max-width: 44px;
  padding: 0 !important;
  border-radius: 14px !important;
  gap: 0;
  flex-direction: column !important;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(24, 200, 242, 0.28) !important;
  background: rgba(24, 200, 242, 0.07) !important;
  color: inherit;
}
.biz-sw-trigger svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.biz-sw-trigger:hover {
  border-color: rgba(24, 200, 242, 0.5) !important;
  background: rgba(24, 200, 242, 0.12) !important;
}
html[data-ui-theme="light"] .biz-sw-trigger {
  border-color: rgba(14, 165, 233, 0.3) !important;
  background: rgba(14, 165, 233, 0.08) !important;
}
html[data-ui-theme="light"] .biz-sw-trigger:hover {
  border-color: rgba(14, 165, 233, 0.55) !important;
  background: rgba(14, 165, 233, 0.14) !important;
}
.biz-sw-name {
  display: none !important;
}
.biz-active-strip {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 960;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: min(680px, calc(100vw - 140px));
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(24, 200, 242, 0.16);
  background: rgba(12, 18, 31, 0.76);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(2, 8, 23, 0.28);
  color: #d9e8f8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
html[data-ui-theme="light"] .biz-active-strip {
  border-color: rgba(14, 165, 233, 0.2);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.12);
  color: #17304f;
}
@media (min-width: 821px) {
  .ma-icon-topbar .biz-active-strip,
  .wa-page-topbar .biz-active-strip {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    right: auto;
    transform: translateY(-50%);
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    min-height: 150px;
    max-height: 250px;
    padding: 16px 0;
    border-radius: 999px;
    white-space: normal;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-align: center;
    line-height: 1.12;
    letter-spacing: 0.08em;
    font-size: 11px;
  }
}
@media (max-width: 820px) {
  .biz-active-strip {
    display: none !important;
  }
}

/* ──────────────────────────────────────────────────────────
   Business / Company Switcher Panel  (biz-switcher.js)
   ────────────────────────────────────────────────────────── */
.biz-sw-panel {
  position: fixed;
  z-index: 9999;
  width: 264px;
  border-radius: 18px;
  padding: 14px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: #0d1220;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e7edf7;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.52);
}
html[data-ui-theme="light"] .biz-sw-panel {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.14);
  color: #10203c;
  box-shadow: 0 24px 64px rgba(37, 99, 235, 0.18);
}
.biz-sw-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7890;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
html[data-ui-theme="light"] .biz-sw-title {
  color: #7b8ca5;
  border-bottom-color: rgba(37, 99, 235, 0.1);
}
.biz-sw-co-group { margin-bottom: 10px; }
.biz-sw-co-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7890;
  padding: 0 4px 5px;
}
html[data-ui-theme="light"] .biz-sw-co-label { color: #7b8ca5; }
.biz-sw-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #e7edf7;
  text-align: left;
  transition: background 0.14s;
}
html[data-ui-theme="light"] .biz-sw-item { color: #10203c; }
.biz-sw-item:hover { background: rgba(255, 255, 255, 0.06); }
html[data-ui-theme="light"] .biz-sw-item:hover { background: rgba(37, 99, 235, 0.06); }
.biz-sw-item-active { color: #18c8f2; background: rgba(24, 200, 242, 0.09); }
html[data-ui-theme="light"] .biz-sw-item-active { color: #0ea5e9; background: rgba(14, 165, 233, 0.09); }
.biz-sw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
}
html[data-ui-theme="light"] .biz-sw-dot { background: rgba(37, 99, 235, 0.18); }
.biz-sw-dot-active { background: #18c8f2; }
html[data-ui-theme="light"] .biz-sw-dot-active { background: #0ea5e9; }
.biz-sw-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-sw-check { margin-left: auto; font-size: 11px; color: #18c8f2; flex-shrink: 0; }
html[data-ui-theme="light"] .biz-sw-check { color: #0ea5e9; }
.biz-sw-all-link {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #18c8f2;
  text-decoration: none;
  padding: 10px 4px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 6px;
  transition: opacity 0.14s;
}
html[data-ui-theme="light"] .biz-sw-all-link { color: #0ea5e9; border-top-color: rgba(37, 99, 235, 0.1); }
.biz-sw-all-link:hover { opacity: 0.74; }
.biz-sw-loading, .biz-sw-empty, .biz-sw-no-biz {
  font-size: 12px;
  color: #6b7890;
  padding: 12px 4px;
  text-align: center;
  line-height: 1.6;
}
html[data-ui-theme="light"] .biz-sw-loading,
html[data-ui-theme="light"] .biz-sw-empty,
html[data-ui-theme="light"] .biz-sw-no-biz { color: #7b8ca5; }

/* ── Dashboard empty-state logo: theme-aware ──────────────────────────────── */
/* Dark mode (default): show dark logo, hide light logo */
.ma-logo-dark  { display: block; }
.ma-logo-light { display: none;  }

/* Light mode: swap logos */
html[data-ui-theme="light"] .ma-logo-dark  { display: none;  }
html[data-ui-theme="light"] .ma-logo-light { display: block; }
