/* =============================================
   PRODE DIGITAL — CSS Mobile-First
   ============================================= */

:root {
    --primary: #00b04f;
    --primary-dark: #008a3c;
    --primary-light: #e8f9f0;
    --secondary: #1a1a2e;
    --accent: #f5a623;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f59e0b;
    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow:    0 1px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
    --radius:    12px;
    --radius-sm: 8px;
    --transition: all 0.25s ease;
    --page-px: 16px;
}
@media (min-width: 768px) { :root { --page-px: 24px; } }

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}
/* Wrapper columna para mobile-nav + admin-layout en panel organizador/admin */
/* No necesario: body ya es flex-column, los bloques se apilan automáticamente */
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    background: var(--secondary);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--page-px);
    height: 58px;
    max-width: 1200px;
    margin: 0 auto;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--white);
}
.navbar-brand i { color: var(--primary); font-size: 1.35rem; }

.navbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.navbar-toggle:hover { background: rgba(255,255,255,0.1); }

/* Mobile menu (off-canvas) */
.navbar-menu {
    display: none;
    position: fixed;
    top: 58px; left: 0; right: 0; bottom: 0;
    background: var(--secondary);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
    overflow-y: auto;
    z-index: 998;
    list-style: none;
}
.navbar-menu.open { display: flex; }
.navbar-menu > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.navbar-menu > li > a:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-nav-login   { border: 1px solid rgba(255,255,255,0.3) !important; }
.btn-nav-register{ background: var(--primary) !important; color: white !important; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    margin-left: 4px;
}

/* Dropdown — inline en mobile */
.navbar-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 2px 0;
}
.navbar-dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    transition: var(--transition);
}
.dropdown-menu a:hover { background: rgba(255,255,255,0.08); color: white; }
.dropdown-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 0; }

