/* CSS Variables & Theme Setup */
:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Color Palette - Premium Dark Mode */
  --bg-primary: #050a1e;
  --bg-secondary: #0a122c;
  --bg-tertiary: #101c42;
  
  --glass-bg: rgba(16, 28, 66, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.25);
  
  /* Brand Colors */
  --remax-blue: #003DA5;
  --remax-red: #ED1C24;
  --remax-blue-gradient: linear-gradient(135deg, #003DA5 0%, #0072CE 100%);
  --remax-red-gradient: linear-gradient(135deg, #ED1C24 0%, #FF5A60 100%);
  --gold-gradient: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  --accent-gradient: linear-gradient(135deg, #0072CE 0%, #ED1C24 100%);
  
  /* Status Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #3B82F6;
  --color-purple: #8B5CF6;
  
  /* Text Colors */
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  
  /* Dimensions & Spacing */
  --header-height: 70px;
  --nav-height: 70px;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
}

.install-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 8, 18, 0.72);
  backdrop-filter: blur(14px);
}

.install-sheet.hidden {
  display: none;
}

.install-sheet-card {
  position: relative;
  width: min(430px, 100%);
  padding: 26px 22px 22px;
  border-radius: 30px 30px 24px 24px;
  border: 1px solid rgba(143, 186, 255, 0.24);
  box-shadow: 0 -18px 55px rgba(0, 0, 0, 0.38);
  animation: installSheetIn 260ms ease-out;
}

.install-sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.1);
  font-size: 18px;
  font-weight: 800;
}

.install-sheet-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0, 112, 255, 0.28);
  margin-bottom: 14px;
}

.install-sheet-card h2 {
  margin: 8px 0 10px;
  font-size: 1.55rem;
  line-height: 1.1;
}

.install-sheet-card p {
  color: var(--text-secondary);
  line-height: 1.45;
}

.install-steps {
  margin: 18px 0 0;
  padding: 16px 16px 16px 34px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #eaf2ff;
}

.install-steps li {
  margin: 8px 0;
}

.install-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin-top: 18px;
}

@keyframes installSheetIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Base Reset & Mobile-First Constraints */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Enforce Phone Simulator Frame on Wide Screens */
@media (min-width: 480px) {
  body {
    background-color: #030612;
  }
  
  #splash-screen,
  #login-screen,
  #app-shell,
  .modal-overlay,
  #celebration-overlay {
    max-width: 450px;
    height: 90vh;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  }
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-success { color: var(--color-success); }
.text-info { color: var(--color-info); }
.text-purple { color: var(--color-purple); }

.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Splash Screen / Loading Page */
.splash-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: opacity 0.5s ease;
}

.splash-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 16px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.splash-avatar {
  width: 124px;
  height: 164px;
  border-radius: 28px;
  border: 3px solid var(--remax-blue);
  box-shadow: 0 0 20px rgba(0, 114, 206, 0.3);
  object-fit: contain;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(236,241,250,0.92));
  padding: 6px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--remax-red);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

/* Auth / Login Page */
.login-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 1000;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 32px 24px;
  box-shadow: 0 10px 25px var(--glass-shadow);
  backdrop-filter: blur(10px);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-avatar {
  width: 120px;
  height: 148px;
  border-radius: 24px;
  border: 3px solid var(--remax-blue);
  margin-bottom: 16px;
  object-fit: contain;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(236,241,250,0.92));
  padding: 6px;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

.agent-access-card {
  margin-top: 18px;
}

.agent-access-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

/* ── AI Chat Header Strip ─────────────────────────────── */
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(5, 10, 30, 0.7);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}

.ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.ai-avatar-sm {
  width: 40px;
  height: 50px;
  border-radius: 14px;
  object-fit: contain;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(236,241,250,0.92));
  border: 2px solid var(--remax-blue);
  padding: 2px;
  box-shadow: 0 0 12px rgba(0, 114, 206, 0.25);
}

.ai-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--color-success);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.ai-chat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-chat-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.ai-chat-status {
  font-size: 0.72rem;
  color: var(--color-success);
  font-weight: 500;
}

/* Legacy shell (used in home view) */
.assistant-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
}

