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

:root {
    --primary-color: #e10600;
    --secondary-color: #1a1a1a;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1.1em;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #c50500;
}

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

.btn-secondary:hover {
    background-color: #333;
}

.btn-secondary:disabled,
.btn-secondary[disabled] {
    background-color: #ccc;
    color: #888;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary:disabled:hover,
.btn-secondary[disabled]:hover {
    background-color: #ccc;
}

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

.btn-warning:hover {
    background-color: #e0a800;
}

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

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

/* Navbar */
.navbar {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.navbar-brand h1 {
    font-size: 1.5em;
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Container */
.container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
}

.menu {
    list-style: none;
}

.menu li a {
    display: block;
    padding: 15px 25px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

.menu li a:hover,
.menu li a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Content */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: var(--secondary-color);
}

/* Dashboard */
/* Dashboard */
#dashboard {
    position: relative;
}

#dashboard::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: 0;
    background: 
        linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><defs><linearGradient id="g1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23e10600;stop-opacity:0.1"/><stop offset="100%" style="stop-color:%231a1a1a;stop-opacity:0.05"/></linearGradient></defs><circle cx="200" cy="150" r="80" fill="url(%23g1)"/><circle cx="950" cy="250" r="120" fill="url(%23g1)"/><circle cx="600" cy="500" r="100" fill="url(%23g1)"/><circle cx="300" cy="650" r="90" fill="url(%23g1)"/><circle cx="1000" cy="600" r="70" fill="url(%23g1)"/><path d="M100,300 Q400,200 700,350 T1100,400" stroke="%23e10600" stroke-width="3" fill="none" opacity="0.1"/><path d="M150,500 Q450,400 750,550 T1150,600" stroke="%231a1a1a" stroke-width="2" fill="none" opacity="0.08"/></svg>');
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    z-index: -1;
}

