/* ==========================================================================
   aifinanzas.com - Dashboard & Copiloto IA App Styles
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: calc(100vh - 73px);
}

/* Sidebar de Navegación del App */
.app-sidebar {
  width: 280px;
  background: rgba(14, 20, 36, 0.95);
  border-right: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.sidebar-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald-400);
}

/* Alerta de Calendario Tributario */
.tax-calendar-card {
  margin-top: auto;
  background: rgba(7, 10, 18, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 1rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--amber-400);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.calendar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.calendar-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Área Principal de Contenido */
.app-main {
  flex: 1;
  padding: 2rem 2.5rem;
  background: var(--bg-primary);
  overflow-y: auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.view-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Interfaz del Chat del Copiloto */
.copilot-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-bubble {
  max-width: 80%;
  padding: 1.15rem 1.4rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
  color: #ffffff;
}

.chat-bubble strong {
  color: var(--emerald-400);
}

.chat-bubble.user strong {
  color: #ffffff;
}

.code-pill {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.88rem;
}

/* Sugerencias Rápidas / Prompt Chips */
.prompt-chips-wrapper {
  padding: 0.75rem 1.5rem;
  background: rgba(7, 10, 18, 0.4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.chip-btn {
  white-space: nowrap;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chip-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--emerald-500);
  color: var(--emerald-400);
}

/* Input del Chat */
.chat-input-bar {
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Zona Drag & Drop de XMLs */
.dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.03);
  border-radius: 20px;
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--emerald-400);
  margin-bottom: 1rem;
}

.xml-results-card {
  margin-top: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 2rem;
}

/* Tablas de Resultados */
.tax-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.tax-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
}

.tax-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
}

/* Grid de Formulario de Simulador */
.simulator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.simulator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 2rem;
}

.input-group {
  margin-bottom: 1.25rem;
}

.input-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-field {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.input-field:focus {
  border-color: var(--emerald-500);
}

/* Modal de Configuración de API Key */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
}
