/* Golf Club Imola - Custom Styles */

:root {
    /* Colors */
    --golf-dark: #1e3a5f;
    --golf-primary: #2563eb;
    --golf-light: #3b82f6;
    --golf-accent: #60a5fa;
    --golf-green: #10b981;
    --golf-sand: #fef3c7;
    --golf-white: #FFFFFF;
    --golf-text: #1f2937;
    --golf-text-secondary: #6b7280;
    --golf-text-muted: #9ca3af;
    --golf-gradient-start: #1e40af;
    --golf-gradient-end: #06b6d4;

    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.25rem;     /* 20px */
    --font-size-2xl: 1.5rem;     /* 24px */
    --font-size-3xl: 1.875rem;   /* 30px */
    --font-size-4xl: 2.25rem;    /* 36px */

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Spacing */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
}

/* ========================================
   GLOBAL TYPOGRAPHY
   ======================================== */

* {
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--golf-text);
    letter-spacing: -0.011em;
}

/* Headings Scale */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: var(--line-height-tight);
    letter-spacing: -0.025em;
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    color: var(--golf-dark);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-lg);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

h6 {
    font-size: var(--font-size-base);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Paragraph & Text */
p {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-relaxed);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-xs {
    font-size: var(--font-size-xs);
}

.text-lg {
    font-size: var(--font-size-lg);
}

small, .small {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--golf-text-secondary);
}

.text-muted {
    color: var(--golf-text-muted) !important;
}

/* Links */
a {
    color: var(--golf-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--golf-dark);
}

/* Spacing Utilities */
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

/* Background gradient for login */
.bg-golf-gradient {
    background: linear-gradient(135deg, var(--golf-dark) 0%, var(--golf-primary) 50%, var(--golf-light) 100%);
}

/* Navbar */
.bg-golf-dark {
    background-color: var(--golf-dark) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--golf-accent);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* Login Card */
.login-card {
    max-width: 420px;
    width: 100%;
    border: none;
    border-radius: 16px;
}

.golf-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--golf-gradient-start), var(--golf-gradient-end));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.golf-logo i {
    font-size: 2.5rem;
    color: white;
}

.text-golf-dark {
    color: var(--golf-dark);
}

/* Buttons */
.btn-golf {
    background: linear-gradient(135deg, var(--golf-gradient-start), var(--golf-gradient-end));
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-golf:hover {
    background: linear-gradient(135deg, var(--golf-light), var(--golf-accent));
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-golf-outline {
    border: 2px solid var(--golf-primary);
    color: var(--golf-primary);
    background: transparent;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-golf-outline:hover {
    background: var(--golf-primary);
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    border-bottom: 2px solid var(--golf-accent);
    font-weight: 600;
}

/* Default card-header style (when no Bootstrap bg-* class is applied) */
.card-header:not([class*="bg-"]) {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--golf-dark);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--golf-dark), var(--golf-primary));
    color: white;
    font-weight: 500;
    border: none;
    padding: 12px 16px;
}

.table tbody tr:nth-child(even) {
    background-color: rgba(96, 165, 250, 0.08);
}

.table tbody tr:hover {
    background-color: rgba(96, 165, 250, 0.15);
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* Form controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--golf-light);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--golf-text);
}

/* Dashboard cards */
.stat-card {
    border-left: 4px solid var(--golf-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--golf-gradient-start), var(--golf-gradient-end));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon i {
    font-size: 1.8rem;
    color: white;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--golf-dark);
    line-height: 1.2;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Trend Indicators */
.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
}

.stat-trend i {
    font-size: 1.1rem;
}

