@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600&family=Manrope:wght@400;500;600&display=swap');

:root {
  --page-bg: #fdf5f1;
  --navbar-bg: #ffffff;
  --banner-start: #d4a04a;
  --banner-end: #c47a2a;
  --btn-dark: #1a1a2e;
  --text-primary: #1f1f1f;
  --text-muted: #5f5f5f;
  --bubble-user: #e3f2fd;
  --bubble-assistant: #ffffff;
  --input-border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

/* =========================================
   NAVBAR
   ========================================= */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--navbar-bg);
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar__menu {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background 0.2s;
}

.navbar__menu:hover {
  background: #f5f5f5;
}
.navbar__menu:focus-visible,
.navbar__dropdown-item:focus-visible,
.navbar__new-chat:focus-visible,
.navbar__dashboard:focus-visible,
.chat-input__queue:focus-visible,
.chat-input__send:focus-visible,
.chat-input__mic:focus-visible,
.preguntador-run:focus-visible,
.preguntador-stop:focus-visible,
.charts-query:focus-visible,
.charts-render:focus-visible,
.charts-png:focus-visible,
.dashboard-controls button:focus-visible,
.dashboard-controls select:focus-visible,
.preguntador-card input:focus-visible,
.charts-card input:focus-visible,
.charts-card textarea:focus-visible,
.chat-input textarea:focus-visible {
  outline: 2px solid #1f3b5a;
  outline-offset: 2px;
}

.navbar__dropdown {
  position: absolute;
  top: 56px;
  left: 24px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  padding: 8px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 120;
}

.navbar__dropdown[hidden] {
  display: none;
}

.navbar__dropdown-item {
  background: #f8f3ea;
  border: 1px solid #ead9c3;
  color: #6a3b12;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  transition: transform 0.15s, background 0.15s;
}

.navbar__dropdown-item:hover {
  background: #f1dfc7;
  transform: translateY(-1px);
}

.navbar__dropdown-version {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #bbb;
  padding-top: 4px;
  letter-spacing: 0.05em;
}

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

.navbar__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.navbar__logo-icon {
  font-family: 'Archivo', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #8b1a1a;
  line-height: 1;
}

.navbar__logo-region {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #8b1a1a;
  text-transform: uppercase;
}

.navbar__separator {
  width: 1px;
  height: 36px;
  background: #ccc;
}

.navbar__title {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
}

.navbar__version {
  font-size: 0.65rem;
  font-weight: 600;
  color: #999;
  align-self: flex-start;
  margin-top: 4px;
  margin-left: 2px;
  letter-spacing: 0.02em;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #4a4a4a;
  background: #f6f1e7;
  border: 1px solid #ead9c3;
  padding: 6px 10px;
  border-radius: 10px;
}