.assistant-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.assistant-hero-copy h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.assistant-hero-copy p {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.55;
}

.assistant-hero-avatar {
  width: 100%;
  max-width: 104px;
  justify-self: end;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(236,241,250,0.92));
  padding: 6px;
}

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

.agent-home-actions {
  display: grid;
  gap: 14px;
}

.agent-home-btn {
  width: 100%;
  border: 1px solid rgba(117, 206, 255, 0.55);
  border-radius: 24px;
  padding: 24px 20px;
  background:
    linear-gradient(135deg, rgba(6, 163, 255, 0.96), rgba(21, 113, 235, 0.94)),
    var(--glass-bg);
  box-shadow: 0 18px 34px rgba(0, 121, 255, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff;
  text-align: center;
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 118px;
  place-content: center;
}

.agent-home-btn strong {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.agent-home-btn span:last-child {
  color: rgba(255, 255, 255, 0.84);
  font-size: .92rem;
}

.agent-home-kicker {
  display: none;
}

.calendar-connect-card {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 16px;
}

.calendar-connect-card strong {
  color: var(--text-primary);
  display: block;
  font-size: 1rem;
  margin-top: 6px;
}

.calendar-connect-card p {
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.4;
  margin: 6px 0 0;
}

.calendar-connect-card .btn {
  flex: 0 0 auto;
  min-width: 104px;
}

.assistant-mini-card {
  padding: 16px;
}

.assistant-mini-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.74rem;
  margin-bottom: 8px;
}

.assistant-mini-card strong {
  font-size: 1rem;
  line-height: 1.35;
}

.assistant-quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  align-items: center;
  flex-shrink: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.assistant-quick-actions::-webkit-scrollbar {
  display: none;
}

.assistant-chip {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-family: var(--font-main);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  touch-action: manipulation;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1;
  min-height: 40px;
}

.assistant-chip:active {
  background: rgba(0, 114, 206, 0.2);
  border-color: rgba(0, 114, 206, 0.4);
  transform: scale(0.95);
}

/* ── Chat Thread ─────────────────────────────────────────── */
.ai-chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.icon-btn.active {
  background-color: rgba(0, 114, 206, 0.16);
  color: #93c5fd;
}

.assistant-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ── Native Chat Bubble Messages ────────────────────────── */
.assistant-message {
  max-width: 88%;
  display: flex;
  flex-direction: column;
  animation: msgSlideIn 0.25s ease-out;
}

.assistant-message.is-selectable {
  position: relative;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.assistant-message.is-selectable:active {
  transform: scale(0.985);
}

.assistant-message.is-selectable::after {
  content: '';
  position: absolute;
  top: 8px;
  right: -28px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.04);
}

.assistant-message.is-selected::after {
  background: var(--remax-blue);
  border-color: var(--remax-blue);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.92);
}

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Max / AI bubble — izquierda */
.assistant-message-ai,
.assistant-message-system {
  align-self: flex-start;
  margin-right: auto;
}

.assistant-message-ai .assistant-message-head,
.assistant-message-system .assistant-message-head {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-left: 4px;
  letter-spacing: 0.04em;
}