.trend-up {
    background-color: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.trend-up i {
    color: #10b981;
}

.trend-down {
    background-color: rgba(244, 67, 54, 0.15);
    color: #C62828;
}

.trend-down i {
    color: #F44336;
}

.trend-neutral {
    background-color: rgba(158, 158, 158, 0.15);
    color: #616161;
}

.trend-neutral i {
    color: #9E9E9E;
}

/* Fade-in animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Page header */
.page-header {
    border-bottom: 2px solid var(--golf-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    color: var(--golf-dark);
    font-weight: 600;
}

/* Badge categories */
.badge-cat1 {
    background-color: #FFD700;
    color: #333;
}

.badge-cat2 {
    background-color: #C0C0C0;
    color: #333;
}

/* Score grid */
.score-grid {
    overflow-x: auto;
}

.score-grid table {
    min-width: 100%;
}

.score-grid input[type="number"] {
    width: 60px;
    min-width: 60px;
    text-align: center;
    padding: 8px 4px;
}

/* Mobile optimization for score inputs */
@media (max-width: 768px) {
    .score-grid input[type="number"] {
        width: 50px;
        min-width: 50px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 4px;
        min-height: 44px; /* Touch-friendly */
    }

    /* Optimize number inputs in tables (campo configuration, etc) */
    .table input[type="number"].form-control-sm {
        min-width: 60px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 8px 4px;
        min-height: 42px; /* Touch-friendly */
    }
}

.score-grid .buca-header {
    background: linear-gradient(135deg, var(--golf-primary), var(--golf-light));
    color: white;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
}

.score-grid .par-row {
    background-color: var(--golf-sand);
    font-weight: 500;
}

.score-grid .totals-row {
    background-color: var(--golf-dark);
    color: white;
    font-weight: 600;
}

/* Classifica */
.classifica-table .position-1 {
    background-color: rgba(255, 215, 0, 0.3) !important;
}

.classifica-table .position-2 {
    background-color: rgba(192, 192, 192, 0.3) !important;
}

.classifica-table .position-3 {
    background-color: rgba(205, 127, 50, 0.3) !important;
}

/* Footer */
.footer {
    border-top: 1px solid rgba(27, 94, 32, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        width: 50px;
        height: 50px;
    }

    .stat-card .stat-icon i {
        font-size: 1.5rem;
    }
}

/* Action buttons in tables */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Search/Filter section */
.filter-section {
    background-color: var(--golf-sand);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: var(--golf-accent);
    opacity: 0.7;
    margin-bottom: 1rem;
}

/* Dropdown menu styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.dropdown-item:hover {
    background-color: rgba(96, 165, 250, 0.15);
    color: var(--golf-dark);
}

.dropdown-item i {
    color: var(--golf-primary);
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */

/* Sidebar container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background-color: var(--golf-dark);
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Sidebar header */
.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--golf-gradient-end), var(--golf-accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo i {
    font-size: 1.5rem;
    color: white;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

/* Sidebar navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.25), transparent);
    border-left-color: var(--golf-gradient-end);
    color: white;
}

.sidebar-nav .nav-link .bi-chevron-down {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.sidebar-nav .nav-link[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* Submenu */
.sidebar-nav .submenu {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
}

.sidebar-nav .submenu .nav-link {
    padding: 0.625rem 1.25rem 0.625rem 3.5rem;
    font-size: 0.9rem;
}

.sidebar-nav .submenu .nav-link i {
    font-size: 0.875rem;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
}

.sidebar-user i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sidebar-logout:hover {
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff6b6b;
}

.sidebar-logout i {
    font-size: 1.1rem;
}

/* Main content with sidebar offset */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Mobile header (hidden on desktop) */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--golf-dark);
    color: white;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.mobile-user {
    font-size: 1.5rem;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: 80px;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    margin: 10px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.6), rgba(37, 99, 235, 0.6));
    border-radius: 10px;
    border: 2px solid var(--golf-dark);
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.9), rgba(37, 99, 235, 0.9));
    border-color: rgba(96, 165, 250, 0.3);
}

.sidebar::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--golf-accent), var(--golf-primary));
}

/* Firefox scrollbar */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.6) rgba(0, 0, 0, 0.15);
}

/* ========================================
   MICRO-INTERACTIONS & ANIMATIONS
   ======================================== */

/* Smooth Transitions Global */
*,
*::before,
*::after {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

button,
a,
.btn,
.card,
.nav-link,
input,
select,
textarea {
    transition-duration: 0.2s;
}

/* Button Effects */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.btn:active {
    transform: scale(0.98);
}

.btn-golf:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.btn-golf:active {
    transform: translateY(0);
}

/* Button Ripple Effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Pulse Animation for Primary Actions */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
}

.btn-golf.pulse {
    animation: pulse 2s infinite;
}

/* Card Lift Effect */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card.clickable {
    cursor: pointer;
}

.card.clickable:active {
    transform: translateY(-2px);
}

