/* ============================================
   CASA RURAL · Vera · 8-10 Mayo
   Diseño minimalista y limpio
   ============================================ */

:root {
    --bg: #f7f3ec;
    --bg-alt: #ffffff;
    --border: #e6dfd3;
    --border-strong: #d4ccbc;

    --text: #2a2420;
    --text-soft: #665b4f;
    --text-muted: #9a8f80;

    --accent: #5a7a4f;
    --accent-dark: #3f5a37;
    --accent-light: #e8efe4;

    --warn: #c08a2a;
    --danger: #b55535;
    --success: #4a7a3f;

    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(42, 36, 32, 0.06), 0 1px 2px rgba(42, 36, 32, 0.04);
    --shadow-md: 0 4px 12px rgba(42, 36, 32, 0.08);

    --transition: 150ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ HERO ============ */
.hero {
    padding: 3.5rem 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
}

.hero-inner {
    max-width: 820px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-soft);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.hero-title {
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.hero-dates {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--text-soft);
    margin-bottom: 2rem;
    font-weight: 500;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-weight: 500;
}

/* ============ CONTAINER ============ */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    position: sticky;
    top: 0.75rem;
    z-index: 10;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    min-width: fit-content;
    background: transparent;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab:hover { color: var(--text); background: var(--bg); }

.tab.active {
    background: var(--text);
    color: var(--bg);
}

.tab-icon { font-size: 1rem; }

/* ============ PANELS ============ */
.panel { display: none; }
.panel.active { display: block; }

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.panel-header p {
    color: var(--text-soft);
    font-size: 0.95rem;
}

/* ============ FORMS ============ */
.form-add {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.form-add input, .form-add select {
    flex: 1;
    min-width: 140px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-strong);
    background: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color var(--transition);
}

.form-add input:focus, .form-add select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-add select { cursor: pointer; }

/* ============ BUTTONS ============ */
.btn {
    padding: 0.65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--text);
    color: var(--bg-alt);
}
.btn-primary:hover { background: #000; }

.btn-ghost {
    background: var(--bg-alt);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--text-soft); }

.btn-danger {
    background: var(--bg-alt);
    color: var(--danger);
    border-color: var(--border-strong);
}
.btn-danger:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* ============ CHIPS ============ */
.people-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.chip-green { border-color: #c7d8bf; color: var(--success); }
.chip-amber { border-color: #e5d5a8; color: var(--warn); }
.chip-red   { border-color: #e4bfb0; color: var(--danger); }

/* ============ BOTÓN APUNTARSE ============ */
.signup-cta {
    text-align: center;
    margin-bottom: 1.75rem;
}

.btn-big {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    min-width: 280px;
    box-shadow: var(--shadow-md);
}

.btn-big:hover { transform: translateY(-1px); }

/* ============ PEOPLE ============ */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
}

.person-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.person-card:hover {
    border-color: var(--text-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.person-card.status-no { opacity: 0.5; }
.person-card.status-pendiente { background: #fbf6eb; }

.person-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.person-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.person-info { flex: 1; min-width: 0; }

.person-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.person-dates {
    font-size: 0.82rem;
    color: var(--text-soft);
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: 7px;
    line-height: 1.5;
}

.person-dates strong { font-weight: 600; color: var(--text); margin-right: 0.25rem; }

.person-drinks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.drink-pill {
    padding: 0.2rem 0.55rem;
    background: var(--accent-light);
    color: var(--accent-dark);
    border: 1px solid #c7d8bf;
    border-radius: 100px;
    font-size: 0.76rem;
    font-weight: 500;
}

.drink-pill.more { background: var(--bg); color: var(--text-soft); border-color: var(--border); }

.person-notes {
    font-size: 0.82rem;
    color: var(--text-soft);
    font-style: italic;
    padding-top: 0.25rem;
    border-top: 1px dashed var(--border);
}

.icon-btn {
    background: transparent;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover { background: var(--bg); }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: var(--bg-alt);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}
.empty-state.hidden { display: none; }

/* ============ BANNER OBLIGATORIAS ============ */
.mandatory-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--accent-light);
    border: 1px solid #c7d8bf;
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.25rem;
}

.mandatory-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    font-weight: 700;
}

.mandatory-text strong {
    display: block;
    color: var(--accent-dark);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.mandatory-text div {
    color: var(--text-soft);
    font-size: 0.88rem;
}

/* ============ BEBIDAS ============ */
.drinks-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.drinks-legend > span:first-child {
    font-weight: 600;
    margin-right: 0.25rem;
}

.legend-item {
    padding: 0.3rem 0.7rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-soft);
}

.drinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.drink-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.drink-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.drink-card-header .person-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

.drink-card-header .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.drink-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.drink-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg);
    border-radius: 7px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.85rem;
    user-select: none;
    border: 1px solid transparent;
}