.assistant-message-ai p,
.assistant-message-system p {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px 18px 18px 18px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* System message — centrado */
.assistant-message-system {
  align-self: center;
  margin-right: 0;
  max-width: 95%;
}

.assistant-message-system p {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
}

/* User bubble — derecha */
.assistant-message-user {
  align-self: flex-end;
  margin-left: auto;
}

.assistant-message-user .assistant-message-head {
  font-size: 0.68rem;
  color: rgba(147, 197, 253, 0.7);
  margin-bottom: 4px;
  padding-right: 4px;
  text-align: right;
  letter-spacing: 0.04em;
}

.assistant-message-user p {
  background: linear-gradient(135deg, #003DA5 0%, #0072CE 100%);
  border-radius: 18px 4px 18px 18px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 61, 165, 0.3);
}

/* Shared head layout */
.assistant-message-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.assistant-draft-card {
  border: 1px solid rgba(0, 114, 206, 0.22);
  background: rgba(9, 15, 32, 0.92);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

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

.assistant-draft-head strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.assistant-draft-head span {
  color: var(--color-info);
  font-size: 0.75rem;
}

.assistant-draft-body {
  display: grid;
  gap: 8px;
}

.assistant-draft-body div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.assistant-draft-body span {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.assistant-draft-body strong {
  color: var(--text-primary);
  font-size: 0.82rem;
  text-align: right;
}

.assistant-draft-actions {
  display: flex;
  gap: 10px;
}

.assistant-draft-actions .btn {
  flex: 1;
}

/* Memory card (legacy) */
.assistant-memory-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  align-self: flex-start;
  max-width: 88%;
}

.assistant-memory-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.assistant-memory-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.8rem;
}

.assistant-memory-item span {
  color: var(--text-secondary);
}

/* ── Composer Shell (always below the thread) ────────────── */
.assistant-composer-shell {
  flex-shrink: 0;
  background: var(--bg-primary);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 16px 12px;
  z-index: 20;
}

.assistant-composer {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: flex-end;
}

.assistant-voice-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  flex-shrink: 0;
}

.assistant-voice-btn:active {
  transform: scale(0.92);
  background: rgba(237, 28, 36, 0.12);
}

.assistant-voice-btn.is-listening {
  background: rgba(237, 28, 36, 0.18);
  border-color: rgba(237, 28, 36, 0.5);
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(237, 28, 36, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(237, 28, 36, 0); }
}

.assistant-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--remax-blue-gradient);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 61, 165, 0.35);
  touch-action: manipulation;
  flex-shrink: 0;
}

.assistant-send-btn:active {
  transform: scale(0.9);
  box-shadow: 0 2px 6px rgba(0, 61, 165, 0.2);
}

.assistant-input-wrap {
  position: relative;
  flex: 1;
}

.assistant-input-wrap textarea {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  padding: 13px 16px;
  resize: none;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: border-color 0.2s ease;
}

.assistant-input-wrap textarea:focus {
  outline: none;
  border-color: rgba(0, 114, 206, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.assistant-status-text {
  margin-top: 6px;
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}

.assistant-status-text.ok   { color: #86efac; }
.assistant-status-text.warn { color: #fcd34d; }
.assistant-status-text.pending { color: #93c5fd; }

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.input-with-icon {
  position: relative;
  width: 100%;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.input-with-icon input {
  padding-left: 44px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--remax-blue);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 114, 206, 0.15);
}

select {
  appearance: none;
  cursor: pointer;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.7rem;
  color: var(--text-muted);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

textarea {
  resize: none;
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 6px;
  line-height: 1.3;
}

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

.lexicon-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.lexicon-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
}

.lexicon-stat-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lexicon-report-block {
  margin-top: 16px;
}

.lexicon-report-block h4 {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.lexicon-toolbar {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin-top: 14px;
}

.lexicon-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lexicon-toolbar-search {
  min-width: 0;
}

.lexicon-toolbar-label {
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lexicon-list {
  display: grid;
  gap: 8px;
}

.lexicon-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 12px;
}

.lexicon-item strong {
  display: block;
  font-size: 0.88rem;
}

.lexicon-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.lexicon-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.lexicon-item-examples {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.lexicon-item-example {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.35;
}

.forgot-link {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: var(--remax-blue);
  text-decoration: none;
  margin-top: 8px;
  font-weight: 500;
}

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

.login-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.login-mode-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 600;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.login-mode-btn.active {
  background: rgba(0, 114, 206, 0.16);
  border-color: rgba(0, 114, 206, 0.32);
  color: var(--text-primary);
  box-shadow: 0 8px 18px rgba(0, 61, 165, 0.2);
}

.workspace-login-panel {
  display: grid;
  gap: 18px;
}

.workspace-options {
  display: grid;
  gap: 14px;
}

.workspace-structure-card,
.workspace-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.workspace-structure-head h3,
.workspace-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.workspace-structure-head p,
.workspace-card p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.workspace-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #93c5fd;
}

.workspace-structure-grid,
.workspace-module-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.workspace-structure-item,
.workspace-module-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 10, 28, 0.7);
  padding: 14px;
}

.workspace-structure-item strong,
.workspace-module-card strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.workspace-structure-item span,
.workspace-module-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.workspace-option-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.workspace-role-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.workspace-role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 114, 206, 0.16);
  border: 1px solid rgba(0, 114, 206, 0.22);
  color: #dbeafe;
}

.workspace-email-chip {
  font-size: 0.72rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.workspace-option-copy {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: -2px;
  margin-bottom: 4px;
}

.workspace-launch-btn {
  justify-content: flex-start;
}

.workspace-quick-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.workspace-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.workspace-footnote {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.workspace-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  font-size: 0.76rem;
  line-height: 1.4;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 24px;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--remax-blue-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 61, 165, 0.35);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 6px rgba(0, 61, 165, 0.2);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.btn-secondary:active {
  background-color: rgba(255, 255, 255, 0.13);
  transform: scale(0.97);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
  transform: scale(0.96);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s, transform 0.15s;
  touch-action: manipulation;
}

.icon-btn:active {
  background-color: rgba(255, 255, 255, 0.08);
}

.device-settings-fab {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2100;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(8, 17, 29, 0.78);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  touch-action: manipulation;
}

.device-settings-fab svg {
  width: 20px;
  height: 20px;
}

.device-settings-card {
  display: grid;
  gap: 14px;
}

.device-settings-actions {
  display: grid;
  gap: 10px;
}

.device-settings-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.device-settings-actions .btn svg {
  width: 17px;
  height: 17px;
}

/* App Shell Structure */
.app-shell {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: var(--header-height);
  background-color: rgba(5, 10, 30, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  padding-top: env(safe-area-inset-top);
}

.agent-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-container {
  position: relative;
  width: 40px;
  height: 40px;
}

.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.98);
  padding: 2px;
}

.network-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.network-badge.online { background-color: var(--color-success); }
.network-badge.offline { background-color: var(--color-warning); }

.agent-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.agent-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

.sync-indicator {
  color: var(--color-warning);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content Area */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
}

.app-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
  animation: fadeIn 0.3s ease;
}

