/* ==================== Variables ==================== */
:root {
    --primary: #1a5f2a;
    --primary-dark: #144a21;
    --secondary: #f4a020;
    --bg-dark: #1a1a2e;
    --bg-sidebar: #16213e;
    --bg-card: #ffffff;
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --border: #e0e0e0;
    --danger: #dc3545;
    --success: #28a745;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ==================== Login ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-sidebar));
}

.login-box {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-box h2 {
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-weight: 500;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-box label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-box input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: var(--primary-dark);
}

.login-hint {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==================== Admin Panel ==================== */
.admin-panel {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-logo {
    padding: 1.5rem;
    font-size: 1.3rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo span {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--secondary);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-bar h1 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.user-info {
    color: var(--text-muted);
}

.content-section {
    display: none;
    padding: 2rem;
}

.content-section.active {
    display: block;
}

/* ==================== Dashboard ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--text-dark);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.recent-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.recent-section h2 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.recent-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ==================== Jugadores ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.jugadores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.jugador-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s;
}

.jugador-card:hover {
    transform: translateY(-5px);
}

.jugador-card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.jugador-numero {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    font-weight: bold;
    opacity: 0.5;
}

.jugador-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.jugador-card-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.jugador-card-header p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.jugador-card-body {
    padding: 1rem;
}

.jugador-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.jugador-stat {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.jugador-stat strong {
    display: block;
    font-size: 1.2rem;
    color: var(--primary);
}

.jugador-stat span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.jugador-card-actions {
    display: flex;
    gap: 0.5rem;
}

.jugador-card-actions button {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-edit {
    background: var(--secondary);
    color: white;
}

.btn-edit:hover {
    background: #e09000;
}

.btn-delete {
    background: #f8d7da;
    color: var(--danger);
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

.btn-view {
    background: #d4edda;
    color: var(--success);
}

.btn-view:hover {
    background: var(--success);
    color: white;
}

/* ==================== Formulario ==================== */
.jugador-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ==================== Buttons ==================== */
.btn-primary {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    padding: 0.8rem 1.5rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

/* ==================== Configuración ==================== */
.config-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.config-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.config-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.config-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.config-card.danger {
    border: 2px solid var(--danger);
}

.config-card input[type="file"] {
    width: 100%;
}

.coming-soon {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* ==================== Modal ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-dark);
}

/* ==================== Perfil Modal ==================== */
.perfil-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.perfil-header img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    margin-bottom: 1rem;
}

.perfil-header h2 {
    color: var(--text-dark);
}

.perfil-header .numero {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: bold;
}

.perfil-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.perfil-info-item {
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.perfil-info-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.perfil-info-item span {
    font-weight: 600;
    color: var(--text-dark);
}

.perfil-bio {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.perfil-bio h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .jugadores-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== Cobros ==================== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9f9f9;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 0.9rem;
}

.cobros-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cobro-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: var(--shadow);
}

.cobro-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
}

.cobro-info h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.cobro-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cobro-monto {
    text-align: right;
}

.cobro-monto .total {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
}

.cobro-monto .por-persona {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cobro-deudas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.deuda-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.deuda-mini.pendiente {
    background: #fff3cd;
}

.deuda-mini.validando {
    background: #cce5ff;
}

.deuda-mini.pagada {
    background: #d4edda;
}

.deuda-mini.rechazado {
    background: #f8d7da;
}

.deuda-mini .nombre {
    font-weight: 500;
}

.deuda-mini .monto {
    font-weight: bold;
}

.deuda-mini.pendiente .monto {
    color: #856404;
}

.deuda-mini.validando .monto {
    color: #004085;
}

.deuda-mini.pagada .monto {
    color: #155724;
    text-decoration: line-through;
}

.deuda-mini.rechazado .monto {
    color: #721c24;
}

.btn-pagar {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.btn-pagar:hover {
    background: #218838;
}

.cobro-actions {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.btn-sm.danger {
    background: var(--danger);
    color: white;
}
