        /* =============================================================================
           FLASK APP CSS STYLES - TABLET OPTIMIZED
           Copy the CSS between the <style> tags to your Flask app
           ============================================================================= */

        /* Reset and Base Styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
            line-height: 1.6;
            color: #333;
        }

        /* Container and Layout */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(10px);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
            padding:15px 30px;
            text-align: center;
        }

        .header h1 {
            font-size: 2.5rem;
            margin: 0 0 5px 0;
            font-weight: 300;
        }

        .header p {
            font-size: 1.1rem;
            opacity: 0.9;
            margin: 0 0 5px 0;
        }

        .content {
            padding: 30px;
        }

        /* Navigation */
        .nav {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            padding: 12px 20px;
            border-bottom: 1px solid #dee2e6;
            /* text-align: center; */
            margin: 0;
            flex-grow: 1;
            text-align: right;
        }

        .nav a {
            color: white;
            text-decoration: none;
            margin: 0 15px;
            font-size: 1rem;
            transition: color 0.3s ease;
        }

        .nav a:hover {
            text-decoration: underline;
            color: #007bff;
        }

        .nav a.active {
            font-weight: bold;
            text-decoration: underline;
        }

        /* Forms - Tablet Optimized */
        .form-container {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            margin: 20px 0;
        }

        .form-group {
            margin-bottom: 25px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #555;
            font-size: 1.1rem;
        }

        .form-control {
            width: 100%;
            padding: 5px;
            border: 2px solid #e9ecef;
            border-radius: 8px;
            font-size: 1.1rem;
            transition: all 0.3s ease;
            background: #fafafa;
        }

        .form-control:focus {
            outline: none;
            border-color: #007bff;
            background: white;
            box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
        }

        /* Buttons - Touch Friendly */
        .btn {
            padding: 0;  /* Remove padding, we'll control height directly */
            border: none;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;  /* Changed to inline-flex for better control */
            align-items: center;  /* Vertically center text */
            justify-content: center;  /* Horizontally center text */
            text-align: center;
            min-width: 120px;
            height: 50px;  /* Single height value */
            line-height: 1;  /* Reset line-height */
        }

        .btn-primary {
            background: linear-gradient(135deg, #007bff, #0056b3);
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
        }

        .btn-success {
            background: linear-gradient(135deg, #28a745, #1e7e34);
            color: white;
        }

        .btn-success:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
        }

        .btn-danger {
            background: linear-gradient(135deg, #dc3545, #c82333);
            color: white;
        }

        .btn-danger:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
        }

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

        .btn-secondary:hover {
            background: #545b62;
            transform: translateY(-2px);
        }

        /* Tables - Tablet Responsive */
        .table-container {
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            margin: 20px 0;
        }

        .table {
            width: 100%;
            border-collapse: collapse;
            font-size: 1rem;
        }

        .table th {
            background: #f8f9fa;
            padding: 8px 15px;
            text-align: left;
            font-weight: 600;
            color: #495057;
            border-bottom: 2px solid #dee2e6;
        }

        .table td {
            padding: 8px 15px;
            border-bottom: 1px solid #dee2e6;
            vertical-align: middle;
        }

        .table tbody tr:hover {
            background: #f8f9fa;
            transition: background 0.2s ease;
        }

        .table tbody tr:last-child td {
            border-bottom: none;
        }

        /* Action Buttons in Tables */
        .action-buttons {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .btn-sm {
            padding: 0;  /* Remove padding */
            font-size: 0.9rem;
            min-width: 80px;
            height: 36px;  /* Fixed height for small buttons */
            line-height: 1;  /* Reset line-height */
        }

        /* Cards */
        .card {
            background: white;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            margin: 20px 0;
            overflow: hidden;
            transition: transform 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        }

        .card-header {
            background: #f8f9fa;
            padding: 20px;
            border-bottom: 1px solid #dee2e6;
        }

        .card-header h3 {
            margin: 0;
            color: #495057;
            font-size: 1.3rem;
        }

        .card-body {
            padding: 20px;
        }

        /* Alerts and Messages */
        .alert {
            padding: 15px 20px;
            border-radius: 8px;
            margin: 20px 0;
            font-weight: 500;
        }

        .alert-success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        .alert-error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        .alert-info {
            background: #d1ecf1;
            color: #0c5460;
            border: 1px solid #b8daff;
        }



        /* Loading Spinner */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease-in-out infinite;
        }

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

        /* Table Wrapper Fix - Prevent horizontal scroll */
        .table-wrapper {
            overflow-x: hidden;
            width: 100%;
            max-width: 100%;
        }

        .table-wrapper table {
            table-layout: fixed;
            width: 100%;
            max-width: 100%;
        }

        .table-wrapper table td,
        .table-wrapper table th {
            overflow: hidden;
            text-overflow: ellipsis;
            padding: 8px;
            box-sizing: border-box;
        }

        /* Allow notes column to wrap */
        .table-wrapper table td:last-child,
        .table-wrapper table th:last-child {
            white-space: normal;
            word-wrap: break-word;
            overflow-wrap: break-word;
            overflow: visible;
        }

        /* Ensure textarea/input in notes doesn't overflow */
        .table-wrapper table td:last-child textarea,
        .table-wrapper table td:last-child input {
            max-width: 100%;
            width: 100%;
            box-sizing: border-box;
        }

        /* Make status dropdown narrower */
        .session-status-dropdown {
            max-width: 100%;
            font-size: 0.85rem !important;
            padding: 4px 6px !important;
        }

        /* Utility Classes */
        .text-center { text-align: center; }
        .text-right { text-align: right; }
        .mt-3 { margin-top: 1rem; }
        .mb-3 { margin-bottom: 1rem; }
        .p-3 { padding: 1rem; }
        .hidden { display: none; }

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

        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        ::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        /* Header action buttons */
        .card-header .action-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: nowrap;
        }

        .card-header .action-buttons .btn-sm {
            white-space: nowrap;
        }

        /* Responsive adjustment for smaller screens */
        @media (max-width: 768px) {
            .card-header > div {
                flex-direction: column !important;
                align-items: flex-start !important;
                gap: 15px;
            }
            
            .card-header .action-buttons {
                width: 100%;
                justify-content: flex-start;
            }
        }
        