/* Assistant view: flex column con scroll solo en el thread */
#view-assistant {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism Cards */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
  backdrop-filter: blur(10px);
}

/* Virtual Assistant Max Card */
.assistant-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.assistant-avatar-wrapper {
  width: 50px;
  height: 64px;
  flex-shrink: 0;
}

.assistant-avatar-img {
  width: 50px;
  height: 64px;
  border-radius: 16px;
  border: 2px solid var(--remax-blue);
  box-shadow: 0 0 10px rgba(0, 114, 206, 0.2);
  object-fit: contain;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(236,241,250,0.92));
  padding: 2px;
}

.assistant-bubble {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  border-top-left-radius: 4px;
  padding: 12px 16px;
  position: relative;
  flex: 1;
}

.assistant-bubble p {
  font-size: 0.85rem;
  line-height: 1.45;
}

/* PCoins Progress Card */
.pcoins-progress-card {
  margin-bottom: 16px;
}

.pcoins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

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

.coin-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
}

.coin-display h2 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.coin-display p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.progress-bar-container {
  margin-bottom: 12px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.next-level-label {
  color: var(--text-secondary);
}

.next-level-label strong {
  color: var(--text-primary);
}

#pcoins-needed-label {
  color: var(--text-secondary);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--remax-blue-gradient);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.badges-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.badge {
  display: inline-flex;
  padding: 6px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-info { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-ok { background-color: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-warn { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Dashboard Sections */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  margin-bottom: 12px;
}

.section-title i {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.section-title h3 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Alertas Operativas */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--border-radius-md);
  border-left: 4px solid;
}

.alert-item.danger {
  background-color: rgba(239, 68, 68, 0.05);
  border-color: var(--color-danger);
  border-top: 1px solid rgba(239, 68, 68, 0.1);
  border-right: 1px solid rgba(239, 68, 68, 0.1);
  border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

.alert-item.warning {
  background-color: rgba(245, 158, 11, 0.05);
  border-color: var(--color-warning);
  border-top: 1px solid rgba(245, 158, 11, 0.1);
  border-right: 1px solid rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.1);
}

.alert-item-content p {
  font-size: 0.85rem;
  font-weight: 500;
}

.alert-item-content span {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Agenda Groups */
.agenda-group {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.agenda-group-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.02);
}

.agenda-group-header .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 12px;
}

.agenda-group.overdue .indicator { background-color: var(--color-danger); }
.agenda-group.today .indicator { background-color: var(--color-info); }
.agenda-group.broker-tasks .indicator { background-color: var(--color-warning); }
.agenda-group.coaching .indicator { background-color: var(--color-purple); }

.agenda-group-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.count-badge {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 12px;
  font-weight: 600;
}

.agenda-group-list {
  padding: 4px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Agenda Card Styles */
.agenda-card {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.agenda-card-left {
  flex: 1;
}

.agenda-card-left h5 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.agenda-card-left p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.agenda-card-left .meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.agenda-card-actions {
  display: flex;
  gap: 6px;
}

.btn-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-circle i {
  width: 16px;
  height: 16px;
}

.btn-circle:active {
  transform: scale(0.92);
}

.btn-circle.btn-ok:active { background-color: var(--color-success); color: #fff; }
.btn-circle.btn-warn:active { background-color: var(--color-warning); color: #fff; }

/* Listings Tab ("Mis Captaciones") */
.view-header {
  margin-bottom: 16px;
}

.view-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.view-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.search-bar {
  position: relative;
  margin-top: 12px;
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.search-bar input {
  padding-left: 40px;
}

.listings-stats {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-bottom: 16px;
}

.listings-stats .stat-item span {
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
}

.listings-stats .stat-item p {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.listings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listing-card {
  transition: transform 0.2s;
}

.listing-card:active {
  transform: scale(0.98);
}

.listing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.listing-title h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.listing-title p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.listing-price {
  text-align: right;
}

.listing-price strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.listing-price p {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.listing-details {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  font-size: 0.75rem;
}

.listing-details span {
  color: var(--text-secondary);
}

.listing-details strong {
  color: var(--text-primary);
}

.listing-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.listing-action-tag {
  color: var(--color-info);
  font-weight: 500;
}

/* Floating Action Button */
.fab-new {
  position: fixed;
  bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--remax-red-gradient);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 16px rgba(237, 28, 36, 0.4);
  cursor: pointer;
  z-index: 99;
  transition: transform 0.2s;
}

.fab-new i {
  width: 24px;
  height: 24px;
}

.fab-new:active {
  transform: scale(0.92);
}

/* Assistant Tip Boxes */
.assistant-tip-box {
  background-color: rgba(0, 114, 206, 0.05);
  border: 1px solid rgba(0, 114, 206, 0.15);
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tip-avatar {
  width: 36px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--remax-blue);
  flex-shrink: 0;
  object-fit: contain;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(236,241,250,0.92));
  padding: 2px;
}

.tip-content p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Activity Form styling */
.form-card {
  max-width: 100%;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

/* Rewards Tab Styling */
.rewards-tabs {
  display: flex;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 4px;
  margin-bottom: 16px;
}

.rewards-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.rewards-tab-btn.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.rewards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.reward-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.reward-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.reward-card-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.reward-cost {
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.reward-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: 12px;
}

.reward-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.reward-stock {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reward-card .btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--border-radius-sm);
}

.redemptions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.redemption-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.redemption-left h5 {
  font-size: 0.85rem;
  font-weight: 600;
}

.redemption-left p {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.redemption-right {
  text-align: right;
}

/* Config panel elements */
.config-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.info-row span {
  color: var(--text-secondary);
}

/* ── Premium Bottom Tab Bar ──────────────────────────────── */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background-color: rgba(4, 8, 24, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1000;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 52px;
  cursor: pointer;
  transition: color 0.2s ease;
  gap: 3px;
  position: relative;
  touch-action: manipulation;
}

.tab-btn i {
  width: 22px;
  height: 22px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-btn span {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

/* Active tab indicator pill */
.tab-btn::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--remax-blue);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-btn.active {
  color: #60a5fa;
}

.tab-btn.active::before {
  transform: translateX(-50%) scaleX(1);
}

.tab-btn.active i {
  transform: translateY(-3px) scale(1.1);
  color: #60a5fa;
}

.tab-btn:active i {
  transform: scale(0.88);
}

/* Central FAB Button in Nav Bar */
.tab-btn-fab {
  background: transparent;
  border: none;
  width: 68px;
  height: 68px;
  margin-top: -28px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1001;
  touch-action: manipulation;
}

.fab-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--remax-blue-gradient);
  box-shadow: 0 4px 20px rgba(0, 114, 206, 0.5), 0 0 0 4px rgba(0, 114, 206, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.fab-circle i {
  width: 24px;
  height: 24px;
}

.tab-btn-fab:active .fab-circle {
  transform: scale(0.88);
  box-shadow: 0 2px 8px rgba(0, 114, 206, 0.3);
}

/* Modals & Dialogs */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(3, 5, 15, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 2000;
  transition: opacity 0.3s ease;
}

.modal-card {
  width: 100%;
  background-color: var(--bg-secondary);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  max-height: 85%;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
}

/* Celebration Overlay */
#celebration-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(3, 5, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 3000;
}

.celebration-card {
  width: 100%;
  max-width: 320px;
  background: var(--glass-bg);
  border: 1.5px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.coin-animation {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.celebration-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.celebration-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 24px;
}

/* ==========================================================================
   UPDATED PWA, VOICE WAVE & PROPERTY CAROUSEL STYLES
   ========================================================================== */

/* PWA Install Banner */
.pwa-install-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(16, 28, 66, 0.9);
  border-bottom: 1px solid var(--glass-border);
  padding: 16px 20px;
  backdrop-filter: blur(10px);
  z-index: 1001;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-banner-content i {
  font-size: 1.5rem;
  color: var(--color-info);
}

.pwa-banner-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.pwa-banner-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pwa-banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Voice Wave Visualizer */
.assistant-input-wrap {
  position: relative;
}

.voice-wave-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: rgba(8, 15, 34, 0.95);
  border-radius: 18px;
  z-index: 5;
}

.voice-wave-container span {
  display: inline-block;
  width: 4px;
  height: 10px;
  background: var(--remax-red);
  border-radius: 2px;
  animation: bounceWave 0.8s ease-in-out infinite;
}

.voice-wave-container span:nth-child(2) { animation-delay: 0.15s; }
.voice-wave-container span:nth-child(3) { animation-delay: 0.3s; }
.voice-wave-container span:nth-child(4) { animation-delay: 0.45s; }
.voice-wave-container span:nth-child(5) { animation-delay: 0.6s; }

@keyframes bounceWave {
  0%, 100% { height: 10px; }
  50% { height: 35px; }
}

/* Property Chat Cards */
.properties-carousel-container {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0;
  margin-top: 10px;
}

.properties-carousel {
  display: flex;
  gap: 14px;
  width: max-content;
  padding-bottom: 6px;
}

.property-chat-card {
  width: 250px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.property-chat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 114, 206, 0.3);
}

.property-chat-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.property-chat-card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.property-chat-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-chat-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #10B981;
}

.property-chat-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.property-chat-card-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.property-chat-card-footer span {
  font-size: 0.7rem;
  color: var(--color-info);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.property-chat-card-link {
  font-size: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.property-chat-card-link:hover {
  text-decoration: underline;
}

/* Plataforma: Tracking + Agenda */
.platform-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
  margin: 14px 0;
}

.platform-switch-btn {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--text-primary);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 61, 165, 0.10);
}

.platform-switch-btn.active {
  color: #fff;
  background: var(--remax-blue-gradient);
  box-shadow: 0 14px 30px rgba(0, 61, 165, 0.28);
}

.platform-panel.hidden,
.platform-agenda-panel.hidden {
  display: none !important;
}

.tracking-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.tracking-suite-hero {
  padding: 18px;
  border-radius: 26px;
  margin-bottom: 14px;
  background:
    radial-gradient(circle at 12% 18%, rgba(227, 6, 19, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(224, 238, 255, 0.72));
}

.tracking-suite-hero h3 {
  margin: 8px 0 6px;
  color: var(--text-primary);
  font-size: 1.24rem;
  letter-spacing: -0.02em;
}

.tracking-suite-hero p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.tracking-session-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 26px;
  margin-bottom: 14px;
}

.tracking-session-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.18), transparent 52%),
    linear-gradient(135deg, #003da5, #0078d7);
  box-shadow: 0 16px 30px rgba(0, 61, 165, 0.25);
}

.tracking-session-ring strong {
  font-size: 1.18rem;
  line-height: 1;
}

.tracking-session-ring span {
  margin-top: 3px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tracking-session-copy h3 {
  margin: 6px 0 4px;
  color: var(--text-primary);
  font-size: 1.08rem;
}

.tracking-session-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
}

.tracking-finish-btn {
  min-height: 42px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #111827, #003da5);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
}

.tracking-finish-bottom {
  width: 100%;
  min-height: 52px;
  margin: 2px 0 18px;
  border-radius: 20px;
}

.tracking-card,
.daily-routine-card,
.weekly-summary-card {
  padding: 16px;
  border-radius: 24px;
}

.tracking-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.tracking-card strong {
  display: block;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.tracking-mini-bar {
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(0, 61, 165, 0.12);
}

.tracking-mini-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--remax-blue-gradient);
  transition: width 260ms ease;
}

.daily-routine-card,
.weekly-summary-card {
  margin-bottom: 14px;
}

.tracking-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.tracking-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 61, 165, 0.10);
}

