/**
 * SkaterWorld Design System
 * A comprehensive, professional CSS framework for the SkaterWorld application
 * Maintains orange branding while providing modern, responsive components
 */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */
:root {
    /* Primary Brand Colors - Orange Theme */
    --sw-primary: #ec814b;
    --sw-primary-light: #f5a066;
    --sw-primary-dark: #d66a35;
    --sw-primary-rgb: 236, 129, 75;

    /* Secondary Colors */
    --sw-secondary: #2c3e50;
    --sw-secondary-light: #34495e;
    --sw-secondary-dark: #1a252f;

    /* Accent Colors */
    --sw-accent: #3498db;
    --sw-accent-light: #5dade2;
    --sw-accent-dark: #2980b9;

    /* Status Colors */
    --sw-success: #27ae60;
    --sw-success-light: #2ecc71;
    --sw-success-dark: #1e8449;
    --sw-warning: #f39c12;
    --sw-warning-light: #f1c40f;
    --sw-warning-dark: #d68910;
    --sw-danger: #e74c3c;
    --sw-danger-light: #ec7063;
    --sw-danger-dark: #c0392b;
    --sw-info: #17a2b8;
    --sw-info-light: #3498db;
    --sw-info-dark: #117a8b;

    /* Medal Colors */
    --sw-gold: #FFD700;
    --sw-silver: #C0C0C0;
    --sw-bronze: #CD7F32;

    /* Neutral Colors */
    --sw-white: #ffffff;
    --sw-gray-50: #fafafa;
    --sw-gray-100: #f5f5f5;
    --sw-gray-200: #eeeeee;
    --sw-gray-300: #e0e0e0;
    --sw-gray-400: #bdbdbd;
    --sw-gray-500: #9e9e9e;
    --sw-gray-600: #757575;
    --sw-gray-700: #616161;
    --sw-gray-800: #424242;
    --sw-gray-900: #212121;
    --sw-black: #000000;

    /* Background Colors */
    --sw-bg-primary: #f8f9fa;
    --sw-bg-secondary: #ffffff;
    --sw-bg-dark: var(--sw-secondary);

    /* Text Colors */
    --sw-text-primary: #2c3e50;
    --sw-text-secondary: #6c757d;
    --sw-text-muted: #95a5a6;
    --sw-text-light: #ffffff;

    /* Shadows */
    --sw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --sw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --sw-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --sw-shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    --sw-shadow-hover: 0 8px 30px rgba(230, 126, 34, 0.2);

    /* Border Radius */
    --sw-radius-sm: 0.25rem;
    --sw-radius-md: 0.5rem;
    --sw-radius-lg: 0.75rem;
    --sw-radius-xl: 1rem;
    --sw-radius-2xl: 1.5rem;
    --sw-radius-full: 50%;

    /* Spacing Scale */
    --sw-space-1: 0.25rem;
    --sw-space-2: 0.5rem;
    --sw-space-3: 0.75rem;
    --sw-space-4: 1rem;
    --sw-space-5: 1.5rem;
    --sw-space-6: 2rem;
    --sw-space-7: 2.5rem;
    --sw-space-8: 3rem;

    /* Typography */
    --sw-font-primary: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sw-font-heading: 'Poppins', var(--sw-font-primary);
    --sw-font-mono: 'Fira Code', 'Consolas', monospace;

    /* Font Sizes */
    --sw-text-xs: 0.75rem;
    --sw-text-sm: 0.875rem;
    --sw-text-base: 1rem;
    --sw-text-lg: 1.125rem;
    --sw-text-xl: 1.25rem;
    --sw-text-2xl: 1.5rem;
    --sw-text-3xl: 1.875rem;
    --sw-text-4xl: 2.25rem;

    /* Z-Index Layers */
    --sw-z-dropdown: 1000;
    --sw-z-sticky: 1020;
    --sw-z-fixed: 1030;
    --sw-z-modal-backdrop: 1040;
    --sw-z-modal: 1050;
    --sw-z-popover: 1060;
    --sw-z-tooltip: 1070;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--sw-font-primary);
    background-color: var(--sw-bg-primary);
    color: var(--sw-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--sw-font-heading);
    font-weight: 700;
    color: var(--sw-text-primary);
    margin-bottom: 0.5em;
}