/* Skeleton Loaders */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0px,
        #e0e0e0 40px,
        #f0f0f0 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.4s ease-in-out infinite;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: 12px;
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    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 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Smooth Hover Effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Focus States */
input:focus,
select:focus,
textarea:focus,
button:focus,
.btn:focus {
    outline: 2px solid var(--golf-accent);
    outline-offset: 2px;
}

/* Scale on Hover */
.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.5s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.5s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.5s ease-out;
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* Progress Bar Animation */
@keyframes progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

.progress-bar-animated {
    animation: progress 1.5s ease-out;
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.8);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Table Row Animations */
.table tbody tr {
    transition: background-color 0.2s ease;
}

/* Input Focus Animations */
.form-control:focus,
.form-select:focus {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

/* Toast Container */
.toast-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

.toast-container.top-right {
    top: var(--spacing-lg);
    right: var(--spacing-lg);
}

.toast-container.top-left {
    top: var(--spacing-lg);
    left: var(--spacing-lg);
}

.toast-container.bottom-right {
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
}

.toast-container.bottom-left {
    bottom: var(--spacing-lg);
    left: var(--spacing-lg);
}

.toast-container.top-center {
    top: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
}

.toast-container.bottom-center {
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
}

/* Toast Item */
.toast-item {
    pointer-events: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: var(--spacing-md);
    min-width: 300px;
    max-width: 500px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    position: relative;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Left-side animations */
.toast-container.top-left .toast-item,
.toast-container.bottom-left .toast-item {
    animation: slideInLeft 0.3s ease-out;
}

.toast-item.removing.left {
    animation: slideOutLeft 0.3s ease-in forwards;
}

.toast-item.removing {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Toast Border Left Accent */
.toast-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast-item.toast-success::before {
    background: var(--golf-green);
}

.toast-item.toast-error::before {
    background: #ef4444;
}

.toast-item.toast-warning::before {
    background: #f59e0b;
}

.toast-item.toast-info::before {
    background: var(--golf-primary);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: var(--spacing-md);
    border-radius: 50%;
}

.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--golf-green);
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.toast-info .toast-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--golf-primary);
}

/* Toast Content */
.toast-content {
    flex-grow: 1;
    padding: var(--spacing-md) 0;
}

.toast-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-xs);
    color: #1f2937;
}

.toast-message {
    font-size: var(--font-size-sm);
    color: #6b7280;
    line-height: 1.5;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: var(--spacing-md);
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #4b5563;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    transform-origin: left;
    animation: toast-progress linear forwards;
}

.toast-success .toast-progress {
    background: var(--golf-green);
}

.toast-error .toast-progress {
    background: #ef4444;
}

.toast-warning .toast-progress {
    background: #f59e0b;
}

.toast-info .toast-progress {
    background: var(--golf-primary);
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .toast-container {
        left: var(--spacing-sm) !important;
        right: var(--spacing-sm) !important;
        transform: none !important;
    }

    .toast-item {
        min-width: unset;
        width: 100%;
    }
}

/* ============================================
   MODAL IMPROVEMENTS
   ============================================ */

/* Modal Backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-backdrop.show {
    opacity: 1;
}

/* Modal Dialog */
.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Modal Content */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Modal Header */
.modal-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
}

.modal-header .modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--golf-dark);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.modal-header .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7280'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-header .btn-close:hover {
    background-color: #f3f4f6;
    transform: scale(1.1);
}

/* Modal Body */
.modal-body {
    padding: var(--spacing-xl);
    color: #4b5563;
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

/* Modal Footer */
.modal-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    gap: var(--spacing-sm);
}

.modal-footer .btn {
    min-width: 100px;
}

/* Modal Sizes */
.modal-sm .modal-content {
    border-radius: 10px;
}

.modal-lg .modal-content,
.modal-xl .modal-content {
    border-radius: 16px;
}

/* Modal Animation Variants */
.modal.fade.modal-slide-up .modal-dialog {
    transform: translate(0, 100%);
}

.modal.show.modal-slide-up .modal-dialog {
    transform: translate(0, 0);
}

.modal.fade.modal-zoom .modal-dialog {
    transform: scale(0.7);
}

.modal.show.modal-zoom .modal-dialog {
    transform: scale(1);
}

/* Fullscreen Modal Improvements */
.modal-fullscreen .modal-content {
    border-radius: 0;
}

