/* ============================================================
   NUMERA — Sistema Tributario Empresarial
   Design System v2
   ============================================================ */

/* ── Dark mode ─────────────────────────────────────────────── */
/* html.dark tiene especificidad 0,0,1,1 > :root 0,0,1,0 — siempre gana */
html.dark {
  color-scheme: dark;   /* le dice al browser que use controles nativos oscuros */
  --sidebar-bg:        #060d1a;
  --sidebar-hover:     rgba(59,130,246,0.15);
  --sidebar-active-bg: rgba(59,130,246,0.2);
  --sidebar-active-border: #3b82f6;
  --sidebar-text:      #64748b;
  --sidebar-text-active: #e2e8f0;
  --sidebar-text-hover: #94a3b8;
  --sidebar-divider:   rgba(148,163,184,0.07);

  --primary:        #3b82f6;
  --primary-hover:  #2563eb;
  --primary-light:  rgba(37,99,235,0.15);
  --primary-border: rgba(59,130,246,0.25);

  --bg-page:    #0f172a;
  --bg-card:    #1e293b;
  --bg-subtle:  #1e293b;
  --bg-muted:   #0f172a;

  --border:       #334155;
  --border-light: #1e293b;

  --text-heading: #f1f5f9;
  --text-body:    #cbd5e1;
  --text-muted:   #94a3b8;
  --text-faint:   #475569;

  --green-bg:     rgba(5,150,105,0.12);
  --green-border: rgba(52,211,153,0.25);

  --red-bg:     rgba(220,38,38,0.12);
  --red-border: rgba(254,202,202,0.15);

  --amber-bg:     rgba(217,119,6,0.12);
  --amber-border: rgba(253,230,138,0.15);
}

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  color-scheme: light;
  --sidebar-bg:        #0c1a2e;
  --sidebar-hover:     rgba(59,130,246,0.12);
  --sidebar-active-bg: rgba(59,130,246,0.15);
  --sidebar-active-border: #3b82f6;
  --sidebar-text:      #94a3b8;
  --sidebar-text-active: #e2e8f0;
  --sidebar-text-hover: #cbd5e1;
  --sidebar-divider:   rgba(148,163,184,0.1);

  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #eff6ff;
  --primary-border: #bfdbfe;

  --bg-page:    #f1f5f9;
  --bg-card:    #ffffff;
  --bg-subtle:  #f8fafc;
  --bg-muted:   #f1f5f9;

  --border:       #e2e8f0;
  --border-light: #f1f5f9;

  --text-heading: #0f172a;
  --text-body:    #334155;
  --text-muted:   #64748b;
  --text-faint:   #94a3b8;

  --green:        #059669;
  --green-bg:     #f0fdf4;
  --green-border: #6ee7b7;

  --red:        #dc2626;
  --red-bg:     #fef2f2;
  --red-border: #fecaca;

  --amber:        #d97706;
  --amber-bg:     #fffbeb;
  --amber-border: #fde68a;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;

  --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm: 0 1px 4px rgba(15,23,42,0.07), 0 0 0 1px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08), 0 0 0 1px rgba(15,23,42,0.04);
  --shadow-lg: 0 8px 24px rgba(15,23,42,0.10), 0 0 0 1px rgba(15,23,42,0.04);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  background-color: var(--bg-page);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: 248px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(255,255,255,0.04);
}

/* Brand header */
.sidebar h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f8fafc;
  margin: 0;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-divider);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar h1::before {
  content: '';
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpath d='M9 7H6a2 2 0 00-2 2v9a2 2 0 002 2h9a2 2 0 002-2v-3'/%3E%3Cpath d='M18 2l4 4-10 10H8v-4L18 2z'/%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Nav items */
.sidebar ul {
  list-style: none;
  padding: 12px 10px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar ul li {
  margin: 2px 0;
}

.sidebar ul li a {
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 450;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
}

.sidebar ul li a i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.sidebar ul li a:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-hover);
}

.sidebar ul li a:hover i { opacity: 1; }

.sidebar ul li a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}

.sidebar ul li a.active i { opacity: 1; color: var(--sidebar-active-border); }