.dashboard-hero {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.dashboard-hero h1 {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.dashboard-subtitle {
    font-size: 1.2em;
    color: #666;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card-modern {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(225, 6, 0, 0.2);
}

.stat-icon {
    font-size: 3em;
    background: linear-gradient(135deg, var(--primary-color), #c10500);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

.season-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 6px;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1em;
}

.leader-info, .next-race-info {
    padding: 20px;
    background: linear-gradient(135deg, rgba(225, 6, 0, 0.05), rgba(225, 6, 0, 0.02));
    border-radius: 8px;
    text-align: center;
}

.leader-name {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.leader-points {
    font-size: 1.3em;
    color: #666;
}

.next-race-name {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.next-race-date {
    font-size: 1.1em;
    color: #666;
}

.loading-text {
    color: #999;
    font-style: italic;
}

.welcome-message {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-message h3 {
    color: var(--primary-color);
    font-size: 1.8em;
    margin-bottom: 15px;
}

.welcome-message p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 25px;
    line-height: 1.6;
}

.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    padding: 24px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #e10600;
}

.stat-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background-color: var(--secondary-color);
    color: white;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
}

table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background-color: #f9f9f9;
}

.status-active {
    color: var(--success-color);
    font-weight: bold;
}

.status-inactive {
    color: var(--danger-color);
    font-weight: bold;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons button {
    padding: 5px 10px;
    font-size: 12px;
}

/* Profile */
.profile-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.profile-info,
.profile-password {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.profile-info h3,
.profile-password h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.profile-info p {
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: 4px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    color: var(--secondary-color);
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions .btn {
    width: auto;
}

/* Error Messages */
.error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin: 10px 0;
    display: none;
}

.error-message.show {
    display: block;
}

/* Logs Controls */
.logs-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logs-controls select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Admin Only Elements */
.admin-only {
    display: none;
}

body.is-admin .admin-only {
    display: table-cell;
}

body.is-admin button.admin-only,
body.is-admin .section-header button.admin-only {
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .profile-container {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-user {
        flex-direction: column;
        gap: 10px;
    }
}

/* Rider Selection Checkboxes */
.rider-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    background-color: #fafafa;
}

.rider-checkbox-item {
    padding: 8px;
    margin: 5px 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.rider-checkbox-item:hover {
    background-color: #f0f0f0;
}

.rider-checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.rider-checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.rider-checkbox-item.selected {
    background-color: #e8f5e9;
}

.rider-checkbox-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rider-group-title {
    font-weight: 700;
    font-size: 1em;
    color: var(--primary-color);
    padding: 12px 8px 8px 8px;
    margin-top: 15px;
    border-bottom: 2px solid var(--primary-color);
    background: linear-gradient(to bottom, transparent, rgba(225, 6, 0, 0.05));
}

.rider-group-title:first-child {
    margin-top: 5px;
}

.rider-info {
    flex: 1;
}

.rider-number {
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 10px;
}

.rider-team {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

#selectedCount {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: var(--primary-color);
}

.riders-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.rider-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: inline-block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 1000px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
}

.detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.detail-summary .stat-card {
    background: linear-gradient(135deg, var(--primary-color), #c10500);
    color: white;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.3);
    transition: all 0.3s ease;
}

.detail-summary .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(225, 6, 0, 0.4);
}

.detail-summary .stat-label {
    font-size: 0.75em;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-summary .stat-value {
    font-size: 2.8em;
    font-weight: 800;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tabs generales */
.detail-tabs {
    display: flex;
    gap: 10px;
    margin: 30px 0 20px 0;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    background-color: rgba(225, 6, 0, 0.1);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

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

/* Tabs específicos de Riders */
.riders-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid var(--border-color);
}

/* Vista de Grupos */
.grupos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.grupo-column {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.grupo-column:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.grupo-header {
    background: linear-gradient(135deg, #e10600 0%, #c10500 100%);
    color: white;
    padding: 16px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grupo-riders {
    padding: 12px;
    min-height: 100px;
}

.rider-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.rider-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    z-index: 0;
}

.rider-card:hover {
    border-color: #e10600;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rider-card-content {
    position: relative;
    z-index: 1;
}

.rider-number {
    font-size: 0.85em;
    font-weight: 700;
    color: #666;
    margin-bottom: 4px;
}

.rider-name {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.rider-team {
    font-size: 0.75em;
    color: #999;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grupo-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* Sección de Pilotos Excluidos */
.excluded-riders-section {
    margin-top: 40px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.excluded-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #666;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #ddd;
}

.excluded-riders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.excluded-rider-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e9ecef;
}

.excluded-rider-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #e10600;
}

.excluded-rider-number {
    font-weight: 700;
    font-size: 1.1em;
    color: #2c3e50;
    min-width: 50px;
}

.excluded-rider-name {
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

.excluded-rider-team {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

.excluded-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* Responsive para vista de grupos */
@media (max-width: 1200px) {
    .grupos-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .grupos-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .grupo-header {
        padding: 12px;
        font-size: 0.95em;
    }
    
    .rider-card {
        padding: 10px;
    }
    
    .excluded-riders-list {
        grid-template-columns: 1fr;
    }
    
    .excluded-rider-item {
        padding: 10px 12px;
    }
    
    .excluded-rider-number {
        min-width: 40px;
        font-size: 1em;
    }
    
    .excluded-rider-team {
        display: none;
    }
}


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

.tab-content h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.breakdown-list {
    font-size: 0.9em;
    color: #666;
}

.breakdown-item {
    display: inline-block;
    margin-right: 10px;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 4px;
}

.position-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95em;
}

.position-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.position-silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #000;
}

.position-bronze {
    background: linear-gradient(135deg, #CD7F32, #B5651D);
    color: #fff;
}

/* Modal de Confirmación */
.modal-confirm {
    max-width: 500px;
    text-align: center;
}

.confirm-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.confirm-buttons .btn {
    min-width: 120px;
}

/* Modal de Progreso */
.modal-process {
    max-width: 600px;
}

.process-info {
    text-align: center;
    margin-bottom: 30px;
}

.process-race-name {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.process-message {
    color: #666;
    font-size: 1.1em;
}

.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #ff4444);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--primary-color);
}

.process-steps {
    margin-bottom: 30px;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f8f8;
    border-radius: 8px;
    transition: all 0.3s;
}

.step-item.active {
    background: rgba(225, 6, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

.step-item.completed {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success-color);
}

.step-item.error {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-color);
}

.step-icon {
    font-size: 1.5em;
    margin-right: 15px;
    min-width: 30px;
}

.step-text {
    flex: 1;
    color: #666;
}

.step-item.active .step-text {
    color: var(--primary-color);
    font-weight: bold;
}

.step-item.completed .step-text {
    color: var(--success-color);
}

.process-result {
    text-align: center;
    padding: 30px;
}

.result-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.process-result h3 {
    color: var(--success-color);
    margin-bottom: 20px;
}

.process-error {
    text-align: center;
    padding: 30px;
}

.error-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.process-error h3 {
    color: var(--danger-color);
    margin-bottom: 20px;
}

#processDetails {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

#processDetails p {
    margin: 5px 0;
    color: #666;
}

/* Progress Steps */
.progress-steps {
    padding: 20px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
    transition: all 0.3s ease;
}

.progress-step.active {
    border-left-color: var(--primary-color);
    background: white;
}

.progress-step.completed {
    border-left-color: var(--success-color);
    opacity: 0.8;
}

.progress-step p {
    margin: 0;
    font-size: 0.95em;
    color: var(--text-color);
}

.progress-step.completed p {
    color: var(--success-color);
}

.progress-step .spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.progress-step span {
    color: var(--success-color);
    min-width: 24px;
    text-align: center;
}


/* Badges para estado de carreras */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* ============================================================================
   MODALES PERSONALIZADOS
   ============================================================================ */

/* Animación de spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress step completado */
.progress-step.completed {
    opacity: 0.7;
}

.progress-step.completed p {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Estilos para modales de confirmación */
#customConfirmModal .modal-content,
#successModal .modal-content,
#errorModal .modal-content,
#processProgressModal .modal-content {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botones de los modales */
#customConfirmModal .modal-footer .btn,
#successModal .btn,
#errorModal .btn {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#customConfirmModal .modal-footer .btn:hover,
#successModal .btn:hover,
#errorModal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Barra de progreso animada */
#processProgressBar {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Spinner dentro de los pasos */
.progress-step .spinner {
    animation: spin 1s linear infinite;
}


/* ============================================================================
   PRIMER LOGIN CON PAD NUMÉRICO
   ============================================================================ */

.first-login-form {
    text-align: center;
}

.first-login-header {
    margin-bottom: 30px;
}

.first-login-header h2 {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1.5em;
}

.first-login-header p {
    color: #999;
    font-size: 0.95em;
}

/* PIN Display */
.pin-display {
    margin: 30px 0;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Numpad */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto 20px;
}

.numpad-btn {
    padding: 20px;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.numpad-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.numpad-btn:active {
    transform: translateY(0);
}

#confirmBtn {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    font-size: 28px;
}

#confirmBtn:hover {
    background: #218838;
    border-color: #218838;
}

#backspaceBtn {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
    font-size: 20px;
}

#backspaceBtn:hover {
    background: #c82333;
    border-color: #c82333;
}

/* ============================================================================
   MODALES PERSONALIZADOS (Success, Error, Confirm)
   ============================================================================ */

/* Podium Bonus Badges */
.podium-bonus {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85em;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
    cursor: help;
    transition: all 0.3s ease;
}

.podium-bonus:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.podium-no-match {
    color: #999;
    font-size: 1.3em;
    cursor: help;
    transition: all 0.3s ease;
}

.podium-no-match:hover {
    color: #e10600;
    transform: scale(1.2);
}

.podium-none {
    color: #ddd;
    font-size: 0.9em;
}

/* Overlay de modales */
#successModal.modal,
#errorModal.modal,
#confirmModal.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

#successModal .modal-content,
#errorModal .modal-content,
#confirmModal .modal-content {
    background: white;
    margin: 10% auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Botón de danger para confirmaciones */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* Mensajes en modales */
#successMessage p,
#errorMessage p,
#confirmMessage p {
    margin: 10px 0;
}

#successMessage strong,
#errorMessage strong,
#confirmMessage strong {
    color: #e10600;
    font-weight: 700;
}

/* Checkbox mejorado para Miembro Activo y Piloto Activo */
.checkbox-group {
    margin: 15px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}

.checkbox-label span {
    user-select: none;
}

/* Color picker mejorado */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.color-picker-container input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-picker-container input[type="color"]:hover {
    border-color: var(--primary-color);
}

.color-preview {
    width: 80px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: #000000;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.color-picker-container input[type="text"] {
    flex: 1;
    max-width: 120px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    text-transform: uppercase;
}

.color-picker-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}


/* ============================================
   ESTILOS POR ROL
   ============================================ */

/* Labels dinámicos según rol */
.admin-label {
    display: none;
}

.standard-label {
    display: none;
}

/* Mostrar label correcto según rol */
body.is-admin .admin-label {
    display: inline;
}

body.is-standard .standard-label {
    display: inline;
}

/* Ocultar secciones admin-only para usuarios standard */
body.is-standard .admin-only {
    display: none !important;
}

/* Destacar fila del usuario en clasificación */
.standings-my-row {
    background-color: #fff3cd !important;
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
}

.standings-my-row td {
    color: var(--primary-color);
}

/* ============================================
   MODAL DE NOTIFICACIÓN
   ============================================ */

.notification-modal {
    max-width: 400px;
    text-align: center;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.notification-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.notification-modal h2 {
    margin: 0 0 15px 0;
    color: #28a745;
    font-size: 1.8em;
}

.notification-modal p {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 1.1em;
    line-height: 1.5;
}

.notification-modal .btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.notification-modal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* ============================================
   MI EQUIPO
   ============================================ */

.my-team-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.pole-header-actions {
    display: flex;
    gap: 10px;
}

.my-team-selection-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.my-team-slots-wrapper {
    flex: 0 0 auto;
}

.slots-title {
    background: linear-gradient(135deg, #e10600 0%, #b30500 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 1em;
    text-align: center;
    margin-bottom: -1px;
}

/* Grid de 8 slots para pilotos seleccionados */
.my-team-slots {
    flex: 0 0 auto;
    min-width: 280px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 0 0 8px 8px;
}

.team-slot {
    position: relative;
}

.slot-box {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slot-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.slot-box.filled {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(225, 6, 0, 0.2);
}

.slot-label {
    background: linear-gradient(135deg, #e10600 0%, #b30500 100%);
    color: white;
    text-align: center;
    padding: 6px;
    font-weight: 600;
    font-size: 0.8em;
}

.rider-slot-selection {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.empty-slot {
    text-align: center;
    color: #999;
}

.empty-icon {
    font-size: 1.5em;
    margin-bottom: 4px;
    opacity: 0.3;
}

.empty-text {
    font-size: 0.7em;
}

.selected-rider-display {
    text-align: center;
    width: 100%;
}

.selected-rider-number {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1;
}

.selected-rider-name {
    font-size: 0.8em;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.2;
}

.selected-rider-team {
    font-size: 0.7em;
    color: #666;
    line-height: 1.2;
}

.remove-rider-btn {
    position: absolute;
    top: 28px;
    right: 4px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.slot-box:hover .remove-rider-btn {
    opacity: 1;
}

.remove-rider-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Grid de pilotos disponibles agrupados */
.my-team-riders-grid {
    flex: 1;
    min-width: 300px;
}

.riders-group-section {
    margin-bottom: 25px;
}

.riders-group-header {
    background: linear-gradient(135deg, #e10600 0%, #b30500 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-status {
    font-size: 0.9em;
    opacity: 0.9;
}

.riders-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.rider-card-selectable {
    background: white;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-left: 4px solid #000;
}

.rider-card-selectable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.rider-card-selectable.selected {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
}

.rider-card-selectable.selected:hover {
    transform: none;
    box-shadow: none;
}

.rider-card-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.rider-card-name {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.rider-card-team {
    font-size: 0.8em;
    color: #666;
}

/* Responsive */
@media (max-width: 1200px) {
    .my-team-selection-container {
        flex-direction: column;
    }
    
    .my-team-slots-wrapper {
        width: 100%;
    }
    
    .my-team-slots {
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .my-team-slots {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .riders-group-grid {
        grid-template-columns: 1fr;
    }
    
    .my-team-header {
        flex-direction: column;
    }
    
    .pole-header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .pole-header-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .slot-label {
        font-size: 0.7em;
        padding: 5px;
    }
    
    .selected-rider-number {
        font-size: 1.4em;
    }
    
    .selected-rider-name {
        font-size: 0.75em;
    }
    
    .selected-rider-team {
        font-size: 0.65em;
    }
}
