/* =============================================
   GESTFÚTBOL — Estilos principales v2
   Mobile-first, profesional
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
    --ink:      #0d1117;
    --ink2:     #3a4250;
    --ink3:     #7c8899;
    --rule:     #e4e8ef;
    --surface:  #f7f8fa;
    --white:    #ffffff;
    --accent:   #1e6b3c;
    --accent2:  #27924f;
    --accentL:  #e8f5ee;
    --danger:   #c0392b;
    --dangerL:  #fdf0ee;
    --warn:     #b7590a;
    --warnL:    #fef5ec;
    --info:     #1a5fa8;
    --infoL:    #edf4ff;
    --shadow:   0 1px 3px rgba(13,17,23,.07), 0 4px 16px rgba(13,17,23,.06);
    --shadow2:  0 2px 8px rgba(13,17,23,.10), 0 12px 40px rgba(13,17,23,.10);
    --r:        12px;
    --rsm:      8px;
    --rlg:      18px;
    --t:        .15s ease;
}

/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    background: var(--surface);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Status bar (móvil PWA) ────────────────── */
.status-bar {
    background: var(--ink);
    color: rgba(255,255,255,.6);
    height: 0;          /* oculto en web normal */
    display: none;
}

/* ── Top nav ────────────────────────────────── */
.topnav {
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    padding: .85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-family: 'DM Serif Display', serif;
    font-size: 1.15rem;
    color: var(--ink);
    text-decoration: none !important;
}
.nav-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.nav-right { display: flex; align-items: center; gap: .65rem; }
.nav-user {
    font-size: .75rem; font-weight: 500; color: var(--ink2);
    display: flex; align-items: center; gap: .35rem;
}
.avatar-xs {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700; flex-shrink: 0;
}
.btn-exit {
    background: var(--surface);
    border: 1px solid var(--rule);
    color: var(--ink3);
    padding: .28rem .7rem;
    border-radius: 100px;
    font-size: .72rem; font-weight: 500;
    font-family: inherit; cursor: pointer;
    transition: all var(--t);
}
.btn-exit:hover { background: var(--rule); color: var(--ink); }

/* ── Segment nav ────────────────────────────── */
.seg-nav {
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 57px;
    z-index: 99;
}
.seg-nav::-webkit-scrollbar { display: none; }
.seg-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ink3);
    padding: .7rem 1rem;
    font-size: .78rem; font-weight: 500;
    white-space: nowrap;
    display: flex; align-items: center; gap: .35rem;
    font-family: inherit; cursor: pointer;
    transition: all var(--t);
    text-decoration: none;
}
.seg-btn.on, .seg-btn:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.seg-btn.on { font-weight: 600; }

/* ── Page content ───────────────────────────── */
.content { padding: 1.1rem; max-width: 680px; margin: 0 auto; }
.page-heading {
    font-size: 1.25rem; font-weight: 700; color: var(--ink);
    margin-bottom: .2rem;
}
.page-sub { font-size: .82rem; color: var(--ink3); margin-bottom: 1.1rem; }

/* ── Login page ─────────────────────────────── */
.login-page {
    background: var(--ink);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    position: relative; overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; top: -100px; right: -100px;
    width: 350px; height: 350px; border-radius: 50%;
    background: radial-gradient(circle, rgba(30,107,60,.28) 0%, transparent 70%);
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute; bottom: -80px; left: -80px;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(30,107,60,.15) 0%, transparent 70%);
    pointer-events: none;
}
.login-box {
    width: 100%; max-width: 380px;
    position: relative; z-index: 1;
}
.login-eyebrow {
    font-size: .7rem; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent2); margin-bottom: .6rem;
}
.login-title {
    font-family: 'DM Serif Display', serif;
    font-size: 2.2rem; color: #fff;
    line-height: 1.1; letter-spacing: -.5px;
    margin-bottom: 2rem;
}
.login-title em { font-style: italic; color: rgba(255,255,255,.38); }

.f-group { margin-bottom: 1rem; }
.f-label {
    display: block;
    font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255,255,255,.38); margin-bottom: .45rem;
}
.f-label.dark { color: var(--ink3); }
.f-ctrl {
    width: 100%;
    border-radius: var(--rsm);
    padding: .7rem 1rem;
    font-family: inherit; font-size: .9rem;
    outline: none;
    transition: border-color var(--t), box-shadow var(--t);
    -webkit-appearance: none; appearance: none;
}
.f-ctrl.light {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
}
.f-ctrl.light::placeholder { color: rgba(255,255,255,.22); }
.f-ctrl.light:focus {
    border-color: rgba(30,107,60,.7);
    background: rgba(255,255,255,.09);
}
.f-ctrl.dark {
    background: var(--white);
    border: 1.5px solid var(--rule);
    color: var(--ink);
}
.f-ctrl.dark:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(30,107,60,.1);
}
select.f-ctrl.dark {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8d' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center;
    padding-right: 2.2rem;
}
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
textarea.f-ctrl { resize: vertical; min-height: 72px; }