/* ============================================================================
   MANAGE SWIMMERS/SESSIONS PAGE STYLES
============================================================================ */

/* Search and Filter Section */
.search-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

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

.search-header h2 {
    color: #495057;
    font-size: 1.5rem;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}


        /* Attendance Edit Search/Filter Form Styles */
        .search-container {
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 8px;
            background-color: #ffffff;
            margin-bottom: 20px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            overflow: visible;
            max-width: 100%; /* Prevent overflow beyond parent */
            box-sizing: border-box;
        }

        
/* =====================================================================================================
 search form for filters and clear button
===================================================================================================== */

        /* Media query for 2-field forms on smaller screens */
        @media (max-width: 900px) {
            .search-form.two-field-form {
                grid-template-columns: 1fr 1fr 100px;
                gap: 10px;
            }
        }

        @media (max-width: 650px) {
            .search-form.two-field-form {
                grid-template-columns: 1fr;
            }
        }


.search-form {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-end;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    max-width: 100%;
    padding: 0;
}

.search-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
}


.search-form label {
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: block;
}

.search-form .form-control {
    height: 38px;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
}

.search-form .btn {
    margin-bottom: 0 !important;
    height: 36px !important;
    width: 65px !important;
    min-width: 65px !important;
    max-width: 65px !important;
    font-size: 0.75rem !important;
    padding: 6px 4px !important;
    flex: 0 0 65px !important;
}

/* Default widths for 4+ field forms (attendance, sessions, users) */
.search-form .form-group:nth-child(1) { flex: 0 0 160px; }
.search-form .form-group:nth-child(2) { flex: 0 0 160px; }
.search-form .form-group:nth-child(3) { flex: 0 0 160px; }
.search-form .form-group:nth-child(4) { flex: 0 0 160px; }
.search-form .btn:nth-child(5) { flex: 0 0 75px; }
.search-form .btn:nth-child(6) { flex: 0 0 75px; }

/* Overrides for 2-field forms (swimmers, groups, timetable) */
.search-form .form-group:nth-child(1):nth-last-child(3) { flex: 0 0 160px; }
.search-form .form-group:nth-child(2):nth-last-child(2) { flex: 0 0 160px; }
.search-form .btn:nth-child(3):nth-last-child(1) { flex: 0 0 75px; }

/* ===================================================================================================


/* Results Section */
.results-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.results-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    color: #495057;
    font-size: 1.3rem;
}

.results-count {
    color: #6c757d;
    font-size: 0.95rem;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 25px;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 300;
    margin: 0;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;  /* Make it even narrower - was 500px */
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
    padding: 0;  /* Remove any extra padding */
}

.modal-body {
    padding: 20px 30px;  /* Adjust padding */
}

