/* ==================================================
   Business Agent OS
   Global
================================================== */

* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  --background: #090a0d;
  --surface: #14161b;
  --surface-soft: #101217;
  --surface-hover: #1a1d24;

  --border: #2a2d35;
  --border-strong: #3b404b;

  --text: #f5f7fa;
  --text-soft: #c8cdd6;
  --muted: #9299a6;

  --primary: #ffffff;
  --primary-text: #111318;

  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.12);

  --success: #8ff0ad;
  --success-background: #183523;

  --danger: #ffb4b4;
  --danger-background: #2a1515;

  --radius-small: 10px;
  --radius-medium: 14px;
  --radius-large: 20px;

  background: var(--background);
  color: var(--text);
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 48px;
  overflow-x: hidden;
  background:
    radial-gradient(
      circle at top center,
      rgba(79, 140, 255, 0.05),
      transparent 32%
    ),
    var(--background);
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

button,
textarea,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
}

p {
  color: var(--text-soft);
}

a {
  color: inherit;
}

.main-header {
  width: min(100%, 1200px);
  margin: 0 auto 40px;
}

.main-header h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.04em;
}

#app {
  width: min(100%, 1200px);
  margin: 0 auto;
}

/* ==================================================
   Reusable buttons
================================================== */

button,
.button,
.agent-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

button:hover,
.button:hover,
.agent-link:hover {
  transform: translateY(-1px);
}

button:active,
.button:active,
.agent-link:active {
  transform: translateY(0);
}

button,
.button--primary,
.agent-link {
  color: var(--primary-text);
  background: var(--primary);
}

button:hover,
.button--primary:hover,
.agent-link:hover {
  background: #e9ebef;
}

.button--secondary,
.secondary-button,
.workspace-back-button {
  border-color: var(--border);
  color: var(--text);
  background: #24272f;
}

.button--secondary:hover,
.secondary-button:hover,
.workspace-back-button:hover {
  border-color: var(--border-strong);
  background: #2b2f38;
}

.button--ghost {
  border-color: var(--border);
  color: var(--text-soft);
  background: transparent;
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

/* ==================================================
   Dashboard
================================================== */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02),
      transparent
    ),
    var(--surface);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.18);
}

.dashboard-header h2 {
  margin-bottom: 10px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.025em;
}

.dashboard-header p:last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: #9db8ee;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.agents-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(265px, 1fr));
  gap: 18px;
}

.agent-card,
.empty-card,
.error-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.agent-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.agent-card:hover {
  transform: translateY(-3px);
  border-color: #3a3f4a;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.22);
}

.agent-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-background);
  font-size: 11px;
  font-weight: 800;
}

.agent-sector {
  min-height: 42px;
  margin-bottom: 14px;
  color: #a9afba;
  line-height: 1.45;
}

code {
  display: block;
  width: 100%;
  margin: 10px 0 20px;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid #191c22;
  border-radius: 10px;
  color: #d7dbe3;
  background: #0d0f13;
  font-size: 12px;
  line-height: 1.5;
}

.agent-card__actions,
.agent-actions,
.card-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: auto;
}

.agent-card__actions button,
.agent-card__actions a,
.agent-actions button,
.agent-actions a,
.card-actions button,
.card-actions a {
  flex: 1 1 0;
  min-width: 0;
  padding-right: 12px;
  padding-left: 12px;
  text-align: center;
  white-space: normal;
}

.agent-link {
  margin-top: auto;
}

.error-card {
  border-color: #6e3030;
}

/* ==================================================
   Workspace
================================================== */

.workspace,
.agent-workspace,
.workspace-view {
  display: grid;
  gap: 24px;
}

.workspace-header,
.workspace__header,
.agent-workspace__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background:
    linear-gradient(
      135deg,
      rgba(79, 140, 255, 0.05),
      transparent 50%
    ),
    var(--surface);
}

.workspace-header__content,
.workspace__identity,
.workspace-intro {
  min-width: 0;
}

.workspace-header h2,
.workspace__header h2,
.agent-workspace__header h2 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.workspace-subtitle,
.workspace-sector {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
}

.workspace-actions,
.workspace-header__actions,
.workspace__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.workspace-meta,
.workspace-summary,
.agent-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-agent-id,
.agent-id,
.workspace-slug {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #1e2229;
  border-radius: 10px;
  color: #cfd5df;
  background: #0d0f13;
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 12px;
}

.workspace-grid,
.workspace-sections,
.agent-workspace__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.workspace-card,
.workspace-section,
.data-card,
.info-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.workspace-card:hover,
.workspace-section:hover,
.data-card:hover,
.info-card:hover {
  border-color: #383d47;
}

.workspace-card--wide,
.workspace-section--wide,
.workspace-card.full-width,
.workspace-section.full-width {
  grid-column: 1 / -1;
}

.workspace-card__header,
.workspace-section__header,
.data-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.workspace-card__header h3,
.workspace-section__header h3,
.data-card__header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.workspace-card__header p,
.workspace-section__header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace-card button,
.workspace-section button {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: #20232a;
  font-size: 12px;
}

.workspace-card button:hover,
.workspace-section button:hover {
  color: var(--text);
  background: #292d35;
}

.workspace-details,
.workspace-fields,
.business-details,
.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.workspace-field,
.detail-row,
.business-field,
.info-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(42, 45, 53, 0.8);
}

.workspace-field:last-child,
.detail-row:last-child,
.business-field:last-child,
.info-row:last-child {
  border-bottom: 0;
}

.workspace-field__label,
.detail-label,
.business-field__label,
.info-label,
.workspace-field dt,
.detail-row dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.workspace-field__value,
.detail-value,
.business-field__value,
.info-value,
.workspace-field dd,
.detail-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.workspace-list,
.service-list,
.faq-list,
.rules-list,
.schedule-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workspace-list-item,
.service-item,
.faq-item,
.rule-item,
.schedule-item {
  padding: 15px;
  border: 1px solid #252932;
  border-radius: 12px;
  background: var(--surface-soft);
}

.service-item h4,
.faq-item h4,
.rule-item h4,
.schedule-item h4 {
  margin-bottom: 7px;
  font-size: 15px;
}

.service-item p:last-child,
.faq-item p:last-child,
.rule-item p:last-child,
.schedule-item p:last-child {
  margin-bottom: 0;
}

.service-item__meta,
.faq-answer,
.rule-description,
.schedule-value {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.schedule-grid,
.schedule-days {
  display: grid;
  gap: 10px;
}

.schedule-day {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #252932;
  border-radius: 12px;
  background: var(--surface-soft);
}

.schedule-day__name {
  color: var(--text);
  font-weight: 700;
}

.schedule-day__hours {
  color: var(--muted);
}

.empty-value,
.workspace-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #343944;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
}

/*
  Fallback para el HTML actual del Workspace.

  Estas reglas ordenan el contenido aunque app.js todavía
  no utilice todas las clases anteriores.
*/

#app > section > code,
#app > main > code {
  margin-bottom: 22px;
}

#app dl {
  margin: 0;
}

#app dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#app dd {
  margin: 4px 0 14px;
  color: var(--text);
}

#app ul {
  padding-left: 20px;
}

#app li {
  margin-bottom: 8px;
  color: var(--text-soft);
  line-height: 1.5;
}

#app hr {
  height: 1px;
  margin: 24px 0;
  border: 0;
  background: var(--border);
}

/* ==================================================
   Modal
================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 32px;
  border: 1px solid #2f3239;
  border-radius: 22px;
  background: #17191f;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border-radius: 10px;
  color: var(--text);
  background: #25282f;
  font-size: 24px;
  line-height: 1;
}

.modal__description {
  max-width: 560px;
  margin-bottom: 28px;
  color: #a9afba;
  line-height: 1.6;
}

#create-agent-form {
  display: grid;
  gap: 14px;
}

#create-agent-form label {
  font-weight: 700;
}

#create-agent-form textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #343740;
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: #0f1115;
  line-height: 1.55;
}

#create-agent-form textarea:focus {
  border-color: #727986;
  box-shadow:
    0 0 0 3px rgba(114, 121, 134, 0.18);
}

.form-help {
  margin-bottom: 6px;
  color: #8f96a3;
  font-size: 13px;
  line-height: 1.5;
}

.creation-status {
  padding: 14px 16px;
  border: 1px solid #343740;
  border-radius: 12px;
  color: #d7dbe3;
  background: #111318;
  line-height: 1.5;
}

.creation-status.is-error {
  border-color: #6e3030;
  color: var(--danger);
  background: var(--danger-background);
}

.creation-status.is-success {
  border-color: #2d6942;
  color: var(--success);
  background: #163522;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ==================================================
   Build progress
================================================== */