.modal-fullscreen .modal-header {
    background: var(--golf-dark);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.modal-fullscreen .modal-title {
    color: white;
}

.modal-fullscreen .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================
   BREADCRUMBS NAVIGATION
   ============================================ */

.breadcrumb-container {
    background: transparent;
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: var(--font-size-sm);
}

.breadcrumb-item {
    color: #6b7280;
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--golf-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-item a:hover {
    color: var(--golf-light);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    padding: 0;
    margin: 0 var(--spacing-sm);
}

/* Mobile Responsive Breadcrumbs */
@media (max-width: 768px) {
    .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .breadcrumb-item {
        white-space: nowrap;
    }

    /* Collapse middle items on mobile */
    .breadcrumb-item:not(:first-child):not(:last-child):not(:nth-last-child(2)) {
        display: none;
    }

    /* Show ellipsis for collapsed items */
    .breadcrumb-item:nth-child(2)::after {
        content: '...';
        color: #9ca3af;
        margin: 0 var(--spacing-xs);
    }
}

/* ============================================
   ADVANCED FILTERS SYSTEM
   ============================================ */

/* Filter Bar Container */
.filter-bar {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.filter-controls {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: var(--spacing-md);
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: #374151;
    margin-bottom: var(--spacing-xs);
}

.filter-group .form-control,
.filter-group .form-select {
    font-size: var(--font-size-sm);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

.filter-actions .btn {
    white-space: nowrap;
}

/* Active Filters (Chips/Tags) */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid #e5e7eb;
    margin-top: var(--spacing-md);
}

.active-filters:empty {
    display: none;
}

.active-filters-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: #6b7280;
    margin-right: var(--spacing-xs);
}

/* Filter Chip/Tag */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: white;
    border: 1px solid var(--golf-primary);
    color: var(--golf-dark);
    padding: 4px 8px 4px 12px;
    border-radius: 16px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    animation: slideInDown 0.3s ease-out;
}

.filter-chip:hover {
    background: #eff6ff;
    border-color: var(--golf-light);
}

.filter-chip-label {
    color: #6b7280;
    font-weight: 400;
    margin-right: 4px;
}

.filter-chip-value {
    color: var(--golf-dark);
    font-weight: 500;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1;
}

.filter-chip-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Clear All Filters Button */
.clear-all-filters {
    font-size: var(--font-size-sm);
    padding: 4px 12px;
    border-radius: 16px;
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-all-filters:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
}

/* Loading State */
.filter-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--golf-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Date Range Picker Styling */
.date-range-inputs {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.date-range-inputs input[type="date"] {
    flex: 1;
    min-width: 0;
}

.date-range-separator {
    color: #9ca3af;
    font-size: var(--font-size-sm);
}

/* Mobile Responsive Filters */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        min-width: unset;
    }

    .filter-actions {
        width: 100%;
        justify-content: stretch;
    }

    .filter-actions .btn {
        flex: 1;
    }

    .active-filters {
        margin-top: var(--spacing-sm);
        padding-top: var(--spacing-sm);
    }
}

/* Search Input with Icon */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .form-control {
    padding-left: 36px;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* ============================================
   TABLE IMPROVEMENTS
   ============================================ */

/* Table Container */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-responsive {
    border-radius: 8px;
    overflow-x: clip;
    overflow-y: visible;
}

/* Enhanced Table Styling */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
    color: #374151;
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
    padding: 1rem 0.75rem;
    vertical-align: middle;
    white-space: nowrap;
}

/* Sticky Header on Scroll */
.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Zebra Striping (Subtle) */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(249, 250, 251, 0.5);
}

/* Hover Effects (More Evident) */
.table-hover tbody tr {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.table-hover tbody tr:hover {
    background-color: #eff6ff !important;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

/* Table Body */
.table tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    color: #4b5563;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Column Alignment */
.table th.text-center,
.table td.text-center {
    text-align: center;
}

.table th.text-end,
.table td.text-end {
    text-align: right;
}

.table th.text-start,
.table td.text-start {
    text-align: left;
}

/* Numeric Columns */
.table td.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

/* Action Column */
.table td.actions {
    text-align: center;
    white-space: nowrap;
}

/* Table Action Buttons */
.table-actions {
    display: inline-flex;
    gap: 4px;
}

.table-actions .btn {
    padding: 4px 8px;
    font-size: var(--font-size-xs);
    line-height: 1;
    border-radius: 4px;
}

.table-actions .btn i {
    font-size: 14px;
}

/* Empty Table State */
.table-empty {
    padding: 3rem;
    text-align: center;
    color: #9ca3af;
}

.table-empty i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
    display: block;
}

.table-empty p {
    font-size: var(--font-size-base);
    margin: 0;
}

/* Table Badges */
.table td .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
}