/* Section labels in sidebar */
.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148,163,184,0.5);
  padding: 14px 14px 4px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--sidebar-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-footer-text {
  font-size: 11px;
  color: rgba(148,163,184,0.4);
  letter-spacing: 0.02em;
}

.dark-toggle-btn {
  background: rgba(148,163,184,0.08);
  border: 1px solid var(--sidebar-divider);
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dark-toggle-btn:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  border-color: rgba(148,163,184,0.25);
}

/* ── Hamburger ─────────────────────────────────────────────── */
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1001;
  background: var(--sidebar-bg);
  color: #e2e8f0;
  border: none;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  box-shadow: var(--shadow-md);
}

/* ── Main content area ─────────────────────────────────────── */
.main-content {
  flex-grow: 1;
  padding: 32px 36px;
  margin-left: 248px;
  min-height: 100vh;
}

.main-content h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.main-content > p {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 14px;
}

/* ── Page header pattern ───────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 4px;
}

.page-header p {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}

/* ── Dashboard home ────────────────────────────────────────── */
.dashboard-welcome {
  margin-bottom: 32px;
}

.dashboard-welcome h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 4px;
}

.dashboard-welcome p {
  color: var(--text-muted);
  margin: 0;
  font-size: 14.5px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.dashboard-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 4px;
}

.dashboard-stat-card .stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dashboard-stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.03em;
  line-height: 1;
}

.dashboard-stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-faint);
}

.dashboard-actions-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}

.dashboard-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.dashboard-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  box-shadow: var(--shadow-xs);
}

.dashboard-action-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dashboard-action-card .action-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.action-icon.blue  { background: var(--primary-light); color: var(--primary); }
.action-icon.green { background: var(--green-bg);     color: var(--green); }
.action-icon.amber { background: var(--amber-bg);     color: var(--amber); }
.action-icon.slate { background: #f8fafc;              color: #475569; }

.dashboard-action-card .action-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
}

.dashboard-action-card .action-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Upload area ───────────────────────────────────────────── */
.upload-area {
  border: 1.5px dashed var(--primary-border);
  padding: 40px;
  text-align: center;
  margin-top: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  transition: border-color 0.2s, background 0.2s;
}

.upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.upload-area button {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-area button:hover { background: var(--primary-hover); }

.upload-area button:disabled {
  background: var(--text-faint);
  cursor: not-allowed;
}

/* ── Chatbot fullscreen ────────────────────────────────────── */
.page-chatbot { background: var(--bg-page); }

.chat-fullscreen {
  position: fixed;
  top: 0;
  left: 248px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}

/* Top bar */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

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

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.chat-bot-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-heading);
}

.chat-bot-status {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  display: inline-block;
}

/* Messages */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Bubbles */
.message {
  max-width: 65%;
  padding: 11px 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: bubble-in 0.2s ease-out;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}

.message.bot {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-heading);
  border-radius: 16px 16px 16px 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.message.bot strong { color: var(--primary); }

.message.info {
  align-self: flex-start;
  max-width: 65%;
  background: var(--primary-light);
  color: #1e40af;
  border-left: 3px solid var(--primary);
  border-radius: 2px 12px 12px 2px;
  font-size: 12.5px;
  padding: 9px 14px;
}

/* Typing dots */
.message.typing {
  align-self: flex-start;
  background: var(--bg-card);
  border-radius: 16px 16px 16px 4px;
  padding: 14px 22px;
  display: flex;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.message.typing .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: dot-bounce 1.4s ease-in-out infinite;
}

.message.typing .dot:nth-child(2) { animation-delay: .15s; }
.message.typing .dot:nth-child(3) { animation-delay: .3s; }

@keyframes dot-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-5px); background: var(--primary); }
}

/* Footer / input */
.chat-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-footer #chat-input {
  flex: 1;
  padding: 11px 18px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: var(--bg-subtle);
  transition: border-color .2s, background .2s;
  color: var(--text-body);
}

.chat-footer #chat-input::placeholder { color: var(--text-muted); }
html.dark .chat-footer #chat-input::placeholder { color: #1e293b; }

.chat-footer #chat-input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
}

.chat-footer #chat-input:disabled { opacity: .4; }

.chat-footer #send-button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .1s;
  flex-shrink: 0;
}