.build-progress {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #2d3139;
  border-radius: 18px;
  background: var(--surface);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.28);
}

.build-progress__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.build-progress__eyebrow {
  margin: 0 0 6px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.build-progress__title {
  margin: 0;
  color: #f5f7fa;
  font-size: 22px;
  line-height: 1.2;
}

.build-progress__percentage {
  min-width: 54px;
  color: #ffffff;
  font-size: 22px;
  text-align: right;
}

.build-progress__bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #252932;
}

.build-progress__bar-fill {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      #8b5cf6,
      #4f8cff
    );
  transition: width 0.45s ease;
}

.build-progress__message {
  margin: 16px 0 0;
  color: #c9ced8;
  font-size: 14px;
  line-height: 1.6;
}

.build-progress__steps {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.build-progress__step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #8f96a3;
  background: #111318;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.build-progress__icon {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #252932;
  color: #aab0bc;
  font-size: 14px;
  font-weight: 800;
}

.build-progress__label {
  font-size: 14px;
  font-weight: 600;
}

.build-progress__step--active {
  border-color: #4f8cff;
  color: #f5f7fa;
  background: rgba(79, 140, 255, 0.08);
  transform: translateX(3px);
}

.build-progress__step--active
.build-progress__icon {
  color: #ffffff;
  background: #4f8cff;
  animation: progressPulse 1.2s infinite;
}

.build-progress__step--completed {
  color: #d8f7e2;
}

.build-progress__step--completed
.build-progress__icon {
  color: #8ff0ad;
  background: #174b2a;
}

.build-progress__step--error {
  border-color: #7f1d1d;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.12);
}

.build-progress__step--error
.build-progress__icon {
  color: #ffffff;
  background: #7f1d1d;
}

.build-progress[data-status="completed"] {
  border-color: #245c35;
}

.build-progress[data-status="completed"]
.build-progress__bar-fill {
  background:
    linear-gradient(
      90deg,
      #16a34a,
      #4ade80
    );
}

.build-progress[data-status="error"] {
  border-color: #7f1d1d;
}

.build-progress[data-status="error"]
.build-progress__bar-fill {
  background: #dc2626;
}

@keyframes progressPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 rgba(79, 140, 255, 0.4);
  }

  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 0 7px rgba(79, 140, 255, 0);
  }
}

/* ==================================================
   Loading
================================================== */

.loading-card,
.workspace-loading {
  display: grid;
  min-height: 240px;
  place-items: center;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  color: var(--muted);
  background: var(--surface);
}

/* ==================================================
   Responsive
================================================== */