/* Notificaciones mobile */
.notif-header { padding: 10px 16px; font-weight: 600; font-size: 0.8rem; color: rgba(255,255,255,0.4); border-bottom: 1px solid rgba(255,255,255,0.1); }
.notif-item { flex-direction: column !important; align-items: flex-start !important; gap: 2px !important; }
.notif-item strong { font-size: 0.85rem; color: rgba(255,255,255,0.9); }
.notif-item small  { font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.notif-time  { font-size: 0.72rem; color: rgba(255,255,255,0.35); }
.notif-empty { padding: 20px; text-align: center; color: rgba(255,255,255,0.4); font-size: 0.85rem; }
.avatar-xs { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* Desktop overrides */
@media (min-width: 768px) {
    .navbar-container { height: 64px; }
    .navbar-toggle { display: none; }
    .navbar-menu {
        display: flex !important;
        position: static;
        flex-direction: row;
        align-items: center;
        background: none;
        padding: 0;
        gap: 2px;
        overflow: visible;
    }
    .navbar-menu > li > a { font-size: 0.88rem; padding: 8px 12px; }
    .navbar-dropdown .dropdown-menu {
        display: none; /* controlado solo por JS via .dd-open */
    }
    .notif-menu { min-width: 300px; background: white; }
    .notif-header { color: var(--gray-500); border-bottom-color: var(--gray-200); }
    .notif-item strong { color: var(--gray-800); }
    .notif-item small  { color: var(--gray-600); }
    .notif-time  { color: var(--gray-400); }
    .notif-empty { color: var(--gray-500); }
}

/* =============================================
   LAYOUT BASE
   ============================================= */
.main-content { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--page-px); }

/* =============================================
   BOTONES
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn-primary  { background: var(--primary); color: white; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-secondary { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.5); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-outline  { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-danger   { background: var(--danger); color: white; }
.btn-warning  { background: var(--warning); color: white; }
.btn-sm  { padding: 8px 14px; font-size: 0.82rem; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* =============================================
   CARDS
   ============================================= */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.card-body { padding: 18px; }

/* =============================================
   HERO
   ============================================= */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #16213e 60%, #0f3460 100%);
    color: white;
    padding: 44px var(--page-px) 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(0,176,79,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.hero-content { position: relative; max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.65rem, 6vw, 3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 14px; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 0.98rem; color: rgba(255,255,255,0.72); margin-bottom: 28px; }
.hero-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.hero-stat { background: rgba(255,255,255,0.07); border-radius: var(--radius-sm); padding: 10px 18px; }
.hero-stat .number { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.hero-stat .label  { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* =============================================
   TORNEOS GRID
   ============================================= */
.torneos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px 0;
}
@media (min-width: 480px) { .torneos-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .torneos-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 36px 0; } }

.torneo-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}
.torneo-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.torneo-card-banner {
    background: linear-gradient(135deg, var(--secondary), #0f3460);
    height: 100px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
@media (min-width: 480px) { .torneo-card-banner { height: 120px; } }
.torneo-card-banner i { font-size: 2.5rem; color: var(--primary); }
.torneo-card-banner img { width: 60px; height: 60px; object-fit: contain; }
.torneo-badge {
    position: absolute; top: 10px; right: 10px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}
.badge-activo     { background: var(--primary); color: white; }
.badge-cerrado    { background: var(--warning); color: white; }
.badge-finalizado { background: var(--gray-500); color: white; }

.torneo-card-body { padding: 14px 16px; flex: 1; }
.torneo-card-body h3 { font-size: 0.95rem; margin-bottom: 5px; line-height: 1.3; }
.torneo-card-body p  { font-size: 0.78rem; color: var(--gray-500); margin-bottom: 10px; line-height: 1.4; }
.torneo-meta { display: flex; gap: 10px; font-size: 0.73rem; color: var(--gray-500); margin-bottom: 10px; flex-wrap: wrap; }
.torneo-meta i { color: var(--primary); }
.torneo-precio { font-size: 1.35rem; font-weight: 800; color: var(--primary); }
.torneo-precio.gratis { color: var(--success); }
.torneo-card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* =============================================
   PARTIDOS
   ============================================= */
.partidos-lista { display: flex; flex-direction: column; gap: 10px; }

.partido-card {
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (min-width: 580px) {
    .partido-card { flex-direction: row; align-items: center; }
}

.partido-fecha {
    font-size: 0.73rem;
    color: var(--gray-500);
    text-align: center;
    flex-shrink: 0;
    min-width: 55px;
}
.partido-fecha strong { display: block; color: var(--gray-700); }

.partido-equipos {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.equipo { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.equipo.visitante { flex-direction: row-reverse; text-align: right; }
.equipo-logo {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--gray-600);
    overflow: hidden;
    flex-shrink: 0;
}
.equipo-logo img { width: 100%; height: 100%; object-fit: cover; }
.equipo-nombre {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 768px) { .equipo-nombre { font-size: 0.88rem; } }
.partido-vs { color: var(--gray-400); font-weight: 700; font-size: 0.78rem; flex-shrink: 0; }

.partido-marcador {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    flex-shrink: 0;
}
.marcador-input {
    width: 44px; height: 44px;
    text-align: center;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 16px; /* evita zoom iOS */
    font-weight: 700;
    color: var(--gray-800);
    background: white;
    transition: var(--transition);
    -moz-appearance: textfield;
}
.marcador-input::-webkit-outer-spin-button,
.marcador-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.marcador-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,176,79,0.18); }
.marcador-input[readonly] { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }
.marcador-dash { color: var(--gray-400); font-weight: 700; }

.partido-resultado {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: var(--secondary);
    color: white;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 800;
    flex-shrink: 0;
}

.puntos-badge { font-size: 0.7rem; padding: 3px 8px; border-radius: 20px; font-weight: 700; white-space: nowrap; }
.puntos-exacto    { background: #fef3c7; color: #92400e; }
.puntos-resultado { background: #d1fae5; color: #065f46; }
.puntos-cero      { background: var(--gray-200); color: var(--gray-500); }

/* =============================================
   TABLA POSICIONES
   ============================================= */
.tabla-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.tabla-posiciones { width: 100%; border-collapse: collapse; background: white; min-width: 380px; }
.tabla-posiciones th {
    background: var(--secondary);
    color: white;
    padding: 11px 12px;
    text-align: left;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}
.tabla-posiciones td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); font-size: 0.84rem; }
.tabla-posiciones tr:last-child td { border-bottom: none; }
.tabla-posiciones tr:hover td { background: var(--gray-50); }
.posicion-num { font-weight: 800; font-size: 1rem; color: var(--gray-500); }
.pos-1 .posicion-num { color: #d97706; }
.pos-2 .posicion-num { color: #9ca3af; }
.pos-3 .posicion-num { color: #b45309; }
.pos-me td { background: rgba(0,176,79,0.05) !important; }
.user-cell { display: flex; align-items: center; gap: 8px; }
.avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.76rem; font-weight: 700; color: var(--gray-600);
    overflow: hidden; flex-shrink: 0;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 480px) {
    .tabla-posiciones th:nth-child(5),
    .tabla-posiciones td:nth-child(5),
    .tabla-posiciones th:nth-child(6),
    .tabla-posiciones td:nth-child(6) { display: none; }
}

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 0.87rem; font-weight: 600; color: var(--gray-700); }
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--gray-800);
    transition: var(--transition);
    background: white;
    -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,176,79,0.15); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 480px) { .form-row { grid-template-columns: 1fr 1fr; gap: 14px; } }
.form-hint { font-size: 0.77rem; color: var(--gray-500); margin-top: 4px; }

/* =============================================
   AUTH
   ============================================= */
.auth-page {
    min-height: calc(100vh - 58px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px var(--page-px);
    background: linear-gradient(135deg, var(--secondary) 0%, #16213e 100%);
}
.auth-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
@media (min-width: 480px) { .auth-card { padding: 36px 40px; } }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo i { font-size: 2.5rem; color: var(--primary); }
.auth-logo h2 { font-size: 1.35rem; margin-top: 8px; }
.auth-logo p  { color: var(--gray-500); font-size: 0.86rem; margin-top: 4px; }

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.86rem;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    line-height: 1.4;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* =============================================
   SECCIONES
   ============================================= */
.section { padding: 36px 0; }
@media (min-width: 768px) { .section { padding: 60px 0; } }
.section-header { text-align: center; margin-bottom: 28px; }
.section-header h2 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; margin-bottom: 8px; }
.section-header p  { color: var(--gray-600); font-size: 0.92rem; }

.page-header { background: var(--secondary); color: white; padding: 24px 0; margin-bottom: 24px; }
@media (min-width: 768px) { .page-header { padding: 36px 0; margin-bottom: 32px; } }
.page-header h1 { font-size: clamp(1.25rem, 4vw, 1.75rem); font-weight: 700; }
.page-header p  { color: rgba(255,255,255,0.65); margin-top: 5px; font-size: 0.88rem; }

/* =============================================
   TABS
   ============================================= */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 18px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    padding: 9px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.tab-btn.active, .tab-btn:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* =============================================
   STEPS
   ============================================= */
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; text-align: center; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 24px; } }
.step { padding: 10px; }
.step-icon {
    width: 56px; height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.4rem;
    color: var(--primary);
}
.step h3 { font-size: 0.9rem; margin-bottom: 5px; }
.step p  { font-size: 0.78rem; color: var(--gray-600); line-height: 1.4; }