.tracking-item.is-done {
  border-color: rgba(0, 61, 165, 0.20);
  background: rgba(235, 244, 255, 0.82);
}

.tracking-check {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--remax-blue-gradient);
}

.tracking-check.pending {
  color: var(--remax-blue);
  background: rgba(0, 61, 165, 0.10);
}

.tracking-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.tracking-item span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin-top: 2px;
}

.tracking-item-copy {
  min-width: 0;
}

.tracking-item-action {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(118px, 1fr);
  gap: 10px;
  align-items: center;
  padding-left: 44px;
}

.tracking-slots {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 44px;
}

.tracking-slot {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.tracking-slot.pending {
  color: var(--remax-blue);
  background: rgba(0, 61, 165, 0.10);
  box-shadow: inset 0 0 0 1px rgba(0, 61, 165, 0.10);
}

.tracking-slot.done {
  color: #fff;
  background: var(--remax-blue-gradient);
  box-shadow: 0 8px 16px rgba(0, 61, 165, 0.18);
}

.tracking-slot svg {
  width: 16px;
  height: 16px;
}

.tracking-extra-count {
  align-self: center;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--remax-red);
  background: rgba(227, 6, 19, 0.10);
  font-size: 0.72rem;
  font-weight: 900;
}

.tracking-entry-list {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 0 0 44px;
  display: grid;
  gap: 6px;
}