@media (max-width: 900px) {
  body {
    padding: 32px;
  }

  .workspace-grid,
  .workspace-sections,
  .agent-workspace__grid {
    grid-template-columns: 1fr;
  }

  .workspace-card--wide,
  .workspace-section--wide,
  .workspace-card.full-width,
  .workspace-section.full-width {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  body {
    padding: 22px;
  }

  .main-header {
    margin-bottom: 28px;
  }

  .dashboard-header,
  .workspace-header,
  .workspace__header,
  .agent-workspace__header {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }

  .dashboard-header button {
    width: 100%;
  }

  .workspace-actions,
  .workspace-header__actions,
  .workspace__actions {
    justify-content: stretch;
  }

  .workspace-actions button,
  .workspace-actions a,
  .workspace-header__actions button,
  .workspace-header__actions a,
  .workspace__actions button,
  .workspace__actions a {
    flex: 1 1 100%;
  }

  .agent-card__actions,
  .agent-actions,
  .card-actions {
    flex-direction: column;
  }

  .workspace-field,
  .detail-row,
  .business-field,
  .info-row,
  .schedule-day {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .modal {
    padding: 12px;
  }

  .modal__content {
    max-height: calc(100vh - 24px);
    padding: 24px;
  }

  .modal__actions {
    flex-direction: column-reverse;
  }

  .modal__actions .button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .build-progress {
    padding: 18px;
  }

  .build-progress__header {
    align-items: center;
  }

  .build-progress__title,
  .build-progress__percentage {
    font-size: 19px;
  }
}/* ==================================================
   Workspace — compatibilidad con app.js actual
================================================== */

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

.workspace__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.workspace__header > div:first-child {
  min-width: 0;
}

.workspace__header h2 {
  margin-bottom: 8px;
}

.workspace__header p:last-child {
  margin-bottom: 0;
}

.workspace__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.workspace__status .status-badge {
  margin-bottom: 0;
}

.workspace__status code {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
}

/* Resumen superior */

.workspace__summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.workspace-summary-card {
  display: flex;
  min-width: 0;
  min-height: 96px;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.workspace-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-summary-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Contador de servicios */

.workspace-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 800;
}

/* Datos del negocio */

.workspace-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.workspace-details > div {
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.workspace-details dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.workspace-details dd {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Servicios */

.workspace-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workspace-service {
  min-width: 0;
  padding: 16px;
  border: 1px solid #252932;
  border-radius: 13px;
  background: var(--surface-soft);
}

.workspace-service h4 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.35;
}

.workspace-service p {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.workspace-service small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Horarios */

.workspace-schedule {
  display: grid;
  gap: 9px;
}

.workspace-schedule__row {
  display: grid;
  grid-template-columns: minmax(110px, 0.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid #252932;
  border-radius: 11px;
  background: var(--surface-soft);
}

.workspace-schedule__row strong {
  color: var(--text);
  font-size: 13px;
}

.workspace-schedule__row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* FAQs y reglas comerciales */

.workspace-document {
  width: 100%;
  max-height: 440px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  border: 1px solid #252932;
  border-radius: 13px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Acciones de error */

.workspace-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Adaptación a pantallas medianas */

@media (max-width: 900px) {
  .workspace__summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-details,
  .workspace-services {
    grid-template-columns: 1fr;
  }
}

/* Adaptación móvil */

@media (max-width: 700px) {
  .workspace__topbar,
  .workspace__header {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace__topbar > *,
  .workspace__topbar a,
  .workspace__topbar button {
    width: 100%;
  }

  .workspace__status {
    align-items: flex-start;
  }

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

  .workspace-schedule__row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
/* ==================================================
   Workspace V2 con sidebar
================================================== */

.workspace-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.workspace-sidebar {
  padding: 22px 14px;
  border-right: 1px solid var(--border);
  background: #101217;
}

.workspace-sidebar__title {
  margin: 0 10px 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-nav {
  display: grid;
  gap: 5px;
}

.workspace-nav__button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.workspace-nav__button:hover {
  color: var(--text);
  background: #191c22;
  transform: none;
}

.workspace-nav__button.is-active {
  border-color: #343945;
  color: var(--text);
  background: #242832;
}

.workspace-nav__button span {
  width: 22px;
  font-size: 16px;
  text-align: center;
}

.workspace-content {
  min-width: 0;
  padding: 26px;
}

.workspace-panel {
  display: none;
}

.workspace-panel.is-active {
  display: block;
  animation: workspacePanelFade 0.18s ease;
}

.workspace-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.workspace-panel__header h3 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.workspace-panel__header p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.workspace-panel .workspace__summary-grid {
  margin-bottom: 18px;
}

.workspace-panel .workspace-card {
  min-height: 0;
}

.workspace-ai-placeholder {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.workspace-ai-placeholder__icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-soft);
  font-size: 34px;
}

.workspace-ai-placeholder h4 {
  margin: 0;
  font-size: 22px;
}

.workspace-ai-placeholder p {
  max-width: 520px;
  margin: 0 0 6px;
  line-height: 1.6;
}

@keyframes workspacePanelFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

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

@media (max-width: 900px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    overflow-x: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .workspace-sidebar__title {
    display: none;
  }

  .workspace-nav {
    display: flex;
    min-width: max-content;
  }

  .workspace-nav__button {
    width: auto;
  }
}

@media (max-width: 700px) {
  .workspace-content {
    padding: 18px;
  }

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

  .workspace-panel__header button {
    width: 100%;
  }
}/* ==================================================
   Editor de Empresa
================================================== */

.business-edit-form {
  display: grid;
  gap: 20px;
}

.business-edit-form[hidden],
#business-view[hidden] {
  display: none;
}

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

.business-edit-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.business-edit-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.business-edit-field input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
  line-height: 1.4;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.business-edit-field input:hover {
  border-color: var(--border-strong);
}

.business-edit-field input:focus {
  border-color: var(--accent);
  background: #11141a;
  box-shadow:
    0 0 0 3px
    rgba(79, 140, 255, 0.14);
}

.business-edit-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.business-save-status {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  line-height: 1.5;
}

.business-save-status--info {
  color: #cbd5e1;
  background: #171a20;
}

.business-save-status--success {
  border-color: #2d6942;
  color: var(--success);
  background: #163522;
}

.business-save-status--error {
  border-color: #6e3030;
  color: var(--danger);
  background: var(--danger-background);
}

@media (max-width: 700px) {
  .business-edit-grid {
    grid-template-columns: 1fr;
  }

  .business-edit-form__actions {
    flex-direction: column-reverse;
  }

  .business-edit-form__actions button {
    width: 100%;
  }
}
/* ==================================================
   Editor de Servicios
================================================== */

.service-editor-item {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px;
}

.service-editor-item:last-child {
  margin-bottom: 0;
}

.service-editor-item .business-form-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.service-editor-item .business-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-editor-item .business-form-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.service-editor-item input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
  transition:
    border-color .18s,
    box-shadow .18s;
}

.service-editor-item input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(79,140,255,.15);
}

.remove-service-button {
  align-self: flex-start;
  background: #3a1c1c;
  color: #ffb4b4;
  border: 1px solid #6e3030;
}

.remove-service-button:hover {
  background: #522323;
}

#add-service-button {
  width: 100%;
  margin-top: 10px;
}

#services-count {
  margin-right: 10px;
}

.workspace-panel__header > div:last-child {
  display: flex;
  align-items: center;
}

@media (max-width:900px){

  .service-editor-item
  .business-form-grid{

    grid-template-columns:1fr;

  }

}
/* ==================================================
   Editor de Horarios
================================================== */

.schedule-editor-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.schedule-editor-item:last-child {
  margin-bottom: 0;
}

.schedule-editor-item h4 {
  margin: 0;
  font-size: 15px;
}

.schedule-editor-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.schedule-times {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-times input[type="time"] {
  width: 140px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.schedule-times span {
  color: var(--muted);
  font-weight: 700;
}

.schedule-times input:disabled {
  opacity: .45;
}
/* ==================================================
   Tools
================================================== */

.tools-category {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.tools-category:last-child {
  margin-bottom: 0;
}

.tools-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tools-category__header h4 {
  margin: 0;
  font-size: 16px;
}

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

.tool-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.tool-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tool-card__header h4 {
  margin: 0 0 7px;
  font-size: 15px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tool-card__status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tool-card.is-enabled {
  border-color: #2d6942;
}

.tool-card.is-enabled
.tool-card__status {
  color: var(--success);
}

.tool-card.is-coming-soon {
  opacity: 0.68;
}

.tool-card__toggle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.tool-card__toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.tool-card__toggle input:disabled {
  cursor: not-allowed;
}

/* ==================================================
   Modal del editor Tools
================================================== */

.workspace-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.workspace-editor {
  width: min(100%, 960px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 30px;
  border: 1px solid #2f3239;
  border-radius: 22px;
  background: #17191f;
  box-shadow:
    0 24px 80px
    rgba(0, 0, 0, 0.55);
}

.workspace-editor__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.workspace-editor__header h3 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.workspace-editor__header p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tools-editor-list {
  display: grid;
  gap: 4px;
}

.workspace-editor
.business-edit-form__actions {
  position: sticky;
  bottom: -30px;
  margin: 24px -30px -30px;
  padding: 18px 30px;
  border-top: 1px solid var(--border);
  background: #17191f;
}

@media (max-width: 800px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .workspace-editor-overlay {
    padding: 0;
  }

  .workspace-editor {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    padding: 20px;
    border-radius: 0;
  }

  .workspace-editor__header {
    flex-direction: column;
  }

  .workspace-editor__header button {
    width: 100%;
  }

  .workspace-editor
  .business-edit-form__actions {
    bottom: -20px;
    margin:
      20px -20px -20px;
    padding: 16px 20px;
  }
}

/* --------------------------------------------------
   Google Calendar Connection
-------------------------------------------------- */

.calendar-connection-card {
  margin-bottom: 24px;
  padding: 20px;
  border:
    1px solid rgba(
      255,
      255,
      255,
      0.1
    );
  border-radius: 16px;
  background:
    rgba(
      255,
      255,
      255,
      0.025
    );
}

.calendar-connection-card.is-connected {
  border-color:
    rgba(
      34,
      197,
      94,
      0.38
    );
  background:
    linear-gradient(
      135deg,
      rgba(
        34,
        197,
        94,
        0.08
      ),
      rgba(
        255,
        255,
        255,
        0.02
      )
    );
}

.calendar-connection-card.is-disconnected {
  border-color:
    rgba(
      245,
      158,
      11,
      0.32
    );
}

.calendar-connection-card__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.calendar-connection-card__content h4 {
  margin:
    4px 0 8px;
}

.calendar-connection-card__content p {
  margin: 0;
  max-width: 560px;
  color: var(
    --text-muted,
    #94a3b8
  );
  line-height: 1.6;
}

.calendar-connection-card__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.calendar-connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding:
    6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.calendar-connection-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    0 0 10px currentColor;
}

.calendar-connection-badge.is-connected {
  color: #4ade80;
  background:
    rgba(
      34,
      197,
      94,
      0.14
    );
}

.calendar-connection-badge.is-disconnected {
  color: #fbbf24;
  background:
    rgba(
      245,
      158,
      11,
      0.14
    );
}

.calendar-connection-id {
  color: var(
    --text-muted,
    #94a3b8
  );
  font-size: 12px;
}

.calendar-connection-card__status .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  text-decoration: none;
}

@media (
  max-width: 720px
) {
  .calendar-connection-card__content {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-connection-card__status {
    width: 100%;
    align-items: flex-start;
  }

  .calendar-connection-card__status .button {
    width: 100%;
  }
}

/* --------------------------------------------------
   Agent Test Chat
-------------------------------------------------- */

.agent-chat-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at top,
      rgba(59, 130, 246, 0.1),
      transparent 34%
    ),
    #080b10;
  color: #f8fafc;
}

.agent-chat-shell {
  display: flex;
  flex-direction: column;
  width: min(
    1080px,
    calc(100% - 40px)
  );
  min-height: calc(
    100vh - 48px
  );
  margin: 24px auto;
}

.agent-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  border:
    1px solid rgba(
      148,
      163,
      184,
      0.18
    );
  border-radius: 18px 18px 0 0;
  background:
    rgba(
      17,
      22,
      31,
      0.96
    );
}

.agent-chat-header h1 {
  margin:
    4px 0 6px;
  font-size:
    clamp(
      24px,
      4vw,
      34px
    );
}

.agent-chat-header p {
  margin: 0;
  color: #94a3b8;
}

.agent-chat-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.agent-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4ade80;
  font-size: 13px;
  font-weight: 700;
}

.agent-chat-status span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow:
    0 0 12px
    rgba(
      34,
      197,
      94,
      0.9
    );
}

.agent-chat-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  border:
    1px solid rgba(
      148,
      163,
      184,
      0.18
    );
  border-top: 0;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  background:
    rgba(
      12,
      16,
      23,
      0.98
    );
}

.agent-chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  min-height: 420px;
  max-height: calc(
    100vh - 260px
  );
  padding: 28px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.agent-chat-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(
    78%,
    720px
  );
}