/* =============================================
   PAGO
   ============================================= */
.pago-card { max-width: 480px; margin: 20px auto; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.pago-header { background: linear-gradient(135deg, var(--secondary), #0f3460); color: white; padding: 24px 20px; text-align: center; }
.pago-header h2 { font-size: 1.2rem; margin-bottom: 5px; }
.pago-precio { font-size: 2.4rem; font-weight: 800; color: var(--primary); }
.pago-body { padding: 20px; }
.pago-features { list-style: none; margin-bottom: 18px; }
.pago-features li { padding: 9px 0; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 9px; font-size: 0.86rem; }
.pago-features i { color: var(--primary); flex-shrink: 0; }

/* =============================================
   FOOTER
   ============================================= */
.footer { background: var(--secondary); color: rgba(255,255,255,0.72); padding: 40px 0 0; margin-top: auto; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 var(--page-px); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; } }
.footer-brand p { font-size: 0.8rem; color: rgba(255,255,255,0.42); margin-top: 10px; line-height: 1.6; }
.footer-logo { font-size: 1.2rem; font-weight: 800; color: white; display: flex; align-items: center; gap: 8px; }
.footer-logo i { color: var(--primary); }
.footer-social { display: flex; gap: 9px; margin-top: 14px; }
.footer-social a {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.82rem; transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); }
.footer-links h4 { color: white; font-size: 0.85rem; margin-bottom: 12px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a  { font-size: 0.8rem; color: rgba(255,255,255,0.48); transition: var(--transition); }
.footer-links a:hover { color: var(--primary); }
.footer-payments h4 { color: white; font-size: 0.85rem; margin-bottom: 12px; }
.mp-logo-footer { max-width: 100px; filter: brightness(0) invert(1) opacity(0.7); }
.footer-secure  { font-size: 0.76rem; color: rgba(255,255,255,0.38); margin-top: 10px; }
.footer-bottom  { border-top: 1px solid rgba(255,255,255,0.08); padding: 16px 0; text-align: center; font-size: 0.76rem; color: rgba(255,255,255,0.32); }

/* =============================================
   ADMIN / ORGANIZADOR — Layout
   ============================================= */

/* Label "· Organizador" en navbar — oculto en pantallas chicas */
.org-label {
    color: rgba(255,255,255,0.45);
    font-size: 0.75rem;
    font-weight: 400;
}
@media (max-width: 360px) { .org-label { display: none; } }

/* Mobile nav — FUERA del flex container, bloque independiente bajo el navbar */
.admin-mobile-nav {
    background: var(--secondary);
    padding: 8px var(--page-px);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Importante: no es hijo del admin-layout flex */
}
.admin-mobile-nav::-webkit-scrollbar { display: none; }
.admin-mobile-nav a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 13px;
    color: rgba(255,255,255,0.72);
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: rgba(255,255,255,0.07);
    flex-shrink: 0;
    text-decoration: none;
}
.admin-mobile-nav a.active { background: var(--primary); color: white; }
.admin-mobile-nav a:hover  { background: rgba(255,255,255,0.14); color: white; }
@media (min-width: 768px)  { .admin-mobile-nav { display: none; } }

/* Flex layout sidebar + contenido — solo toma el espacio restante */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 58px); /* se ajusta si hay mobile-nav */
    flex: 1;
}