.tracking-entry-list.empty {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.tracking-entry-list li {
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-primary);
}

.tracking-entry-list strong,
.tracking-entry-list span {
  display: block;
}

.tracking-entry-list span {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.tracking-badge {
  border-radius: 999px;
  padding: 6px 9px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--remax-blue);
}

.tracking-badge.pending {
  color: var(--text-primary);
  background: rgba(0, 61, 165, 0.10);
}

.tracking-mark-btn {
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  padding: 8px 12px;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #003da5, #0078d7);
  box-shadow: 0 10px 22px rgba(0, 61, 165, 0.22);
}

.tracking-item.is-done .tracking-mark-btn {
  background: linear-gradient(135deg, #e30613, #ff5b5f);
  box-shadow: 0 10px 22px rgba(227, 6, 19, 0.20);
}

.tracking-mark-btn:active {
  transform: translateY(1px);
}

.tracking-weekly-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tracking-weekly-summary article {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.tracking-weekly-summary span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.tracking-weekly-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 1.15rem;
}

.tracking-followup-card {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 24px;
}

.tracking-followup-suggestions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tracking-followup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.tracking-followup-item strong,
.tracking-followup-item span {
  display: block;
}

.tracking-followup-item span {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.tracking-followup-item button {
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  padding: 7px 10px;
  color: #fff;
  font-weight: 800;
  background: var(--remax-blue-gradient);
}
