:root {
    --primary-color: #b91c1c;
    --primary-dark: #991b1b;
    --primary-light: #dc2626;
    --secondary-color: #374151;
    --secondary-dark: #1f2937;
    --secondary-light: #6b7280;
    --accent-color: #f59e0b;
    --accent-light: #fbbf24;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --muted-color: #64748b;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --text-color: #334155;
    --text-muted: #64748b;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
}

/* Layout Principal */
.main-wrapper {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 4px 0 20px var(--shadow-color);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header small {
    opacity: 0.8;
    font-size: 12px;
}

.sidebar.collapsed .sidebar-header h3,
.sidebar.collapsed .sidebar-header small {
    display: none;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
    padding-left: 0 !important;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}


.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--accent-color);
}

.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--accent-color);
}

.sidebar-menu a i {
    width: 20px;
    margin-right: 15px;
    font-size: 16px;
}

.sidebar.collapsed .sidebar-menu a span {
    display: none;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 12px 10px;
}

.sidebar.collapsed .sidebar-menu a i {
    margin-right: 0;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    transition: all 0.3s ease;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 70px;
}

.top-navbar {
    background: var(--bg-color);
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.navbar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-right: 20px;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-dropdown {
    position: relative;
}

.user-dropdown .dropdown-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-dropdown .dropdown-toggle:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.content-area {
    padding: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.breadcrumb {
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.card-body {
    padding: 25px;
}

.card-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Estilos para tarjetas de ligas mejoradas */
.liga-card-enhanced {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.liga-card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.liga-card-enhanced .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
}

.liga-card-enhanced .badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.liga-stats-item {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    margin-bottom: 8px;
}

.liga-stats-item .number {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.liga-stats-item .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.create-liga-card {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.create-liga-card:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.create-liga-card .card-body {
    padding: 40px 20px;
    text-align: center;
}

.create-liga-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
}

/* Botones */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(185, 28, 28, 0.3);
}

.btn-primary.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
}

.btn-primary.shadow-sm {
    box-shadow: 0 2px 4px rgba(185, 28, 28, 0.2);
}

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

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

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-warning:hover {
    background: #d97706;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

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

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.form-control:invalid {
    border-color: var(--danger-color);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    margin-bottom: 0;
    background: var(--bg-color);
}

.table th {
    background: var(--bg-secondary);
    color: var(--text-color);
    font-weight: 600;
    padding: 15px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

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

.badge-warning {
    background: var(--warning-color);
    color: white;
}

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

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

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    margin-bottom: 20px;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Stats Cards */
.stats-card {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.stats-card .stats-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 15px;
}

.stats-card .stats-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.stats-card .stats-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* Estilos para Gestión de Ligas */
.liga-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.liga-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.liga-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.25rem;
    border-bottom: none;
}

.liga-card .card-header .badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.liga-card .card-body {
    padding: 1.5rem 1.25rem;
}

.liga-card .card-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 0 0 12px 12px;
}

/* Botón flotante para crear liga */
.floating-create-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(185, 28, 28, 0.3);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.floating-create-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(185, 28, 28, 0.4);
    color: white;
}

.floating-create-btn:active {
    transform: scale(0.95);
}

/* Tooltip para botón flotante */
.floating-create-btn::before {
    content: 'Crear Liga';
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.floating-create-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Responsive para botón flotante */
@media (max-width: 768px) {
    .floating-create-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
        bottom: 20px;
        right: 20px;
    }
    
    .floating-create-btn::before {
        right: 60px;
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.shadow-sm { box-shadow: 0 1px 3px var(--shadow-color); }
.shadow { box-shadow: 0 4px 20px var(--shadow-color); }
.shadow-lg { box-shadow: 0 8px 30px var(--shadow-color); }

.border-radius { border-radius: 8px; }
.border-radius-lg { border-radius: 12px; }
.border-radius-xl { border-radius: 16px; }
