/* IVAD Home & Goods — Encuesta de Satisfacción */
:root {
  --bg: #f5f2ec;
  --card: #ffffff;
  --ink: #101a3a;
  --ink-soft: #2a355e;
  --muted: #6b6f7d;
  --rule: #d9d4c7;
  --secondary: #ece7db;
  --danger: #b91c1c;
  --success: #15803d;
  --star: #101a3a; /* Azul oscuro para igualar el logo */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 26, 58, 0.06), 0 8px 30px rgba(16, 26, 58, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.font-display { font-family: 'Playfair Display', 'Times New Roman', serif; letter-spacing: 0.01em; }

/* Layout */
main { min-height: 100vh; padding: 40px 16px; }
.container { max-width: 820px; margin: 0 auto; }
.container-wide { max-width: 1200px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
@media (min-width: 640px) { .card { padding: 48px; } }

/* Header */
.header {
  display: flex; flex-direction: column; gap: 20px;
  padding-bottom: 22px; border-bottom: 2px solid var(--ink);
}
@media (min-width: 640px) {
  .header { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .header-right { text-align: right; }
}
.header img { height: 64px; width: auto; }
.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 30px; font-weight: 600; margin: 0; color: var(--ink);
  letter-spacing: 0.02em;
}
@media (min-width: 640px) { .header h1 { font-size: 34px; } }
.header .sub {
  margin-top: 8px; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}

/* Intro (dashed frame) */
.intro {
  margin-top: 22px; padding: 16px 20px;
  border: 1.5px dashed var(--rule); border-radius: 6px;
  background: rgba(236, 231, 219, 0.5);
}
.intro p { margin: 0; font-size: 14px; color: var(--ink); }
.intro .scale { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Section */
.section { margin-top: 34px; }
.section-tag {
  display: inline-block;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  padding-bottom: 6px; margin-bottom: 16px;
  border-bottom: 1px solid var(--rule); width: 100%;
}
.q {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: var(--ink); margin: 0 0 16px;
}

/* Fields */
.row { display: grid; grid-template-columns: 1fr; gap: 20px 32px; }
@media (min-width: 640px) { .row.cols-2 { grid-template-columns: 1fr 1fr; } }
.field label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
  margin-bottom: 6px;
}
.field-line {
  width: 100%; background: transparent;
  border: none; border-bottom: 1px solid var(--rule);
  padding: 8px 2px; font: inherit; color: var(--ink);
  outline: none; transition: border-color 0.15s;
}
.field-line:focus { border-bottom: 2px solid var(--ink); padding-bottom: 7px; }
textarea.field-line { resize: vertical; min-height: 90px; }

.date-row { margin-top: 30px; display: flex; align-items: flex-end; gap: 16px; }
.date-row label { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; white-space: nowrap; }
.date-row .field-line { max-width: 260px; }

/* Stars */
.stars-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }
.stars { display: flex; gap: 10px; }
.star-btn {
  background: none; border: none; padding: 4px; cursor: pointer;
  transition: transform 0.15s;
  border-radius: 6px;
}
.star-btn:hover { transform: scale(1.12); }
.star-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.star-btn svg { width: 40px; height: 40px; display: block; }
.star-btn svg path { fill: transparent; stroke: var(--ink); stroke-width: 1.5; transition: fill 0.15s, stroke 0.15s; }
.star-btn.active svg path { fill: var(--star); stroke: var(--star); }
.stars-label { font-size: 13px; color: var(--muted); min-height: 20px; }
.stars-label strong { color: var(--ink); font-weight: 600; }

/* Recommend */
.recommend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 420px; }
.recommend label {
  cursor: pointer; text-align: center;
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px; font-size: 14px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.15s;
}
.recommend label:hover { border-color: var(--ink); }
.recommend input { position: absolute; opacity: 0; pointer-events: none; }
.recommend label.checked {
  background: var(--ink); color: #fff; border-color: var(--ink);
  box-shadow: 0 1px 3px rgba(16,26,58,0.2);
}