.admin-sidebar {
    width: 220px;
    background: var(--secondary);
    padding: 14px 0;
    flex-shrink: 0;
    display: none; /* oculto en mobile, se muestra en desktop */
}
@media (min-width: 768px) { .admin-sidebar { display: block; } }

.admin-sidebar .sidebar-title {
    color: rgba(255,255,255,0.32);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 14px 16px 5px;
    text-transform: uppercase;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.68);
    font-size: 0.84rem;
    transition: var(--transition);
    text-decoration: none;
}
.admin-sidebar a:hover,
.admin-sidebar a.active { color: white; background: rgba(255,255,255,0.09); }
.admin-sidebar a i { width: 16px; color: var(--primary); flex-shrink: 0; }

.admin-content {
    flex: 1;
    padding: 16px var(--page-px);
    min-width: 0; /* evita overflow en flex */
    overflow-x: hidden;
}
@media (min-width: 768px) { .admin-content { padding: 24px 28px; } }

.admin-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.admin-card-header { padding: 14px 18px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-card-header h3 { font-size: 0.92rem; font-weight: 700; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: var(--gray-100); padding: 10px 13px; text-align: left; font-size: 0.76rem; color: var(--gray-600); font-weight: 600; border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
.admin-table td { padding: 10px 13px; border-bottom: 1px solid var(--gray-200); font-size: 0.84rem; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }

.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
@media (min-width: 768px) { .admin-stats { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.admin-stat-card { background: white; border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 13px; }
.admin-stat-card .icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.icon-green  { background: var(--primary-light); color: var(--primary); }
.icon-blue   { background: #dbeafe; color: #1d4ed8; }
.icon-yellow { background: #fef3c7; color: #92400e; }
.icon-purple { background: #ede9fe; color: #6d28d9; }
.admin-stat-card .value { font-size: 1.55rem; font-weight: 800; line-height: 1; }
.admin-stat-card .label { font-size: 0.73rem; color: var(--gray-500); margin-top: 2px; }
/* =============================================
   ADMIN RESPONSIVE — fixes mobile completo
   ============================================= */

/* Grids de formularios admin */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-smtp { display: grid; grid-template-columns: 1fr; gap: 14px; }

@media (min-width: 480px) {
    .grid-2    { grid-template-columns: 1fr 1fr; }
    .grid-smtp { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 640px) {
    .grid-3    { grid-template-columns: 1fr 80px 1fr; }
}
@media (min-width: 768px) {
    .grid-4    { grid-template-columns: 1fr 1fr 1fr 80px; align-items: end; }
    .grid-smtp { grid-template-columns: 2fr 2fr 1fr 80px; }
}

/* Admin tables — scroll en mobile */
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Columnas opcionales en tablas admin — ocultar en mobile */
@media (max-width: 600px) {
    /* pagos */
    .admin-table .col-hide-xs { display: none; }
}
@media (max-width: 768px) {
    .admin-table .col-hide-sm { display: none; }
}

/* Header de sección con botón */
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-section-header h2 { margin-bottom: 0; }

/* Filtros (torneo/etapa selects) */
.admin-filters {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.admin-filters label { font-weight: 600; font-size: 0.85rem; display: block; margin-bottom: 4px; }
.admin-filters select {
    display: block;
    padding: 10px 14px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    width: 100%;
}
@media (min-width: 480px) {
    .admin-filters > div { min-width: 180px; flex: 1; max-width: 280px; }
}

/* Acciones de etapa */
.admin-actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

/* Modal responsive */
#modal-resultado > div {
    width: 92%;
    max-width: 400px;
    padding: 24px 20px;
}
@media (min-width: 480px) {
    #modal-resultado > div { padding: 32px; }
}

/* Tabla resultados — ocultar columna fecha en mobile */
@media (max-width: 560px) {
    .admin-table .col-fecha { display: none; }
}

/* Tabla partidos admin — compactar en mobile */
@media (max-width: 640px) {
    .admin-table .col-orden  { display: none; }
    .admin-table .col-estado { display: none; }
}

/* Tabla torneos — ocultar puntos en mobile */
@media (max-width: 560px) {
    .admin-table .col-puntos { display: none; }
}

/* Tabla pagos / usuarios — ocultar columnas secundarias */
@media (max-width: 680px) {
    .admin-table .col-mp    { display: none; }
    .admin-table .col-email { display: none; }
}

/* Card body padding responsive */
.card-body { padding: 16px; }
@media (min-width: 480px) { .card-body { padding: 20px 24px; } }

/* Botones de acción en tabla — compactar */
.table-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* Torneo selector pills — wrap en mobile */
.torneo-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }

/* Premios layout */
.premios-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}
@media (min-width: 860px) {
    .premios-layout { grid-template-columns: 360px 1fr; }
}

/* SMTP grid en configuracion */
@media (max-width: 479px) {
    /* stack todo en mobile */
    [style*="grid-template-columns:2fr 2fr 1fr 80px"],
    [style*="grid-template-columns: 2fr 2fr 1fr 80px"] {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns:1fr 80px 1fr"],
    [style*="grid-template-columns: 1fr 80px 1fr"] {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns:1fr 1fr 1fr 80px"],
    [style*="grid-template-columns: 1fr 1fr 1fr 80px"] {
        grid-template-columns: 1fr 1fr !important;
    }
}