:root {
    --bg-color: #FAFAFA;
    --card-bg: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --primary-color: #000000; /* Dinámico luego */
    --hover-bg: #F3F4F6;
    
    --header-height: 60px;
    --nav-height: 65px;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-full: 9999px;
}

/* Modo oscuro */
body.dark-mode {
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --hover-bg: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* HEADER */
.header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
body.dark-mode .header { background: rgba(30, 41, 59, 0.7); }

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-select {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(20px + var(--nav-height)); /* Espacio para nav */
}

/* BOTTOM NAV (Móvil) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}
body.dark-mode .bottom-nav { background: rgba(30, 41, 59, 0.85); }

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: 0.2s ease;
}
.nav-item.active {
    color: var(--primary-color);
}
.nav-item:hover {
    background: var(--hover-bg);
}

/* COMPONENTES */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-main);
}

.input-group {
    margin-bottom: 15px;
}
.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-muted);
}
.input-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: 0.2s;
}
.input-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.btn-primary {
    width: 100%;
    background: var(--primary-color);
    color: #FFF;
    padding: 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: 0.2s transform;
}
.btn-primary:active {
    transform: scale(0.98);
}

/* LISTA (Atletas / Correos) */
.list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}
.list-item:last-child { border-bottom: none; }
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--hover-bg);
}
.list-info { flex: 1; }
.list-title { font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.list-subtitle { font-size: 0.8rem; color: var(--text-muted); }

/* ESCRITORIO Ajustes */
@media (min-width: 768px) {
    body { flex-direction: row; }
    .bottom-nav {
        position: static;
        width: 80px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 20px;
        gap: 20px;
        border-top: none;
        border-right: 1px solid var(--border-color);
    }
    .header { width: calc(100% - 80px); position: absolute; left: 80px; }
    .main-content {
        margin-left: 80px;
        margin-top: var(--header-height);
        padding-bottom: 20px;
    }
}
