/* assets/styles.css — estilo base, limpio y neutro. */

:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --success: #3fb950;
  --warning: #d29922;
  --error: #f85149;
  --radius: 12px;
  --gap: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 24px 20px 8px;
  text-align: center;
}
.app-header h1 { margin: 0; font-size: 1.6rem; }
.subtitle { color: var(--muted); margin: 6px 0 0; }

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.app-footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
}

/* Stepper */
.stepper {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.stepper__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
}
.stepper__item.is-active { color: var(--text); border-color: var(--accent); }
.stepper__item.is-done { color: var(--success); border-color: var(--success); }
.stepper__num {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.8rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 56px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone--active {
  border-color: var(--accent);
  background: var(--surface-2);
}
.dropzone__title { font-size: 1.1rem; margin: 0 0 6px; }
.dropzone__hint { color: var(--muted); margin: 0; }

.placeholder {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* Texto extraído (auditoría Etapa 3) */
.extracted__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.muted { color: var(--muted); }
.extracted__pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 55vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.45;
}
.btn {
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }

/* Tarjetas y tablas de datos */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.card h3 { margin: 24px 0 8px; font-size: 1rem; color: var(--muted); }

/* Envoltorio que permite scroll horizontal sin romper el layout. */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin-top: 8px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table.data-table--wide { min-width: 760px; }
.data-table th, .data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--muted); font-weight: 600; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: var(--surface-2); }

.row--low { background: rgba(210, 153, 34, .08); }
.badge-low { color: var(--warning); font-weight: 700; }

.warnings {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--warning);
  font-size: 0.85rem;
}

/* Navegación superior */
.appnav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.appnav__item {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
}
.appnav__item:hover { color: var(--text); }
.appnav__item.is-active { color: var(--text); border-bottom-color: var(--accent); }

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.actions__group { display: flex; gap: 12px; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 6px; }
.btn--sm { padding: 5px 10px; font-size: 0.82rem; margin-top: 0; }
.btn--danger { border-color: var(--error); color: var(--error); }
.btn--danger:hover { background: rgba(248,81,73,.12); }
.ok-text { color: var(--success); }

.actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 16px;
}
.actions--end { justify-content: flex-end; }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn--primary:hover { filter: brightness(1.08); }

.data-table tfoot td { border-top: 2px solid var(--border); font-weight: 600; }
.strong { font-weight: 700; }

.toolbar { margin-bottom: 16px; }
.select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-left: 8px;
}

.validation {
  margin-top: 20px;
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border);
}
.validation--ok { border-color: var(--success); background: rgba(63,185,80,.07); }
.validation--fail { border-color: var(--error); background: rgba(248,81,73,.07); }
.validation__title { font-weight: 700; margin-bottom: 8px; }
.validation--ok .validation__title { color: var(--success); }
.validation--fail .validation__title { color: var(--error); }

/* Toasts */
.notifications {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  max-width: 340px;
  animation: toast-in .18s ease-out;
}
.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--error { border-left-color: var(--error); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