a {
    color: var(--sw-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--sw-primary-dark);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sw-text-primary {
    color: var(--sw-primary) !important;
}

.sw-text-secondary {
    color: var(--sw-secondary) !important;
}

.sw-bg-primary {
    background-color: var(--sw-primary) !important;
}

.sw-bg-light {
    background-color: var(--sw-bg-primary) !important;
}

.sw-bg-white {
    background-color: var(--sw-white) !important;
}

.sw-shadow-sm {
    box-shadow: var(--sw-shadow-sm) !important;
}

.sw-shadow-md {
    box-shadow: var(--sw-shadow-md) !important;
}

.sw-shadow-lg {
    box-shadow: var(--sw-shadow-lg) !important;
}

.sw-rounded-md {
    border-radius: var(--sw-radius-md) !important;
}

.sw-rounded-lg {
    border-radius: var(--sw-radius-lg) !important;
}

.sw-rounded-xl {
    border-radius: var(--sw-radius-xl) !important;
}

/* ============================================
   BUTTON COMPONENTS
   ============================================ */
.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-family: var(--sw-font-primary);
    font-weight: 600;
    font-size: var(--sw-text-base);
    border-radius: var(--sw-radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.sw-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--sw-shadow-md);
}

.sw-btn:active {
    transform: translateY(0);
}

.sw-btn-primary {
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 129, 75, 0.3);
}

.sw-btn-primary:hover {
    color: white;
    box-shadow: 0 6px 20px rgba(236, 129, 75, 0.4);
}

.sw-btn-secondary {
    background: var(--sw-secondary);
    color: white;
}

.sw-btn-secondary:hover {
    background: var(--sw-secondary-dark);
    color: white;
}

.sw-btn-outline {
    background: transparent;
    border: 2px solid var(--sw-primary);
    color: var(--sw-primary);
}

.sw-btn-outline:hover {
    background: var(--sw-primary);
    color: white;
}

.sw-btn-danger {
    background: linear-gradient(135deg, var(--sw-danger) 0%, var(--sw-danger-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.sw-btn-danger:hover {
    color: white;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.sw-btn-warning {
    background: linear-gradient(135deg, var(--sw-warning) 0%, var(--sw-warning-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.sw-btn-warning:hover {
    color: white;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.sw-btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: var(--sw-text-sm);
}

.sw-btn-lg {
    padding: 0.8rem 1.6rem;
    font-size: var(--sw-text-lg);
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.sw-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--sw-gray-200);
}

.sw-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sw-shadow-hover);
}

.sw-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--sw-gray-100);
    background: var(--sw-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sw-card-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sw-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sw-card-body {
    padding: 1.25rem;
}

.sw-card-footer {
    padding: 1rem 1.25rem;
    background: var(--sw-gray-50);
    border-top: 1px solid var(--sw-gray-100);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.sw-form-group {
    margin-bottom: 1.5rem;
}

.sw-form-label {
    display: block;
    font-weight: 600;
    color: var(--sw-text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.sw-form-input,
.sw-form-select,
.sw-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--sw-font-primary);
    font-size: var(--sw-text-base);
    border: 2px solid var(--sw-gray-200);
    border-radius: var(--sw-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--sw-white);
}

.sw-form-input:focus,
.sw-form-select:focus,
.sw-form-textarea:focus {
    outline: none;
    border-color: var(--sw-primary);
    box-shadow: 0 0 0 4px rgba(236, 129, 75, 0.1);
}

.sw-form-input::placeholder {
    color: var(--sw-gray-400);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.sw-page-header {
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-dark) 100%);
    padding: 1rem 0;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: var(--sw-shadow-md);
}

.sw-page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--sw-secondary);
}

.sw-page-header-subtitle {
    font-size: 0.9rem;
    color: var(--sw-secondary);
    opacity: 0.85;
    margin-bottom: 0;
    font-weight: 400;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.sw-table-responsive {
    overflow-x: auto;
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
}

.sw-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--sw-white);
}

.sw-table th {
    background: var(--sw-gray-50);
    color: var(--sw-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--sw-gray-200);
}

.sw-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--sw-gray-100);
    color: var(--sw-text-primary);
    vertical-align: middle;
}