/* Sortable Table Headers */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem;
}

.table th.sortable:hover {
    background-color: #e5e7eb;
}

.table th.sortable::after {
    content: '\F282';
    font-family: 'bootstrap-icons';
    position: absolute;
    right: 0.75rem;
    opacity: 0.3;
    font-size: 12px;
}

.table th.sortable.asc::after {
    content: '\F286';
    opacity: 1;
    color: var(--golf-primary);
}

.table th.sortable.desc::after {
    content: '\F283';
    opacity: 1;
    color: var(--golf-primary);
}

/* Compact Table Variant */
.table-compact thead th,
.table-compact tbody td {
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-xs);
}

/* Bordered Table Enhancement */
.table-bordered {
    border: 1px solid #e5e7eb;
}

.table-bordered th,
.table-bordered td {
    border-color: #e5e7eb;
}

/* Table Footer */
.table tfoot {
    background-color: #f9fafb;
    font-weight: 600;
    border-top: 2px solid #e5e7eb;
}

.table tfoot td {
    padding: 1rem 0.75rem;
}

/* Mobile Responsive Tables */
@media (max-width: 768px) {
    /* Horizontal Scroll Option */
    .table-responsive-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive-scroll table {
        min-width: 600px;
    }

    /* Card View Option for Mobile */
    .table-card-view {
        display: block;
    }

    .table-card-view thead {
        display: none;
    }

    .table-card-view tbody {
        display: block;
    }

    .table-card-view tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .table-card-view tbody tr:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .table-card-view tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
        text-align: right;
    }

    .table-card-view tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        text-align: left;
        margin-right: 1rem;
    }

    .table-card-view tbody td.actions {
        justify-content: flex-end;
    }

    .table-card-view tbody td.actions::before {
        content: none;
    }

    /* Hide action column labels on mobile */
    .table-actions-mobile-label {
        display: none;
    }
}

/* Loading Overlay for Tables */
.table-loading {
    position: relative;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* Selection Checkbox Column */
.table td.select-checkbox,
.table th.select-checkbox {
    width: 40px;
    text-align: center;
}

.table td.select-checkbox input[type="checkbox"],
.table th.select-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Row Selected State */
.table tbody tr.selected {
    background-color: #dbeafe !important;
}

.table tbody tr.selected:hover {
    background-color: #bfdbfe !important;
}

/* ============================================
   MOBILE RESPONSIVE OPTIMIZATIONS
   ============================================ */

/* Touch-Friendly Buttons (minimum 44px tap target) */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: var(--font-size-base);
    }

    .btn-sm {
        min-height: 38px;
        padding: 8px 16px;
        font-size: var(--font-size-sm);
    }

    .btn-lg {
        min-height: 50px;
        padding: 14px 24px;
        font-size: var(--font-size-lg);
    }

    /* Icon-only buttons */
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
    }
}

/* Cards Stack Vertically on Mobile */
@media (max-width: 768px) {
    .row > [class*="col-"] {
        margin-bottom: var(--spacing-md);
    }

    .row > [class*="col-"]:last-child {
        margin-bottom: 0;
    }

    /* Force full width on small screens */
    .col-sm-12-mobile {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Page Header Mobile */
@media (max-width: 768px) {
    .page-header {
        padding: var(--spacing-md) 0;
    }

    .page-header h1 {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-sm);
    }

    .page-header .btn {
        width: 100%;
        margin-top: var(--spacing-sm);
    }
}

/* Stat Cards Mobile */
@media (max-width: 768px) {
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .stat-card .stat-value {
        font-size: var(--font-size-2xl);
    }

    .stat-card .stat-label {
        font-size: var(--font-size-xs);
    }
}

/* Form Optimizations for Mobile */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
    }

    .form-label {
        font-size: var(--font-size-base);
        font-weight: 600;
        margin-bottom: var(--spacing-sm);
    }

    /* Stack form groups */
    .row .col-md-6,
    .row .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Full-width form buttons */
    .form-actions .btn {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }

    .form-actions {
        display: flex;
        flex-direction: column-reverse;
    }
}

