:root {
    --brand: #e11d48;
    --bg: #f7f7f8;
    --card: #ffffff;
    --text: #1f2430;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--brand); }

/* ---------- Público ---------- */
.hero {
    padding: 2rem 1rem 1.25rem;
    text-align: center;
}
.hero h1 { margin: 0; font-size: 1.9rem; color: var(--brand); }
.hero .tagline { margin: .35rem auto 0; max-width: 34rem; color: var(--muted); }
.hero .logo { max-width: 96px; max-height: 96px; border-radius: 12px; }
.rating-badge { font-weight: 600; color: #b45309; margin: .4rem 0 0; }
.rating-badge span { color: var(--muted); font-weight: 400; }

.live-pill {
    display: flex; align-items: center; gap: .45rem;
    justify-content: center;
    color: var(--muted); font-size: .78rem; text-transform: uppercase;
    letter-spacing: .06em;
}
.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e; animation: pulse 1.6s infinite;
}
.live-pill.offline .dot { background: #d97706; animation: none; }
.live-pill.offline #live-text { color: #b45309; }
@keyframes pulse { 50% { opacity: .3; } }

.menu-section { max-width: 56rem; margin: 0 auto 1.75rem; padding: 0 1rem; }
.menu-section h2 {
    font-size: 1.15rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--brand); border-bottom: 2px solid var(--brand); padding-bottom: .3rem;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.card {
    background: var(--card); border-radius: var(--radius);
    padding: .85rem 1rem; box-shadow: 0 1px 3px rgb(0 0 0 / .07);
}
.card header { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.card h3 { margin: 0; font-size: 1rem; }
.card p { margin: .3rem 0 0; color: var(--muted); font-size: .88rem; }
.price {
    color: var(--brand); font-weight: 700; white-space: nowrap;
}

.payments { max-width: 56rem; margin: 0 auto; padding: 0 1rem 1rem; }
.payments h2 { font-size: 1.05rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: 0; }
.chip {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 999px; padding: .4rem .9rem; font-size: .85rem;
    display: flex; gap: .45rem; align-items: center;
}
.chip strong { color: var(--brand); }

.review-box {
    max-width: 34rem; margin: 1.5rem auto 2.5rem; padding: 1.25rem 1.25rem;
    background: var(--card); border-radius: var(--radius);
    box-shadow: 0 1px 3px rgb(0 0 0 / .07);
}
.review-box h2 { margin-top: 0; font-size: 1.1rem; }
.review-box textarea {
    width: 100%; resize: vertical; margin: .6rem 0;
    border: 1px solid var(--border); border-radius: 10px; padding: .6rem;
    font: inherit;
}
.stars.row-reverse {
    display: inline-flex; flex-direction: row-reverse; gap: .15rem;
}
.stars input[type="radio"] { display: none; }
.stars label {
    font-size: 1.7rem; cursor: pointer; color: #d1d5db; user-select: none;
}
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label { color: #f59e0b; }
.review-box button {
    width: 100%; padding: .65rem; border: 0; border-radius: 10px;
    background: var(--brand); color: #fff; font-weight: 600; font-size: 1rem;
    cursor: pointer;
}
.hidden { display: none; }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }

.foot {
    text-align: center; padding: 1rem; color: var(--muted); font-size: .85rem;
    display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}
.foot .admin-link { color: var(--muted); opacity: .7; }
.foot .admin-link:hover { opacity: 1; }

/* Powered by (igual que agenda) */
.pie {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    padding: 1rem;
}

/* ---------- Login / errores ---------- */
.auth-card, .center-card {
    max-width: 22rem; margin: 10vh auto; background: var(--card);
    padding: 1.6rem; border-radius: var(--radius);
    box-shadow: 0 2px 10px rgb(0 0 0 / .08); text-align: center;
}
.auth-card form { display: flex; flex-direction: column; gap: .5rem; text-align: left; }
.auth-card label { font-size: .85rem; font-weight: 600; }
.auth-card input {
    padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px; font: inherit;
}
.auth-card button {
    margin-top: .6rem; padding: .6rem; border: 0; border-radius: 10px;
    background: var(--brand); color: #fff; font-weight: 600; cursor: pointer;
}

/* ---------- Administración ---------- */
body.admin { background: #f2f4f7; }
.admin-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    flex-wrap: wrap; padding: .65rem 1.2rem;
    background: var(--brand); color: #fff;
}
.admin-bar nav { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; }
.admin-bar a { color: #fff; text-decoration: none; opacity: .92; }
.admin-bar a:hover { opacity: 1; text-decoration: underline; }
.admin-main { max-width: 62rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.panel {
    background: var(--card); border-radius: var(--radius); padding: 1rem 1.2rem;
    margin-bottom: 1.2rem; box-shadow: 0 1px 3px rgb(0 0 0 / .06);
}
.panel-head {
    display: flex; gap: .8rem; justify-content: space-between; align-items: center;
    flex-wrap: wrap; margin-bottom: .6rem;
}
.panel-head.inactive { opacity: .55; }
.title-input { font-weight: 700; font-size: 1.02rem; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: .72rem; text-transform: uppercase;
    color: var(--muted); letter-spacing: .05em;
}
.table td { padding: .3rem .35rem; vertical-align: middle; }
.table tr > form { display: contents; }
.table input[type="text"] {
    width: 100%; min-width: 6rem; padding: .38rem .55rem;
    border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
.price-input { max-width: 5.5rem !important; }
.row-off td { opacity: .5; }
.actions { display: flex; gap: .3rem; white-space: nowrap; }
.actions.nowrap { flex-wrap: nowrap; }
.hidden-form { display: none; }
.review-loader { color: var(--muted); font-size: .9rem; }
.review-loader::after {
    content: '…';
    display: inline-block;
    animation: loader-dots 1.2s steps(4, end) infinite;
}
@keyframes loader-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75%, 100% { content: '...'; }
}
.add-item { margin-top: .7rem; }

.inline { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: .4rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

button.small, .link {
    padding: .32rem .7rem; font-size: .82rem; border-radius: 8px;
    border: 1px solid var(--border); background: #fff; cursor: pointer; font: inherit;
}
button.primary {
    padding: .5rem 1rem; background: var(--brand); color: #fff;
    border: 0; border-radius: 10px; font-weight: 600; cursor: pointer;
}
button.danger { color: #dc2626; border-color: #fecaca; }
button.ghost { color: var(--muted); }
.link { background: none; border: 0; color: #fff; text-decoration: underline; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin-top: 1rem; }
.stat-card {
    background: var(--card); border-radius: var(--radius); padding: 1rem 1.1rem;
    text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgb(0 0 0 / .06);
}
.stat-card:hover { outline: 2px solid var(--brand); }
.stat-card h2 { margin: 0; font-size: 1rem; color: var(--brand); }
.stat-card p { margin: .3rem 0 0; color: var(--muted); font-size: .88rem; }

.flash {
    padding: .55rem .9rem; border-radius: 10px; margin-bottom: .8rem;
    background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
}
.flash.error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ---------- Super usuario ---------- */
.super-bar { background: #111827; }
.muted-light { color: #9ca3af; font-size: .85rem; }
.super-banner {
    display: flex; justify-content: space-between; align-items: center; gap: .8rem;
    flex-wrap: wrap; padding: .5rem .9rem; margin-bottom: 1rem;
    background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
    border-radius: 10px; font-size: .9rem;
}
.btn-back-super {
    background: #7c3aed !important; color: #fff !important; border: 0 !important;
    font-weight: 600; cursor: pointer;
}
.btn-back-super:hover { background: #6d28d9 !important; }
.badge {
    display: inline-block; padding: .05rem .45rem; border-radius: 999px;
    background: #ede9fe; color: #6d28d9; font-size: .72rem; font-weight: 600;
    vertical-align: middle;
}
.row-active td:first-child { box-shadow: inset 3px 0 0 #7c3aed; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }

/* ---------- Código QR ---------- */
.qr-preview { text-align: center; margin-top: 1rem; }
.qr-preview img {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: .5rem;
}
.qr-actions { margin-top: .8rem; }
.download-link {
    padding: .32rem .7rem; font-size: .82rem; border-radius: 8px;
    background: var(--brand); color: #fff !important; text-decoration: none;
    font-weight: 600;
}
input.wide { width: 100%; }
select {
    width: 100%; padding: .45rem .55rem; border: 1px solid var(--border);
    border-radius: 8px; font: inherit; background: #fff;
}
.btn-link { text-decoration: none; display: inline-block; }

.muted { color: var(--muted); font-size: .9rem; }
.error-detail { text-align: left; background: #fee2e2; padding: .8rem; border-radius: 8px; overflow: auto; }

/* ---------- Reseñas (admin) ---------- */
.review-summary {
    display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap;
    background: var(--card); border-radius: 10px; padding: .7rem 1rem;
    margin-bottom: 1rem; box-shadow: 0 1px 3px rgb(0 0 0 / .06);
    font-size: 1.05rem;
}
.summary-stars, .review-stars { color: #f59e0b; letter-spacing: .1em; }
.review-item { padding: .8rem 1rem; }
.review-head {
    display: flex; justify-content: space-between; align-items: center; gap: .8rem;
    flex-wrap: wrap; margin-bottom: .25rem;
}
.review-comment { margin: 0; }

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .table th:nth-child(2) { display: none; }
}