.agent-chat-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.agent-chat-message__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border:
    1px solid rgba(
      96,
      165,
      250,
      0.35
    );
  border-radius: 12px;
  background:
    rgba(
      59,
      130,
      246,
      0.14
    );
  color: #93c5fd;
  font-size: 11px;
  font-weight: 800;
}

.agent-chat-message--user
.agent-chat-message__avatar {
  border-color:
    rgba(
      167,
      139,
      250,
      0.35
    );
  background:
    rgba(
      139,
      92,
      246,
      0.14
    );
  color: #c4b5fd;
}

.agent-chat-message__content {
  padding: 13px 16px;
  border:
    1px solid rgba(
      148,
      163,
      184,
      0.14
    );
  border-radius: 6px 16px 16px 16px;
  background: #161c26;
  color: #e2e8f0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.agent-chat-message--user
.agent-chat-message__content {
  border-color:
    rgba(
      99,
      102,
      241,
      0.3
    );
  border-radius: 16px 6px 16px 16px;
  background:
    linear-gradient(
      135deg,
      #3730a3,
      #4f46e5
    );
  color: #ffffff;
}

.agent-chat-message__content p {
  margin: 0;
}

.agent-chat-message.is-loading
.agent-chat-message__content {
  color: #94a3b8;
  animation:
    agent-chat-pulse
    1.2s ease-in-out
    infinite;
}

.agent-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 18px;
  border-top:
    1px solid rgba(
      148,
      163,
      184,
      0.16
    );
  background:
    rgba(
      17,
      22,
      31,
      0.98
    );
}

.agent-chat-form textarea {
  flex: 1;
  min-height: 48px;
  max-height: 160px;
  padding: 13px 15px;
  border:
    1px solid rgba(
      148,
      163,
      184,
      0.22
    );
  border-radius: 14px;
  outline: none;
  resize: none;
  background: #0c1119;
  color: #f8fafc;
  font: inherit;
  line-height: 1.5;
}

.agent-chat-form textarea:focus {
  border-color: #6366f1;
  box-shadow:
    0 0 0 3px
    rgba(
      99,
      102,
      241,
      0.14
    );
}

.agent-chat-form textarea::placeholder {
  color: #64748b;
}

.agent-chat-form .button {
  min-width: 100px;
  min-height: 48px;
}

.agent-chat-error {
  margin: 0;
  padding:
    12px 18px;
  border-top:
    1px solid
    rgba(
      239,
      68,
      68,
      0.25
    );
  background:
    rgba(
      127,
      29,
      29,
      0.22
    );
  color: #fca5a5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip:
    rect(
      0,
      0,
      0,
      0
    );
  white-space: nowrap;
  border: 0;
}

@keyframes agent-chat-pulse {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

@media (
  max-width: 720px
) {
  .agent-chat-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
  }

  .agent-chat-header {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 0;
  }

  .agent-chat-header__actions {
    width: 100%;
    justify-content: space-between;
  }

  .agent-chat-panel {
    border-radius: 0;
  }

  .agent-chat-messages {
    max-height: none;
    padding: 18px;
  }

  .agent-chat-message {
    width: 92%;
  }

  .agent-chat-form {
    padding: 12px;
  }
}

.agent-chat-message {
  flex:
    0 0 auto;
  min-height: 0;
}

.agent-chat-message__content {
  height: auto;
  min-height: 0;
}

/* ==================================================
   Publicación en Vapi
================================================== */

.workspace__topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.vapi-publish-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #2a3140;
  border-radius: 999px;
  background: #121721;
  color: #aeb8c8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.vapi-publish-status--success {
  border-color: rgba(53, 196, 118, 0.35);
  background: rgba(53, 196, 118, 0.1);
  color: #73dda2;
}

.vapi-publish-status--warning {
  border-color: rgba(245, 184, 65, 0.35);
  background: rgba(245, 184, 65, 0.1);
  color: #f3c96f;
}

.vapi-publish-status--error {
  border-color: rgba(239, 92, 92, 0.4);
  background: rgba(239, 92, 92, 0.1);
  color: #ff9191;
}

#publish-vapi-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 760px) {
  .workspace__topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace__topbar-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .vapi-publish-status {
    justify-content: center;
    white-space: normal;
  }

  .workspace__topbar-actions .button {
    text-align: center;
  }
}

/* ==================================================
   Agenda operativa
================================================== */

.agenda-readonly-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
}

.agenda-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.agenda-toolbar {
  display: grid;
  grid-template-columns: auto minmax(310px, 1fr) minmax(150px, 210px) minmax(150px, 210px);
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.agenda-view-switch,
.agenda-date-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.agenda-view-switch .is-active {
  border-color: #60a5fa;
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
}

.agenda-date-controls input,
.agenda-filter select {
  min-height: 42px;
  border: 1px solid #2a3140;
  border-radius: 10px;
  background: #0c1119;
  color: #f8fafc;
  padding: 9px 11px;
  color-scheme: dark;
}

.agenda-date-controls input {
  min-width: 148px;
}

.agenda-filter {
  display: grid;
  gap: 6px;
  color: #aeb8c8;
  font-size: 12px;
  font-weight: 600;
}

.agenda-summary {
  margin: 0 0 14px;
  color: #94a3b8;
  font-size: 13px;
}

.agenda-content {
  display: grid;
  gap: 16px;
}

.agenda-state {
  padding: 28px;
  border: 1px dashed #303847;
  border-radius: 14px;
  color: #94a3b8;
  text-align: center;
}

.agenda-state--warning {
  border-color: rgba(245, 184, 65, 0.35);
  background: rgba(245, 184, 65, 0.08);
  color: #f3c96f;
}

.agenda-state--error {
  border-color: rgba(239, 92, 92, 0.4);
  background: rgba(239, 92, 92, 0.08);
  color: #ff9191;
}

.agenda-day {
  overflow: hidden;
  border: 1px solid #29313d;
  border-radius: 14px;
  background: #10151e;
}

.agenda-day h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid #29313d;
  color: #e5e7eb;
  font-size: 14px;
}

.agenda-day h4 span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #202735;
  color: #aeb8c8;
  font-size: 11px;
}

.agenda-events {
  display: grid;
}

.agenda-event {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  padding: 15px 16px;
  border-left: 3px solid #60a5fa;
  border-bottom: 1px solid #242b36;
}