.drink-option:hover { background: #eee5d4; }
.drink-option input { accent-color: var(--accent); cursor: pointer; }

.drink-option:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

/* ============ TOTALES ============ */
.drinks-totals {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.drinks-totals h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 700;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.total-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 0.65rem;
    text-align: center;
}

.total-item .icon { font-size: 1.35rem; }

.total-item .qty {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0.2rem 0;
}

.total-item .label {
    font-size: 0.78rem;
    color: var(--text-soft);
    font-weight: 500;
}

.hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ============ COMIDAS ============ */
.meals-container {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.meal-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
}

.meal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.meal-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 1px solid #c7d8bf;
}

.meal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.meal-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meal-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.35rem;
}

.meal-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    background: var(--bg);
    border-radius: 7px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.87rem;
    user-select: none;
    border: 1px solid transparent;
}

.meal-option:hover { background: #eee5d4; }
.meal-option input { accent-color: var(--accent); cursor: pointer; }

.meal-option:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

/* ============ EXTRAS ============ */
.extras-box, .custom-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
}

.extras-box h3, .custom-box h3 {
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
    color: var(--text);
    font-weight: 700;
}

.extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.35rem;
}

.extra-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    background: var(--bg);
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.87rem;
    transition: all var(--transition);
    border: 1px solid transparent;
    user-select: none;
}

.extra-item:hover { background: #eee5d4; }
.extra-item input { accent-color: var(--accent); cursor: pointer; }

.extra-item:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
    font-weight: 600;
    color: var(--accent-dark);
}

/* ============ CUSTOM LIST ============ */
.custom-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.custom-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--accent-light);
    color: var(--accent-dark);
    border: 1px solid #c7d8bf;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
}

.custom-tag button {
    background: transparent;
    border: none;
    color: var(--accent-dark);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--transition);
}

.custom-tag button:hover { background: rgba(0,0,0,0.08); }

/* ============ RESUMEN ============ */
.summary-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.summary-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.summary-card ul { list-style: none; }

.summary-card li {
    display: flex;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.92rem;
    gap: 0.6rem;
}

.summary-card li:last-child { border-bottom: none; }

.summary-card li .item-name { flex: 1; }
.summary-card li .item-qty {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
}

.summary-card li.checked { opacity: 0.45; text-decoration: line-through; }

.check-btn {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    width: 20px;
    height: 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    padding: 0;
}

.check-btn.checked {
    background: var(--accent);
    border-color: var(--accent);
    position: relative;
}

.check-btn.checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    font-size: 0.8rem;
    font-weight: bold;
}