.navbar__new-chat {
  background: transparent;
  color: var(--btn-dark);
  border: 2px solid var(--btn-dark);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.navbar__new-chat:hover {
  background: var(--btn-dark);
  color: #fff;
}

.navbar__dashboard {
  background: var(--btn-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.navbar__dashboard:hover {
  opacity: 0.85;
}

/* =========================================
   CHAT PAGE
   ========================================= */

.chat-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px;
  gap: 0;
}

/* =========================================
   WELCOME BANNER
   ========================================= */

.welcome-banner {
  background: linear-gradient(120deg, var(--banner-start), var(--banner-end));
  border-radius: 16px;
  padding: 18px 28px;
  color: #fff;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.welcome-banner p {
  margin: 0;
}

/* =========================================
   CHAT LOG
   ========================================= */

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 4px;
}

.message {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: #2d5faa;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid #eee;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}
.message.assistant.is-selected {
  border-color: #2d5faa;
  box-shadow: 0 0 0 2px rgba(45, 95, 170, 0.15);
}

.message-icon-btn {
  margin-top: 10px;
  border: 1px solid #2d5faa;
  background: transparent;
  color: #2d5faa;
  padding: 6px;
  border-radius: 12px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.message-icon-btn:hover {
  background: #e7effc;
}

.message-icon-btn[title] {
  position: relative;
}

.message-icon-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f3b5a;
  color: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 50;
}

/* =========================================
   FEEDBACK BUTTONS (👍👎)
   ========================================= */

.message-feedback-wrap {
  display: inline-flex;
  gap: 4px;
  margin-top: 10px;
  margin-right: 8px;
  vertical-align: middle;
}

.message-feedback-btn {
  border: 1px solid #ccc;
  background: transparent;
  color: #888;
  padding: 5px;
  border-radius: 8px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.message-feedback-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.message-feedback-btn:hover {
  border-color: #2d5faa;
  color: #2d5faa;
  background: #eef3ff;
}

.message-feedback-btn.is-active-up {
  border-color: #2d5faa;
  background: #2d5faa;
  color: #fff;
}

.message-feedback-btn.is-active-down {
  border-color: #c44;
  background: #c44;
  color: #fff;
}

.feedback-text-wrap {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.feedback-text-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  background: #fafafa;
  max-width: 400px;
}

.feedback-text-input:focus {
  outline: none;
  border-color: #2d5faa;
  background: #fff;
}

.feedback-text-send {
  border: none;
  background: #2d5faa;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* =========================================
   EDIT BUTTON (✏️)
   ========================================= */

.message.user {
  position: relative;
}

.message-edit-btn {
  position: absolute;
  top: 8px;
  right: -36px;
  border: 1px solid #ccc;
  background: #fff;
  color: #888;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.message-edit-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.message.user:hover .message-edit-btn {
  display: inline-flex;
}

.message-edit-btn:hover {
  border-color: #2d5faa;
  color: #2d5faa;
  background: #eef3ff;
}

.edit-question-textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
  color: #1f1f1f;
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
}

.edit-question-textarea:focus {
  outline: none;
  border-color: #2d5faa;
}

.edit-confirm-wrap {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.edit-confirm-btn {
  border: none;
  background: #2d5faa;
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.edit-cancel-btn {
  border: 1px solid #ccc;
  background: #fff;
  color: #555;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.message-meta {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #888;
}

.message-sources {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #6f6f6f;
}

.sql-details {
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.sql-details summary {
  font-size: 0.78rem;
  color: #2d5faa;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

.sql-details summary:hover {
  text-decoration: underline;
}

.sql-code {
  margin-top: 8px;
  padding: 10px 14px;
  background: #f4f4f8;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: #333;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

.message.assistant .loading-dots::after {
  content: '...';
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================
   CHAT INPUT
   ========================================= */

.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 0 0;
  border-top: 1px solid #eee;
  margin-top: auto;
}

.chat-input__mic {
  border: 1px solid #2d5faa;
  background: transparent;
  color: #2d5faa;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.chat-input__mic.is-recording {
  background: #e53935;
  border-color: #e53935;
  color: #fff;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  padding: 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  min-height: 52px;
  max-height: 160px;
  transition: border-color 0.2s;
}

.chat-input textarea:focus {
  outline: none;
  border-color: #aaa;
}

.chat-input__send {
  border: none;
  border-radius: 10px;
  background: var(--btn-dark);
  color: #fff;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.chat-input__send:hover {
  opacity: 0.85;
}

.chat-input__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input__queue {
  border: 1px solid #1f3b5a;
  background: transparent;
  color: #1f3b5a;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chat-queue-status {
  font-size: 0.85rem;
  color: #5f5f5f;
  padding: 6px 0 0;
}

/* =========================================
   DASHBOARD EMBED
   ========================================= */

.dashboard-view {
  flex: 1;
  display: none;
  flex-direction: column;
}

.dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.dashboard-title {
  font-weight: 700;
  color: #4b2b12;
}

.dashboard-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dashboard-controls select {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
  min-width: 240px;
}

.dashboard-controls button {
  border: none;
  background: #2d5faa;
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.dashboard-embed {
  flex: 1;
  display: flex;
  min-height: 0;
}

.dashboard-view iframe {
  width: 100%;
  height: calc(100vh - 65px);
  border: none;
}

/* =========================================
   PREGUNTADOR
   ========================================= */

.preguntador-view {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.preguntador-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.preguntador-header h1 {
  font-family: 'Archivo', sans-serif;
  font-size: 2rem;
  color: #5a1f12;
}

.preguntador-header p {
  margin-top: 8px;
  color: #5f5f5f;
  max-width: 680px;
}

.preguntador-status {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #f3efe7;
  color: #6a3b12;
}

.preguntador-status[data-state='running'] {
  background: #ffe9c2;
  color: #8a4b00;
}

.preguntador-status[data-state='done'] {
  background: #d9f2e2;
  color: #1f6b3f;
}

.preguntador-status[data-state='error'] {
  background: #fde2e2;
  color: #a11d1d;
}

.preguntador-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.preguntador-card label {
  font-weight: 600;
  color: #3b3b3b;
}

.preguntador-card input {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
}

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

.preguntador-run {
  border: none;
  background: #2d5faa;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.preguntador-run:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.preguntador-stop {
  border: 1px solid #b44a3b;
  background: transparent;
  color: #b44a3b;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.preguntador-stop:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.preguntador-meta {
  font-size: 0.85rem;
  color: #6f6f6f;
}

.preguntador-log {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  min-height: 240px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: 60vh;
}

.preguntador-item {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.preguntador-item--question {
  background: #f6f1e7;
  border: 1px solid #ead9c3;
}

.preguntador-item--answer {
  background: #e3f2fd;
  border: 1px solid #c6e2ff;
}

.preguntador-item--error {
  background: #fde2e2;
  border: 1px solid #f5bcbc;
}

/* =========================================
   CHARTS
   ========================================= */

.charts-view {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.charts-header h1 {
  font-family: 'Archivo', sans-serif;
  font-size: 2rem;
  color: #1f3b5a;
}

.charts-header p {
  margin-top: 8px;
  color: #5f5f5f;
}

.charts-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.charts-card label {
  font-weight: 600;
  color: #3b3b3b;
}

.charts-card textarea {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  min-height: 120px;
}

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

.charts-question input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
}

.charts-query {
  border: none;
  background: #2d5faa;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

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

.charts-render {
  border: none;
  background: #1f3b5a;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.charts-png {
  border: 1px solid #1f3b5a;
  background: transparent;
  color: #1f3b5a;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.charts-meta {
  font-size: 0.85rem;
  color: #6f6f6f;
}

.charts-preview {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #eee;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow);
}

.charts-preview canvas {
  width: 100%;
  max-height: 360px;
}

.charts-preview img {
  max-width: 100%;
  border: 1px solid #eee;
  border-radius: 12px;
}

/* =========================================
   REPORT
   ========================================= */

.report-view {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* =========================================
   PLAN VIEW
   ========================================= */

.plan-view {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.plan-header h1 {
  font-family: 'Archivo', sans-serif;
  font-size: 2rem;
  color: #2a2a2a;
}

.plan-header p {
  margin-top: 8px;
  color: #5f5f5f;
}

.plan-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.plan-card label {
  font-weight: 600;
  color: #3b3b3b;
}

.plan-card input,
.plan-card textarea {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
}

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

.plan-generate {
  border: none;
  background: #1f3b5a;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.plan-apply {
  border: 1px solid #1f3b5a;
  background: transparent;
  color: #1f3b5a;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.plan-meta {
  font-size: 0.85rem;
  color: #6f6f6f;
}

.plan-result {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.plan-section h2 {
  font-size: 1.05rem;
  color: #2a2a2a;
  margin-bottom: 8px;
}

.plan-box {
  background: #fcfbf8;
  border: 1px solid #f1e9dd;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 40px;
}

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

.plan-item {
  background: #f6f1e7;
  border: 1px solid #ead9c3;
  color: #6a3b12;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.plan-item label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-item-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.plan-item-action {
  border: none;
  background: #fff;
  color: #6a3b12;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  border: 1px solid #ead9c3;
}

.plan-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.plan-add input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.plan-add-btn {
  border: 1px solid #1f3b5a;
  background: transparent;
  color: #1f3b5a;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.report-header h1 {
  font-family: 'Archivo', sans-serif;
  font-size: 2rem;
  color: #2a2a2a;
}

.report-header p {
  margin-top: 8px;
  color: #5f5f5f;
  max-width: 760px;
}

.report-status {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #eef3ff;
  color: #2d5faa;
}

.report-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.report-card label {
  font-weight: 600;
  color: #3b3b3b;
}

.report-card textarea {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  min-height: 120px;
}

.report-options {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.report-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: #3b3b3b;
}

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

.report-generate {
  border: none;
  background: #1f3b5a;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.report-clear {
  border: 1px solid #1f3b5a;
  background: transparent;
  color: #1f3b5a;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.report-meta {
  font-size: 0.85rem;
  color: #6f6f6f;
}

.report-intent {
  font-size: 0.9rem;
  color: #2d5faa;
  background: #eef3ff;
  border-radius: 10px;
  padding: 10px 12px;
}

.report-selection {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid #eee;
  box-shadow: var(--shadow);
}

.report-selection h2 {
  font-size: 1.1rem;
  color: #2a2a2a;
  margin-bottom: 12px;
}

.report-selection-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.report-item {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fafafa;
  display: grid;
  gap: 8px;
}

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

.report-item-title {
  font-weight: 600;
  color: #2d5faa;
  font-size: 0.95rem;
}

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

.report-item-actions button {
  border: none;
  background: #f0f4ff;
  color: #2d5faa;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.report-item-content {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
  white-space: pre-wrap;
}

.report-preview {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

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

.report-preview-header h2 {
  font-size: 1.1rem;
  color: #2a2a2a;
}

.report-copy {
  border: 1px solid #2d5faa;
  background: transparent;
  color: #2d5faa;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.report-document {
  background: #fcfbf8;
  border: 1px solid #f1e9dd;
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 180px;
  line-height: 1.6;
  color: #2b2b2b;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.report-charts {
  display: grid;
  gap: 16px;
}

.report-chart-card {
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fafafa;
  display: grid;
  gap: 10px;
}

.report-chart-title {
  font-weight: 600;
  color: #1f3b5a;
}

.report-chart-card canvas,
.report-chart-card img {
  max-width: 100%;
}

.message-report-btn {
  margin-top: 10px;
  border: 1px solid #1f3b5a;
  background: transparent;
  color: #1f3b5a;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
}

.message-report-btn.is-selected {
  background: #1b6b3f;
  border-color: #1b6b3f;
  color: #fff;
}

.message-suggestions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 12px;
  background: #fff;
  border: 1px solid #f1e9dd;
  border-radius: 12px;
  padding: 10px;
}

.message-suggestions__left,
.message-suggestions__right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.message-suggestions button {
  border: 1px solid #ead9c3;
  background: #f6f1e7;
  color: #6a3b12;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.message-source-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #4a4a4a;
  background: #fff7ed;
  border: 1px solid #f1dfc7;
  padding: 4px 8px;
  border-radius: 8px;
}

.message-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ead9c3;
  background: #f6f1e7;
  color: #6a3b12;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.message-source-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ead9c3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #6a3b12;
}

/* =========================================
   INFO PANEL
   ========================================= */

.info-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: min(420px, 90vw);
  background: #ffffff;
  border-left: 1px solid #eee;
  box-shadow: -10px 0 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.info-panel.is-open {
  transform: translateX(0);
}

.info-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.info-panel__tabs {
  display: flex;
  gap: 8px;
}

.info-panel__tab {
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.info-panel__tab.is-active {
  border-color: #2d5faa;
  color: #2d5faa;
  background: #eef3ff;
}

.info-panel__close {
  border: none;
  background: #1f3b5a;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.info-panel__body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
}

.info-panel__meta {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 10px;
}

.info-panel__content {
  display: grid;
  gap: 12px;
}

.info-panel__source {
  font-size: 0.8rem;
  color: #6b7280;
}

.info-card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fafafa;
  display: grid;
  gap: 6px;
}

.info-card__title {
  font-weight: 700;
  color: #2d5faa;
  font-size: 0.95rem;
}

.info-card__meta {
  font-size: 0.8rem;
  color: #6f6f6f;
}

.info-card__link {
  font-size: 0.85rem;
  color: #1f3b5a;
  text-decoration: underline;
}

.info-card canvas {
  width: 100%;
  max-height: 260px;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 720px) {
  .navbar {
    padding: 10px 16px;
  }

  .navbar__title {
    font-size: 1.2rem;
  }

  .navbar__new-chat {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .navbar__dashboard {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .navbar__dropdown {
    left: 16px;
  }

  .chat-page {
    padding: 12px 16px;
  }

  .welcome-banner {
    padding: 14px 20px;
    font-size: 0.92rem;
  }

  .message {
    max-width: 92%;
  }

  .preguntador-view {
    padding: 16px;
  }

  .preguntador-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .preguntador-actions {
    flex-direction: column;
  }

  .charts-view {
    padding: 16px;
  }

  .charts-actions {
    flex-direction: column;
  }

  .charts-question {
    flex-direction: column;
    align-items: stretch;
  }

  .report-view {
    padding: 16px;
  }

  .report-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-actions {
    flex-direction: column;
  }

  .plan-view {
    padding: 16px;
  }
}
