:root {
  --brand: #0b6e79;
  --brand-dark: #08525a;
  --brand-light: #e6f4f5;
  --bs-primary: #0b6e79;
  --bs-primary-rgb: 11, 110, 121;
  --bs-link-color: #0b6e79;
  --bs-link-color-rgb: 11, 110, 121;
  --bs-link-hover-color: #08525a;
  /* Valores por defecto; tema.php los reemplaza con los colores de cada empresa */
  --on-brand: #ffffff;
  --brand-ink: #0b6e79;
  --sidebar: #0b6e79;
  --sidebar-text: #ffffff;
  --accent: #f5b301;
  --on-accent: #111827;
  --page-bg: #f4f7f8;
  --app-font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body { background: var(--page-bg); font-family: var(--app-font); --bs-body-font-family: var(--app-font); }
.bg-brand { background: var(--brand) !important; }
.text-brand { color: var(--brand) !important; }
.btn-primary { --bs-btn-color: var(--on-brand); --bs-btn-hover-color: var(--on-brand); --bs-btn-active-color: var(--on-brand); --bs-btn-disabled-color: var(--on-brand); --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-hover-color: var(--on-brand); --bs-btn-active-color: var(--on-brand); --bs-btn-color: var(--brand-ink); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); }
.bg-primary { background-color: var(--brand) !important; color: var(--on-brand) !important; }
.text-primary { color: var(--brand-ink) !important; }
.bg-primary-subtle { background-color: var(--brand-light) !important; }
.btn-check:checked + .btn-outline-primary { color: var(--on-brand); }
.badge.bg-primary { color: var(--on-brand) !important; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand-ink); }
.progress { --bs-progress-bar-bg: var(--brand); }
.yesno.tres label { padding: .7rem .25rem; font-size: .9rem; }
.active > .page-link, .page-link.active { background-color: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- Admin layout ---------- */
@media (min-width: 992px) {
  .sidebar { width: 260px; min-height: 100vh; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
}
.sidebar, .topbar { --bs-offcanvas-bg: var(--sidebar); --bs-offcanvas-color: var(--sidebar-text); background: var(--sidebar) !important; color: var(--sidebar-text) !important; }
.sidebar a:not(.dropdown-item), .sidebar .nav-link, .topbar a, .topbar .btn-link, .topbar .navbar-brand { color: var(--sidebar-text) !important; }
.sidebar .nav-link { border-radius: .5rem; opacity: .85; }
.sidebar .nav-link:hover { background: color-mix(in srgb, var(--sidebar-text) 12%, transparent); opacity: 1; }
.sidebar .nav-link.active { background: color-mix(in srgb, var(--sidebar-text) 20%, transparent); opacity: 1; font-weight: 600; }
.sidebar hr { border-color: var(--sidebar-text); }
.sidebar .menu-section { color: var(--sidebar-text); opacity: .55; }
.sidebar .logo-box, .logo-box { background: #fff; border-radius: .6rem; padding: 4px; display: inline-grid; place-items: center; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.btn-volver-super { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; }
.btn-volver-super:hover { filter: brightness(.93); color: var(--on-accent); }
.empresa-switch { background: color-mix(in srgb, var(--sidebar-text) 10%, transparent); border-radius: .6rem; }
.empresa-switch .form-select { background-color: transparent; color: var(--sidebar-text); border-color: color-mix(in srgb, var(--sidebar-text) 30%, transparent); }
.empresa-switch .form-select option { color: #111; }
.main-content { min-width: 0; }
.page-title { font-weight: 600; margin-bottom: 1rem; }
.card { border: 0; box-shadow: 0 1px 3px rgba(16,24,40,.08); border-radius: .75rem; }
.card-header { background: #fff; border-bottom: 1px solid #edf0f2; font-weight: 600; border-radius: .75rem .75rem 0 0 !important; }
.kpi .kpi-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.kpi .kpi-label { font-size: .85rem; color: #6c757d; }
.kpi .kpi-icon { width: 46px; height: 46px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.4rem; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; font-weight: 600; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.drag-handle { cursor: grab; color: #adb5bd; }
.pregunta-item.dragging { opacity: .5; }
.puntaje-pill { min-width: 3.2rem; display: inline-block; text-align: center; }

/* ---------- Login ---------- */
.login-bg { min-height: 100vh; background: linear-gradient(135deg, var(--brand) 0%, #1aa3a3 100%); }
.login-card { max-width: 400px; width: 100%; }

/* ---------- Encuesta pública ---------- */
.survey-body { background: linear-gradient(180deg, var(--brand) 0, var(--brand) 180px, var(--page-bg) 180px); min-height: 100vh; }
.survey-wrap { max-width: 640px; margin: 0 auto; }
.survey-header { color: var(--on-brand); padding: 1.5rem 1rem 1rem; text-align: center; }
.survey-card { border-radius: 1rem; }
.q-block { padding: 1.1rem 0; border-bottom: 1px solid #eef1f3; }
.q-block:last-child { border-bottom: 0; }
.q-title { font-weight: 600; margin-bottom: .75rem; }
.q-title .req { color: #dc3545; }
.q-block.invalid .q-title { color: #dc3545; }

.scale-faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.scale-faces input { display: none; }
.scale-faces label { border: 2px solid #e3e7ea; border-radius: .75rem; padding: .5rem .2rem; text-align: center; cursor: pointer; transition: all .15s; font-size: .72rem; color: #555; user-select: none; }
.scale-faces label .face { font-size: 1.8rem; display: block; line-height: 1.2; }
.scale-faces input:checked + label { border-color: var(--brand); background: var(--brand-light); color: var(--brand-ink); font-weight: 600; transform: translateY(-2px); }

.stars { display: inline-flex; flex-direction: row-reverse; gap: .25rem; }
.stars input { display: none; }
.stars label { font-size: 2.2rem; color: #d6dade; cursor: pointer; transition: color .1s; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--accent); }

.nps-grid { display: grid; grid-template-columns: repeat(11, 1fr); gap: .25rem; }
.nps-grid input { display: none; }
.nps-grid label { border: 2px solid #e3e7ea; border-radius: .5rem; text-align: center; padding: .45rem 0; cursor: pointer; font-weight: 600; font-size: .9rem; }
.nps-grid input:checked + label { color: #fff; border-color: transparent; }
.nps-grid input.det:checked + label { background: #dc3545; }
.nps-grid input.pas:checked + label { background: #ffc107; color: #222; }
.nps-grid input.pro:checked + label { background: #198754; }
@media (max-width: 420px) { .nps-grid { grid-template-columns: repeat(6, 1fr); } }

.choice-list .form-check { padding: .6rem .75rem .6rem 2.25rem; border: 1px solid #e3e7ea; border-radius: .6rem; margin-bottom: .4rem; }
.choice-list .form-check:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.yesno input { display: none; }
.yesno label { border: 2px solid #e3e7ea; border-radius: .75rem; padding: .7rem; text-align: center; cursor: pointer; font-weight: 600; }
.yesno input:checked + label { border-color: var(--brand); background: var(--brand-light); color: var(--brand-ink); }

/* ---------- Póster QR ---------- */
.qr-poster { max-width: 520px; margin: 0 auto; background: #fff; border-radius: 1rem; text-align: center; padding: 2rem; border: 3px solid var(--brand); }
.qr-poster .poster-title { color: var(--brand-ink); }
.qr-poster .poster-band { background: var(--brand); color: var(--on-brand); border-radius: .6rem; padding: .5rem 1rem; }
.qr-poster .qr-box svg, .qr-poster .qr-box img { width: 300px; height: 300px; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff !important; }
  .no-print, .sidebar, nav.navbar { display: none !important; }
  .main-content { padding: 0 !important; }
  .qr-poster { border-width: 4px; max-width: 100%; margin-top: 10mm; }
  .qr-poster .qr-box svg, .qr-poster .qr-box img { width: 110mm; height: 110mm; }
}

/* ---------- Tarjetas de planes (diseño claro) ---------- */
.planes-vitrina { --plan-acc: var(--brand, #1a9cb6); --plan-ok: #2fa57a; }
.plan-card { position: relative; background: #fff; color: #0f2a33; border: 1px solid #e3e8ea; border-radius: 22px; padding: 2rem 1.9rem 1.8rem; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,42,51,.08); }
.plan-card.destacado { border: 1.5px solid var(--plan-acc); box-shadow: 0 20px 45px rgba(15,42,51,.10); }
.plan-badge { position: absolute; top: -14px; left: 1.9rem; background: #3bb48a; color: #0b3326; font-size: .8rem; font-weight: 600; border-radius: 2rem; padding: .3rem .9rem; }
.plan-actual { position: absolute; top: -14px; right: 1.5rem; background: #0f2a33; color: #fff; font-size: .75rem; font-weight: 600; border-radius: 2rem; padding: .3rem .8rem; }
.plan-nombre { font-size: 1.45rem; font-weight: 600; margin-bottom: .6rem; }
.plan-precio { display: flex; align-items: baseline; gap: .35rem; }
.plan-precio .monto { font-size: 2.9rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.plan-precio .periodo { font-size: 1.1rem; color: #6b7c82; font-weight: 500; }
.plan-nota { color: #6b7c82; font-size: .95rem; margin: .5rem 0 1.3rem; }
.plan-lista { list-style: none; margin: 0; padding: 0; flex: 1; }
.plan-lista li { display: flex; gap: .8rem; align-items: flex-start; padding: .45rem 0; font-size: 1.02rem; line-height: 1.45; }
.plan-lista li i { color: var(--plan-ok); font-size: 1.15rem; line-height: 1.3; }
.plan-pie { padding-top: 1.6rem; }
.plan-btn { display: block; width: 100%; text-align: center; background: #fff; color: #0f2a33; border: 2px solid #dfe8ea; border-radius: 2rem; padding: .8rem 1rem; font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.plan-btn:hover { border-color: var(--plan-acc); color: #0f2a33; background: #f5fbfc; }
.plan-btn.lleno { background: var(--plan-acc); border-color: var(--plan-acc); color: var(--on-brand, #fff); box-shadow: 0 12px 26px rgba(15,127,153,.25); }
.plan-btn.lleno:hover { filter: brightness(.95); color: var(--on-brand, #fff); }
.plan-btn-ghost { background: #f4f7f8; border-color: #f4f7f8; color: #6b7c82; cursor: default; }
.plan-btn-ghost:hover { background: #f4f7f8; border-color: #f4f7f8; color: #6b7c82; }
.planes-nota { text-align: center; color: #6b7c82; max-width: 760px; margin: 2rem auto 0; line-height: 1.6; }
.planes-nota a { color: var(--plan-acc, #1a9cb6); }
.sus-hero { background: linear-gradient(120deg, var(--sidebar) 0%, var(--brand) 100%); color: var(--sidebar-text); border-radius: 1rem; padding: 2rem; position: relative; overflow: hidden; }
.sus-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
.sus-hero h1 { font-weight: 800; letter-spacing: -.02em; }
.feature-tile { background: #fff; border-radius: .9rem; padding: 1.2rem; height: 100%; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.feature-tile .ico { width: 46px; height: 46px; border-radius: .8rem; display: grid; place-items: center; font-size: 1.35rem; background: var(--brand-light); color: var(--brand-ink); margin-bottom: .7rem; }
.feature-tile h3 { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; }
.feature-tile p { font-size: .85rem; color: #6b7280; margin: 0; }
/* ---------- Modal de confirmación ---------- */
.confirmar { border-radius: 1.1rem; }
.confirmar-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; }
.confirmar-titulo { font-weight: 600; }
.confirmar-detalle { background: #f6f8f9; border: 1px solid #e7ecee; border-radius: .75rem; padding: .7rem .9rem; font-size: .92rem; color: #334; }
.confirmar .modal-footer .btn { padding: .6rem 1rem; border-radius: .7rem; font-weight: 500; }
.plan-edit.apagado { background: #f4f5f6; border-style: dashed !important; }
.plan-edit.apagado > :not(:first-child) { opacity: .45; }
.plan-cfg { border: 1.5px solid #dce7ea; border-radius: 1rem; padding: 1.1rem; background: #fff; transition: background .15s, border-color .15s; }
.plan-cfg .estado-txt { color: #15803d; }
.plan-cfg.apagado .estado-txt { color: #b42318; }
.plan-cfg-precio { font-size: 1.6rem; font-weight: 600; margin-bottom: .6rem; }
.plan-cfg .form-switch .form-check-input { cursor: pointer; }

/* ======================================================================
   Informe imprimible del dashboard (Imprimir / Guardar como PDF)
   ====================================================================== */
.print-head, .print-foot, .print-sec { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm 12mm 16mm; }
  html, body { background: #fff !important; font-size: 9.5pt; color: #1f2a30; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; box-shadow: none !important; }
  .main-content > .alert, .main-content > .alert-dismissible { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }

  /* Encabezado del informe */
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12mm;
    border-bottom: 2.5px solid var(--brand, #1a9cb6); padding-bottom: 4mm; margin-bottom: 5mm; }
  .print-head .ph-izq { display: flex; align-items: center; gap: 4mm; }
  .print-head img { max-height: 16mm; max-width: 40mm; object-fit: contain; }
  .print-head .ph-emp { font-size: 15pt; font-weight: 600; line-height: 1.15; color: #10232b; }
  .print-head .ph-tit { font-size: 10pt; color: var(--brand, #1a9cb6); font-weight: 600; letter-spacing: .02em; }
  .print-head .ph-der { font-size: 8pt; color: #44545b; text-align: right; line-height: 1.55; }
  .print-head .ph-der span { display: inline-block; min-width: 18mm; color: #8a979c; text-transform: uppercase; font-size: 6.8pt; letter-spacing: .06em; margin-right: 2mm; }

  /* Pie al final del informe */
  .print-foot { display: flex; justify-content: space-between; gap: 6mm; margin-top: 5mm;
    font-size: 7pt; color: #8a979c; border-top: 1px solid #dfe5e7; padding-top: 2mm; break-inside: avoid; }

  /* Títulos de sección */
  .print-sec { display: block; font-size: 8pt; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
    color: #6b7a80; margin: 4mm 0 2mm; break-after: avoid; page-break-after: avoid; }
  .print-sec.salto { break-before: page; page-break-before: always; margin-top: 0; }
  .dash > .print-sec:first-child { margin-top: 0; }

  /* Rejilla: mantener las columnas del escritorio en papel */
  .dash .row { display: flex !important; flex-wrap: nowrap !important; --bs-gutter-x: 4mm; --bs-gutter-y: 0; margin-bottom: 3mm !important; break-inside: avoid; page-break-inside: avoid; }
  .dash .col-xl, .dash .dash-kpis > [class*="col-"] { flex: 1 1 0 !important; width: auto !important; max-width: none !important; }
  .dash .col-xl-8 { flex: 0 0 62% !important; max-width: 62% !important; }
  .dash .col-xl-4 { flex: 0 0 38% !important; max-width: 38% !important; }
  .dash .col-xl-7 { flex: 0 0 57% !important; max-width: 57% !important; }
  .dash .col-xl-5 { flex: 0 0 43% !important; max-width: 43% !important; }
  .dash .col-xl-6 { flex: 0 0 50% !important; max-width: 50% !important; }

  /* Tarjetas limpias */
  .dash .card { border: 1px solid #dfe5e7 !important; border-radius: 2.5mm !important; background: #fff !important; break-inside: avoid; page-break-inside: avoid; }
  .dash .card-header { background: #f5f8f9 !important; border-bottom: 1px solid #e6ecee !important; font-size: 9pt; font-weight: 600;
    padding: 2mm 3mm !important; border-left: 3px solid var(--brand, #1a9cb6); border-radius: 2.5mm 2.5mm 0 0 !important; color: #1f2a30 !important; }
  .dash .card-body { padding: 3mm !important; }
  .dash .chart-box, .dash .chart-box.sm { height: 48mm !important; }
  .dash [class*="col-"], .dash .card, .dash .card-body, .dash .chart-box { min-width: 0 !important; }
  .dash canvas { max-width: 100% !important; }
  .dash .table { font-size: 8pt; margin: 0; }
  .dash .table th { font-size: 7pt; text-transform: uppercase; letter-spacing: .04em; color: #6b7a80; background: #fafbfb !important; }
  .dash .table td, .dash .table th { padding: 1.3mm 2mm !important; }
  .dash .list-group-item { padding: 1.4mm 3mm !important; font-size: 7.8pt; border-color: #edf1f2 !important; }
  .dash .list-group-flush > :nth-child(n+6) { display: none !important; }   /* máximo 5 elementos por lista */
  .dash .badge { border: 0; }
  .dash .mb-3 { margin-bottom: 2mm !important; }
  .dash .display-5 { font-size: 22pt !important; }
  .dash .progress { height: 2mm !important; background: #edf1f2 !important; }

  /* KPIs compactos */
  .dash-kpis .card { border-top: 3px solid var(--brand, #1a9cb6) !important; }
  .dash-kpis .kpi-icon { display: none !important; }
  .dash-kpis .kpi-label { font-size: 7pt; text-transform: uppercase; letter-spacing: .05em; color: #6b7a80; }
  .dash-kpis .kpi-value { font-size: 17pt !important; font-weight: 600; margin: 1mm 0; }
  .dash-kpis .kpi-value small { font-size: 8pt !important; }
  .dash-kpis .small { font-size: 6.8pt !important; line-height: 1.3; }
  .dash-kpis .border-danger { border-color: #dfe5e7 !important; border-top-color: #c93b3a !important; }
}