.sw-table tr:last-child td {
    border-bottom: none;
}

.sw-table tr:hover {
    background-color: var(--sw-gray-5);
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.sw-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sw-badge-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--sw-success);
}

.sw-badge-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--sw-warning);
}

.sw-badge-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--sw-danger);
}

.sw-badge-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--sw-info);
}

.sw-badge-primary {
    background-color: rgba(236, 129, 75, 0.1);
    color: var(--sw-primary);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.sw-alert {
    padding: 1rem;
    border-radius: var(--sw-radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid transparent;
}

.sw-alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--sw-success-dark);
    border-left-color: var(--sw-success);
}

.sw-alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--sw-danger);
    border-left-color: var(--sw-danger);
}

.sw-alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--sw-warning-dark);
    border-left-color: var(--sw-warning);
}

.sw-alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--sw-info-dark);
    border-left-color: var(--sw-info);
}

/* ============================================
   STAT CARDS
   ============================================ */
.sw-stat-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--sw-shadow-sm);
    border: 1px solid var(--sw-gray-200);
    transition: transform 0.3s ease;
}

.sw-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sw-shadow-md);
}

.sw-stat-card-label {
    font-size: 0.9rem;
    color: var(--sw-text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.sw-stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sw-text-primary);
    line-height: 1;
}

.sw-stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(236, 129, 75, 0.1);
    color: var(--sw-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes sw-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sw-animate-fade-in {
    animation: sw-fade-in 0.5s ease-out forwards;
}

.sw-animate-slide-up {
    animation: sw-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    .sw-page-header {
        padding: 1.5rem 0;
    }

    .sw-page-header-title {
        font-size: 1.5rem;
    }

    /* Buttons - Full width and touch-friendly on mobile */
    .sw-btn:not(.sw-btn-sm) {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        padding: 0.75rem 1.5rem;
    }

    .sw-btn-sm {
        width: auto;
        min-height: 40px;
        padding: 0.5rem 1rem;
    }

    .sw-btn-lg {
        min-height: 56px;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    /* Bootstrap button overrides for mobile */
    .btn {
        min-height: 44px;
    }

    .btn-lg {
        min-height: 52px;
        padding: 0.875rem 1.5rem;
    }

    .sw-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    /* Form controls - larger touch targets */
    .sw-form-input,
    .sw-form-select,
    .sw-form-textarea,
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Stat cards adjust for mobile */
    .sw-stat-card-value {
        font-size: 1.5rem;
    }

    /* Ensure flexed button groups stack on mobile */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-wrap: wrap;
    }
}

/* Extra small screens (iPhone SE and similar) */
@media (max-width: 375px) {

    .sw-btn,
    .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }

    .sw-page-header-title {
        font-size: 1.25rem;
    }
}

/* ============================================
   Enhanced Mobile Button & Layout Fixes
   ============================================ */