/* ============ ADMIN (página aparte) ============ */
.admin-gate {
    max-width: 360px;
    margin: 6rem auto 2rem;
    padding: 2rem 1.75rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.admin-gate h1 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.admin-gate p {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.admin-gate input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.3em;
    font-family: inherit;
    margin-bottom: 0.75rem;
}

.admin-gate input:focus {
    outline: none;
    border-color: var(--accent);
}

.admin-gate .error {
    color: var(--danger);
    font-size: 0.85rem;
    min-height: 1.2em;
    margin-top: 0.5rem;
}

.admin-gate .back-link {
    display: inline-block;
    margin-top: 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.admin-gate .back-link:hover { color: var(--text); }

.admin-content { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.admin-content .admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-content .admin-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

.admin-content .admin-header p {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

/* Coste alojamiento */
.lodging-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.lodging-card .lodging-title {
    flex: 1;
    font-weight: 600;
    color: var(--text);
    min-width: 180px;
}

.lodging-card .lodging-title small {
    display: block;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.price-input {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: white;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
}

.price-input:focus-within { border-color: var(--accent); }

.price-input input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    width: 75px;
    text-align: right;
    font-family: inherit;
}

.price-input input::-webkit-outer-spin-button,
.price-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.price-input input[type=number] { -moz-appearance: textfield; }

.price-input .currency {
    font-size: 1rem;
    color: var(--text-soft);
    font-weight: 600;
}

/* Destacado reparto */
.big-per-person {
    background: var(--text);
    color: var(--bg-alt);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.bpp-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
    margin-bottom: 0.4rem;
}

.bpp-amount {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

.bpp-sub { font-size: 0.9rem; opacity: 0.7; }

.payments-breakdown {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.payments-breakdown h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
}

.payment-row:last-of-type { border-bottom: none; }

.payment-row .pr-info { flex: 1; min-width: 0; }
.payment-row .pr-name { font-weight: 500; color: var(--text); font-size: 0.95rem; }
.payment-row .pr-calc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.payment-row .pr-amount {
    font-weight: 700;
    color: var(--text);
    font-size: 1.05rem;
    white-space: nowrap;
}

.payments-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1rem 0 0;
    margin-top: 0.5rem;
    border-top: 2px solid var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

.payments-total-row span:last-child { font-size: 1.35rem; }

/* Lista quién paga qué */
.people-payments {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.people-payments h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.people-payments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

.payment-person {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.payment-person .person-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.payment-person .pp-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-person .pp-amount {
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}

/* Gastos extra admin */
.expenses-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.expenses-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.expense-list {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 0.5rem;
}

.expense-item .exp-name { flex: 1; font-size: 0.92rem; }
.expense-item .exp-amount { font-weight: 700; color: var(--text); }
.expense-item button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.expense-item button:hover { color: var(--danger); background: rgba(181, 85, 53, 0.1); }

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    background: var(--bg-alt);
}

.admin-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.admin-link:hover { opacity: 1; color: var(--text); }

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 36, 32, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
    overflow-y: auto;
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-alt);
    z-index: 2;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all var(--transition);
}

.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-form {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-section { display: flex; flex-direction: column; gap: 0.35rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: -0.1rem;
    margin-bottom: 0.4rem;
}

.modal-form input[type="text"],
.modal-form select,
.modal-form textarea {
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-strong);
    background: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color var(--transition);
    width: 100%;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-form textarea { resize: vertical; min-height: 60px; font-family: inherit; }

/* Categorías de bebida (acordeones) */
.drink-category {
    margin-bottom: 0.4rem;
}

.drink-details {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.drink-details[open] { background: var(--bg-alt); border-color: var(--accent); }

.drink-details summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    user-select: none;
    list-style: none;
    transition: background var(--transition);
}

.drink-details summary::-webkit-details-marker { display: none; }

.drink-details summary::after {
    content: '▾';
    margin-left: auto;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.drink-details[open] summary::after { transform: rotate(180deg); }

.drink-details summary:hover { background: var(--bg); }
.drink-details[open] summary { border-bottom: 1px solid var(--border); }

.cat-icon { font-size: 1.15rem; }
.cat-name { flex: 1; color: var(--text); }

.cat-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    background: var(--accent);
    color: white;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.drink-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    padding: 0.75rem;
}

.drink-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    background: white;
    border-radius: 7px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.87rem;
    user-select: none;
    border: 1px solid transparent;
}

.drink-option:hover { background: var(--bg); }
.drink-option input { accent-color: var(--accent); cursor: pointer; }

.drink-option:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: var(--bg-alt);
    padding: 0.75rem 1.25rem;
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    z-index: 100;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
    .hero { padding: 2.25rem 1rem 1.5rem; }
    .hero-stats { gap: 1.5rem; }
    .stat-number { font-size: 1.4rem; }
    .stat-label { font-size: 0.72rem; }

    .container { padding: 1rem 1rem 2.5rem; }

    .tabs {
        padding: 0.25rem;
        gap: 0.15rem;
        top: 0.5rem;
    }
    .tab {
        padding: 0.55rem 0.5rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.15rem;
    }
    .tab span:not(.tab-icon) { font-size: 0.72rem; }
    .tab-icon { font-size: 1.1rem; }

    .panel-header h2 { font-size: 1.25rem; }
    .panel-header p { font-size: 0.88rem; }

    .form-add { flex-direction: column; padding: 0.85rem; }
    .form-add input, .form-add select, .form-add button { width: 100%; min-width: 0; }

    .people-grid { grid-template-columns: 1fr; }
    .drinks-grid { grid-template-columns: 1fr; }
    .drink-options { grid-template-columns: 1fr 1fr; }

    .meal-options { grid-template-columns: 1fr; }
    .extras-grid { grid-template-columns: 1fr 1fr; }

    .totals-grid { grid-template-columns: repeat(2, 1fr); }

    .summary-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        font-size: 0.82rem;
        padding: 0.6rem 0.5rem;
    }

    .summary-grid { grid-template-columns: 1fr; }

    .summary-card li { flex-wrap: wrap; }
    .summary-card li .item-name { flex: 1 1 calc(100% - 30px); }

    .bpp-amount { font-size: 2.5rem; }

    .people-payments-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .btn-big { min-width: 0; width: 100%; padding: 0.9rem 1.5rem; font-size: 1rem; }

    .modal-overlay { padding: 0.5rem; align-items: flex-end; }
    .modal {
        max-height: 95vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .modal-header { padding: 1rem 1.1rem; }
    .modal-form { padding: 1rem 1.1rem 1.5rem; gap: 0.9rem; }
    .form-row { grid-template-columns: 1fr; gap: 0.6rem; }
    .drink-options-grid { grid-template-columns: 1fr; }
    .modal-actions .btn { flex: 1; }

    .people-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
    .hero-stats { gap: 1rem; }
    .stat-number { font-size: 1.25rem; }
    .extras-grid { grid-template-columns: 1fr; }
    .drink-option { font-size: 0.82rem; }
    .summary-actions .btn { flex: 1 1 100%; }
}

/* ============ IMPRESIÓN ============ */
@media print {
    .hero, .tabs, .summary-actions, .footer, .toast { display: none !important; }
    .panel:not(#panel-resumen) { display: none !important; }
    #panel-resumen { display: block !important; }
    body { background: white; }
    .summary-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