.btn-login {
    width: 100%;
    background: var(--accent); color: #fff;
    padding: .85rem; border-radius: var(--rsm);
    font-family: inherit; font-size: .9rem; font-weight: 600;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    transition: background var(--t), transform .1s;
    margin-top: .25rem;
}
.btn-login:hover { background: var(--accent2); }
.btn-login:active { transform: scale(.98); }
.login-hint {
    font-size: .72rem; color: rgba(255,255,255,.22);
    text-align: center; margin-top: 1.25rem;
}

/* ── Stat grid ──────────────────────────────── */
.stat-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: .65rem; margin-bottom: 1rem;
}
.stat-tile {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--rlg);
    padding: .9rem 1rem;
}
.stat-n {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem; color: var(--ink); line-height: 1;
}
.stat-n.accent { color: var(--accent); }
.stat-l {
    font-size: .7rem; font-weight: 500; color: var(--ink3);
    margin-top: .25rem; text-transform: uppercase; letter-spacing: .5px;
}

/* ── Section label ──────────────────────────── */
.sec {
    font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--ink3); margin: .9rem 0 .55rem;
}

/* ── List card ──────────────────────────────── */
.lcard {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--rlg);
    overflow: hidden;
    margin-bottom: .8rem;
}
.lcard-head {
    padding: .8rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--rule);
}
.lcard-title { font-size: .85rem; font-weight: 600; color: var(--ink); }
.lrow {
    display: flex; align-items: center;
    padding: .78rem 1rem;
    border-bottom: 1px solid var(--rule);
    gap: .75rem; transition: background var(--t);
}
.lrow:last-child { border-bottom: none; }
.lrow:hover { background: var(--surface); }
.lrow-info { flex: 1; min-width: 0; }
.lrow-name {
    font-size: .84rem; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lrow-sub { font-size: .72rem; color: var(--ink3); margin-top: .05rem; }
.lrow-actions { display: flex; gap: .35rem; flex-shrink: 0; }

/* ── Buttons ────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .48rem .9rem;
    border-radius: var(--rsm);
    font-family: inherit; font-size: .78rem; font-weight: 600;
    cursor: pointer; border: 1px solid transparent;
    transition: all var(--t); text-decoration: none !important;
    white-space: nowrap;
}
.btn-p  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-p:hover  { background: var(--accent2); border-color: var(--accent2); }
.btn-s  { background: var(--surface); color: var(--ink2); border-color: var(--rule); }
.btn-s:hover  { background: var(--rule); }
.btn-d  { background: var(--dangerL); color: var(--danger); border-color: #f5c6c2; }
.btn-d:hover  { background: var(--danger); color: #fff; }
.btn-w  { background: var(--warnL); color: var(--warn); border-color: #f6dbc4; }
.btn-w:hover  { background: var(--warn); color: #fff; }
.btn-xs { padding: .28rem .6rem; font-size: .72rem; border-radius: 6px; }
.btn-full { width: 100%; justify-content: center; padding: .75rem; font-size: .88rem; }

/* ── Badge ──────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: .15rem .55rem; border-radius: 100px;
    font-size: .66rem; font-weight: 700; letter-spacing: .3px;
}
.bg-g { background: var(--accentL); color: var(--accent); }
.bg-b { background: var(--infoL);   color: var(--info); }
.bg-r { background: var(--dangerL); color: var(--danger); }
.bg-y { background: var(--warnL);   color: var(--warn); }
.bg-x { background: var(--surface); color: var(--ink3); border: 1px solid var(--rule); }

/* ── Inline form inside lcard ───────────────── */
.form-body { padding: .85rem 1rem; }

/* ── Quick action grid ──────────────────────── */
.qa-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: .55rem; margin-bottom: 1rem;
}
.qa-btn {
    background: var(--white);
    border: 1px solid var(--rule); border-radius: var(--r);
    padding: .85rem .8rem;
    display: flex; align-items: center; gap: .6rem;
    font-family: inherit; font-size: .78rem; font-weight: 600;
    color: var(--ink2); cursor: pointer; transition: all var(--t);
    text-align: left;
}
.qa-btn:hover { background: var(--surface); border-color: var(--ink3); color: var(--ink); }
.qa-ico {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.ico-g { background: var(--accentL); }
.ico-b { background: var(--infoL); }
.ico-y { background: var(--warnL); }
.ico-r { background: var(--dangerL); }

/* ── Equipo hero card ───────────────────────── */
.eq-card {
    background: var(--ink);
    border-radius: var(--rlg);
    padding: 1.1rem 1.15rem;
    margin-bottom: .65rem;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; transition: transform var(--t), box-shadow var(--t);
    position: relative; overflow: hidden; text-decoration: none !important;
}
.eq-card::before {
    content: '';
    position: absolute; top: -30px; right: -30px;
    width: 100px; height: 100px; border-radius: 50%;
    background: rgba(30,107,60,.25); pointer-events: none;
}
.eq-card:hover { transform: translateY(-2px); box-shadow: var(--shadow2); }
.eq-name { font-weight: 600; font-size: .95rem; color: #fff; margin-bottom: .2rem; }
.eq-sub  { font-size: .73rem; color: rgba(255,255,255,.45); }
.eq-arrow { color: rgba(255,255,255,.3); font-size: 1.2rem; }
.eq-badge {
    background: rgba(30,107,60,.5); color: rgba(255,255,255,.8);
    font-size: .65rem; font-weight: 700;
    padding: .15rem .5rem; border-radius: 100px;
    margin-top: .35rem; display: inline-block;
}

/* ── Asistencia event banner ────────────────── */
.ev-banner {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--rlg);
    padding: 1rem 1.1rem;
    margin-bottom: .9rem;
}
.ev-banner-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: .75rem;
}
.ev-type {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--ink3); margin-bottom: .2rem;
}
.ev-name { font-size: 1rem; font-weight: 700; color: var(--ink); }
.ev-meta { font-size: .74rem; color: var(--ink3); margin-top: .2rem; }
.ev-counter { text-align: right; }
.ev-counter .big {
    font-family: 'DM Serif Display', serif;
    font-size: 1.8rem; color: var(--accent); line-height: 1;
}
.ev-counter .small { font-size: .68rem; color: var(--ink3); margin-top: .1rem; }
.prog-track { height: 5px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.prog-fill {
    height: 100%; background: var(--accent); border-radius: 3px;
    transition: width .35s ease;
}
.ev-tally {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: .5rem; margin-top: .75rem;
}
.tally { border-radius: 10px; padding: .5rem .4rem; text-align: center; }
.tally .tn { font-family: 'DM Serif Display', serif; font-size: 1.35rem; line-height: 1; }
.tally .tl { font-size: .63rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: .15rem; }
.tally.tp { background: var(--accentL); }
.tally.tp .tn, .tally.tp .tl { color: var(--accent); }
.tally.ta { background: var(--dangerL); }
.tally.ta .tn, .tally.ta .tl { color: var(--danger); }
.tally.tj { background: var(--warnL); }
.tally.tj .tn, .tally.tj .tl { color: var(--warn); }

/* ── Player row (asistencia) ────────────────── */
.p-row {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    padding: .72rem .85rem;
    display: flex; align-items: center; gap: .7rem;
    margin-bottom: .45rem;
    transition: box-shadow var(--t);
}
.p-row:hover { box-shadow: var(--shadow); }
.p-num {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; flex-shrink: 0;
    transition: background .2s, color .2s;
}
.s-p { background: var(--accentL); color: var(--accent); }
.s-j { background: var(--warnL);   color: var(--warn); }
.s-a { background: var(--surface); color: var(--ink3); border: 1px solid var(--rule); }
.p-info { flex: 1; min-width: 0; }
.p-name { font-size: .83rem; font-weight: 600; color: var(--ink); }
.p-pos  { font-size: .7rem; color: var(--ink3); margin-top: .05rem; }
.p-btns { display: flex; gap: .3rem; flex-shrink: 0; }
.p-btn {
    width: 32px; height: 32px; border-radius: var(--rsm);
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    border: 1.5px solid var(--rule);
    background: var(--surface);
    cursor: pointer;
    transition: all .12s;
}
.p-btn:hover { transform: scale(1.08); }
.p-btn.ap { border-color: var(--accent); background: var(--accentL); }
.p-btn.aj { border-color: var(--warn);   background: var(--warnL); }
.p-btn.aa { border-color: var(--danger);  background: var(--dangerL); }

/* ── Dorsal avatar (listas admin) ───────────── */
.dorsal {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--accentL); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; flex-shrink: 0;
}