.agenda-event:last-child { border-bottom: 0; }
.agenda-event--external { border-left-color: #64748b; opacity: 0.82; }
.agenda-event--block {
  border-left-color: #f59e0b;
  background: rgba(120, 53, 15, 0.08);
}
.agenda-event--block .agenda-event__body h5 { color: #fcd38d; }
.agenda-event__time { display: grid; align-content: start; gap: 3px; color: #f8fafc; }
.agenda-event__time span { color: #7f8b9d; font-size: 12px; }
.agenda-event__body h5 { margin: 0 0 5px; color: #f8fafc; font-size: 15px; }
.agenda-event__body p { margin: 0 0 8px; color: #cbd5e1; }
.agenda-event__meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: #8491a4; font-size: 12px; }
.agenda-day__empty { margin: 0; padding: 22px 16px; color: #697588; text-align: center; }

.agenda-event__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button--danger {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(127, 29, 29, 0.2);
  color: #fca5a5;
}

.button--danger:hover {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(127, 29, 29, 0.35);
}

.agenda-notice {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.agenda-notice--success {
  border: 1px solid rgba(53, 196, 118, 0.35);
  background: rgba(53, 196, 118, 0.1);
  color: #73dda2;
}

.agenda-notice--error {
  border: 1px solid rgba(239, 92, 92, 0.4);
  background: rgba(239, 92, 92, 0.1);
  color: #ff9191;
}

.agenda-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 0;
  border: 1px solid #303847;
  border-radius: 18px;
  background: #121721;
  color: #f8fafc;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
}

.agenda-dialog--small { width: min(520px, calc(100vw - 32px)); }
.agenda-dialog::backdrop { background: rgba(2, 6, 12, 0.78); backdrop-filter: blur(3px); }
.agenda-form { padding: 24px; }
.agenda-dialog__header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.agenda-dialog__header h4 { margin: 3px 0 0; font-size: 22px; }
.agenda-dialog__header p:last-child { margin: 7px 0 0; color: #94a3b8; }
.agenda-dialog__close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #202735; color: #dbe4ef; font-size: 22px; cursor: pointer; }
.agenda-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.agenda-form__grid label { display: grid; gap: 7px; color: #aeb8c8; font-size: 12px; font-weight: 600; }
.agenda-form__grid input,
.agenda-form__grid select,
.agenda-form__grid textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #303847; border-radius: 10px; outline: none; background: #0c1119; color: #f8fafc; font: inherit; color-scheme: dark; box-sizing: border-box; }
.agenda-form__grid textarea { resize: vertical; }
.agenda-form__grid input:focus,
.agenda-form__grid select:focus,
.agenda-form__grid textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.agenda-form__wide { grid-column: 1 / -1; }
.agenda-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.agenda-form__status { margin: 16px 0 0; padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.agenda-form__status--info { background: rgba(59, 130, 246, 0.1); color: #93c5fd; }
.agenda-form__status--error { background: rgba(239, 92, 92, 0.1); color: #ff9191; }
.agenda-form__hint { margin: 14px 0 0; color: #8491a4; font-size: 12px; line-height: 1.5; }
.agenda-contact-status { color: #fbbf24 !important; font-weight: 700; }
.agenda-checkbox-field { display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: center; gap: 9px !important; }
.agenda-checkbox-field input[type="checkbox"] { width: 14px; min-height: 14px; height: 14px; margin: 0; padding: 0; accent-color: #60a5fa; box-shadow: none; }
.agenda-checkbox-field span { color: #cbd5e1; }

@media (max-width: 1050px) {
  .agenda-toolbar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .agenda-toolbar { grid-template-columns: 1fr; }
  .agenda-date-controls { flex-wrap: wrap; }
  .agenda-event { grid-template-columns: 65px 1fr; gap: 10px; }
  .agenda-event__actions { grid-column: 2; justify-content: flex-start; }
  .agenda-form__grid { grid-template-columns: 1fr; }
  .agenda-form__wide { grid-column: auto; }
}

/* ==================================================
   Recordatorios y simulaciones
================================================== */

.reminders-mode-badge {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 700;
}

.reminders-form { display: grid; gap: 20px; }
.reminders-test-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reminders-template select,
.reminders-template input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #303847; border-radius: 10px; outline: none; background: #0c1119; color: #f8fafc; font: inherit; }
.reminders-template select:focus,
.reminders-template input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.reminders-provider-status { margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.45; }
.reminders-provider-status--ready { border: 1px solid rgba(53, 196, 118, 0.35); background: rgba(53, 196, 118, 0.1); color: #73dda2; }
.reminders-provider-status--pending { border: 1px solid rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.09); color: #fbbf24; }
.reminders-master-switch,
.reminders-channel,
.reminders-small-check { display: flex; align-items: flex-start; gap: 10px; }
.reminders-master-switch { padding: 15px; border: 1px solid #303847; border-radius: 12px; background: #10151e; }
.reminders-master-switch span,
.reminders-channel span { display: grid; gap: 4px; }
.reminders-master-switch small,
.reminders-channel small { color: #8491a4; font-size: 11px; font-weight: 400; }
.reminders-form input[type="checkbox"] { width: 14px; min-width: 14px; height: 14px; margin: 2px 0 0; padding: 0; accent-color: #60a5fa; }
.reminders-fieldset { margin: 0; padding: 16px; border: 1px solid #303847; border-radius: 12px; }
.reminders-fieldset legend { padding: 0 7px; color: #dbe4ef; font-size: 13px; font-weight: 700; }
.reminders-channel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.reminders-channel { padding: 12px; border: 1px solid #29313d; border-radius: 10px; background: #0c1119; }
.reminders-list { display: grid; gap: 10px; margin-bottom: 12px; }
.reminder-row { display: grid; grid-template-columns: 100px minmax(150px, 240px) 34px; align-items: end; gap: 12px; }
.reminder-row label:not(.reminders-small-check),
.reminders-template { display: grid; gap: 7px; color: #aeb8c8; font-size: 12px; font-weight: 600; }
.reminder-row input[type="number"],
.reminders-template textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #303847; border-radius: 10px; outline: none; background: #0c1119; color: #f8fafc; font: inherit; }
.reminders-template textarea:focus,
.reminder-row input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.reminders-template small { color: #768397; font-weight: 400; line-height: 1.5; }
.reminder-row__remove { width: 34px; height: 38px; border: 1px solid rgba(239, 68, 68, 0.32); border-radius: 9px; background: rgba(127, 29, 29, 0.18); color: #fca5a5; font-size: 20px; cursor: pointer; }
.reminders-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.reminders-status { margin: 0; padding: 11px 13px; border-radius: 10px; font-size: 13px; }
.reminders-status--success { border: 1px solid rgba(53, 196, 118, 0.35); background: rgba(53, 196, 118, 0.1); color: #73dda2; }
.reminders-status--error,
.reminders-error { border: 1px solid rgba(239, 92, 92, 0.4); background: rgba(239, 92, 92, 0.1); color: #ff9191; padding: 11px 13px; border-radius: 10px; }
.reminders-results-card { margin-top: 16px; }
.reminders-results-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.reminders-results-header h4 { margin: 0 0 4px; }
.reminders-results-header p { margin: 0; color: #8491a4; font-size: 12px; }
#reminders-preview-count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 999px; background: #202735; color: #cbd5e1; font-size: 12px; font-weight: 700; }
.reminders-results { display: grid; gap: 10px; }
.reminder-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 13px 14px; border: 1px solid #29313d; border-left: 3px solid #8b5cf6; border-radius: 10px; background: #10151e; }
.reminder-result--warning { border-left-color: #f59e0b; }
.reminder-result strong { color: #e8edf5; }
.reminder-result p { margin: 6px 0 0; color: #aeb8c8; font-size: 13px; line-height: 1.5; }
.reminder-result__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: #8491a4; font-size: 11px; white-space: nowrap; }
.reminder-resolution-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Centro de solicitudes de cancelación */
.workspace-nav__button { position: relative; }
.workspace-nav__badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.workspace-nav__badge[hidden] { display: none; }
.workspace-nav__button.has-pending { color: #fff; }
.reminders-pending-card { border-color: rgba(245, 158, 11, 0.3); }
.reminders-pending-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#reminders-pending-count {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 800;
}
.reminder-result--pending { border-left-color: #f59e0b; }
.reminders-pending-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 66px;
  padding: 14px;
  border: 1px dashed #303847;
  border-radius: 10px;
  color: #73dda2;
}
.reminders-pending-empty p { margin: 0; color: #aeb8c8; }
.workspace-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  display: grid;
  gap: 5px;
  width: min(360px, calc(100vw - 32px));
  padding: 15px 17px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  background: #141922;
  color: #f8fafc;
  text-align: left;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  animation: workspace-toast-in 180ms ease-out;
}
.workspace-toast strong { color: #fbbf24; font-size: 13px; }
.workspace-toast span { color: #dbe4ef; font-size: 13px; line-height: 1.45; }
@keyframes workspace-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .reminders-test-grid { grid-template-columns: 1fr; }
  .reminders-channel-grid { grid-template-columns: 1fr; }
  .reminder-row { grid-template-columns: 90px 1fr 34px; }
  .reminder-result { grid-template-columns: 1fr; }
  .reminder-result__meta { align-items: flex-start; white-space: normal; }
  .reminders-results-header { align-items: flex-start; flex-direction: column; }
  .workspace-toast { right: 16px; bottom: 16px; }
}

/* ==================================================
   Centro de integraciones
================================================== */

.integrations-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.integration-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #29313d;
  border-radius: 11px;
  background: #10151e;
}
.integration-summary-item div { display: grid; min-width: 0; gap: 3px; }
.integration-summary-item strong { overflow: hidden; color: #e8edf5; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.integration-summary-item small { color: #8491a4; font-size: 11px; }
.integration-summary-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 999px; background: #64748b; box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1); }
.integration-summary-dot.is-ready { background: #35c476; box-shadow: 0 0 0 4px rgba(53, 196, 118, 0.1); }
.integration-summary-dot.is-pending { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1); }
.integration-summary-dot.is-checking { background: #60a5fa; box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1); }
.integrations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.integration-card {
  display: flex;
  min-height: 245px;
  flex-direction: column;
  gap: 18px;
  padding: 19px;
  border: 1px solid #29313d;
  border-radius: 14px;
  background: #10151e;
}
.integration-card__head { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.integration-card__icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #303847; border-radius: 11px; background: #171d27; font-size: 20px; }
.integration-card h4 { margin: 2px 0 5px; color: #f8fafc; font-size: 16px; }
.integration-card__head p { margin: 0; color: #8491a4; font-size: 12px; line-height: 1.45; }
.integration-state { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border: 1px solid #3c4655; border-radius: 999px; color: #aeb8c8; background: #202735; font-size: 10px; font-weight: 800; white-space: nowrap; }
.integration-state.is-ready { border-color: rgba(53, 196, 118, 0.35); color: #73dda2; background: rgba(53, 196, 118, 0.1); }
.integration-state.is-pending { border-color: rgba(245, 158, 11, 0.35); color: #fbbf24; background: rgba(245, 158, 11, 0.1); }
.integration-state.is-checking { border-color: rgba(96, 165, 250, 0.35); color: #93c5fd; background: rgba(96, 165, 250, 0.1); }
.integration-card dl { display: grid; gap: 0; margin: 0; }
.integration-card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #252c37; }
.integration-card dt { color: #8491a4; font-size: 11px; }
.integration-card dd { overflow: hidden; margin: 0; color: #dbe4ef; font-size: 11px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.integration-card > .button { align-self: flex-start; margin-top: auto; }
.integrations-status { margin: 16px 0 0; padding: 11px 13px; border-radius: 10px; font-size: 13px; }
.integrations-status--success { border: 1px solid rgba(53, 196, 118, 0.35); background: rgba(53, 196, 118, 0.1); color: #73dda2; }
.integrations-status--error { border: 1px solid rgba(239, 92, 92, 0.4); background: rgba(239, 92, 92, 0.1); color: #ff9191; }

@media (max-width: 900px) {
  .integrations-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integrations-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .integrations-summary { grid-template-columns: 1fr; }
  .integration-card__head { grid-template-columns: 42px minmax(0, 1fr); }
  .integration-state { grid-column: 1 / -1; justify-self: start; }
}

.telephony-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid #343d4b;
  border-radius: 16px;
  background: #141922;
  color: #f8fafc;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}
.telephony-dialog::backdrop { background: rgba(3, 7, 13, 0.78); backdrop-filter: blur(3px); }
.telephony-dialog form { display: grid; gap: 16px; padding: 22px; }
.telephony-dialog [hidden] { display: none !important; }
.telephony-dialog__header { display: flex; justify-content: space-between; gap: 20px; }
.telephony-dialog__header h3 { margin: 4px 0 6px; font-size: 22px; }
.telephony-dialog__header p:last-child { margin: 0; color: #8491a4; font-size: 12px; }
.telephony-dialog__close { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid #303847; border-radius: 9px; background: #202735; color: #cbd5e1; font-size: 21px; cursor: pointer; }
.telephony-dialog label { display: grid; gap: 7px; color: #aeb8c8; font-size: 12px; font-weight: 700; }
.telephony-dialog input,
.telephony-dialog select { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #303847; border-radius: 10px; outline: none; background: #0c1119; color: #f8fafc; font: inherit; }
.telephony-dialog input:focus,
.telephony-dialog select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.telephony-dialog label small { color: #768397; font-weight: 400; line-height: 1.45; }
.telephony-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.telephony-safety-note { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid rgba(96, 165, 250, 0.3); border-radius: 10px; background: rgba(59, 130, 246, 0.08); }
.telephony-safety-note strong { color: #93c5fd; font-size: 12px; }
.telephony-safety-note span { color: #aeb8c8; font-size: 12px; line-height: 1.45; }
.telephony-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.telephony-provisioning { margin-top: 4px; padding: 14px; border: 1px solid rgba(96, 165, 250, 0.35); border-radius: 12px; background: rgba(59, 130, 246, 0.07); }
.telephony-provisioning > strong { display: block; margin-bottom: 10px; color: #dbeafe; font-size: 12px; line-height: 1.45; }
.telephony-provisioning--telnyx {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.07);
}
.telephony-provisioning--telnyx > strong { color: #bbf7d0; }
.telephony-coming-soon {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px dashed rgba(245, 158, 11, 0.42);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.07);
}
.telephony-coming-soon strong { color: #fcd38d; font-size: 12px; }
.telephony-coming-soon span { color: #aeb8c8; font-size: 12px; line-height: 1.5; }
.telnyx-checks { display: grid; gap: 7px; margin-top: 12px; }
.telnyx-check {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #303847;
  border-radius: 9px;
  background: #0c1119;
}
.telnyx-check > span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 999px; font-size: 11px; font-weight: 900; }
.telnyx-check strong { color: #dbe4ef; font-size: 11px; }
.telnyx-check small { color: #8491a4; font-size: 10px; }
.telnyx-check.is-ready > span { color: #bbf7d0; background: rgba(34, 197, 94, 0.16); }
.telnyx-check.is-ready small { color: #73dda2; }
.telnyx-check.is-pending > span { color: #fcd38d; background: rgba(245, 158, 11, 0.14); }
.telnyx-check.is-pending small { color: #fbbf24; }
.button--danger { color: #fecaca; border-color: rgba(239, 68, 68, 0.5); background: rgba(127, 29, 29, 0.22); }
.twilio-number-results { display: grid; gap: 9px; margin-top: 12px; }
.twilio-number-result { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid #303847; border-radius: 10px; background: #0c1119; }
.twilio-number-result > div { display: grid; gap: 4px; }
.twilio-number-result strong { color: #f8fafc; font-size: 13px; }
.twilio-number-result small { color: #8491a4; font-size: 10px; line-height: 1.4; }
.twilio-number-result span { color: #dbe4ef; font-size: 11px; font-weight: 700; }
.twilio-number-capabilities { display: flex !important; flex-wrap: wrap; justify-content: flex-end; }
.twilio-number-capabilities span { padding: 3px 6px; border-radius: 999px; color: #64748b; background: #171d27; font-size: 9px; }
.twilio-number-capabilities span.is-enabled { color: #73dda2; background: rgba(53, 196, 118, 0.12); }
.twilio-number-empty { margin: 0; padding: 12px; border: 1px dashed #303847; border-radius: 10px; color: #8491a4; font-size: 12px; }

@media (max-width: 560px) {
  .telephony-form-grid { grid-template-columns: 1fr; }
  .telephony-dialog form { padding: 17px; }
  .twilio-number-result { grid-template-columns: 1fr; }
  .twilio-number-capabilities { justify-content: flex-start; }
}

/* ==================================================
   Prueba de voz Vapi integrada
================================================== */

button.agent-link {
  font: inherit;
  cursor: pointer;
}

button.agent-link:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.vapi-voice-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #343d4b;
  border-radius: 18px;
  background: #141922;
  color: #f8fafc;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

.vapi-voice-dialog::backdrop {
  background: rgba(3, 7, 13, 0.8);
  backdrop-filter: blur(4px);
}

.vapi-voice-dialog__shell {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.vapi-voice-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.vapi-voice-dialog__header h2 {
  margin: 5px 0 8px;
  color: #f8fafc;
  font-size: clamp(21px, 4vw, 28px);
}

.vapi-voice-dialog__header p:last-child {
  max-width: 560px;
  margin: 0;
  color: #93a0b3;
  font-size: 13px;
  line-height: 1.55;
}

.vapi-voice-dialog__close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #303847;
  border-radius: 10px;
  background: #202735;
  color: #cbd5e1;
  font-size: 23px;
  cursor: pointer;
}

.vapi-voice-dialog__close:hover {
  border-color: #4b5870;
  color: #fff;
}

.vapi-voice-dialog__notice {
  padding: 11px 13px;
  border: 1px solid #303847;
  border-radius: 10px;
  background: #10151e;
  color: #aeb8c8;
  font-size: 12px;
  line-height: 1.5;
}

.vapi-voice-dialog__notice--success {
  border-color: rgba(53, 196, 118, 0.38);
  background: rgba(53, 196, 118, 0.09);
  color: #73dda2;
}

.vapi-voice-dialog__notice--warning {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.09);
  color: #fcd38d;
}

.vapi-voice-dialog__notice--error {
  border-color: rgba(239, 92, 92, 0.42);
  background: rgba(239, 92, 92, 0.1);
  color: #ff9b9b;
}

.vapi-voice-console {
  display: grid;
  gap: 16px;
}

.vapi-voice-console__stage {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 11px;
  border: 1px solid #29313d;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 30%, rgba(96, 165, 250, 0.1), transparent 48%),
    #0c1119;
}

.vapi-voice-console__stage strong {
  color: #dbe4ef;
  font-size: 14px;
}

.vapi-voice-console__stage time {
  color: #8491a4;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.vapi-voice-orb {
  --vapi-scale: 1;
  --vapi-glow: 18px;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  box-shadow:
    0 0 var(--vapi-glow) rgba(96, 165, 250, 0.38);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.vapi-voice-orb span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #60a5fa;
  transform: scale(var(--vapi-scale));
  transition: transform 100ms linear;
}

.vapi-voice-orb[data-state="connecting"] {
  animation: vapi-voice-pulse 1.1s ease-in-out infinite;
}

.vapi-voice-orb[data-state="speaking"] {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.55);
}

.vapi-voice-orb[data-state="speaking"] span {
  background: #a78bfa;
  animation: vapi-voice-pulse 0.8s ease-in-out infinite;
}

.vapi-voice-orb[data-state="muted"] {
  filter: grayscale(0.8);
  opacity: 0.65;
}

.vapi-voice-orb[data-state="error"] {
  border-color: rgba(239, 92, 92, 0.6);
  background: rgba(239, 92, 92, 0.12);
}

.vapi-voice-orb[data-state="error"] span {
  background: #ef5c5c;
}

.vapi-voice-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vapi-voice-transcript {
  overflow: hidden;
  border: 1px solid #29313d;
  border-radius: 14px;
  background: #0c1119;
}

.vapi-voice-transcript__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #252c37;
}

.vapi-voice-transcript__header strong {
  color: #dbe4ef;
  font-size: 12px;
}

.vapi-voice-transcript__header small {
  color: #768397;
  font-size: 10px;
}

.vapi-voice-transcript__messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 120px;
  max-height: 230px;
  padding: 14px;
  overflow-y: auto;
}

.vapi-voice-transcript__empty {
  align-self: center;
  margin: 30px 0;
  color: #768397;
  font-size: 12px;
  text-align: center;
}

.vapi-voice-transcript__message {
  display: grid;
  gap: 4px;
  max-width: 88%;
  padding: 9px 11px;
  border: 1px solid #29313d;
  border-radius: 11px;
  background: #141922;
}

.vapi-voice-transcript__message--user {
  justify-self: end;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.08);
}

.vapi-voice-transcript__message strong {
  color: #93c5fd;
  font-size: 10px;
}

.vapi-voice-transcript__message--user strong {
  color: #fcd38d;
}

.vapi-voice-transcript__message p {
  margin: 0;
  color: #dbe4ef;
  font-size: 12px;
  line-height: 1.5;
}

.vapi-voice-transcript__message.is-partial {
  opacity: 0.68;
}

.vapi-voice-dialog__empty {
  display: grid;
  min-height: 250px;
  padding: 24px;
  place-items: center;
  color: #8491a4;
  text-align: center;
}

.vapi-voice-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #8491a4;
  font-size: 11px;
}

@keyframes vapi-voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (max-width: 620px) {
  .vapi-voice-dialog__shell {
    padding: 17px;
  }

  .vapi-voice-dialog__header {
    gap: 14px;
  }

  .vapi-voice-dialog__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .vapi-voice-controls .button {
    width: 100%;
  }

  .vapi-voice-transcript__header {
    align-items: flex-start;
    flex-direction: column;
  }
}
.crm-opportunities {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 22px;
  border: 1px solid #303643;
  border-radius: 18px;
  background: #13171f;
}

.crm-opportunities__header,
.crm-opportunities__actions,
.crm-opportunity__title,
.crm-opportunity__meta,
.crm-opportunity__actions {
  display: flex;
  align-items: center;
}

.crm-opportunities__header {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.crm-opportunities__header h3,
.crm-opportunities__header p,
.crm-opportunity p {
  margin: 4px 0 0;
}

.crm-opportunities__actions,
.crm-opportunity__actions {
  gap: 10px;
}

.crm-opportunities__count {
  min-width: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #ffd37a;
  background: #46320b;
  text-align: center;
  font-weight: 700;
}

.crm-opportunities__list {
  display: grid;
  gap: 12px;
}

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

.crm-dashboard__metric {
  display: grid;
  gap: 7px;
  padding: 15px 16px;
  border: 1px solid #303744;
  border-radius: 13px;
  background: #10151d;
}

.crm-dashboard__metric span {
  color: #96a3b8;
  font-size: 12px;
}

.crm-dashboard__metric strong {
  color: #f3f6fb;
  font-size: 24px;
}

.crm-dashboard__metric--alert {
  border-color: #6b3434;
  background: #251515;
}

.crm-dashboard__metric--alert strong {
  color: #ff9d9d;
}

.crm-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.crm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.crm-filter {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #374050;
  border-radius: 999px;
  color: #b9c4d7;
  background: #171d27;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.crm-filter:hover {
  border-color: #6354b8;
  color: #f3f6fb;
}

.crm-filter--active {
  border-color: #7c5cff;
  color: #ffffff;
  background: #5b42cf;
}

.crm-sort {
  display: grid;
  flex: 0 0 210px;
  gap: 6px;
  color: #96a3b8;
  font-size: 12px;
}

.crm-sort select {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #374050;
  border-radius: 10px;
  color: #f3f6fb;
  background: #0d1219;
  font: inherit;
}

.crm-filter-result {
  margin: 0 0 12px;
  color: #96a3b8;
  font-size: 12px;
}

.crm-opportunities__empty {
  padding: 30px;
  border: 1px dashed #353c49;
  border-radius: 14px;
  color: #9da8bb;
  text-align: center;
}

.crm-opportunity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 22px;
  padding: 18px;
  border: 1px solid #303744;
  border-left: 3px solid #7c5cff;
  border-radius: 14px;
  background: #10151d;
}

.crm-opportunity--overdue {
  border-left-color: #ef7a7a;
}

.crm-opportunity--today {
  border-left-color: #f0c466;
}

.crm-opportunity--future {
  border-left-color: #7c5cff;
}

.crm-opportunity--pending {
  border-left-color: #5fa8e8;
}

.crm-opportunity--closed {
  border-left-color: #596475;
}

.crm-opportunity__title {
  gap: 10px;
  flex-wrap: wrap;
}

.crm-opportunity__status {
  padding: 4px 8px;
  border-radius: 999px;
  color: #b9c4d7;
  background: #242b37;
  font-size: 12px;
}

.crm-opportunity__status--new {
  color: #ffd37a;
  background: #46320b;
}

.crm-opportunity__status--converted {
  color: #75efae;
  background: #113c29;
}

.crm-opportunity__contact {
  margin-top: 10px;
  font-weight: 700;
}

.crm-opportunity__meta {
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
  color: #96a3b8;
  font-size: 12px;
}

.crm-owner {
  padding: 5px 9px;
  border-radius: 999px;
  color: #b9c4d7;
  background: #242b37;
  font-weight: 700;
}

.crm-owner--ai {
  color: #c9d9f3;
  background: #203354;
}

.crm-owner--human {
  color: #ffe1a3;
  background: #493411;
}

.crm-owner--success {
  color: #75efae;
  background: #113c29;
}

.crm-owner--closed {
  color: #b9c4d7;
  background: #2a303b;
}

.crm-opportunity__task {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid #303744;
  border-radius: 11px;
  background: #171d27;
}

.crm-opportunity__task span {
  color: #96a3b8;
  font-size: 12px;
}

.crm-opportunity__task strong {
  color: #e5ebf5;
  font-size: 13px;
}

.crm-opportunity__actions {
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.crm-follow-up {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid #2c3340;
}

.crm-follow-up__recommendation {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #364968;
  border-radius: 12px;
  color: #c9d9f3;
  background: #142036;
}

.crm-follow-up__fields {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-follow-up__fields label {
  display: grid;
  gap: 7px;
  color: #aeb9ca;
  font-size: 13px;
}

.crm-follow-up select,
.crm-follow-up input[type="datetime-local"] {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #374050;
  border-radius: 10px;
  color: #f3f6fb;
  background: #0d1219;
}

.crm-follow-up__consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #b8c2d2;
  font-size: 13px;
}

.crm-follow-up__consent input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.crm-follow-up__consent[hidden] {
  display: none;
}

.crm-follow-up__buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #4d3c19;
  border-radius: 12px;
  background: #241d10;
}

.crm-quick-actions > div:first-child {
  display: grid;
  gap: 4px;
}

.crm-quick-actions small {
  color: #c9b98f;
  font-size: 12px;
}

.crm-quick-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.crm-follow-up__result {
  color: #77e8ac;
}

.crm-follow-up__alert {
  color: #ff9d9d;
  font-weight: 700;
}

.crm-follow-up__draft {
  color: #f0c466;
}

.crm-history {
  grid-column: 1 / -1;
  border-top: 1px solid #2c3340;
  padding-top: 14px;
}

.crm-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: #dce5f3;
  font-weight: 700;
  list-style: none;
}

.crm-history summary::-webkit-details-marker {
  display: none;
}

.crm-history summary span {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #b9c9e8;
  background: #253148;
  text-align: center;
  font-size: 12px;
}

.crm-history__content {
  display: grid;
  grid-template-columns:
    minmax(260px, 0.85fr)
    minmax(280px, 1.15fr);
  gap: 18px;
  margin-top: 15px;
}

.crm-history__form {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.crm-history__form label {
  display: grid;
  gap: 7px;
  color: #aeb9ca;
  font-size: 13px;
}

.crm-history__form select,
.crm-history__form input,
.crm-history__form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #374050;
  border-radius: 10px;
  color: #f3f6fb;
  background: #0d1219;
  font: inherit;
}

.crm-history__form textarea {
  resize: vertical;
}

.crm-history__note,
.crm-history__form .button {
  grid-column: 1 / -1;
}

.crm-history__form .button {
  justify-self: start;
}

.crm-history__timeline {
  display: grid;
  gap: 9px;
  align-content: start;
  max-height: 330px;
  overflow-y: auto;
}

.crm-history__item {
  padding: 11px 13px;
  border: 1px solid #2e3745;
  border-radius: 11px;
  background: #0d1219;
}

.crm-history__item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-history__item time,
.crm-history__item small {
  color: #93a2b8;
  font-size: 12px;
}

.crm-history__item p {
  margin: 7px 0 4px;
  color: #cbd5e4;
  font-size: 13px;
}

.crm-history__empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #353c49;
  border-radius: 11px;
  color: #9da8bb;
  text-align: center;
}

.crm-sales-settings {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px solid #303643;
  border-radius: 18px;
  background: #13171f;
}

.crm-sales-settings > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.crm-sales-settings > summary::-webkit-details-marker {
  display: none;
}

.crm-sales-settings > summary > span {
  display: grid;
  gap: 5px;
}

.crm-sales-settings > summary strong {
  color: #f3f6fb;
}

.crm-sales-settings > summary small {
  color: #96a3b8;
}

.crm-sales-settings__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.crm-sales-settings__grid .workspace-card {
  min-height: 0;
}

.crm-sales-settings__grid .workspace-card p {
  margin: 8px 0 0;
}

@media (max-width: 720px) {
  .crm-opportunities__header,
  .crm-opportunity {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .crm-opportunity__meta {
    align-items: flex-start;
  }

  .crm-follow-up__fields {
    grid-template-columns: 1fr;
  }

  .crm-history__content,
  .crm-history__form {
    grid-template-columns: 1fr;
  }

  .crm-dashboard,
  .crm-sales-settings__grid {
    grid-template-columns: 1fr;
  }

  .crm-toolbar,
  .crm-sales-settings > summary,
  .crm-quick-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-quick-actions__buttons {
    justify-content: flex-start;
  }

  .crm-sort {
    flex-basis: auto;
  }
}
.website-importer {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    rgba(37, 99, 235, 0.12),
    rgba(15, 23, 42, 0.42)
  );
}

.website-importer__heading,
.website-importer__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.website-importer__heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.website-importer__heading small {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
}

.website-importer__badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 700;
}

.website-importer__controls input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #303847;
  border-radius: 10px;
  outline: none;
  background: #0c1119;
  color: #f8fafc;
  font: inherit;
}

.website-importer__controls input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px
    rgba(59, 130, 246, 0.12);
}

.website-importer__separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.website-importer__separator::before,
.website-importer__separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #273142;
}

.website-analysis-preview {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid
    rgba(148, 163, 184, 0.18);
}

.website-analysis-preview__metrics {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.website-analysis-preview__metric {
  padding: 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.76);
  text-align: center;
}

.website-analysis-preview__metric strong,
.website-analysis-preview__metric span {
  display: block;
}

.website-analysis-preview__metric span {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 0.72rem;
}

.website-analysis-preview__notice {
  margin: 8px 0 0;
  color: #fbbf24;
  font-size: 0.8rem;
}

@media (max-width: 620px) {
  .website-importer__controls {
    align-items: stretch;
    flex-direction: column;
  }
}

/* --------------------------------------------------
   Prompt Builder editable
   -------------------------------------------------- */

.prompt-editor-card {
  padding: 22px;
}

.prompt-editor-status {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  color: #aebbd0;
  text-align: center;
}

.prompt-editor {
  display: grid;
  gap: 22px;
}

.prompt-editor[hidden] {
  display: none;
}

.prompt-editor__field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.prompt-editor__field > span {
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
}

.prompt-editor__field > small {
  color: #9aa8bd;
  font-size: 0.82rem;
  line-height: 1.45;
}

.prompt-editor__textarea {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid #303746;
  border-radius: 14px;
  outline: none;
  background: #11151d;
  color: #f8fafc;
  padding: 16px 18px;
  font: 500 0.9rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompt-editor__textarea:focus {
  border-color: #77a7ff;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

.prompt-editor__textarea--first-message {
  min-height: 138px;
  max-height: 320px;
}

.prompt-editor__textarea--prompt {
  min-height: 440px;
  max-height: 72vh;
}

.prompt-editor__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 24px;
}

.prompt-editor__save-status,
.prompt-editor__count {
  font-size: 0.78rem;
}

.prompt-editor__save-status--saved {
  color: #34d399;
}

.prompt-editor__save-status--pending {
  color: #fbbf24;
}

.prompt-editor__count {
  color: #aebbd0;
  white-space: nowrap;
}

[data-workspace-content="prompt"] .workspace-panel__header > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  .prompt-editor-card {
    padding: 16px;
  }

  .prompt-editor__textarea--prompt {
    min-height: 340px;
  }

  .prompt-editor__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  [data-workspace-content="prompt"] .workspace-panel__header > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }
}