.chat-footer #send-button:hover  { background: var(--primary-hover); transform: scale(1.05); }
.chat-footer #send-button:active { transform: scale(.95); }
.chat-footer #send-button:disabled { background: var(--text-faint); cursor: default; transform: none; }

/* ── Misc UI ───────────────────────────────────────────────── */
.download-container { margin-top: 20px; text-align: center; }

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.download-link:hover { background: var(--primary-hover); }

.results-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 20px;
}

.results-panel h3 { color: var(--primary); margin-bottom: 15px; font-size: 16px; }

.result-item {
  margin-bottom: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.result-item:last-child { border-bottom: none; }
.result-item strong { color: var(--text-body); }
.result-item h4 { color: var(--primary); margin: 15px 0 10px; }
.result-item p { margin: 5px 0; color: var(--text-muted); }

.actions {
  margin-top: 20px;
  text-align: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-body);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover { background: var(--border); border-color: #cbd5e1; }

.file-selected {
  background: var(--primary-light);
  color: #1e40af;
  padding: 14px;
  border-radius: var(--radius);
  margin: 15px 0;
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ── DECLARACIONES AGENT ───────────────────────────────────── */
.page-declaraciones { background: var(--bg-page); }

.decl-fullscreen {
  position: fixed;
  top: 0;
  left: 248px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}

/* Topbar */
.decl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.decl-topbar-left { display: flex; align-items: center; gap: 12px; }

.decl-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.decl-title   { font-weight: 600; font-size: 14px; color: var(--text-heading); }
.decl-subtitle { font-size: 12px; color: var(--text-faint); display: flex; align-items: center; gap: 5px; margin-top: 1px; }

.decl-select {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-subtle);
  color: var(--text-body);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.decl-select:focus { border-color: var(--primary); }

/* Split */
.decl-split {
  position: relative;
  flex: 1;
  display: flex;
  overflow: hidden;
}

.decl-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;        /* ← clave: permite que flexbox lo comprima y el hijo pueda scrollear */
  border-right: 1px solid var(--border);
  background: var(--bg-page);
  overflow: hidden;
}

.decl-dashboard-panel {
  width: 370px;
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--bg-subtle);
  padding: 16px;
  border-left: 1px solid var(--border);
}

.decl-dashboard-panel::-webkit-scrollbar { width: 4px; }
.decl-dashboard-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Upload zone */
.decl-upload-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.upload-icon { font-size: 44px; color: var(--primary); margin-bottom: 16px; opacity: 0.8; }
.decl-upload-zone h3  { font-size: 18px; font-weight: 600; color: var(--text-heading); margin: 0 0 8px; }
.decl-upload-zone p   { color: var(--text-muted); margin: 0 0 12px; font-size: 14px; }

.upload-formats {
  display: inline-block;
  padding: 4px 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.btn-upload {
  padding: 11px 26px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-upload:hover { background: var(--primary-hover); transform: translateY(-1px); }

.file-list { margin-top: 16px; width: 100%; max-width: 400px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-body);
  box-shadow: var(--shadow-xs);
}

.file-item i { color: var(--primary); }
.file-item span { flex: 1; text-align: left; }

.btn-remove-file {
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 12px; padding: 4px;
  transition: color 0.15s;
}
.btn-remove-file:hover { color: var(--red); }

.btn-analizar {
  margin-top: 16px;
  padding: 13px 30px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
  box-shadow: 0 4px 14px rgba(37,99,235,0.28);
}

.btn-analizar:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.36);
}

.btn-analizar:disabled { opacity: 0.55; cursor: wait; transform: none; box-shadow: none; }

/* Chat body */
.decl-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.decl-chat-body::-webkit-scrollbar { width: 4px; }
.decl-chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.decl-chat-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.decl-chat-footer #chat-input {
  flex: 1;
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: var(--bg-subtle);
  transition: border-color .2s, background .2s;
  color: var(--text-body);
}

.decl-chat-footer #chat-input::placeholder { color: var(--text-muted); }
html.dark .decl-chat-footer #chat-input::placeholder { color: #1e293b; }

.decl-chat-footer #chat-input:focus { border-color: var(--primary); background: var(--bg-card); }

.decl-chat-footer #send-button {
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .1s;
}