/* Actions */
.actions {
  margin-top: 48px; padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: flex-end; gap: 12px;
}
.btn {
  display: inline-block; cursor: pointer;
  padding: 11px 24px; font: inherit; font-size: 14px;
  border-radius: 6px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink);
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink); }
.btn-primary {
  background: var(--ink); color: #fff; border-color: var(--ink);
  font-weight: 600; letter-spacing: 0.04em; padding: 11px 28px;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.error { color: var(--danger); font-size: 13px; margin-top: 16px; text-align: right; }

/* Footer */
.foot {
  margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--rule);
  text-align: center; font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}

/* Success */
.success { max-width: 560px; margin: 0 auto; text-align: center; }
.success img { height: 64px; margin-bottom: 18px; }
.success h2 { font-family: 'Playfair Display', serif; font-size: 30px; margin: 8px 0 10px; color: var(--ink); }
.success p { font-size: 14px; color: var(--muted); }
.success .folio { font-family: ui-monospace, SFMono-Regular, monospace; color: var(--ink); font-weight: 700; }

/* ==== PANEL / DASHBOARD (Lovable Design) ==== */
.panel-container { max-width: 1100px; margin: 0 auto; }
.top-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel-header {
  display: flex; align-items: flex-start; gap: 24px;
}
.panel-header img { height: 60px; width: auto; margin-top: 5px; }
.panel-header .right { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.live-tag {
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; padding: 4px 10px; border-radius: 4px; text-transform: uppercase;
}
.panel-header h1 {
  font-family: 'Playfair Display', serif; font-size: 32px; color: var(--ink); margin: 0; font-weight: 500;
}
.panel-header .sub {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600;
}

.kpis {
  display: grid; grid-template-columns: repeat(1, 1fr); gap: 16px; margin-bottom: 20px;
}
@media (min-width: 768px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 20px 24px; display: flex; flex-direction: column; justify-content: center;
}
.kpi.active { border-color: var(--ink); border-width: 1.5px; } /* For the highlighted KPI in screenshot */
.kpi .label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.kpi .val { font-family: 'Playfair Display', serif; font-size: 32px; color: var(--ink); margin: 0; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.grid-charts {
  display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px;
}
@media (min-width: 900px) { .grid-charts { grid-template-columns: 2fr 1fr; } }
.chart-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
}
.chart-header { padding: 20px; border-bottom: 1px solid var(--rule); }
.chart-tag {
  font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0.5px; text-transform: uppercase;
}
.chart-body { padding: 20px; position: relative; height: 300px; width: 100%; }

.donut-body { padding: 20px; position: relative; height: 300px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-legend { display: flex; gap: 16px; margin-top: 20px; justify-content: center; font-size: 12px; color: var(--ink-soft); }
.donut-legend .item { display: flex; align-items: center; gap: 6px; }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 50%; }

.comments-list { padding: 0 20px 20px 20px; }
.comment-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px dashed var(--rule);
}
.comment-item:last-child { border-bottom: none; }
.comment-left { width: 120px; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; color: var(--muted); }
.comment-center { flex: 1; padding: 0 16px; }
.comment-center .stars-name { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 8px; }
.comment-center .stars-inline { display: flex; gap: 2px; }
.comment-center .stars-inline svg { width: 12px; height: 12px; }
.comment-center .stars-inline .on path { fill: var(--ink); stroke: var(--ink); }
.comment-center .stars-inline .off path { fill: transparent; stroke: var(--rule); }
.comment-center .name { color: var(--ink); font-weight: 600; }
.comment-center .date { color: var(--muted); }
.comment-center .text { font-size: 13px; color: var(--ink); line-height: 1.5; }
.comment-center .mejora { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.comment-right { width: 100px; text-align: right; }
.badge-rec {
  display: inline-block; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700;
  padding: 4px 8px; border-radius: 4px; letter-spacing: 0.05em;
}

.empty { text-align: center; padding: 60px 20px; }
.empty .t { font-family: 'Playfair Display', serif; font-size: 24px; color: var(--ink); margin-bottom: 6px; }
.empty .s { font-size: 13px; color: var(--muted); }
