/* Tablero de economía de fichas y rutinas infantiles • Estilos duales */
:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;

  --star-color: #eab308;
  --star-bg: #fef9c3;
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #1a2434;
  --bg-input: #0f1724;
  --border-color: #233044;
  --border-focus: #818cf8;

  --text-main: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  --primary: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.16);
  --primary-border: #3730a3;

  --star-color: #facc15;
  --star-bg: rgba(234, 179, 8, 0.22);
}

[data-theme="dark"] .app-header { background: #131b2e !important; border-bottom: 1px solid #1e293b !important; }
[data-theme="dark"] .brand-title { color: #f8fafc !important; }
[data-theme="light"] .app-header { background: #ffffff !important; border-bottom: 1px solid #cbd5e1 !important; }
[data-theme="light"] .brand-title { color: #0f172a !important; }

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-main);
  margin: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .brand-title, .guide-heading { font-family: var(--font-heading); }
.mono, code { font-family: var(--font-mono); }

.tool-layout { width: 100%; max-width: 1200px; margin: 1.5rem auto 3rem; padding: 0 1rem; flex: 1 0 auto; }
.tool-with-sidebar { display: flex; gap: 2rem; align-items: flex-start; width: 100%; }
.tool-main-content { flex: 1 1 0%; min-width: 0; width: 100%; }

.card-main, .seo-guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-intro-card {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.intro-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--primary); margin-bottom: 0.35rem; }
.panel-intro-card p { margin: 0; font-size: 0.92rem; line-height: 1.5; }

.config-panel { margin-bottom: 1.25rem; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; margin-bottom: 0.85rem; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.form-group { min-width: 0; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.3rem; }

.form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.92rem;
}

select.form-control {
  color-scheme: dark light;
  appearance: none;
  padding-right: 40px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select.form-control option { background-color: var(--bg-card); color: var(--text-main); }
.form-control:focus { outline: none; border-color: var(--border-focus); }

.inline-add { display: flex; gap: 0.5rem; }
.inline-add .form-control { flex: 1 1 0%; width: 0; min-width: 0; }

.btn-primary-sm {
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 9px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.board-sheet {
  background: var(--bg-card-subtle);
  border: 2px solid var(--primary-border);
  border-radius: 14px;
  padding: 1.25rem;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.board-title { margin: 0 0 0.2rem; font-size: 1.22rem; }
.board-reward { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.board-score-pill {
  background: var(--primary);
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
}

.progress-track {
  height: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--star-color);
  transition: width 0.2s ease;
}

.table-responsive { width: 100%; overflow-x: auto; }
.board-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.board-table th, .board-table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: center;
  background: var(--bg-card);
}
.board-table th.col-task, .board-table td.col-task { text-align: left; padding: 0.6rem 0.8rem; font-weight: 600; font-size: 0.9rem; }

.cell-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px dashed var(--border-color);
  background: transparent;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cell-btn.is-checked {
  border-style: solid;
  border-color: var(--star-color);
  background: var(--star-bg);
  color: var(--star-color);
}

.btn-del-task {
  min-height: 36px;
  min-width: 36px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
}

.action-bar { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }

.guide-heading { font-size: 1.2rem; margin: 0 0 0.75rem; }
.seo-guide-card > p { color: var(--text-muted); font-size: 0.94rem; line-height: 1.6; margin: 0 0 1rem; }
.faq-list { display: grid; gap: 0.65rem; }
.faq-item { border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-card-subtle); }
.faq-question { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; font-weight: 600; font-size: 0.92rem; cursor: pointer; list-style: none; }
.faq-question::-webkit-details-marker { display: none; }
.faq-item[open] .faq-arrow { transform: rotate(180deg); }
.faq-arrow { transition: transform 0.2s ease; flex-shrink: 0; }
.faq-answer { padding: 0 1rem 0.95rem; color: var(--text-muted); font-size: 0.89rem; line-height: 1.55; }
.faq-answer p { margin: 0; }

@media (max-width: 960px) {
  .form-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .form-row-4, .form-row-2 { grid-template-columns: 1fr; }
  .btn-secondary, .btn-primary-sm { width: 100%; }
  .inline-add { flex-direction: column; }
  .inline-add .form-control { width: 100%; }
}

@media print {
  .app-header, .tools-ad-banner-section, .tool-ad-sidebar, .no-print, .related-tools-section, .fijate-footer {
    display: none !important;
  }
  body { background: #ffffff; color: #0f172a; }
  .card-main { border: none; padding: 0; background: #ffffff; }
  .board-sheet { background: #ffffff; border: 2px solid #0f172a; }
  .board-table th, .board-table td { background: #ffffff; color: #0f172a; border-color: #94a3b8; }
}