.decl-chat-footer #send-button:hover   { background: var(--primary-hover); transform: scale(1.05); }
.decl-chat-footer #send-button:active  { transform: scale(.95); }
.decl-chat-footer #send-button:disabled { background: var(--text-faint); cursor: default; transform: none; }

/* ── Dashboard panels ──────────────────────────────────────── */
.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}

.dash-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.progress-bar {
  height: 5px;
  background: var(--bg-muted);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.25,1,0.5,1);
}

.progress-text { font-size: 12px; color: var(--text-muted); margin-top: 7px; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dash-card {
  background: var(--bg-subtle);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  transition: border-color 0.15s;
}

.dash-card.highlight      { border-color: var(--red-border);   background: var(--red-bg); }
.dash-card.highlight-blue { border-color: var(--primary-border); background: var(--primary-light); }

.dash-card-label { font-size: 11px; color: var(--text-faint); margin-bottom: 5px; font-weight: 500; }

.dash-card-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  transition: color 0.3s;
  font-variant-numeric: tabular-nums;
}

.dash-card-value.accent-green { color: var(--green); }
.dash-card-value.accent-red   { color: var(--red); }

@keyframes flashPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.07); color: var(--primary); }
  100% { transform: scale(1); }
}

.value-flash { animation: flashPulse 0.5s ease; }

/* Deducciones list */
.deducciones-list { display: flex; flex-direction: column; gap: 6px; }

.deduccion-empty { font-size: 12.5px; color: var(--text-faint); text-align: center; padding: 16px; }

.deduccion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--green-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green);
}

.ded-info  { display: flex; flex-direction: column; }
.ded-name  { font-size: 12px; color: var(--text-body); font-weight: 500; }
.ded-art   { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.ded-value { font-size: 13px; font-weight: 700; color: var(--green); }

/* Escenarios */
.escenarios-grid { display: flex; flex-direction: column; gap: 10px; }

.escenario-card {
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1.5px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.escenario-card:hover { box-shadow: var(--shadow-sm); }

.escenario-card.esc-gray  { background: var(--bg-subtle); border-color: var(--border); }
.escenario-card.esc-blue  { background: var(--primary-light); border-color: var(--primary-border); }
.escenario-card.esc-green { background: var(--green-bg); border-color: var(--green-border); }

.esc-header  { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.esc-num     { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-faint); }
.esc-name    { font-size: 14px; font-weight: 700; color: var(--text-heading); margin-bottom: 4px; }
.esc-desc    { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }

.esc-metrics { display: flex; gap: 12px; margin-bottom: 10px; }

.esc-metric  { display: flex; flex-direction: column; gap: 2px; }
.esc-metric span   { font-size: 10px; color: var(--text-faint); }
.esc-metric strong { font-size: 14px; color: var(--text-heading); }

.btn-elegir {
  width: 100%;
  padding: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-elegir:hover { background: var(--primary-hover); }

/* Advertencias */
.advertencia-item {
  padding: 10px 12px;
  background: var(--amber-bg);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #92400e;
  border-left: 3px solid var(--amber);
  margin-bottom: 6px;
}

.advertencia-item i { color: var(--amber); margin-right: 6px; }

/* Tip icon */
.tip-icon { font-size: 15px; }

/* ── Client registration form ──────────────────────────────── */
.decl-client-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow-y: auto;        /* permite scroll cuando el contenido no cabe */
  -webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 768px) {
  .decl-client-zone {
    justify-content: flex-start;  /* en mobile no centrar: empieza desde arriba */
    padding: 24px 16px 32px;
  }
}

.decl-client-zone h3 { font-size: 18px; font-weight: 700; color: var(--text-heading); margin: 0 0 6px; }
.decl-client-zone p  { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }

.client-form { width: 100%; max-width: 480px; }

.client-row   { display: flex; gap: 12px; margin-bottom: 12px; }
.client-field { flex: 1; display: flex; flex-direction: column; }
.client-field.full { flex: 1 1 100%; }

.client-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.client-field input,
.client-field select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  background: var(--bg-card);
  color: var(--text-body);
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}

.client-field input:focus,
.client-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Client card in dashboard */
.client-card-name { font-size: 15px; font-weight: 700; color: var(--text-heading); }
.client-card-nit  { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* ── Mode selector (overlay sobre decl-split) ────────────── */
.decl-mode-zone {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg-page);
  animation: modeZoneIn .4s ease-out both;
}

@keyframes modeZoneIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Header */
.mode-header {
  text-align: center;
  margin-bottom: 40px;
  animation: modeHeaderIn .5s ease-out both;
  animation-delay: .05s;
}

@keyframes modeHeaderIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mode-header-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 21px;
}