.modal-body .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;  /* This is critical */
    background: white;
    color: #000;
    font-weight: 500;
}

.modal-body .form-control[readonly] {
    background: #f8f9fa;
    font-style: italic;
    color: #6c757d;
    cursor: not-allowed;
}

.modal-body .form-control:not([readonly]):focus {
    background: white;
    color: #000;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #e9ecef;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.delete-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.delete-warning h3 {
    color: #856404;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-warning p {
    color: #856404;
    margin: 0;
}

.info-display {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #495057;
    min-width: 150px;
}

.info-value {
    color: #6c757d;
}

/* Login Form Specific Styles */
.login-form-container {
    max-width: 450px;
    margin: 0 auto;
}

.login-form-container .form-control {
    max-width: 100%;
    padding: 5px;
    box-sizing: border-box;    
}

/* Reports Page Styles */
.report-filters {
    display: grid;
    grid-template-columns: 150px 150px 200px 200px auto auto;
    gap: 15px;
    align-items: end;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.performance-list {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    min-height: 200px;
}

.performer-item {
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .report-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .report-filters {
        grid-template-columns: 1fr;
    }
}

/* Modal Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Additional Responsive Styles */
@media (max-width: 1200px) {
    .search-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }

    .info-row {
        flex-direction: column;
    }

    .info-label {
        margin-bottom: 5px;
    }
}

/* Index Page Specific Styles */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.info-item h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.info-item p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.info-item small {
    color: #999;
    font-style: italic;
}

.btn + .btn {
    margin-left: 10px;
}

/* User Management Styles */
.role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.role-viewer {
    background: #e7f3ff;
    color: #0066cc;
}

.role-editor {
    background: #fff3cd;
    color: #856404;
}

