:root {
    --blue: #5278b9; --blue-d: #3d5f9a; --blue-l: #e6eef9;
    --pink: #ec4f6e; --pink-l: #fde6eb;
    --orange: #f2a25c; --orange-l: #fdf0e1;
    --navy: #232c63;
    --ink: #232c63; --mut: #66709a; --line: #e4e9f5; --bg: #fffaf4;
    --r: 22px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.6 "Trebuchet MS", "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue-d); text-decoration: none; }
a:hover { color: var(--pink); }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; }

/* Cabecera */
.site-header { background: #fff; position: sticky; top: 0; z-index: 10; }
.site-header::after { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--blue) 33%, var(--pink) 33% 66%, var(--orange) 66%); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 16px; }
.brand img { height: 52px; display: block; }
nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--navy); font-weight: 700; padding: 8px 14px; border-radius: 99px; }
nav a:hover { background: var(--blue-l); color: var(--blue-d); }
nav a.btn { color: #fff; }
nav a.btn:hover { background: var(--pink); color: #fff; }

main.wrap { padding-top: 28px; padding-bottom: 56px; min-height: 70vh; }
.site-footer { background: var(--navy); color: #cfd6f5; padding: 0 0 26px; position: relative; margin-top: 60px; }
.site-footer .wave { display: block; width: 100%; height: 50px; margin-top: -49px; }
.site-footer .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 14px; }
.site-footer img { height: 46px; background: #fff; border-radius: 14px; padding: 6px 10px; }

h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 .4em; color: var(--navy); }
h2 { font-size: 1.45rem; margin: 1.8em 0 .7em; color: var(--navy); display: flex; align-items: center; gap: 10px; }
h2::before { content: ""; width: 14px; height: 14px; border-radius: 50% 50% 50% 0; background: var(--pink); transform: rotate(-45deg); flex: none; }
h2:nth-of-type(3n+2)::before { background: var(--orange); }
h2:nth-of-type(3n)::before { background: var(--blue); }

/* Portada con formas */
.hero { position: relative; overflow: hidden; border-radius: 36px 36px 120px 36px; padding: 54px 40px 58px; margin-bottom: 14px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-d) 100%); color: #fff; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: 2.6rem; max-width: 620px; }
.hero p { max-width: 540px; font-size: 1.1rem; opacity: .96; }
.hero .blob { position: absolute; border-radius: 50%; z-index: 0; }
.hero .b1 { width: 260px; height: 260px; background: var(--pink); right: -70px; top: -60px; opacity: .95; }
.hero .b2 { width: 170px; height: 170px; background: var(--orange); right: 130px; bottom: -70px; opacity: .9; }
.hero .b3 { width: 70px; height: 70px; background: #fff; right: 60px; bottom: 60px; opacity: .25; }

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.card { background: #fff; border-radius: var(--r); padding: 22px; border: 2px solid var(--line); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.grid .card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 10px 24px rgba(35, 44, 99, .12); }
.card::after { content: ""; position: absolute; right: -26px; top: -26px; width: 80px; height: 80px; border-radius: 50%; background: var(--blue-l); }
.grid .card:nth-child(3n+2)::after, .stats .card:nth-child(3n+2)::after { background: var(--pink-l); }
.grid .card:nth-child(3n)::after, .stats .card:nth-child(3n)::after { background: var(--orange-l); }
.card > * { position: relative; z-index: 1; }
.card h3 { margin: 6px 0; font-size: 1.15rem; }
.card h3 a { color: var(--navy); }
.muted { color: var(--mut); font-size: .92rem; }
.tag { display: inline-block; font-size: .76rem; padding: 3px 11px; border-radius: 99px; background: var(--blue-l); color: var(--blue-d); font-weight: 700; }
.tag.pendiente { background: var(--orange-l); color: #a8650f; }
.tag.confirmada { background: #dcf7e4; color: #17703a; }
.tag.lista_espera { background: #ece8ff; color: #4b3fb0; }
.tag.cancelada { background: var(--pink-l); color: #b3204a; }

/* Botones y formularios */
.btn, button.btn { display: inline-block; background: var(--pink); color: #fff; border: 0; border-radius: 99px; padding: 11px 24px; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 #c43556; transition: transform .1s, box-shadow .1s; }
.btn:hover { color: #fff; transform: translateY(2px); box-shadow: 0 2px 0 #c43556; }
.btn.small { padding: 7px 16px; font-size: .92rem; box-shadow: 0 3px 0 #c43556; }
.btn.ghost { background: #fff; color: var(--navy); box-shadow: 0 4px 0 var(--orange); }
.btn.ghost:hover { color: var(--pink); box-shadow: 0 2px 0 var(--orange); }
button.link { background: none; border: 0; color: var(--blue-d); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
button.link:hover { color: var(--pink); }
form.inline { display: inline; }
label { display: block; font-weight: 700; margin: 16px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
    width: 100%; padding: 11px 14px; border: 2px solid var(--line); border-radius: 14px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-l); }
textarea { min-height: 140px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; accent-color: var(--pink); }
body.admin .form-box { max-width: 880px; }
.form-box { max-width: 480px; background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 12px 26px 20px; }
.alert { padding: 13px 18px; border-radius: 16px; margin-bottom: 18px; font-weight: 600; }
.alert.ok { background: #dcf7e4; color: #17703a; }
.alert.err { background: var(--pink-l); color: #b3204a; }
.alert ul { margin: 0; padding-left: 18px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; }
th, td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: var(--blue-l); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-d); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
td.actions { white-space: nowrap; }
td.actions > * { margin-right: 12px; }
td.actions > *:last-child { margin-right: 0; }
.prose { white-space: pre-line; background: #fff; border-radius: var(--r); padding: 22px; border: 2px solid var(--line); }
.pager ul { display: flex; gap: 8px; list-style: none; padding: 0; margin-top: 22px; }

/* Panel */
body.admin { display: grid; grid-template-columns: 224px 1fr; transition: grid-template-columns .15s; min-height: 100vh; background: #f6f8fd; }
.sidebar { background: var(--navy); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 16px; border-radius: 0 36px 36px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar form { margin-top: auto; }
.sidebar .brand img { background: #fff; border-radius: 16px; padding: 8px 12px; height: 58px; width: auto; max-width: 100%; }
.sidebar nav { flex-direction: column; align-items: stretch; gap: 1px; }
.sidebar nav a, .sidebar button.link { display: flex; align-items: center; gap: 10px; font-size: .88rem; line-height: 1.25; }
.sidebar nav a { color: #d4dbf7; padding: 7px 12px; border-radius: 12px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar button.link { color: var(--orange); }
.content { padding: 32px; overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat b { display: block; font-size: 2.2rem; line-height: 1.1; color: var(--blue); }
.stats .stat:nth-child(3n+2) b { color: var(--pink); }
.stats .stat:nth-child(3n) b { color: var(--orange); }
@media (max-width: 760px) {
    body.admin { grid-template-columns: 1fr; }
    .sidebar { border-radius: 0 0 28px 28px; position: static; height: auto; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .hero { padding: 36px 24px 44px; border-radius: 28px 28px 80px 28px; }
    .hero h1 { font-size: 2rem; }
    .bar { height: auto; padding: 10px 22px; flex-wrap: wrap; }
}

/* Menú desplegable */
.dd { position: relative; }
.dd-m { display: none; position: absolute; top: 100%; left: 0; min-width: 190px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 8px; box-shadow: 0 12px 28px rgba(35, 44, 99, .15); z-index: 20; }
.dd:hover .dd-m, .dd:focus-within .dd-m { display: block; }
.dd-m a { display: block; }

/* Portada ampliada */
.hero { padding: 72px 44px 84px; border-radius: 40px 40px 140px 40px; }
.hero.has-photo { background: linear-gradient(135deg, rgba(82, 120, 185, .82), rgba(54, 85, 150, .70)), var(--photo) center 35%/cover; }
.hero .kicker { display: inline-block; background: rgba(255, 255, 255, .2); padding: 4px 14px; border-radius: 99px; font-weight: 700; font-size: .85rem; margin-bottom: 14px; }
.hero .kid { position: absolute; width: 150px; right: 70px; bottom: 40px; z-index: 1; transform: rotate(8deg); filter: drop-shadow(0 8px 0 rgba(35, 44, 99, .25)); }
.hero p { margin-bottom: 24px; }
.hero .row { gap: 14px; }

/* Cifras */
.stats-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 26px 0 6px; }
.stats-band div { background: #fff; border: 2px solid var(--line); border-radius: 28px 28px 28px 8px; padding: 16px 20px; text-align: center; }
.stats-band b { display: block; font-size: 2.4rem; line-height: 1.1; color: var(--blue); }
.stats-band div:nth-child(2) b { color: var(--pink); }
.stats-band div:nth-child(3) b { color: var(--orange); }
.stats-band span { color: var(--mut); font-weight: 700; }

/* Ventajas */
.perks .ico { display: grid; place-items: center; width: 56px; height: 56px; font-size: 1.7rem; border-radius: 50% 50% 50% 12px; background: var(--blue-l); margin-bottom: 8px; }
.perks .card:nth-child(3n+2) .ico { background: var(--pink-l); border-radius: 50% 12px 50% 50%; }
.perks .card:nth-child(3n) .ico { background: var(--orange-l); border-radius: 12px 50% 50% 50%; }
.perks .card::after { display: none; }

/* Tarjetas de evento con portada de color */
.card.event { padding: 0 0 18px; }
.card.event::after { display: none; }
.card.event h3, .card.event p { padding: 0 20px; }
.card.event .cover { height: 130px; display: flex; align-items: flex-end; padding: 12px 16px; margin-bottom: 8px; position: relative; overflow: hidden;
    background: var(--blue); border-radius: 0 0 60px 0; }
.card.event .cover::before { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .25); right: -30px; top: -40px; }
.card.event .cover.t-extraescolar { background: var(--pink); }
.card.event .cover.t-evento { background: var(--orange); }
.card.event .cover span { position: relative; background: #fff; color: var(--navy); font-weight: 700; font-size: .78rem; padding: 3px 12px; border-radius: 99px; }
@media (max-width: 760px) { .hero .kid { display: none; } .hero { padding: 44px 24px 56px; } }

/* Formulario en cuadrícula (panel) */
body.admin .form-box.form-grid { max-width: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .contents { display: contents; }
.form-grid .check-cell { grid-column: 1 / -1; }
.form-grid .check-cell .check { margin: 0; }
@media (max-width: 1100px) { body.admin .form-box.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { body.admin .form-box.form-grid { grid-template-columns: 1fr; } }

/* Editor de texto enriquecido */
.editor { border: 2px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-l); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--blue-l); border-bottom: 2px solid var(--line); }
.editor-bar button { font: inherit; font-size: .85rem; padding: 5px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.editor-bar button:hover { border-color: var(--blue); color: var(--blue-d); }
.editor .editor-area { border: 0; border-radius: 0; min-height: 160px; outline: 0; }
.rich { white-space: normal; }
.rich p { margin: 0 0 .7em; }
.rich ul, .rich ol { margin: 0 0 .7em; padding-left: 1.4em; }
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }

/* Fotos de actividades */
.card.event .cover { background-size: cover; background-position: center; }
.card.event .cover[style]::before { display: none; }
.card-photo { display: block; width: calc(100% + 44px); max-width: none; height: 150px; object-fit: cover; margin: -22px -22px 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0 0 20px; }
.gallery img { display: block; width: 100%; height: 160px; object-fit: cover; border-radius: 16px; border: 2px solid var(--line); }
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.thumb { margin: 0; font-weight: 600; font-size: .85rem; }
.thumb img { display: block; width: 130px; height: 90px; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); margin-bottom: 4px; }
.form-grid input[type=file] { width: 100%; padding: 10px; border: 2px dashed var(--line); border-radius: 14px; background: #fff; font: inherit; }

/* Filas de hijos/as (nombre + curso) */
.child-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.child-row input { flex: 2 1 0; min-width: 0; }
.child-row select { flex: 1 1 0; min-width: 0; }
.child-remove { flex: none; width: 38px; height: 38px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--pink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.child-remove:hover { border-color: var(--pink); }

/* Filas de hijos/as (nombre + curso) */
.child-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.child-row input { flex: 2 1 0; min-width: 0; }
.child-row select { flex: 1 1 0; min-width: 0; }
.child-remove { flex: none; width: 38px; height: 38px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--pink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.child-remove:hover { border-color: var(--pink); }

.prose.contact { white-space: normal; }
.prose.contact p { margin: 0 0 1.1em; }
.prose.contact p:last-child { margin-bottom: 0; }

/* Formulario de inscripción ancho y horas como botones */
.form-box.wide { max-width: 960px; }
.slot-day { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.slot-day legend { padding: 0; margin-bottom: 10px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { position: relative; margin: 0; font-weight: 700; }
.slot input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.slot span { display: block; min-width: 76px; text-align: center; padding: 9px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; transition: background .12s, border-color .12s; }
.slot:hover span { border-color: var(--blue); }
.slot input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.slot input:focus-visible + span { box-shadow: 0 0 0 4px var(--blue-l); }
.slot.taken { opacity: .4; }
.slot.taken input { cursor: not-allowed; }

/* Pagos */
.pay-amount { font-size: 2.2rem; font-weight: 800; color: var(--blue-d); margin: 0 0 14px; }
.pay-methods { border: 0; padding: 0; margin: 0 0 8px; }
.pay-methods legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.pay-method { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.pay-method input { width: auto; accent-color: var(--pink); }
.pay-method:has(input:checked) { border-color: var(--blue); background: var(--blue-l); }
.pay-data { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
.pay-data dt { font-weight: 700; }
.pay-data dd { margin: 0; word-break: break-all; }

/* Acciones con aspecto de botón (panel y web pública, dentro del contenido) */
main button.link,
main a.link-btn,
main td.actions > a {
    display: inline-block; margin: 2px 4px 2px 0; padding: 3px 11px; border: 2px solid var(--blue); border-radius: 99px;
    background: #fff; color: var(--blue-d); font: inherit; font-size: .78rem; font-weight: 700; line-height: 1.3; cursor: pointer; white-space: nowrap;
    transition: background .12s, color .12s, border-color .12s;
}
main button.link:hover,
main a.link-btn:hover,
main td.actions > a:hover { background: var(--blue); color: #fff; }
main button.link.danger { border-color: var(--pink); color: var(--pink); }
main button.link.danger:hover { background: var(--pink); color: #fff; }
main td.actions form.inline { display: inline-block; }
/* En una celda, las acciones de una misma fila van juntas */
main td .inline { white-space: nowrap; }

/* Botones de una misma acción siempre en la misma línea (la columna se ensancha si hace falta) */
.pay-actions { display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 4px; white-space: nowrap; }
.pay-actions form { display: block; margin: 0; }
main td.actions { white-space: nowrap; }

/* Ficha de socio */
.member-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-top: 16px; }
.member-card { background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 6px 24px 22px; }
.member-card h2 { margin-top: 18px; }
.member-card .pay-data { grid-template-columns: max-content 1fr; align-items: center; }
.member-card table { box-shadow: none; }
.member-card .child-row { margin-bottom: 0; }

/* Tienda */
.shop-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.shop-cats a { padding: 6px 16px; border: 2px solid var(--line); border-radius: 99px; background: #fff; font-weight: 700; font-size: .9rem; }
.shop-cats a:hover, .shop-cats a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.card.product { padding: 0 0 16px; }
.card.product::after { display: none; }
.card.product h3, .card.product p, .card.product .tag { margin-left: 20px; margin-right: 20px; }
.product-photo { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: var(--blue-l); margin-bottom: 10px; overflow: hidden; font-size: 3rem; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-steps { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 14px 0 20px; }
.order-steps li { padding: 6px 16px; border: 2px solid var(--line); border-radius: 99px; background: #fff; font-size: .88rem; font-weight: 700; color: var(--mut); }
.order-steps li.done { border-color: var(--blue); color: var(--blue-d); }
.order-steps li.now { background: var(--blue); border-color: var(--blue); color: #fff; }
.gallery.square { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery.square img { height: auto; aspect-ratio: 1 / 1; }

/* Insignias de pendientes en el menú del panel */
.sidebar nav .badge { display: inline-block; min-width: 22px; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--pink); color: #fff; font-size: .74rem; font-weight: 800; line-height: 1.4; text-align: center; vertical-align: 1px; }

/* Chat con el AMPA */
.chat { background: #fff; border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; max-width: 760px; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.chat-layout .chat { max-width: none; }
.chat-side { padding-bottom: 8px; }
.chat-side h3 { margin: 16px 0 8px; font-size: 1rem; }
@media (max-width: 1100px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-log { height: 440px; overflow-y: auto; padding: 18px 16px; background: #f6f8fd; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { margin: auto; text-align: center; }
.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.bubble { max-width: min(82%, 520px); padding: 9px 14px 6px; border-radius: 18px; background: #fff; border: 2px solid var(--line); word-wrap: break-word; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--blue); border-color: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.theirs .bubble { border-bottom-left-radius: 6px; }
.bubble .who { font-size: .74rem; font-weight: 800; color: var(--pink); margin-bottom: 2px; }
.bubble .time { font-size: .7rem; opacity: .65; text-align: right; margin-top: 3px; }
.bubble .attach { display: flex; align-items: center; gap: 8px; margin: 6px 0; padding: 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, .6); color: var(--ink); font-size: .85rem; font-weight: 700; }
.bubble .attach img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.paycard { margin: 8px 0 4px; padding: 12px 14px; border-radius: 14px; background: #fff; color: var(--ink); border: 2px solid var(--orange); }
.paycard.state-pagado { border-color: #3aa86b; }
.paycard.state-cancelado { border-color: var(--line); opacity: .75; }
.paycard-head { font-size: .78rem; font-weight: 800; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; }
.paycard-label { font-weight: 700; margin-top: 4px; }
.paycard-amount { font-size: 1.5rem; font-weight: 800; color: var(--blue-d); margin: 2px 0 8px; }
.paycard-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.paycard-state { font-size: .88rem; font-weight: 700; color: var(--mut); }
.paycard-state.ok { color: #1f7a48; }
.paycard-state.wait { color: #a45a00; }
.chat-form { padding: 10px 12px 12px; border-top: 2px solid var(--line); background: #fff; }
.chat-form textarea { min-height: 0; height: 64px; resize: vertical; }
.chat-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.chat-attach { margin: 0; font-size: .85rem; font-weight: 700; cursor: pointer; color: var(--blue-d); max-width: 14rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-error { flex: 1; color: var(--pink); font-size: .85rem; font-weight: 700; }
.nav-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: .72rem; font-weight: 800; line-height: 1.5; text-align: center; vertical-align: 1px; }
.badge-inline { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 99px; background: var(--pink); color: #fff; font-size: .72rem; font-weight: 800; }
tr.unread td { background: var(--pink-l); }

/* Marcas de lectura */
.ticks { margin-left: 6px; font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.msg.mine .bubble .ticks { color: rgba(255, 255, 255, .8); }
.msg.mine .bubble .ticks.read { color: #bff3d4; }
td .ticks { color: var(--mut); }
td .ticks.read { color: #1f7a48; }

/* Elegir cómo inscribirse (por alumno/a o toda la familia) */
.reg-mode { border: 0; padding: 0; margin: 0 0 14px; }
.reg-mode legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

/* Orden de los productos de la tienda */
.order-cell { width: 64px; white-space: nowrap; }
.drag-handle { display: inline-block; cursor: grab; font-size: 1.3rem; line-height: 1; color: var(--mut); padding: 4px 6px; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.order-arrows { display: inline-flex; flex-direction: column; margin: 0; vertical-align: middle; }
.order-arrows button { border: 0; background: none; padding: 0 4px; font-size: .62rem; line-height: 1.2; color: var(--blue-d); cursor: pointer; }
.order-arrows button:hover:not(:disabled) { color: var(--pink); }
.order-arrows button:disabled { color: var(--line); cursor: default; }
tr.dragging { opacity: .45; background: var(--blue-l); }

/* Imprimir listados del panel (p. ej. reservas para el día de entrega) */
@media print {
    body.admin { display: block; background: #fff; }
    body.admin .sidebar, .no-print, .alert { display: none !important; }
    body.admin .content { padding: 0; }
    table { box-shadow: none; border: 1px solid #999; }
    .stats .card { border: 1px solid #999; }
}

/* Fotos de producto: se ven enteras (ajustadas por el lado más largo) con 5 px de margen blanco */
.product-photo { background: #fff; padding: 5px; box-sizing: border-box; }
.product-photo img { object-fit: contain; }
.gallery.square img { object-fit: contain; background: #fff; padding: 5px; box-sizing: border-box; }
.gallery.square a { display: block; }

/* Formularios públicos a dos columnas (registro) */
.form-box.form-2col { max-width: 760px; }
.form-box.form-2col h1 { margin-bottom: 4px; }
.form-2col .cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; align-items: start; }
.form-2col .cols-2 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-2col .cols-2 { grid-template-columns: 1fr; } }

/* Hijos/as en «Mi cuenta»: filas alineadas con los botones a la derecha */
.children-list { background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 4px 16px; margin-bottom: 14px; }
.child-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; margin: 0; }
.children-list .child-line + .child-line { border-top: 1px solid var(--line); }
.child-line input[type=text], .child-line input[type=email] { flex: 2 1 0; min-width: 0; }
.child-line select { flex: 1 1 0; min-width: 0; }
.child-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.child-actions .link, .child-actions .btn { margin: 0; }
.child-line.readonly { justify-content: space-between; }
.child-line.add-line { margin-top: 14px; padding: 0; }
.confirm-children { margin-top: 18px; }
@media (max-width: 640px) {
    .child-line { flex-wrap: wrap; }
    .child-line input[type=text], .child-line input[type=email], .child-line select { flex: 1 1 100%; }
    .child-actions { width: 100%; justify-content: flex-end; }
}

/* El atributo hidden debe ganar a los estilos de display (p. ej. la insignia de Contacto cuando no hay mensajes) */
.nav-badge[hidden], .badge-inline[hidden], [hidden] { display: none !important; }

/* Pedido / reserva: separación entre la tabla y los avisos y botones de debajo */
.order-after { margin-top: 22px; }
.order-after > * { margin-top: 0; margin-bottom: 0; }
.order-after > * + * { margin-top: 18px; }
.order-after .alert { margin: 0; }

/* Carnet de socio/a virtual */
.vcard { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; max-width: 560px; aspect-ratio: 1.586; padding: 22px 26px; border-radius: 22px; color: #fff;
    background: linear-gradient(135deg, #232c63 0%, #3d5f9a 58%, #5278b9 100%); box-shadow: 0 14px 30px rgba(35, 44, 99, .28); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.vcard::before { content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(236, 79, 110, .55); }
.vcard::after { content: ""; position: absolute; right: 70px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: rgba(244, 162, 97, .5); }
.vcard > * { position: relative; z-index: 1; }
.vcard-top { display: flex; align-items: center; justify-content: space-between; }
.vcard-top img { height: 46px; width: auto; background: #fff; border-radius: 12px; padding: 5px 9px; }
.vcard-top span { font-weight: 800; letter-spacing: .12em; font-size: .82rem; opacity: .92; margin-right: 38px; }
.vcard-body { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.vcard-name { font-size: 1.45rem; font-weight: 800; line-height: 1.15; margin: 2px 0 14px; }
.vcard-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.vcard-row { display: flex; gap: 30px; }
.vcard-row b { font-size: 1.2rem; letter-spacing: .06em; }
.vcard-qr { flex: none; background: #fff; padding: 8px; border-radius: 14px; line-height: 0; }
.vcard-foot { font-size: .7rem; opacity: .82; }
@media (max-width: 560px) {
    .vcard { aspect-ratio: auto; }
    .vcard-body { flex-direction: column-reverse; align-items: flex-start; }
    .vcard-top span { margin-right: 0; font-size: .7rem; }
}

/* Verificación del carnet (la ve el comercio al escanear el QR) */
.verify { max-width: 520px; padding: 28px; border-radius: var(--r); text-align: center; border: 3px solid; background: #fff; }
.verify h2 { margin: 6px 0; }
.verify-icon { width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 800; color: #fff; }
.verify-ok { border-color: #3aa86b; }
.verify-ok .verify-icon { background: #3aa86b; }
.verify-bad { border-color: var(--pink); }
.verify-bad .verify-icon { background: var(--pink); }
.verify-name { font-size: 1.4rem; font-weight: 800; color: var(--blue-d); margin: 4px 0; }

/* Comercios con descuento */
.card.partner .partner-logo { display: block; max-height: 60px; max-width: 170px; object-fit: contain; margin: 0 0 10px; }
.partner-discount { font-weight: 800; color: var(--pink); font-size: 1.05rem; margin: 4px 0 8px; }
.partner-discount.locked { color: var(--mut); font-weight: 700; font-size: .95rem; }
.partner-contact { font-size: .9rem; margin-bottom: 0; }
.contact-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
.contact-layout .chat { max-width: none; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }

/* Menú lateral del panel: iconos + texto, o solo iconos */
.sidebar .ico { width: 19px; height: 19px; flex: none; }
.sidebar nav a .lbl, .sidebar button.link .lbl { flex: 1; min-width: 0; }
.sidebar nav .badge { margin-left: auto; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar .brand { min-width: 0; }
.sidebar .nav-toggle { flex: none; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #d4dbf7; cursor: pointer; }
.sidebar .nav-toggle:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.sidebar button.link { padding: 7px 12px; text-align: left; width: 100%; }
body.admin.nav-mini { grid-template-columns: 68px 1fr; }
.nav-mini .sidebar { padding: 14px 8px; border-radius: 0 24px 24px 0; }
.nav-mini .sidebar-top { flex-direction: column; }
.nav-mini .sidebar .brand { display: block; width: 100%; }
.nav-mini .sidebar .brand img { display: block; width: 100%; height: auto; max-height: 44px; object-fit: contain; padding: 4px; border-radius: 12px; }
.nav-mini .sidebar .lbl { display: none; }
.nav-mini .sidebar nav a, .nav-mini .sidebar button.link { justify-content: center; padding: 9px 0; position: relative; }
.nav-mini .sidebar nav .badge { position: absolute; top: 1px; right: 4px; min-width: 16px; margin: 0; padding: 0 4px; font-size: .64rem; }
@media (max-width: 760px) {
    .sidebar .nav-toggle { display: none; }
    body.admin.nav-mini { grid-template-columns: 1fr; }
    .nav-mini .sidebar .lbl { display: inline; }
    .sidebar nav a { padding: 7px 10px; }
}
.sidebar nav .nav-sep { border: 0; border-top: 1px solid rgba(255, 255, 255, .14); margin: 7px 6px; }
@media (max-width: 760px) { .sidebar nav .nav-sep { display: none; } }

/* Textos legales, pie y aviso de cookies */
.legal h2 { margin-top: 1.6em; }
.legal table { margin: 12px 0; }
.legal ul { padding-left: 1.2em; }
.site-footer .legal-links { margin-left: 18px; font-size: .88rem; }
.site-footer .legal-links a { color: inherit; text-decoration: underline; }
.cookie-note { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 760px; margin: 0 auto; display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 18px; background: #fff; border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(35, 44, 99, .2); font-size: .9rem; }
.cookie-note p { margin: 0; }
.cookie-note[hidden] { display: none !important; }
@media (max-width: 600px) { .cookie-note { flex-direction: column; align-items: stretch; } }
@media print { .cookie-note { display: none !important; } }
.danger-zone { max-width: 560px; margin-top: 10px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: #b3261e; }
.btn.danger { background: #b3261e; border-color: #b3261e; }

.maint-bar { position: sticky; top: 0; z-index: 70; padding: 7px 14px; background: #f5a54a; color: #3b2a07; text-align: center; font-size: .88rem; font-weight: 700; }
.maint-bar a { color: inherit; text-decoration: underline; }
body.admin .maint-bar { grid-column: 1 / -1; }
@media print { .maint-bar { display: none; } }