.mode-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 8px;
}

.mode-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ---- 3-column grid ---- */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 820px;
}

/* ---- Card button ---- */
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px 28px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  overflow: hidden;
  outline: none;
  transition:
    border-color .3s ease,
    box-shadow   .3s ease,
    transform    .25s cubic-bezier(.34,1.56,.64,1);

  /* Staggered entrance */
  animation: modeCardPop .55s cubic-bezier(.34,1.56,.64,1) both;
}

.mode-card:nth-child(1) { animation-delay: .12s; }
.mode-card:nth-child(2) { animation-delay: .22s; }
.mode-card:nth-child(3) { animation-delay: .32s; }

@keyframes modeCardPop {
  0%   { opacity: 0; transform: translateY(32px) scale(.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Shine sweep on hover */
.mode-card-shine {
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(59,130,246,0.06) 50%,
    transparent 70%
  );
  transition: left .6s ease;
  pointer-events: none;
}

.mode-card:hover .mode-card-shine { left: 100%; }

/* Hover */
.mode-card:hover {
  border-color: var(--primary);
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 12px 32px rgba(37,99,235,0.15),
    0 0 0 1px rgba(59,130,246,0.10);
}

/* Press */
.mode-card:active {
  transform: translateY(-2px) scale(.98);
  transition-duration: .1s;
}

/* Focus visible */
.mode-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Selected */
.mode-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-6px) scale(1.03);
  box-shadow:
    0 0 0 3px rgba(59,130,246,0.20),
    0 14px 36px rgba(37,99,235,0.18);
}

/* Featured card (middle) */
.mode-card--featured {
  border-color: var(--primary-border);
  box-shadow: 0 0 0 1px rgba(59,130,246,0.08);
}

/* ---- Badge ---- */
.mode-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 11px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  line-height: 1.6;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.40); }
  50%      { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

/* ---- Icon ---- */
.mode-icon-wrap {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}

.mode-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 24px;
  background: var(--primary-light);
  color: var(--primary);
  transition:
    background .3s ease,
    color      .3s ease,
    transform  .3s cubic-bezier(.34,1.56,.64,1),
    box-shadow .3s ease;
}

.mode-card:hover .mode-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.12) rotate(-3deg);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

.mode-card.selected .mode-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