.role-admin {
    background: #f8d7da;
    color: #721c24;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Session Status Badges */
.status-scheduled {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-rescheduled {
    background: #fff3cd;
    color: #856404;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: bold;
}

/* Success Message Style */
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Error Message Style */
.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* --- Forgot Password Modal Styles --- */

/* Basic modal overlay */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Show the modal */
.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content Box */
.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 8px;
    width: 90%; /* Smaller on mobile */
    max-width: 450px; /* Max width on desktop */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Sub-navigation for maintain pages 
.sub-nav {
    background: #e9ecef;
    padding: 10px 20px;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
    margin: 0;
}

.sub-nav a {
    color: #495057;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.sub-nav a:hover {
    color: #007bff;
}

.sub-nav a.active {
    font-weight: bold;
    color: #007bff;
}

*/

/* Fix sub-nav background for maintain_data */
.sub-nav {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 12px 20px;
    border-bottom: 1px solid #dee2e6;
    /* text-align: center; */
    margin: 0;
    flex-grow: 1;
    text-align: left;
}

.sub-nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.sub-nav a:hover {
    text-decoration: underline;
    color: #007bff;
}

.sub-nav a.active {
    font-weight: bold;
    text-decoration: underline;
}

.main-nav-bar {
    display: flex;             /* Enables Flexbox layout */
    justify-content: space-between; /* Pushes the first item (sub-nav) to the left 
                                      and the last item (nav) to the right */
    align-items: center;       /* Vertically centers items */
    padding: 10px 0;           /* Adds vertical padding */
    border-bottom: 1px solid #ccc; /* Optional: Separator line */
    margin-bottom: 20px;       /* Space below the navigation bar */
}

/* Maintain Data Navigation */
.maintain-data-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}


/* Media query for smaller screens: Stacks the form elements vertically */
@media (max-width: 900px) {
    .search-form {
        /* Changes to 2 columns for better display on tablets/large phones */
        grid-template-columns: 1fr 1fr;
    }
    .search-form .btn {
        /* When stacked, buttons should span the entire width of their column */
        width: 100%;
        min-width: auto;
    }
}

/* NEW: Styles for a single-line filter form, to be used on attendance_edit.html */
.filter-form-single-line {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 10px; /* Space between elements */
    align-items: center; /* Vertically aligns items in the middle */
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.filter-form-single-line .form-group {
    /* Ensure form groups don't take up the full width, allowing them to sit next to each other */
    flex-grow: 1;
    min-width: 150px; /* Minimum width for each filter/input */
}

.filter-form-single-line input[type="text"],
.filter-form-single-line select {
    width: 100%; /* Makes inputs/selects fill the space of their parent form-group */
}

/* Specific styling for the button group */
.filter-form-single-line .button-group {
    display: flex;
    gap: 10px;
    align-items: center;
    /* Prevent the button group from stretching too much */
    flex-grow: 0;
}

/* Responsive adjustment for small screens */
@media (max-width: 650px) {
    .filter-form-single-line {
        flex-direction: column; /* Stack vertically on very small screens */
    }
    .filter-form-single-line .form-group,
    .filter-form-single-line .button-group {
        width: 100%; /* Full width when stacked */
        min-width: unset;
    }
}

@media (max-width: 550px) {
    .search-form {
        /* Changes to 1 column for phone view */
        grid-template-columns: 1fr;
    }
}

/* NEW: Styles for a single-line filter form, to be used on attendance_edit.html */
.filter-form-single-line {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 10px; /* Space between elements */
    align-items: center; /* Vertically aligns items in the middle */
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.filter-form-single-line .form-group {
    /* Ensure form groups don't take up the full width, allowing them to sit next to each other */
    flex-grow: 1;
    min-width: 150px; /* Minimum width for each filter/input */
}

.filter-form-single-line input[type="text"],
.filter-form-single-line select {
    width: 100%; /* Makes inputs/selects fill the space of their parent form-group */
}

/* Specific styling for the button group */
.filter-form-single-line .button-group {
    display: flex;
    gap: 10px;
    align-items: center;
    /* Prevent the button group from stretching too much */
    flex-grow: 0;
}

/* Responsive adjustment for small screens */
@media (max-width: 650px) {
    .filter-form-single-line {
        flex-direction: column; /* Stack vertically on very small screens */
    }
    .filter-form-single-line .form-group,
    .filter-form-single-line .button-group {
        width: 100%; /* Full width when stacked */
        min-width: unset;
    }
}

.maintain-data-nav a:hover {
    color: #007bff !important;
    font-weight: bold;
    text-decoration: none;
}

.maintain-data-nav-left {
    text-align: left;
}

.maintain-data-nav-left a,
.maintain-data-nav-right a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    transition: opacity 0.3s ease;
}

.maintain-data-nav-right a:hover {
    color: #007bff !important;
    font-weight: bold;
    text-decoration: none;
}

.maintain-data-nav-left a:hover {
    color: #007bff !important;
    font-weight: bold;
    text-decoration: none;
}

.maintain-data-nav-left a.active {
    font-weight: bold;
    text-decoration: underline;
}

.maintain-data-nav-right {
    text-align: right;
}

.maintain-data-nav-separator {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 5px;
}

/* Maintain Data Page Styles */
/* 1. Grid Container for Data Tiles */
.data-tiles,
.data-management-grid {
    display: grid;
    /* Responsive column layout */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px; /* Spacing between the tiles */
    padding: 40px;
}

/* 2. Individual Tile Styling */
.data-tile {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Proper vertical alignment and button placement */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    border: 1px solid #eee;
}

/* 3. Tile Hover Effect */
.data-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

/* 4. Tile Heading */
.data-tile h2 {
    color: #4facfe;
    font-size: 1.8rem;
    margin-bottom: 15px;
    margin-top: 0;
}

/* 5. Tile Description */
.data-tile p {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.6;
    flex-grow: 1; /* Pushes button to bottom */
}

/* 6. Button Styling - Full Width */
.data-tile .btn,
.data-tile .button.primary {
    display: block;
    width: 100%; /* Ensures button takes full width of the tile */
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: white;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: auto; /* Ensures button stays at bottom */
}

/* 7. Button Hover Effect */
.data-tile .btn:hover,
.data-tile .button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 8. Individual Tile Color Schemes */
.tile-swimmers .btn,
.tile-swimmers .button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tile-attendance .btn,
.tile-attendance .button.primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.tile-timetable .btn,
.tile-timetable .button.primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tile-groups .btn,
.tile-groups .button.primary {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.tile-sessions .btn,
.tile-sessions .button.primary {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tile-users .btn,
.tile-users .button.primary {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* 9. Container Adjustments for Maintain Data Page */
body .container {
    max-width: 1200px; /* Ensures there is room for the tiles to lay out */
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding-bottom: 30px;
}

/* 10. Responsive Adjustments */
@media (max-width: 768px) {
    .data-tiles,
    .data-management-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        padding: 20px;
        gap: 20px;
    }
    
    .data-tile {
        padding: 25px;
    }
    
    .data-tile h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .data-tiles,
    .data-management-grid {
        padding: 15px;
        gap: 15px;
    }
    
    .data-tile {
        padding: 20px;
    }
}