@media (max-width: 768px) {

    /* Quick action buttons - full width stacking */
    .quick-action-btn {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Button groups - proper stacking */
    .d-grid.gap-2 .btn,
    .d-grid.gap-2 .quick-action-btn {
        margin-bottom: 8px;
    }

    /* Card header buttons - ensure proper layout */
    .card-header .btn,
    .section-card .card-header .btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Stat card numbers smaller on mobile */
    .stat-number {
        font-size: 1.4rem;
    }

    /* Dashboard header adjustments */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .dashboard-header .d-flex {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    /* Better table responsiveness */
    .table-responsive {
        margin: 0 -12px;
        padding: 0 12px;
    }

    /* Schedule items - better touch targets */
    .schedule-item {
        padding: 14px;
        margin-bottom: 10px;
    }

    /* Form buttons in mobile */
    form .btn,
    form button {
        min-height: 48px;
        font-size: 1rem;
    }

    /* Action buttons container */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .action-buttons .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    /* Badge sizing on mobile */
    .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    /* Better spacing for section cards */
    .section-card .card-body {
        padding: 1rem;
    }

    /* Fix container padding on mobile */
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Ensure modals don't overflow */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* iPhone Notch & Safe Area Support */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    @media (max-width: 768px) {
        .page-main-content {
            padding-bottom: env(safe-area-inset-bottom);
        }

        /* Fixed bottom elements need safe area consideration */
        .action-buttons {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* Fix breadcrumb visibility in page header */
.sw-page-header a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.sw-page-header a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.sw-page-header .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Global button min-height (exclude btn-sm for proper sizing in card headers) */
.btn:not(.btn-sm) {
    min-height: 44px;
}

.btn-lg {
    min-height: 52px;
    padding: 0.875rem 1.5rem;
}

/* Form controls - consistent sizing */
.sw-form-input,
.sw-form-select,
.sw-form-textarea,
.form-control,
.form-select {
    min-height: 48px;
    font-size: 16px;
}

/* Extra small screens (iPhone SE and similar) */
@media (max-width: 375px) {

    .sw-btn,
    .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }

    .sw-page-header-title {
        font-size: 1.25rem;
    }
}

/* ============================================
   Enhanced Mobile Button & Layout Fixes
   ============================================ */
@media (max-width: 768px) {

    /* Quick action buttons - full width stacking */
    .quick-action-btn {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Button groups - proper stacking */
    .d-grid.gap-2 .btn,
    .d-grid.gap-2 .quick-action-btn {
        margin-bottom: 8px;
    }

    /* Card header buttons - ensure proper layout */
    .card-header .btn,
    .section-card .card-header .btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Stat card numbers smaller on mobile */
    .stat-number {
        font-size: 1.4rem;
    }

    /* Dashboard header adjustments */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .dashboard-header .d-flex {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    /* Better table responsiveness */
    .table-responsive {
        margin: 0 -12px;
        padding: 0 12px;
    }

    /* Schedule items - better touch targets */
    .schedule-item {
        padding: 14px;
        margin-bottom: 10px;
    }

    /* Form buttons in mobile */
    form .btn,
    form button {
        min-height: 48px;
        font-size: 1rem;
    }

    /* Action buttons container */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .action-buttons .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    /* Badge sizing on mobile */
    .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    /* Better spacing for section cards */
    .section-card .card-body {
        padding: 1rem;
    }

    /* Fix container padding on mobile */
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Ensure modals don't overflow */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* iPhone Notch & Safe Area Support */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    @media (max-width: 768px) {
        .page-main-content {
            padding-bottom: env(safe-area-inset-bottom);
        }

        /* Fixed bottom elements need safe area consideration */
        .action-buttons {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* Fix breadcrumb visibility in page header */
.sw-page-header a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.sw-page-header a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.sw-page-header .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.7) !important;
}

.sw-page-header .breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ============================================
   DOCUMENTATION THEME REMOVED
   (See docs-style.css for documentation specific styles)
   ============================================ */

/* Payment Manual Specific Styles */
.prerequisites-list {
    list-style: none;
    padding: 0;
}

.prerequisites-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--sw-gray-200);
}

.prerequisites-list li:last-child {
    border-bottom: none;
}

.prerequisites-list .icon {
    width: 32px;
    height: 32px;
    background: var(--sw-bg-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sw-primary);
    flex-shrink: 0;
}

.field-list {
    list-style: none;
    padding: 0;
}

.field-list li {
    padding: 0.75rem 1rem;
    background: var(--sw-bg-primary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.field-list li strong {
    color: var(--sw-text-primary);
}

.field-list li span {
    color: var(--sw-text-secondary);
    font-size: 0.9rem;
}

.troubleshooting-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--sw-bg-primary);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.troubleshooting-item .icon {
    color: var(--sw-warning);
    font-size: 1.25rem;
}

.troubleshooting-item .content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.troubleshooting-item .content span {
    color: var(--sw-text-secondary);
    font-size: 0.9rem;
}

.security-note {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.security-note i {
    color: var(--sw-warning);
}

/* Legend Styles for Attendance */
.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--sw-bg-primary);
    border-radius: 8px;
}

.legend-box {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.8rem;
}

.status-P {
    background-color: #4CAF50;
}

.status-AB {
    background-color: #F44336;
}

.status-SCH {
    background-color: #FFEB3B;
    color: black;
}

.status-NS {
    background-color: #9ca3af;
}

/* Sensitive Data Blurring */
.sensitive-number {
    transition: filter 0.3s ease;
}

.sensitive-hidden {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
}

.toggle-sensitive {
    cursor: pointer;
    margin-left: 8px;
    color: var(--primary-color);
    font-size: 0.9em;
    vertical-align: middle;
}

.toggle-sensitive:hover {
    opacity: 0.8;
}

/* Widget Overflow Fixes */
.dashboard-card .card-body {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-card .display-4 {
    font-size: 2rem;
    /* Adjusted from 2.5rem to prevent overflow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .dashboard-card .display-4 {
        font-size: 1.5rem;
    }
}

/* ============================================
   DASHBOARD LAYOUT PATTERN (Unified)
   ============================================ */
.sw-dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sw-dashboard-main {
    flex-grow: 1;
    background: var(--sw-bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    padding: 1.5rem;
    padding-top: 0;
    transition: margin-left 0.3s ease;
}

/* Sidebar Top Offset (Fixed Navbar Consideration) */
:root {
    --sw-navbar-height: 80px;
}

/* Sidebar Integration */
@media (min-width: 992px) {
    .sw-dashboard-layout .sw-left-menu {
        top: var(--sw-navbar-height);
        height: calc(100vh - var(--sw-navbar-height));
        width: 240px;
        transition: width 0.3s ease, margin 0.3s ease;
        position: fixed;
    }

    .sw-dashboard-layout .sw-left-menu.collapsed {
        width: 70px;
    }

    .sw-left-menu.collapsed .sw-left-menu-link span {
        display: none;
    }

    .sw-left-menu.collapsed .sw-left-menu-link i {
        margin-right: 0;
        font-size: 1.25rem;
    }

    .sw-left-menu.collapsed .sw-left-menu-link {
        justify-content: center;
        padding: 0.75rem;
        position: relative;
    }

    .sw-left-menu.collapsed .sw-left-menu-header {
        justify-content: center;
        padding: 1rem 0.5rem;
    }

    .sw-left-menu.collapsed .sw-left-menu-header>div {
        gap: 0 !important;
        justify-content: center;
        width: 100%;
    }

    .sw-left-menu.collapsed .sw-left-menu-logo {
        width: 32px;
        height: 32px;
    }

    .sw-left-menu.collapsed .sw-left-menu-title,
    .sw-left-menu.collapsed .sw-left-menu-user-info,
    .sw-left-menu.collapsed .sw-left-menu-section-title,
    .sw-left-menu.collapsed .sw-left-menu-link span {
        display: none;
    }

    .sw-left-menu.collapsed .sw-left-menu-link {
        justify-content: center;
        padding: 0.75rem 0;
        gap: 0;
    }

    .sw-left-menu.collapsed .sw-left-menu-link i {
        margin-right: 0;
        font-size: 1.1rem;
    }

    .sw-left-menu.collapsed .sw-left-menu-user {
        justify-content: center;
        padding: 1.25rem 0.5rem;
    }

    .sw-dashboard-main {
        margin-left: 240px;
        width: calc(100% - 240px);
        padding: 2rem;
        padding-top: 0;
    }

    .sw-dashboard-layout.sidebar-collapsed .sw-dashboard-main {
        margin-left: 70px;
        width: calc(100% - 70px);
    }

    /* Shared Page Header - Standardized to match "Skaters List" premium look */
    .sw-dashboard-header,
    .dashboard-header,
    .page-header {
        background: linear-gradient(135deg, #ec814b 0%, #c0392b 100%);
        border-radius: 16px;
        color: white;
        margin-top: 0;
        box-shadow: 0 4px 15px rgba(236, 129, 75, 0.3);
    }

    /* Layout specific properties kept for sw-dashboard-header to pre-existing alignment */
    .sw-dashboard-header {
        padding: 1.25rem 2rem;
        margin-bottom: 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .sw-dashboard-header h1,
    .dashboard-header h1,
    .page-header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0px !important;
        color: #2c3e50 !important;
        /* var(--sw-secondary) */
        font-weight: 800 !important;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        letter-spacing: -0.5px !important;
    }

    /* Meta text and subtitles */
    .sw-dashboard-header p,
    .dashboard-header .subtitle,
    .page-header .subtitle,
    .page-header p {
        font-size: 0.85rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        opacity: 1 !important;
        margin-bottom: 0 !important;
    }


    .sw-dashboard-header i,
    .dashboard-header h1 i,
    .page-header h1 i {
        color: var(--sw-secondary) !important;
        /* Dark icons match title */
    }

    /* Standardized Header Action Buttons */
    .sw-header-btn {
        background: rgba(255, 255, 255, 0.9);
        border: none;
        color: var(--sw-primary);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        font-size: 1.1rem;
        text-decoration: none;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .sw-header-btn:hover {
        background: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        color: var(--sw-primary-dark);
    }

    /* Premium Sidebar Collapse Button */
    .sw-left-menu-collapse-btn {
        width: 30px;
        height: 30px;
        background: rgba(255, 255, 255, 0.25) !important;
        border: none;
        border-radius: 50%;
        color: white !important;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 0;
        font-size: 11px;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .sw-left-menu-collapse-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-50%) scale(1.1);
    }
}

/* Mobile Dashboard Layout */
@media (max-width: 991.98px) {
    .sw-dashboard-layout {
        display: block;
    }

    .sw-dashboard-main {
        margin-left: 0 !important;
        padding: 1rem;
        padding-top: 0.5rem;
    }

    .sw-dashboard-layout .sw-left-menu {
        position: fixed !important;
        top: 72px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 0 !important;
        overflow: hidden !important;
        overflow-y: hidden !important;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease;
        box-shadow: none;
        z-index: 1052;
        transform: none !important;
        padding-bottom: 0;
    }

    .sw-dashboard-layout .sw-left-menu.show {
        max-height: 85vh !important;
        overflow-y: auto !important;
        padding-bottom: 20px;
        border-bottom: 2px solid var(--sw-primary);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    }

    .sw-dashboard-header {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: var(--sw-radius-md);
    }
}

/* Reusable Dashboard Components */
.sw-dashboard-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--sw-gray-200);
}

.sw-dashboard-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--sw-gray-100);
    background: var(--sw-gray-50);
    font-weight: 700;
}

/* Stat Card Color Variations */
.sw-stat-card-icon.primary {
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-dark) 100%);
    color: white;
}

.sw-stat-card-icon.success {
    background: linear-gradient(135deg, var(--sw-success) 0%, var(--sw-success-dark) 100%);
    color: white;
}

.sw-stat-card-icon.info {
    background: linear-gradient(135deg, var(--sw-info) 0%, var(--sw-info-dark) 100%);
    color: white;
}

.sw-stat-card-icon.warning {
    background: linear-gradient(135deg, var(--sw-warning) 0%, var(--sw-warning-dark) 100%);
    color: white;
}

.sw-stat-card-icon.danger {
    background: linear-gradient(135deg, var(--sw-danger) 0%, var(--sw-danger-dark) 100%);
    color: white;
}

/* Enhanced Form Elements */
.sw-form-select-multiple {
    min-height: 200px;
    padding: 1rem;
}

/* Heats Module Components */
.heat-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--sw-gray-200);
}

.heat-card-header {
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.filter-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--sw-shadow-sm);
    border-left: 5px solid var(--sw-primary);
}

.results-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
}

.results-card-header {
    background: linear-gradient(135deg, var(--sw-info) 0%, var(--sw-info-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 700;
}

.results-card-body {
    padding: 1.5rem;
}

.results-grid {
    display: grid;
    gap: 1rem;
}

.result-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sw-gray-100);
}

.result-header {
    font-weight: 700;
    color: var(--sw-gray-700);
    background: var(--sw-gray-50);
}

@media (max-width: 768px) {
    .result-row {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

/* Heat Detail Components */
.participant-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.participant-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-xl);
    box-shadow: var(--sw-shadow-md);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 4px solid var(--sw-primary);
}

.participant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sw-shadow-lg);
}

.chest-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--sw-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.participant-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sw-gray-800);
    margin-bottom: 0.25rem;
}

.participant-category {
    font-size: 0.85rem;
    color: var(--sw-gray-500);
    margin-bottom: 1rem;
}