/* ---- Text ---- */
.mode-name {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.mode-desc {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

/* ---- Tag pill ---- */
.mode-tag {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 20px;
  letter-spacing: .02em;
  transition: background .3s, color .3s, border-color .3s;
}

.mode-card:hover .mode-tag,
.mode-card.selected .mode-tag {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- Responsive ---- */
@media screen and (max-width: 900px) {
  .decl-mode-zone { padding: 32px 20px; }
  .mode-cards {
    grid-template-columns: 1fr;
    max-width: 360px;
    gap: 14px;
  }
  .mode-card { padding: 24px 20px 20px; }
}

/* ── Archivos Analizados ───────────────────────────────────── */
.archivos-grid { display: flex; flex-direction: column; gap: 16px; }

.cliente-carpeta {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s;
}

.cliente-carpeta:hover { box-shadow: var(--shadow-sm); }

.carpeta-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.carpeta-header i    { color: var(--primary); font-size: 17px; }
.carpeta-nombre      { font-weight: 700; font-size: 14px; color: var(--text-heading); flex: 1; }
.carpeta-count       { font-size: 12px; color: var(--text-faint); background: var(--bg-muted); padding: 2px 8px; border-radius: 20px; border: 1px solid var(--border); }

.carpeta-archivos { padding: 4px 0; }

.archivo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  transition: background .15s;
}

.archivo-item:hover { background: var(--primary-light); }
.archivo-item i     { color: var(--red); font-size: 14px; }

.archivo-link {
  flex: 1;
  color: var(--primary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
}

.archivo-link:hover { text-decoration: underline; }
.archivo-fecha { font-size: 12px; color: var(--text-faint); }
.archivo-size  { font-size: 12px; color: var(--text-faint); min-width: 60px; text-align: right; }

.archivos-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ── ≤1024px: sidebar se oculta, aparece hamburguesa ──────── */
@media screen and (max-width: 1024px) {
  .menu-toggle { display: block; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }

  .main-content {
    margin-left: 0;
    margin-top: 56px;
    padding: 28px 24px;
  }

  .chat-fullscreen { left: 0; }
  .decl-fullscreen { left: 0; }

  /* Dejar espacio al hamburger en topbars */
  .decl-topbar,
  .chat-topbar {
    padding: 0 24px 0 62px;
  }
}

/* ── ≤768px: ajustes móvil ─────────────────────────────────── */
@media screen and (max-width: 768px) {
  body { flex-direction: column; }

  .main-content {
    padding: 20px 16px;
  }

  .main-content h1 { font-size: 20px; }

  .upload-area { padding: 20px; }
  .upload-area button { width: 100%; }

  .chat-body { padding: 16px; }
  .message { max-width: 85%; font-size: 13px; }
  .chat-footer { padding: 12px 16px; }

  .decl-split { flex-direction: column; }
  .decl-dashboard-panel { display: none; }
  .decl-chat-panel { border-right: none; overflow-y: auto; }
  .decl-chat-panel .decl-client-zone,
  .decl-chat-panel .decl-upload-zone { overflow-y: visible; }

  /* Formularios: apilar columnas */
  .client-row {
    flex-direction: column;
    gap: 8px;
  }

  /* Prevenir zoom en iOS al enfocar inputs/selects (font-size < 16px dispara zoom) */
  .client-field input,
  .client-field select,
  .decl-select,
  .decl-chat-footer #chat-input,
  .chat-footer #chat-input {
    font-size: 16px !important;
  }

  .client-field select {
    width: 100%;
    white-space: normal;
  }

  .decl-topbar,
  .chat-topbar {
    padding: 0 14px 0 62px;
    height: 52px;
    gap: 8px;
  }

  .decl-title { font-size: 13px; }
  .decl-subtitle { display: none; }
  .decl-avatar { width: 30px; height: 30px; font-size: 13px; }
  .decl-select { padding: 5px 8px; font-size: 13px; }

  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-actions-grid { grid-template-columns: 1fr; }
  .dash-card-value { font-size: 13px; }
  .dash-card { padding: 10px 12px; }
}

@media screen and (max-width: 480px) {
  .main-content { padding: 16px; }
  .main-content h1 { font-size: 18px; }
  .message { max-width: 90%; font-size: 13px; padding: 9px 12px; }
  .chat-footer { padding: 10px 12px; }
}

@media screen and (max-width: 1100px) {
  .decl-dashboard-panel { width: 310px; }
}

/* ── Parametros Tributarios ───────────────────────────────────────────────── */
.params-toolbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 12px; margin-bottom: 24px;
  background: var(--bg-card); padding: 16px 20px; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.params-toolbar-left { display: flex; align-items: center; gap: 10px; }
.params-toolbar-left label { font-weight: 600; color: var(--text-heading); white-space: nowrap; }
.params-toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }

.params-section {
  background: var(--bg-card); padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.params-section h3 {
  font-size: 16px; font-weight: 700; color: var(--text-heading); margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.params-section h3 i { color: var(--primary); }
.params-section h4 {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin: 20px 0 10px;
}
.params-hint { font-size: 12px; color: var(--text-faint); margin: 0 0 10px; }

.params-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 12px;
}
.params-row { display: flex; gap: 12px; flex-wrap: wrap; }
.params-field { display: flex; flex-direction: column; gap: 4px; }
.params-field label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.params-field input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-body); background: var(--bg-subtle);
  transition: border-color .2s;
}
.params-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.tarifa-header {
  margin-bottom: 4px !important;
}
.tarifa-header span {
  flex: 1; font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px; min-width: 0;
}
.tarifa-header span:last-child { width: 32px; flex: 0 0 32px; }
.tarifa-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px;
}
.tarifa-row input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-body);
  background: var(--bg-subtle); min-width: 0;
}
.tarifa-row input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Botón tutorial ───────────────────────────────────────────── */
.btn-tutorial {
  margin-top: 12px; padding: 10px 22px;
  background: var(--primary);
  color: #fff; border: none; border-radius: 50px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-tutorial:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}
.btn-tutorial i { font-size: 15px; }

/* ── Tour overlay ─────────────────────────────────────────────── */
.tour-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .35s ease;
  pointer-events: none;
}
.tour-overlay.active { opacity: 1; pointer-events: auto; }

