/* ===========================
   Suporte (seção do dashboard)
   =========================== */
.support-wrap { max-width: 920px; margin: 0 auto; }
.support-hero { margin-bottom: 1.75rem; }
.support-hero h2 { font-size: 1.35rem; font-weight: 700; color: #111827; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.support-hero p { font-size: 0.95rem; color: #6b7280; margin: 0; line-height: 1.6; }

.contact-card {
  background: linear-gradient(135deg, #6C3AED 0%, #8B5CF6 100%);
  color: #fff; border-radius: 16px; padding: 1.75rem; margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(108, 58, 237, 0.18);
}
.contact-card h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.4rem; color: #fff; }
.contact-card p { font-size: 0.92rem; line-height: 1.6; margin: 0 0 1.15rem; opacity: 0.95; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #fff; color: #6C3AED; padding: 0.65rem 1.2rem;
  border-radius: 10px; text-decoration: none; font-weight: 600;
  font-size: 0.9rem; transition: transform 0.15s, box-shadow 0.15s;
}
.contact-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.contact-btn.secondary { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.contact-meta { font-size: 0.8rem; opacity: 0.85; margin-top: 0.85rem; }

.support-section { margin-bottom: 2rem; }
.support-section h3 {
  font-size: 1.05rem; font-weight: 700; color: #111827;
  margin: 0 0 0.9rem; letter-spacing: -0.01em;
}

.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
}
.topic-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 1.1rem; transition: border-color 0.15s, transform 0.15s;
}
.topic-card:hover { border-color: #6C3AED; transform: translateY(-2px); }
.topic-icon { font-size: 1.4rem; margin-bottom: 0.4rem; }
.topic-card h4 { font-size: 0.92rem; font-weight: 700; color: #111827; margin: 0 0 0.3rem; }
.topic-card p { font-size: 0.82rem; color: #6b7280; line-height: 1.5; margin: 0; }

.faq-item {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 0.9rem 1.15rem; margin-bottom: 0.65rem;
}
.faq-item summary {
  font-size: 0.92rem; font-weight: 600; color: #111827;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 1.2rem; color: #9ca3af;
  transition: transform 0.2s; flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { font-size: 0.88rem; line-height: 1.65; color: #4b5563; margin: 0.8rem 0 0; }
.faq-item ul { margin: 0.5rem 0 0 1.25rem; }
.faq-item li { font-size: 0.88rem; color: #4b5563; line-height: 1.6; margin-bottom: 0.3rem; }

.links-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}
.link-pill {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 0.8rem 1rem; text-decoration: none; color: #374151;
  font-size: 0.88rem; display: flex; align-items: center; gap: 0.55rem;
  transition: border-color 0.15s, color 0.15s;
}
.link-pill:hover { border-color: #6C3AED; color: #6C3AED; }

@media (max-width: 640px) {
  .support-hero h2 { font-size: 1.2rem; }
  .contact-card { padding: 1.35rem; }
}

/* ===========================
   Dashboard Layout
   =========================== */
.dash-body {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar-header .logo {
  font-size: 1.2rem;
}

.sidebar-header .logo-img {
  height: 28px;
}

/* ===========================
   Bot Info Bar (sidebar)
   =========================== */
.bot-info-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

.bot-info-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bot-info-text:hover,
.bot-info-text:focus-visible {
  background: var(--color-bg);
  outline: none;
}

.bot-info-display {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.bot-info-name {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.bot-info-switch {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bot-info-switch:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===========================
   Bot Picker List
   =========================== */
.bot-panel-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}

.bot-panel-item:hover {
  background: var(--color-bg);
}

.bot-panel-item.active {
  background: rgba(108, 58, 237, 0.06);
}

.bot-panel-item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.bot-panel-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.bot-panel-item-display {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-panel-item-meta {
  font-size: 0.66rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bot-panel-item-wa {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bot-panel-item-wa.connected {
  background: #22C55E;
}

.bot-panel-item-wa.disconnected {
  background: #D1D5DB;
}

.bot-panel-item-plan {
  font-size: 0.62rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-weight: 600;
  flex-shrink: 0;
}

.bot-panel-item-plan.trial {
  background: #FEF3C7;
  color: #92400E;
}

.bot-panel-item-plan.pro {
  background: #EDE9FE;
  color: #6D28D9;
}

.bot-panel-item-plan.canceled {
  background: #FEE2E2;
  color: #991B1B;
}

.bot-panel-item-actions {
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.bot-panel-item:hover .bot-panel-item-actions {
  opacity: 1;
}

.bot-panel-item-actions button {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 0.65rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}

.bot-panel-item-actions button:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.bot-panel-item-actions button.delete:hover,
.bot-panel-item-actions button.delete-btn:hover {
  background: #FEE2E2;
  color: #EF4444;
  border-color: #FECACA;
}

/* Modal de seleção de robôs */
.bot-picker-modal {
  z-index: 120;
}

.bot-picker-modal .modal {
  width: min(92vw, 720px);
  max-width: 720px;
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem;
}

.bot-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 2.5rem;
  margin-bottom: 1rem;
}

.bot-picker-header h2 {
  margin: 0 0 0.35rem;
}

.bot-picker-header p {
  margin: 0;
}

.bot-picker-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.bot-picker-search {
  margin-bottom: 0.9rem;
}

.bot-picker-search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  padding: 0 0.95rem;
  font: inherit;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bot-picker-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 58, 237, 0.12);
  background: var(--color-surface);
}

.bot-picker-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.bot-picker-list .bot-panel-item {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  margin-bottom: 0.7rem;
  background: var(--color-surface);
}

.bot-picker-list .bot-panel-item:last-child {
  margin-bottom: 0;
}

.bot-picker-list .bot-panel-item:hover {
  background: var(--color-bg);
  border-color: rgba(108, 58, 237, 0.28);
}

.bot-picker-list .bot-panel-item.active {
  background: rgba(108, 58, 237, 0.06);
  border-color: rgba(108, 58, 237, 0.28);
  box-shadow: 0 10px 24px rgba(108, 58, 237, 0.08);
}

.bot-picker-list .bot-panel-item-actions {
  opacity: 1;
}

.bot-picker-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 1.25rem;
  border: 1px dashed var(--color-border);
  border-radius: 16px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.5;
}

.bot-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

.bot-picker-add {
  min-width: 150px;
}

.bot-picker-footer #bot-panel-stripe .btn {
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.nav-item.active {
  background: #F5F3FF;
  color: var(--color-primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

/* Separador entre o grupo "do robô" e o grupo "da conta" (Conta/Suporte) */
.nav-divider {
  height: 1px;
  background: var(--color-border, #e5e7eb);
  margin: 0.65rem 0.5rem;
  border: 0;
}

.sidebar-footer {
  padding: 1rem 1rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  transition: all 0.15s;
}

.logout-btn:hover {
  background: #FEE2E2;
  color: #EF4444;
}

/* ===========================
   Main Content
   =========================== */
.dash-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.dash-header h1 {
  font-size: 1.3rem;
  text-align: left;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.3rem;
}

.plan-badge {
  background: #F5F3FF;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.dash-section {
  padding: 2rem;
}

.dash-section.hidden {
  display: none;
}

/* ===========================
   Cards
   =========================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.card h3 {
  margin-bottom: 0.25rem;
}

.card-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ===========================
   Stats Grid (Overview)
   =========================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-change {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  color: var(--color-text-secondary);
}

.stat-change.positive { color: #10B981; }
.stat-change.negative { color: #EF4444; }

/* ===========================
   Onboarding Steps
   =========================== */
.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.onboard-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

.onboard-step .step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F5F3FF;
  color: var(--color-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboard-step div {
  flex: 1;
}

.onboard-step strong {
  display: block;
  font-size: 0.95rem;
}

.onboard-step p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 0.15rem;
}

/* Tips Grid (pós-onboarding) */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tip-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: #FAFAFA;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tip-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.tip-item p {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* ===========================
   WhatsApp Section
   =========================== */
.wa-connect-box {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.qr-placeholder {
  width: 260px;
  height: 260px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-border-light);
  overflow: hidden;
}

.qr-empty {
  text-align: center;
  color: var(--color-text-secondary);
}

.qr-empty span {
  font-size: 1.2rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}

.qr-empty p {
  font-size: 0.8rem;
  max-width: 180px;
}

.qr-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

/* Loading state enquanto o QR code está sendo gerado */
.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem;
  text-align: center;
  color: var(--color-text-secondary);
}
.qr-loading .qr-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(108, 58, 237, 0.18);
  border-top-color: #6C3AED;
  animation: qr-spin 0.9s linear infinite;
}
.qr-loading .qr-loading-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #111827;
}
.qr-loading .qr-loading-sub {
  font-size: 0.78rem;
  max-width: 200px;
  line-height: 1.45;
}
@keyframes qr-spin {
  to { transform: rotate(360deg); }
}

.wa-instructions {
  flex: 1;
}

.wa-instructions h4 {
  margin-bottom: 0.75rem;
}

.wa-instructions ol {
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
}

.wa-instructions li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.wa-status-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
}

.wa-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wa-status-indicator.connected {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.7); }
}

.wa-status-info {
  flex: 1;
}

.wa-status-info strong {
  display: block;
}

.wa-status-info span {
  font-size: 0.85rem;
  color: #10B981;
}

.wa-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
}

.wa-stat {
  display: flex;
  flex-direction: column;
}

.wa-stat-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.wa-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

/* ===========================
   Bot Config Form
   =========================== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 0.3rem;
}

.form-hint.is-success { color: #16a34a; }
.form-hint.is-error { color: #dc2626; }

/* Input com botão de ação ao lado (ex.: campo + botão "Testar") */
.input-with-action {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.input-with-action input {
  flex: 1 1 auto;
  min-width: 0;
}
.input-with-action .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.input-with-action .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Schedule disabled state */
.schedule-disabled .schedule-day {
  opacity: 0.45;
  pointer-events: none;
}
.schedule-disabled .schedule-day .toggle-inline,
.schedule-disabled .schedule-day input { cursor: not-allowed; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: var(--color-surface);
  color: var(--color-text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 58, 237, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #C4C9D4;
}

/* Schedule */
.schedule-toggle {
  margin-bottom: 1.25rem;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.toggle-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.schedule-day {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.schedule-day label {
  min-width: 140px;
}

.time-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-range span {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.time-input {
  width: 110px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.time-input:focus {
  border-color: var(--color-primary);
}

.time-input:disabled {
  background: var(--color-border-light);
  opacity: 0.5;
}

/* Quick replies */
.quick-reply-item {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  padding: 0.75rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.quick-reply-item .form-group {
  flex: 1;
  margin-bottom: 0;
}

.btn-icon-delete {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-bottom: 0.1rem;
}

.btn-icon-delete:hover {
  background: #FEE2E2;
  color: #EF4444;
}

/* Billing */
.billing-current {
  margin-top: 1rem;
}

.billing-plan {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.billing-plan-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.billing-plan-price {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.billing-info {
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}

/* ===========================
   Advanced Settings (Sliders)
   =========================== */
.card-header-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0;
}

.card-header-toggle:hover .toggle-arrow {
  color: var(--color-primary);
}

.toggle-arrow {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  transition: transform 0.3s ease, color 0.15s;
}

.toggle-arrow.open {
  transform: rotate(90deg);
}

.slider-section {
  margin-top: 1rem;
}

.slider-section.hidden {
  display: none;
}

.slider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
}

.slider-item {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  transition: border-color 0.2s;
}

.slider-item:hover {
  border-color: var(--color-primary-light, #A78BFA);
}

.slider-item.special {
  border-color: #FECDD3;
  background: #FFF5F5;
}

.slider-item.special:hover {
  border-color: #FDA4AF;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}

.slider-header label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.slider-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-primary);
  background: #F5F3FF;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  min-width: 28px;
  text-align: center;
}

.slider-item.special .slider-value {
  color: #E11D48;
  background: #FFF1F2;
}

.personality-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.personality-emoji {
  font-size: 2rem;
  transition: transform 0.25s ease;
  display: inline-block;
  line-height: 1;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.4rem;
  opacity: 0.7;
}

/* Range Input Styling */
.slider-item input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--color-border) 0%, var(--color-border) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.slider-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.slider-item input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(108, 58, 237, 0.4);
}

.slider-item input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.slider-item.special input[type="range"]::-webkit-slider-thumb {
  background: #E11D48;
}

.slider-item.special input[type="range"]::-moz-range-thumb {
  background: #E11D48;
}

/* Special Settings wrapper */
.special-settings-wrapper {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed var(--color-border-light);
}

.special-settings-wrapper h4 {
  font-size: 1rem;
  margin: 0;
}

.special-warning {
  color: #E11D48 !important;
  font-size: 0.82rem !important;
  font-style: italic;
}

/* Upgrade gate */
.upgrade-gate {
  background: linear-gradient(135deg, #F5F3FF, #EDE9FE);
  border: 2px dashed var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  margin-top: 1rem;
}

.upgrade-gate-content p {
  margin: 0.25rem 0;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.upgrade-gate-content p strong {
  color: var(--color-text);
}

.upgrade-gate-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.upgrade-gate .btn {
  margin-top: 1rem;
}

.upgrade-gate-link {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: underline;
}

/* ===========================
   Plan Badge Variants
   =========================== */
.plan-badge.plan-pro {
  background: #ECFDF5;
  color: #059669;
}

.plan-badge.plan-canceled {
  background: #FEF2F2;
  color: #DC2626;
}

/* ===========================
   Personality Panel (unified)
   =========================== */
.personality-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.personality-header h3 {
  margin: 0;
}
.personality-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin: 1.25rem 0 0.75rem;
  padding: 0;
  font-weight: 700;
}
.personality-section-special {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.special-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #FEF3C7;
  color: #92400E;
  padding: 0.15rem 0.5rem;
  border-radius: 2rem;
  font-weight: 700;
}
.personality-divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 1.5rem 0 0.5rem;
}
.personality-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  white-space: nowrap;
}
.badge-trial {
  background: #F3F4F6;
  color: #6B7280;
}
.badge-monthly {
  background: #FEF3C7;
  color: #92400E;
}
.badge-annual {
  background: #ECFDF5;
  color: #059669;
}
.badge-addon {
  background: #EDE9FE;
  color: var(--color-primary);
}

/* Upgrade gate variants */
.upgrade-gate-trial {
  background: linear-gradient(135deg, #F9FAFB, #F3F4F6);
  border-color: #D1D5DB;
}
.upgrade-gate-price {
  font-size: 0.9rem;
  margin-top: 0.75rem;
  line-height: 1.6;
}
.upgrade-gate h4 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.05rem;
  color: var(--color-text);
}

/* ===========================
   Modal (Add Bot)
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
}

.modal-close:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.modal h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.modal p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.btn-block {
  width: 100%;
}


/* ===========================
   Responsive
   =========================== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .dash-main {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

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

  .wa-connect-box {
    flex-direction: column;
  }

  .qr-placeholder {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }

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

  .quick-reply-item {
    flex-direction: column;
    align-items: stretch;
  }

  .wa-stats {
    flex-direction: column;
    gap: 1rem;
  }

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

  .bot-picker-modal .modal {
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    padding: 1.2rem;
  }

  .bot-picker-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-right: 2.2rem;
  }

  .bot-picker-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .bot-picker-add,
  .bot-picker-footer #bot-panel-stripe,
  .bot-picker-footer #bot-panel-stripe .btn {
    width: 100%;
  }

}

/* ===========================
   Conversations Panel
   =========================== */
#section-conversations {
  padding: 0;
}

.conv-layout {
  display: flex;
  height: calc(100vh - 61px);
  overflow: hidden;
}

.conv-list-panel {
  width: 340px;
  min-width: 280px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}

.conv-list-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-list-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.conv-list-empty p {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.conv-list-empty span {
  font-size: 0.82rem;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.12s;
}

.conv-item:hover {
  background: #F5F3FF;
}

.conv-item.active {
  background: #EDE9FE;
  border-left: 3px solid var(--color-primary);
}

.conv-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.conv-item-avatar.human {
  background: #FEF3C7;
  color: #92400E;
}

.conv-item-info {
  flex: 1;
  min-width: 0;
}

.conv-item-phone {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item-preview {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.conv-item-meta {
  text-align: right;
  flex-shrink: 0;
}

.conv-item-time {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.conv-item-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.conv-item-badge.human {
  background: #FEF3C7;
  color: #92400E;
}

.conv-item-badge.bot {
  background: #ECFDF5;
  color: #059669;
}

/* Messages panel */
.conv-messages-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  overflow: hidden;
}

.conv-messages-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  gap: 0.5rem;
}

.conv-messages-empty span {
  font-size: 2.5rem;
}

.conv-messages-empty p {
  font-size: 0.9rem;
}

.conv-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.conv-msg-header-info strong {
  display: block;
  font-size: 0.95rem;
}

.conv-msg-status-bot {
  font-size: 0.78rem;
  color: #10B981;
}

.conv-msg-status-human {
  font-size: 0.78rem;
  color: #D97706;
  font-weight: 600;
}

.conv-msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.conv-msg {
  max-width: 75%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
}

.conv-msg.user {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.conv-msg.assistant {
  align-self: flex-end;
  background: #dcf8c6;
  border-bottom-right-radius: 4px;
}

.conv-msg.system {
  align-self: center;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.78rem;
  max-width: 90%;
  text-align: center;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
}

.conv-msg-time {
  display: block;
  font-size: 0.65rem;
  color: #999;
  margin-top: 0.2rem;
  text-align: right;
}

.conv-msg.user .conv-msg-time {
  text-align: left;
}

/* Takeover button variants */
#conv-takeover-btn.takeover {
  background: #D97706;
  color: #fff;
  border-color: #D97706;
}

#conv-takeover-btn.release {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

@media (max-width: 900px) {
  .conv-layout {
    flex-direction: column;
    height: auto;
  }

  .conv-list-panel {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .conv-messages-panel {
    min-height: 60vh;
  }
}

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

  .dash-section {
    padding: 1rem;
  }

  .dash-header {
    padding: 0.75rem 1rem;
  }

  .schedule-day {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===========================
   Calendar
   =========================== */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.calendar-nav h3 {
  font-size: 1.2rem;
  color: var(--color-text);
  min-width: 180px;
  text-align: center;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1rem;
}

#cal-range-toggle.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.cal-range-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FEF3C7;
  color: #92400e;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.cal-range-hint .btn-link {
  background: none;
  border: none;
  color: #92400e;
  text-decoration: underline;
  padding: 0 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.calendar-grid.cal-range-mode .cal-day:not(.cal-empty):not(.cal-past) {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35) inset;
}

.cal-day.cal-selected {
  background: #6366F1 !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px #4338CA inset !important;
}

.cal-day.cal-selected .cal-day-num,
.cal-day.cal-selected .cal-day-label {
  color: #fff !important;
}

.cal-day.cal-range-mid {
  background: #C7D2FE !important;
  color: #4338CA !important;
}

.cal-day.cal-range-mid .cal-day-num,
.cal-day.cal-range-mid .cal-day-label {
  color: #4338CA !important;
}

.cal-range-warn {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 8px 0;
  padding: 8px 12px;
  background: #FEF3C7;
  border-radius: 6px;
}

.calendar-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.cal-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.cal-dot.cal-available { background: var(--color-accent); }
.cal-dot.cal-booked { background: var(--color-primary); }
.cal-dot.cal-pre-booked { background: #F59E0B; }
.cal-dot.cal-blocked { background: #EF4444; }

.calendar-grid {
  max-width: 700px;
  margin: 0 auto;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-size: 0.9rem;
  position: relative;
  border: 2px solid transparent;
}

.cal-day:not(.cal-empty):not(.cal-past):hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}

.cal-day.cal-empty { cursor: default; }

.cal-day.cal-past {
  background: #f3f4f6;
  color: #bbb;
  cursor: default;
}

.cal-day.cal-available {
  background: #ECFDF5;
  color: var(--color-accent);
  font-weight: 600;
}

.cal-day.cal-booked {
  background: #EDE9FE;
  color: var(--color-primary);
  font-weight: 600;
}

.cal-day.cal-pre-booked {
  background: #FEF3C7;
  color: #D97706;
  font-weight: 600;
}

.cal-day.cal-blocked {
  background: #FEE2E2;
  color: #EF4444;
  font-weight: 600;
}

.cal-day-num {
  font-size: 1rem;
  font-weight: 700;
}

.cal-day-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Calendar Modal */
#cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#cal-modal-overlay.active {
  display: flex;
}

#cal-modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

#cal-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

#cal-modal .modal-header h3 {
  font-size: 1.1rem;
  color: var(--color-text);
}

#cal-modal .modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  line-height: 1;
}

#cal-modal .modal-body {
  padding: 1.5rem;
}

.cal-status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
}

.cal-status-badge.cal-available { background: var(--color-accent); }
.cal-status-badge.cal-booked { background: var(--color-primary); }
.cal-status-badge.cal-pre-booked { background: #F59E0B; }
.cal-status-badge.cal-blocked { background: #EF4444; }

.cal-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 600px) {
  .cal-day { font-size: 0.75rem; border-radius: 6px; }
  .cal-day-num { font-size: 0.85rem; }
  .calendar-nav h3 { font-size: 1rem; min-width: 140px; }
}

/* Overview mini-calendar */
.overview-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.overview-calendar-header h3 {
  margin: 0;
}

.cal-day-mini {
  aspect-ratio: 1;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: default;
}

.cal-day-mini .cal-day-num {
  font-size: 0.8rem;
}

.cal-day-mini.cal-today {
  border: 2px solid var(--color-primary);
}

/* ===========================
   Calendar Container (large screens)
   =========================== */
.calendar-container {
  max-width: 700px;
  margin: 0 auto;
}

/* ===========================
   Section Description & Top Bar
   =========================== */
.section-desc-top {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

.section-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-top-bar .section-desc-top {
  margin-bottom: 0;
  flex: 1;
}

/* ===========================
   Config Tabs (Bot Config)
   =========================== */
.config-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  position: sticky;
  top: 61px;
  z-index: 30;
  overflow-x: auto;
}

.config-tab {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.config-tab:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.config-tab.active {
  background: #F5F3FF;
  color: var(--color-primary);
}

/* ===========================
   Config Auto-Save Feedback
   =========================== */
.config-autosave-feedback {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 100;
}

.config-autosave-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.config-autosave-feedback.autosave-ok {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.config-autosave-feedback.autosave-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

@media (max-width: 600px) {
  .config-tabs {
    gap: 0.15rem;
    padding: 0.25rem;
  }

  .config-tab {
    padding: 0.45rem 0.5rem;
    font-size: 0.78rem;
  }

  .section-top-bar {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ===========================
   Section: Plano
   =========================== */
.plan-current-info {
  margin-bottom: 1.5rem;
}

.plan-current-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.plan-current-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  background: var(--color-border-light);
  color: var(--color-text-secondary);
}

.plan-current-badge.badge-trial {
  background: #FEF3C7;
  color: #92400E;
}

.plan-current-badge.badge-pro {
  background: #DBEAFE;
  color: #1E40AF;
}

.plan-current-badge.badge-annual {
  background: #D1FAE5;
  color: #065F46;
}

.plan-trial-countdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.9rem;
  font-weight: 500;
}

.plan-trial-icon {
  font-size: 1.1rem;
}

.plan-manage-link {
  margin-top: 0.85rem;
}
.plan-manage-link .btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary, #7C3AED);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.plan-manage-link .btn-link:hover {
  text-decoration: underline;
}
.plan-manage-link.hidden {
  display: none;
}

/* Plan Cards Grid — versão compacta */
.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.plan-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
}

.plan-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.plan-card.plan-card-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.plan-card-featured {
  border-color: var(--color-primary);
}

.plan-card-ribbon {
  position: absolute;
  top: 8px;
  right: -28px;
  transform: rotate(45deg);
  background: var(--color-primary);
  color: white;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.18rem 1.8rem;
  letter-spacing: 0.02em;
}

.plan-card-header {
  padding: 0.85rem 0.95rem 0.7rem;
}

.plan-card-header h4 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}

.plan-card-subtitle {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.plan-card-header-trial {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
}

.plan-card-header-pro {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
}

.plan-card-header-annual {
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
}

.plan-card-price {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

.plan-card-price-old {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: line-through;
}

.plan-card-price small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.plan-card-price-detail {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #047857;
  font-weight: 600;
}

.plan-card-savings {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #059669;
  background: #D1FAE5;
  padding: 0.12rem 0.5rem;
  border-radius: 10px;
}

.plan-card-features {
  list-style: none;
  padding: 0.65rem 0.95rem 0.4rem;
  margin: 0;
  flex: 1;
}

.plan-card-features li {
  padding: 0.22rem 0;
  font-size: 0.78rem;
  color: var(--color-text);
  position: relative;
  padding-left: 1.15rem;
  line-height: 1.35;
}

.plan-card-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0.22rem;
  color: #059669;
  font-weight: 700;
  font-size: 0.78rem;
}

.plan-card-features li.plan-feature-disabled {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

.plan-card-features li.plan-feature-disabled::before {
  content: '—';
  color: var(--color-text-secondary);
}

.plan-card-features li.plan-feature-excluded {
  color: var(--color-text-secondary);
  opacity: 0.75;
}

.plan-card-features li.plan-feature-excluded::before {
  content: '✗';
  color: #DC2626;
}

.plan-card-action {
  padding: 0.4rem 0.95rem 0.6rem;
}

.plan-card-action .btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

.plan-card-note {
  display: block;
  padding: 0 0.95rem 0.75rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.plan-card-extra-note {
  margin: 0;
  padding: 0 0.95rem 0.85rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.plan-multi-bot-note {
  margin: 1.25rem 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

/* Plan FAQ */
.plan-faq-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.plan-faq-item:last-child {
  border-bottom: none;
}

.plan-faq-item strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.plan-faq-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Responsive: plan cards */
@media (max-width: 900px) {
  .plan-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .plan-card-ribbon {
    right: -35px;
    top: 10px;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .plan-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===========================
   AI Description Assistant
   =========================== */
.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.label-with-action label {
  margin-bottom: 0;
}

.btn-ai-wand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #7C3AED;
  background: #EDE9FE;
  border: 1px solid #C4B5FD;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ai-wand:hover:not(:disabled) {
  background: #DDD6FE;
  border-color: #7C3AED;
}

.btn-ai-wand:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ai-wand.loading {
  pointer-events: none;
  opacity: 0.7;
}

.wand-icon {
  font-size: 1rem;
}

#instructions-char-count {
  text-align: right;
  display: block;
}

.ai-questions-box {
  margin-top: 1rem;
  padding: 1.25rem;
  background: #FAFAF5;
  border: 1px solid #E5E2D9;
  border-radius: 8px;
}

.ai-questions-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ai-questions-subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

.ai-question-item {
  margin-bottom: 1rem;
}

.ai-question-item label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: #333;
}

.ai-question-item textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.85rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  resize: vertical;
  min-height: 2.5rem;
}

.ai-questions-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

#bot-instructions.ai-processing {
  opacity: 0.6;
  pointer-events: none;
  background: #F3F4F6;
}
