/* Modern Typography - Google Fonts */
/* Modern Typography - Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    /* SportPlayers360 Fixed Brand Identity — Professional Blue */
    --primary-dark: #152B47;
    --primary-blue: #1E3A5F;      /* SP360 Primary Blue */
    --accent-blue: #2563EB;       /* Electric Blue Accent */
    --accent-blue-light: #DBEAFE; /* Light Blue Background */
    --accent-red: #dc2626;
    /* Error/Danger */
    --accent-orange: #f97316;
    /* Warning */
    --white: #ffffff;
    --gray-light: #F8FAFC;
    --gray-medium: #94a3b8;
    --gray-dark: #475569;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Surface & Border */
    --surface: #F8FAFC;
    --border: #E2E8F0;
    --text-primary: #0B1320;
    --text-secondary: #475569;

    /* Modern Gradients - SportPlayers360 Teal Theme */
    --gradient-primary: linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%);  /* SP360 blue */
    /* Teal corporate */
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-purple: linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%);   /* SP360 blue */
    /* Teal blend */
    --gradient-pink: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
    /* Red to Orange */
    --gradient-warm: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    /* Orange gradient */

    /* Sombras - Enhanced */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

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

html,
body {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F1F5F9;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Header */
.header {
    background: var(--white);
    border-radius: 16px;
    padding: var(--spacing-md) var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    font-size: 2.5rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header p {
    color: var(--gray-medium);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--surface);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-medium);
    text-transform: capitalize;
}

/* Botones */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    font-family: inherit;
}

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

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

.btn-primary {
    background: #1E3A5F !important;
    color: var(--white) !important;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    color: var(--white);
}

