/* Estilos del panel, login, superadmin y página imprimible. */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font);
  font-size: 15px; line-height: 1.5; background: #f1f5f9; color: #1e293b;
}
a { color: #0f5fa8; }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.muted { color: #64748b; }
.small { font-size: .85rem; }
.right { text-align: right; white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.inline { display: inline; }

.topbar {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #fff; border-bottom: 3px solid var(--primary);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand img { height: 34px; max-width: 90px; object-fit: contain; }
.topbar-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.topbar-nav a { text-decoration: none; color: #334155; padding: 4px 0; }
.topbar-nav a.active { color: #0f172a; font-weight: 700; border-bottom: 2px solid var(--primary); }
.badge { background: #dc2626; color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: #b91c1c; cursor: pointer; }

.support-bar {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center;
  padding: 8px 16px; background: #7c2d12; color: #fff; font-size: .9rem;
}
.support-bar .btn { background: #fff; color: #7c2d12; border-color: #fff; }
.temp-pass { background: #fefce8; border: 1px solid #fde68a; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.temp-pass code { font-size: 1.2rem; background: #fff; padding: 2px 8px; border-radius: 6px; user-select: all; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.content { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.content.narrow { max-width: 560px; }
.flash { margin: 12px 16px 0; padding: 10px 14px; border-radius: 8px; }
.content .flash, .form .flash, .login-card .flash { margin: 0 0 12px; }
.flash.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
textarea.code { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; resize: vertical; }
.errlist { margin: 0; padding-left: 18px; }
.empty { background: #fff; padding: 24px; border-radius: 10px; text-align: center; color: #64748b; }

.panel { background: #fff; border-radius: 12px; padding: 18px; margin-top: 18px; }
.grid-2 { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.form label { display: block; margin-bottom: 12px; font-weight: 600; }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="url"], .form input[type="tel"], .form input[type="date"], .form select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px;
  font: inherit; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff;
}
.form small { display: block; font-weight: 400; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; }
.form-danger { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.color-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.color-row input[type="color"] { width: 46px; height: 40px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 8px; }
.color-row input[type="text"] { margin-top: 0 !important; max-width: 130px; font-family: ui-monospace, monospace; }

.btn {
  display: inline-block; padding: 10px 16px; font: inherit; font-weight: 700;
  background: var(--primary); color: var(--on-primary); text-decoration: none;
  border: 2px solid var(--primary); border-radius: 8px; cursor: pointer;
}
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn-outline { background: #fff; color: #1e293b; border-color: #cbd5e1; }
.btn-whatsapp { background: #128c4b; border-color: #128c4b; color: #fff; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: #fff; padding: 12px; border-radius: 10px; margin-bottom: 14px;
}
.filters label { display: flex; flex-direction: column; font-size: .8rem; color: #475569; }
.filters select, .filters input { padding: 6px 8px; font: inherit; border: 1px solid #cbd5e1; border-radius: 6px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: #fff; color: #334155; text-decoration: none; font-weight: 600; font-size: .9rem;
  border: 1px solid #cbd5e1; border-radius: 999px; transition: border-color .12s, background .12s;
}
.tab:hover { border-color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tab-n {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #e2e8f0; color: #334155;
  font-size: .75rem; text-align: center; font-variant-numeric: tabular-nums;
}
.tab.active .tab-n { background: rgba(255, 255, 255, .25); color: inherit; }
.stars-lg { color: #f59e0b; font-size: 1.5rem; margin: 4px 0; }
.quote { margin: 8px 0 16px; padding: 10px 14px; border-left: 4px solid #cbd5e1; background: #f8fafc; white-space: pre-line; }
.reviews { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.review { background: #fff; border-radius: 10px; padding: 14px; border-left: 4px solid #cbd5e1; }
.review.is-open { border-left-color: #dc2626; }
.review-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.review .stars { color: #f59e0b; letter-spacing: 2px; }
.review-text { margin: 6px 0; white-space: pre-line; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: #e0f2fe; color: #075985; margin-left: 4px; }
.tag-ok { background: #dcfce7; color: #166534; }
.tag-warn { background: #fee2e2; color: #991b1b; }
.tag-muted { background: #f1f5f9; color: #64748b; }
.pager { display: flex; justify-content: space-between; margin-top: 16px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.table th { background: #f8fafc; font-size: .8rem; text-transform: uppercase; color: #64748b; }
.table tr.inactive td { color: #94a3b8; }
.row-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-form select, .row-form input { padding: 5px 6px; font: inherit; font-size: .85rem; border: 1px solid #cbd5e1; border-radius: 6px; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid #e2e8f0; }
  .table td { border: 0; padding: 4px 12px; }
  .right { text-align: left; }
}

.qr-preview { display: block; width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid #e2e8f0; }
.preview { background: var(--bg); padding: 18px; border-radius: 10px; }
.preview-card { background: #fff; border-radius: 12px; padding: 16px; text-align: center; color: #1e293b; }
.preview-logo { max-width: 100px; max-height: 70px; object-fit: contain; display: block; margin: 0 auto 6px; }
.preview-logo[hidden] { display: none; }
.preview-name { color: #1e293b; font-size: 1.2rem; }
.preview-card { font-family: var(--font); border-top: 4px solid var(--accent); }
.preview-badge { display: inline-block; margin: 4px 0; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--accent); color: var(--on-accent); }
.preview-stars { color: #f59e0b; font-size: 1.6rem; margin: 6px 0; }
.preview-btn { display: block; padding: 10px; border-radius: 10px; font-weight: 700; background: var(--primary); color: var(--on-primary); }

.login-body { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 400px; margin-top: 10vh; background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.login-card label { display: block; font-weight: 600; margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 10px; font: inherit; border: 1px solid #cbd5e1; border-radius: 8px; }
.login-card .btn { width: 100%; margin-top: 18px; }

/* Estadísticas: cifras grandes y barras horizontales de un solo color con su número visible */
.health-avg { font-size: 1.1rem; color: #0f172a; }
.section-title { margin: 22px 0 0; font-size: 1rem; color: #475569; text-transform: uppercase; letter-spacing: .03em; }
.stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.period { display: flex; gap: 8px; align-items: flex-end; }
.period label { display: flex; flex-direction: column; font-size: .8rem; color: #475569; }
.period select { padding: 6px 8px; font: inherit; border: 1px solid #cbd5e1; border-radius: 6px; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 12px; }
.tile { background: #fff; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-size: .8rem; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.tile-value { font-size: 2rem; line-height: 1.2; color: #0f172a; font-variant-numeric: tabular-nums; }
.tile-star { color: #f59e0b; font-size: 1.4rem; }
.tile-note { font-size: .8rem; color: #64748b; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; }
.hbar-label { font-size: .9rem; color: #334155; white-space: nowrap; }
.hbar-label.month { font-size: .85rem; }
.hbar-track { height: 14px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.hbar-value { font-size: .85rem; color: #334155; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 2ch; text-align: right; }
.hbar:has(.month) { grid-template-columns: 120px 1fr auto; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.w0 { width: 0%; }
.w1 { width: 1%; }
.w2 { width: 2%; }
.w3 { width: 3%; }
.w4 { width: 4%; }
.w5 { width: 5%; }
.w6 { width: 6%; }
.w7 { width: 7%; }
.w8 { width: 8%; }
.w9 { width: 9%; }
.w10 { width: 10%; }
.w11 { width: 11%; }
.w12 { width: 12%; }
.w13 { width: 13%; }
.w14 { width: 14%; }
.w15 { width: 15%; }
.w16 { width: 16%; }
.w17 { width: 17%; }
.w18 { width: 18%; }
.w19 { width: 19%; }
.w20 { width: 20%; }
.w21 { width: 21%; }
.w22 { width: 22%; }
.w23 { width: 23%; }
.w24 { width: 24%; }
.w25 { width: 25%; }
.w26 { width: 26%; }
.w27 { width: 27%; }
.w28 { width: 28%; }
.w29 { width: 29%; }
.w30 { width: 30%; }
.w31 { width: 31%; }
.w32 { width: 32%; }
.w33 { width: 33%; }
.w34 { width: 34%; }
.w35 { width: 35%; }
.w36 { width: 36%; }
.w37 { width: 37%; }
.w38 { width: 38%; }
.w39 { width: 39%; }
.w40 { width: 40%; }
.w41 { width: 41%; }
.w42 { width: 42%; }
.w43 { width: 43%; }
.w44 { width: 44%; }
.w45 { width: 45%; }
.w46 { width: 46%; }
.w47 { width: 47%; }
.w48 { width: 48%; }
.w49 { width: 49%; }
.w50 { width: 50%; }
.w51 { width: 51%; }
.w52 { width: 52%; }
.w53 { width: 53%; }
.w54 { width: 54%; }
.w55 { width: 55%; }
.w56 { width: 56%; }
.w57 { width: 57%; }
.w58 { width: 58%; }
.w59 { width: 59%; }
.w60 { width: 60%; }
.w61 { width: 61%; }
.w62 { width: 62%; }
.w63 { width: 63%; }
.w64 { width: 64%; }
.w65 { width: 65%; }
.w66 { width: 66%; }
.w67 { width: 67%; }
.w68 { width: 68%; }
.w69 { width: 69%; }
.w70 { width: 70%; }
.w71 { width: 71%; }
.w72 { width: 72%; }
.w73 { width: 73%; }
.w74 { width: 74%; }
.w75 { width: 75%; }
.w76 { width: 76%; }
.w77 { width: 77%; }
.w78 { width: 78%; }
.w79 { width: 79%; }
.w80 { width: 80%; }
.w81 { width: 81%; }
.w82 { width: 82%; }
.w83 { width: 83%; }
.w84 { width: 84%; }
.w85 { width: 85%; }
.w86 { width: 86%; }
.w87 { width: 87%; }
.w88 { width: 88%; }
.w89 { width: 89%; }
.w90 { width: 90%; }
.w91 { width: 91%; }
.w92 { width: 92%; }
.w93 { width: 93%; }
.w94 { width: 94%; }
.w95 { width: 95%; }
.w96 { width: 96%; }
.w97 { width: 97%; }
.w98 { width: 98%; }
.w99 { width: 99%; }
.w100 { width: 100%; }

/* Página imprimible */
.print-body { background: #fff; }
.print-bar { display: flex; justify-content: space-between; align-items: center; max-width: 700px; margin: 12px auto; padding: 0 16px; }
.print-sheet { max-width: 700px; margin: 0 auto; padding: 24px 16px; text-align: center; }
.print-logo { max-width: 220px; max-height: 140px; object-fit: contain; }
.print-name { font-size: 2.2rem; margin: 8px 0 0; }
.print-branch { display: inline-block; font-size: 1.2rem; margin: 6px 0 18px; padding: 4px 16px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-cta { font-size: 2.4rem; margin: 0 0 12px; color: var(--primary); }
.print-qr { width: 100%; max-width: 420px; image-rendering: pixelated; }
.print-hint { font-size: 1.1rem; color: #475569; }
@media print {
  .no-print { display: none !important; }
  .print-sheet { padding: 0; }
  @page { margin: 12mm; }
  .print-cta { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
