/* =============================================
   APPROACH Tenis - Estilos principales
   ============================================= */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0c1425;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38bdf8;
    --sidebar-hover-bg: rgba(56, 189, 248, 0.08);
    --topbar-height: 56px;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.sidebar-brand i {
    font-size: 1.4rem;
    color: var(--sidebar-active);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #e2e8f0;
}

.sidebar-link.active {
    background: rgba(56, 189, 248, 0.12);
    color: var(--sidebar-active);
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 8px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-user-name {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
}

.sidebar-user-role {
    color: var(--sidebar-text);
    font-size: 0.75rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title {
    font-weight: 600;
    font-size: 1rem;
}

.content-wrapper {
    padding: 24px;
    max-width: 1400px;
}

/* =============================================
   CARDS & STATS
   ============================================= */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.stat-card .stat-icon.blue { background: rgba(14,165,233,0.1); color: var(--accent); }
.stat-card .stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-card .stat-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-card .stat-icon.purple { background: rgba(99,102,241,0.1); color: #6366f1; }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =============================================
   TABLES
   ============================================= */
.card-table {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-table-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
}

.table {
    margin: 0;
    font-size: 0.9rem;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge-estado {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-activo { background: rgba(16,185,129,0.1); color: #059669; }
.badge-inactivo { background: rgba(239,68,68,0.1); color: #dc2626; }

.badge-rol {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin { background: rgba(99,102,241,0.1); color: #6366f1; }
.badge-profesor { background: rgba(14,165,233,0.1); color: #0284c7; }
.badge-alumno { background: rgba(245,158,11,0.1); color: #d97706; }

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 18px;
}

.btn-primary:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.btn-outline-secondary {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    transition: all 0.15s;
    cursor: pointer;
}

.btn-action:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(14,165,233,0.05);
}

.btn-action.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239,68,68,0.05);
}

/* =============================================
   FORMS
   ============================================= */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 9px 14px;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0c1425 0%, #1e293b 100%);
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 8px;
    display: block;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
}

.login-brand p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* =============================================
   MODALS
   ============================================= */
.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
    margin: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar.show + .sidebar-overlay {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .content-wrapper {
        padding: 16px;
    }
}

@media (max-width: 575.98px) {
    .card-table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* =============================================
   PWA INSTALL BANNER
   ============================================= */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 0;
    animation: slideBannerUp 0.4s ease-out;
}

@keyframes slideBannerUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.install-banner-content {
    background: linear-gradient(135deg, #0c1425 0%, #1a365d 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin: 12px;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    max-width: 600px;
}

@media (min-width: 992px) {
    .install-banner-content {
        margin-left: calc(var(--sidebar-width) + 12px);
    }
}

.install-banner-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.install-banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.install-banner-text span {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.install-banner-actions .btn-light {
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.85rem;
}