.tour-highlight {
  position: absolute; z-index: 9999;
  border-radius: var(--radius);
  box-shadow: 0 0 0 4000px rgba(0,0,0,0.55), 0 0 0 3px var(--primary), 0 0 20px rgba(59,130,246,0.4);
  transition: top .4s cubic-bezier(.4,0,.2,1), left .4s cubic-bezier(.4,0,.2,1),
              width .4s cubic-bezier(.4,0,.2,1), height .4s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

.tour-tooltip {
  position: absolute; z-index: 10000;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 24px; max-width: 380px; min-width: 300px;
  animation: tourPop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes tourPop {
  0% { opacity: 0; transform: scale(0.85) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.tour-tooltip-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.tour-tooltip-icon.blue { background: var(--primary-light); color: var(--primary); }
.tour-tooltip-icon.green { background: var(--green-bg); color: var(--green, #059669); }
.tour-tooltip-icon.amber { background: var(--amber-bg); color: var(--amber, #d97706); }
.tour-tooltip-icon.purple { background: rgba(124,58,237,0.1); color: #7c3aed; }

.tour-tooltip h3 {
  font-size: 16px; font-weight: 700; color: var(--text-heading);
  margin: 0 0 6px;
}
.tour-tooltip p {
  font-size: 13px; color: var(--text-muted); margin: 0 0 18px; line-height: 1.6;
}
.tour-tooltip-footer {
  display: flex; justify-content: space-between; align-items: center;
}
.tour-tooltip-steps {
  font-size: 11px; color: var(--text-faint); font-weight: 500;
}
.tour-tooltip-btns { display: flex; gap: 6px; }
.tour-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; transition: all .2s;
}
.tour-btn-skip {
  background: transparent; color: var(--text-muted);
}
.tour-btn-skip:hover { color: var(--text-heading); }
.tour-btn-prev {
  background: var(--bg-subtle); color: var(--text-body);
  border: 1px solid var(--border);
}
.tour-btn-prev:hover { background: var(--bg-muted); }
.tour-btn-next {
  background: var(--primary); color: #fff;
}
.tour-btn-next:hover { background: var(--primary-hover); }

/* Progress dots */
.tour-dots { display: flex; gap: 6px; }
.tour-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all .3s;
}
.tour-dot.active {
  background: var(--primary); width: 20px; border-radius: 4px;
}

.btn-primary {
  padding: 8px 16px; background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  padding: 6px 14px; background: var(--bg-subtle); color: var(--primary);
  border: 1px solid var(--primary-border); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s;
}
.btn-secondary:hover { background: var(--primary-light); }

.btn-danger {
  padding: 8px 16px; background: var(--red, #dc2626); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: opacity .2s;
}
.btn-danger:hover { opacity: 0.85; }

.btn-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-subtle); color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.btn-icon:hover { background: var(--red-bg); color: var(--red, #dc2626); border-color: var(--red-border); }

@media screen and (max-width: 768px) {
  .params-toolbar { flex-direction: column; align-items: stretch; }
  .params-toolbar-right { justify-content: flex-end; }
  .params-grid { grid-template-columns: 1fr 1fr; }
  .params-section { padding: 16px; }
  .tarifa-row { flex-wrap: wrap; }
}
@media screen and (max-width: 480px) {
  .params-grid { grid-template-columns: 1fr; }
  .params-section { padding: 12px; }
  .params-toolbar { padding: 12px; }
  .tarifa-row input { font-size: 12px; padding: 6px 8px; }
  .tarifa-header span { font-size: 11px; }
}
