/* ==================== LAYOUT Y ESTRUCTURA ==================== */

.container {
  width: 100%;
  max-width: min(1800px, 95vw);
  padding: 0 10px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  font-size: 36px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

h1 .accent {
  color: #90100f;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
}

.brand-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1px;
  text-align: center;
}

.brand-logo {
  height: 70px;
  width: auto;
}

/* TABS */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: #667085;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover {
  color: #90100f;
  background: #fef2f2;
}

.tab.active {
  color: #90100f;
  border-bottom-color: #90100f;
}

/* Tab-link: <a> styled exactly como un .tab button. */
a.tab-link {
  text-decoration: none;
  display: inline-block;
  line-height: normal;
}

/* Icono SVG dentro de .tab — hereda el color del texto. */
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Sub-tabs dentro del Generador de hoja de práctica
   (Listas predeterminadas / Entrada manual). Segmented control. */
.gen-subtabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin-bottom: 16px;
  background: #f3f4f6;
  border-radius: 10px;
}
.gen-subtab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: #667085;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.gen-subtab:hover {
  color: #90100f;
}
.gen-subtab.active {
  background: #fff;
  color: #90100f;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
  max-width: 100%;
}

.card {
  background: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  padding: 24px;
  position: relative;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: #90100f;
  border-radius: 2px;
}

/* CONTROLES */
.controles {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* STATS */
.stats {
  display: flex;
  gap: 16px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: var(--bg-secondary);
}

.stat-clickable {
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-clickable:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #90100f;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* CONFIGURACIÓN PDF */
.pdf-config {
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.pdf-config .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.pdf-config .form-group {
  display: flex;
  flex-direction: column;
}

.pdf-config label {
  font-size: 12px;
  color: #667085;
  margin-bottom: 6px;
  font-weight: 500;
}

.pdf-config .form-group label {
  color: var(--text-secondary);
}

.pdf-config input,
.pdf-config select {
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.pdf-config input[type="text"] {
  width: 100%;
}

.pdf-config-row-2cols {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Scrollbar personalizado */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-tertiary);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

*::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.empty {
  text-align: center;
  padding: 40px;
  color: #98a2b3;
  grid-column: 1 / -1;
}

.empty:hover {
  color: #90100f;
  transform: scale(1.02);
  transition: all 0.3s;
}