/* ── Alerts ─────────────────────────────────── */
.alert {
    display: flex; align-items: flex-start; gap: .55rem;
    padding: .75rem .9rem; border-radius: var(--rsm);
    font-size: .8rem; margin-bottom: .75rem;
}
.al-g { background: var(--accentL); color: var(--accent); border: 1px solid #b8dfc8; }
.al-r { background: var(--dangerL); color: var(--danger); border: 1px solid #f5c6c2; }
.al-b { background: var(--infoL);   color: var(--info);   border: 1px solid #bcd5f5; }

/* ── Confirm delete ─────────────────────────── */
.confirm-zone {
    display: none; background: var(--dangerL);
    border: 1px solid #f5c6c2; border-radius: var(--rsm);
    padding: .75rem .9rem; margin-top: .5rem; font-size: .82rem;
}
.confirm-zone p { margin-bottom: .5rem; color: var(--danger); }

/* ── Empty state ────────────────────────────── */
.empty {
    text-align: center; padding: 3rem 1rem;
    color: var(--ink3); font-size: .84rem;
}
.empty-icon { font-size: 2.2rem; margin-bottom: .65rem; opacity: .4; }

/* ── Utilities ──────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-stack { display: flex; flex-direction: column; gap: .45rem; }
.text-muted { color: var(--ink3); }
.text-sm { font-size: .8rem; }
.fw-6 { font-weight: 600; }
.w-100 { width: 100%; }

/* ── Responsive ─────────────────────────────── */
@media (min-width: 600px) {
    .stat-row { grid-template-columns: repeat(4, 1fr); }
}