.btn-error {
    background: linear-gradient(135deg, var(--error) 0%, #f87171 100%);
    color: var(--white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn:disabled,
.btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Cards */
.card,
.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: var(--spacing-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover,
.modal-content:hover {
    border-color: #CBD5E1;
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-title-icon {
    font-size: 1.5rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.nav-tab {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.nav-tab:hover {
    background: #F0FDFA;
    color: var(--primary-blue);
}

.nav-tab.active {
    background: var(--accent-blue);
    color: var(--white);
    border-color: transparent;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
    min-width: 0;
    overflow: hidden;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    max-width: 100%;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    color: #1f2937;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Fix select dropdown visibility */
select.form-input,
select.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231f2937' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
    background-color: rgba(255, 255, 255, 0.9);
}

/* Fix option colors - critical fix */
select option {
    background-color: #ffffff;
    color: #1f2937;
    padding: 10px;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563EB;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.form-file {
    display: none;
}

.file-upload-btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: var(--white);
}

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

.table thead {
    background: var(--surface);
}

.table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.table tbody tr {
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
}

.table tbody tr:hover {
    background: var(--surface);
    border-left-color: var(--accent-blue);
    transform: translateX(2px);
}

/* Grid */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 10px;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn var(--transition-slow) ease-in;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Member Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    max-height: none;
    padding: var(--spacing-sm);
}

.attendance-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.member-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: 10px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.member-card:hover {
    border-color: var(--accent-blue);
    background: var(--surface);
}

.member-card.present {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.member-card.absent {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.member-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.member-category {
    font-size: 0.75rem;
    color: var(--gray-dark);
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-tabs {
        overflow-x: auto;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.gap-1 {
    gap: var(--spacing-sm);
}

.gap-2 {
    gap: var(--spacing-md);
}

.gap-3 {
    gap: var(--spacing-lg);
}

/* Statistics Cards */
.stat-card {
    background: #FFFFFF;
    padding: var(--spacing-md);
    border-radius: 12px;
    text-align: center;
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: #1E3A5F;
    box-shadow: 0 10px 25px -5px rgba(15, 118, 110, 0.15);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1E3A5F;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-medium);
    font-weight: 500;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    padding: var(--spacing-sm);
    background: #F8FAFC;
    border-radius: 10px;
}

.category-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.category-tab:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}

.category-tab.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Category action buttons (edit/delete) */
.category-action-btn {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
}

.category-action-btn:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
    transform: scale(1.1);
}

.category-delete-btn:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
}

/* Attendance Category Checkboxes */
.categories-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.category-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.category-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
}

.category-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.category-checkbox-label.selected {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-light) 100%);
    border-color: transparent;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}


.modal-content {
    position: relative;
    background: #F8FAFC;
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid #E2E8F0;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #475569;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid #E2E8F0;
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* Category Checkbox Labels */
.category-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--white);
    font-size: 0.875rem;
    color: var(--text-primary);
    user-select: none;
}

.category-checkbox-label:hover {
    border-color: var(--accent-blue);
    background: #F0FDFA;
}

.category-checkbox-label.selected {
    border-color: #2563EB;
    background: #F0FDFA;
    color: #1E3A5F;
    font-weight: 600;
}

.category-checkbox-label input[type="checkbox"] {
    accent-color: #2563EB;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-slider:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.toggle-switch input:checked + .toggle-slider:hover {
    background-color: var(--accent-blue-light);
}

/* ── Premium Card & Header Styling (Matches Payments/Dashboard styles) ── */
.premium-card {
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    overflow: hidden !important;
    transition: all 0.25s ease !important;
}

.premium-card-header {
    background: linear-gradient(135deg, #1E3A5F 0%, #152B47 100%) !important; /* solid/gradient navy corporate blue */
    color: #ffffff !important;
    padding: 0.65rem 1.25rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 3.5px solid #2563EB !important; /* solid electric blue accent bar */
    box-sizing: border-box !important;
}

.premium-card-header span, 
.premium-card-header h2, 
.premium-card-header h3 {
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

/* Premium Category Tabs Container */
.category-tabs {
    display: flex !important;
    gap: 0.65rem !important;
    flex-wrap: wrap !important;
    padding: 1rem 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    border: none !important;
}

/* Capsule-style category groups */
.category-tab-group {
    display: flex !important;
    align-items: center !important;
    background: #F1F5F9 !important;
    border-radius: 99px !important;
    padding: 3px 10px 3px 3px !important; /* compact pill layout */
    border: 1.5px solid #E2E8F0 !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    gap: 6px !important;
}

.category-tab-group:hover {
    border-color: #2563EB !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08) !important;
    background: #E8F0FE !important;
}

/* Category Tab Pill Button */
.category-tab {
    padding: 6px 16px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 99px !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
    font-family: 'Outfit', sans-serif !important;
}

.category-tab.active {
    background: #2563EB !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2) !important;
}

.category-tab-group.active {
    background: #2563EB !important;
    border-color: #2563EB !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2) !important;
}

.category-tab-group.active .category-tab {
    color: #ffffff !important;
}

/* Category Circle Action Buttons inside capsule */
.category-action-btn {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 50% !important;
    width: 22px !important;
    height: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.68rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #475569 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.category-action-btn:hover {
    background: #ffffff !important;
    transform: scale(1.15) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

.category-delete-btn:hover {
    background: #FEE2E2 !important;
    border-color: #FCA5A5 !important;
    color: #EF4444 !important;
}

/* styling action buttons inside active capsule */
.category-tab-group.active .category-action-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

.category-tab-group.active .category-action-btn:hover {
    background: #ffffff !important;
    color: #2563EB !important;
}

.category-tab-group.active .category-delete-btn:hover {
    background: #EF4444 !important;
    color: #ffffff !important;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }

    .header {
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: 12px;
        margin-bottom: var(--spacing-md);
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .logo-section {
        gap: var(--spacing-sm);
    }

    .logo-icon {
        font-size: 1.8rem;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .header p {
        font-size: 0.75rem;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .user-name {
        font-size: 0.8rem;
    }

    .user-role {
        font-size: 0.65rem;
    }

    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Navigation Tabs - horizontal scroll */
    .nav-tabs {
        gap: var(--spacing-xs);
        margin-bottom: var(--spacing-md);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
        border-radius: 10px;
    }

    /* Cards */
    .card,
    .modal-content {
        padding: var(--spacing-md);
        border-radius: 12px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-title-icon {
        font-size: 1.2rem;
    }

    /* Grid */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    /* Forms */
    .form-group {
        margin-bottom: var(--spacing-md);
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }

    /* Tables - horizontal scroll */
    .table-container {
        margin: 0 calc(-1 * var(--spacing-md));
        width: calc(100% + 2 * var(--spacing-md));
        border-radius: 0;
    }

    .table th,
    .table td {
        padding: var(--spacing-sm);
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Modals - general */
    .modal-content {
        margin: var(--spacing-sm);
        max-width: calc(100vw - 1rem) !important;
        max-height: 90dvh;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Member dashboard modal: full screen on mobile */
    #member-dashboard-content {
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        max-height: 100vh !important;
        height: 100dvh;
        height: 100vh;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    #dashboard-tab-content {
        flex: 1;
        overflow-y: auto;
        padding: 1rem !important;
    }

    #member-dashboard-header {
        padding: 1rem !important;
    }

    #member-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #member-dashboard-modal .modal-content .dash-tab-bar {
        padding: 1rem 1rem 0.25rem !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    #member-dashboard-modal .modal-content .dash-tab-bar::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .modal-header {
        padding: var(--spacing-md);
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .modal-footer {
        padding: var(--spacing-md);
        flex-wrap: wrap;
    }

    .modal-title {
        font-size: 1rem;
    }

    /* Badges */
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    /* Attendance two-card layout */
    .attendance-layout {
        grid-template-columns: 1fr;
    }

    /* Force ALL inputs and selects to fit within container on mobile */
    input,
    select,
    textarea,
    .form-input,
    .form-select,
    select.form-input,
    input[type="date"],
    input[type="time"],
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.3rem 0.4rem !important;
        font-size: 0.8rem !important;
        height: auto !important;
        min-height: 32px;
        min-width: 0 !important;
        overflow: hidden;
    }

    /* Compact form labels on mobile */
    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }

    /* Flexible hours container - stack if needed */
    #flexible-hours-container {
        flex-wrap: wrap;
    }

    /* Session month filter */
    #session-month-filter {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0.4rem 0.5rem !important;
        font-size: 0.85rem !important;
    }

    /* Cards margin */
    .card {
        margin-left: 0;
        margin-right: 0;
    }

    /* Profile editor responsive */
    #profile-editor-modal .modal-content {
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        max-height: 100vh !important;
        height: 100vh;
    }

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

    .profile-grid > div[style*="grid-column"] {
        grid-column: auto !important;
    }

    #profile-editor-modal .modal-body {
        padding: var(--spacing-sm) !important;
    }

    #profile-editor-modal .modal-body > div {
        padding: var(--spacing-sm) !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: var(--spacing-xs);
    }

    /* ROOT CAUSE FIX: container padding was 2rem, way too much on a 375px phone */
    .container {
        padding: 0.5rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .nav-tab {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }

    .card {
        padding: var(--spacing-sm);
        overflow: hidden;
    }

    #attendance-members-container {
        overflow: visible !important;
    }

    .modal-content {
        padding: 0;
        overflow-y: auto;
    }

    .card-title {
        font-size: 1rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-md);
    }

    /* Force ALL inputs to stay within bounds on mobile */
    .form-input,
    .form-select,
    .form-textarea,
    input[type="date"],
    input[type="time"],
    select {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        -webkit-appearance: none;
        appearance: none;
    }

    .form-group {
        min-width: 0 !important;
        max-width: 100%;
    }

    .form-label {
        font-size: 0.75rem;
    }
}