/* Modal Mobile Optimizations */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
    }

    .modal-header,
    .modal-footer {
        padding: var(--spacing-md);
    }

    .modal-body {
        padding: var(--spacing-md);
        overflow-y: auto;
    }

    .modal-footer .btn {
        flex: 1;
    }
}

/* Spacing Optimizations for Thumb Zone */
@media (max-width: 768px) {
    /* Increase spacing between interactive elements */
    .btn-group .btn {
        margin: 0 4px 8px 0;
    }

    .nav-link {
        padding: 12px 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Increase tap target for checkboxes and radios */
    .form-check {
        padding: 12px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .form-check-input {
        width: 24px;
        height: 24px;
        margin-right: 12px;
    }

    .form-check-label {
        font-size: var(--font-size-base);
        cursor: pointer;
        flex: 1;
    }

    /* Dropdown items */
    .dropdown-item {
        padding: 12px 20px;
        min-height: 44px;
        font-size: var(--font-size-base);
    }
}

/* Container Padding Mobile */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }

    .card {
        margin-bottom: var(--spacing-md);
    }

    .card-body {
        padding: var(--spacing-md);
    }
}

/* Charts Mobile Optimization */
@media (max-width: 768px) {
    canvas {
        max-height: 250px;
    }

    .chart-container {
        position: relative;
        height: 250px;
    }
}

/* Badge and Tag Sizing */
@media (max-width: 768px) {
    .badge {
        font-size: var(--font-size-sm);
        padding: 6px 12px;
    }

    .filter-chip {
        font-size: var(--font-size-sm);
        padding: 6px 10px 6px 14px;
    }

    .filter-chip-remove {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }
}

/* Pagination Mobile */
@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-item {
        margin: 2px;
    }

    .page-link {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide page numbers, keep only prev/next */
    .pagination .page-item:not(.disabled):not(.active):not(:first-child):not(:last-child) {
        display: none;
    }

    .pagination .page-item.active {
        display: inline-block;
    }
}

/* Toast Notifications Mobile */
@media (max-width: 576px) {
    .toast-container {
        top: auto !important;
        bottom: var(--spacing-md) !important;
    }

    .toast-item {
        margin-bottom: var(--spacing-sm);
    }
}

/* Alert Mobile */
@media (max-width: 768px) {
    .alert {
        padding: var(--spacing-md);
        font-size: var(--font-size-sm);
    }

    .alert .btn-close {
        padding: var(--spacing-sm);
    }
}

/* Search and Filter Bar Mobile */
@media (max-width: 768px) {
    .search-input-wrapper input {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* List Group Mobile */
@media (max-width: 768px) {
    .list-group-item {
        padding: var(--spacing-md);
        font-size: var(--font-size-base);
    }

    .list-group-item-action {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Horizontal Scrolling Fix */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .row {
        margin-left: 0;
        margin-right: 0;
    }

    .row > * {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Safe Area Insets (for notched devices) */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .sidebar {
            padding-bottom: max(env(safe-area-inset-bottom), var(--spacing-md));
        }

        .mobile-header {
            padding-top: max(env(safe-area-inset-top), var(--spacing-sm));
        }

        .main-content {
            padding-bottom: max(env(safe-area-inset-bottom), var(--spacing-md));
        }
    }
}

/* Small Phone Breakpoint (320px-374px) */
@media (max-width: 374px) {
    :root {
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
    }

    .btn {
        font-size: var(--font-size-sm);
        padding: 10px 16px;
    }

    .page-header h1 {
        font-size: var(--font-size-xl);
    }

    .stat-card .stat-value {
        font-size: var(--font-size-xl);
    }

    .card-body {
        padding: var(--spacing-sm);
    }

    /* Form action buttons: stack vertically on very small screens */
    .form-actions,
    .card-body > form > .d-flex.gap-2:last-child {
        flex-direction: column;
    }

    .form-actions .btn,
    .card-body > form > .d-flex.gap-2:last-child .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 90vh;
    }

    .modal-body {
        max-height: calc(90vh - 120px);
        overflow-y: auto;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .mobile-header,
    .sidebar-overlay,
    .btn,
    .filter-bar,
    .breadcrumb {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .table {
        font-size: 10pt;
    }

    .page-header {
        border-bottom: 2px solid #000;
        margin-bottom: 20pt;
    }
}
