/* Base Theme Colors for Tailwind/CSS compatibility */
:root {
    /* Primary olive color palette */
    --primary: #606C38;
    --primary-dark: #515b2f;
    --primary-light: #7c8b4d;
    --primary-200: #9eaa76;
    
    /* Secondary/accent colors */
    --secondary: #DDA15E;
    --accent: #BC6C25;
    --accent-dark: #a65b1f;
    
    /* Status colors */
    --danger: #8B4513;
    --danger-hover: #723a10;
    --success: #606C38;
    --warning: #DDA15E;
    
    /* Text and UI colors */
    --text-muted: #6c757d;
    --background: #f8f9fa;

    /* For modern gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-primary-accent: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

/* Tailwind CSS compatibility - custom colors */
.bg-primary { background-color: var(--primary) !important; }
.bg-primary-dark { background-color: var(--primary-dark) !important; }
.bg-accent { background-color: var(--accent) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.olive-bg { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.olive-text { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-secondary { color: var(--secondary) !important; }
.border-primary { border-color: var(--primary) !important; }
.border-accent { border-color: var(--accent) !important; }
.border-danger { border-color: var(--danger) !important; }
.border-secondary { border-color: var(--secondary) !important; }
.text-danger { color: var(--danger) !important; }
.from-primary { --tw-gradient-from: var(--primary); }
.to-accent { --tw-gradient-to: var(--accent); }
.to-secondary { --tw-gradient-to: var(--secondary); }
.from-primary-200 { --tw-gradient-from: var(--primary-200); }
.hover\:from-primary-dark:hover { --tw-gradient-from: var(--primary-dark); }
.focus\:ring-primary:focus { --tw-ring-color: var(--primary); }
.focus\:border-primary:focus { border-color: var(--primary) !important; }
.group-focus-within\:text-primary .group:focus-within & { color: var(--primary); }
.hover\:text-primary-dark:hover { color: var(--primary-dark) !important; }

/* Fix hover text visibility - override !important on text-primary */
.hover\:text-white:hover { color: white !important; }
.hover\:text-gray-900:hover { color: #111827 !important; }

/* Button hover effect */
.hover-darker:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: white !important;
}

/* Base styles with Tailwind compatibility */
body {
    background-color: var(--background);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Modern card styling with hover effects */
.card-modern {
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* Add focus state for accessibility */
.card-modern:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Navbar with Tailwind compatible styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    padding: 1rem 2rem;
    background-color: #fff;
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.btn i {
    width: 18px;
    height: 18px;
}

/* Custom button styles with improved hover states */
.btn-custom-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-custom-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-custom-warning {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-custom-warning:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
}

.btn-custom-danger {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-custom-danger:hover {
    background-color: var(--danger-hover);
    border-color: var(--danger-hover);
    color: white;
}

/* Override Bootstrap's colors */
.btn-primary, .bg-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

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

/* Override active state for list items */
.list-group-item.active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-danger {
    background-color: var(--danger) !important;
    border-color: var(--danger) !important;
}

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

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

.btn-warning:hover {
    background-color: #a65b1f !important;
    border-color: #a65b1f !important;
}

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

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

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

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

.btn-outline-danger {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.btn-outline-danger:hover {
    background-color: var(--danger) !important;
    color: white !important;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.badge.bg-primary, .badge.status-open {
    background-color: var(--primary) !important;
    color: white;
}

.badge.bg-warning {
    background-color: var(--accent) !important;
    color: white;
}

.badge.bg-info {
    background-color: var(--secondary) !important;
    color: white;
}

.badge.bg-secondary {
    background-color: var(--text-muted) !important;
}

/* Form Controls */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(96,108,56,.25);
}

/* Override Bootstrap's focus states */
.btn-check:focus + .btn-primary, 
.btn-primary:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(96,108,56,.25);
}

/* Layout */
.container {
    max-width: 1200px;
    padding: 0 2rem;
    margin: 0 auto;
}

/* Card Styles */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    margin-bottom: 1.5rem;
    height: 100%;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.card-body {
    padding: 1.5rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Tabs */
.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border: none;
    border-bottom: 2px solid var(--primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border: none;
    border-bottom: 2px solid var(--primary);
    background: none;
}

/* Timeline */
.timeline-item {
    padding: 1rem;
    border-left: 2px solid var(--primary);
    margin-left: 1rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--primary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.upload-area:hover {
    background-color: rgba(96,108,56,.05);
}

/* ========================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ======================================== */

/* Mobile Navigation */
.mobile-nav-modern {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.5rem 1rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .mobile-nav-modern {
        display: none;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #6b7280;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 48px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary);
    background: rgba(96, 108, 56, 0.1);
    text-decoration: none;
}

.mobile-nav-item .icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-item .label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px; /* Space for mobile nav */
    }

    .container {
        padding: 0 1rem;
    }

    /* Mobile Card Optimizations */
    .card-enhanced {
        margin: 0 0 1rem 0;
        border-radius: 0.75rem;
    }

    .card-body-enhanced {
        padding: 1rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.75rem;
    }

    /* Mobile Button Optimizations */
    .btn-primary-modern,
    .btn-secondary-modern,
    .btn-destructive-modern,
    .btn-ghost-modern {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
        min-height: 48px;
    }

    .btn-sm {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        min-height: 40px;
    }

    /* Mobile Form Improvements */
    .form-input-modern {
        padding: 0.875rem 1rem;
        font-size: 1rem; /* Prevents zoom on iOS */
        min-height: 48px;
    }

    /* Mobile Table Improvements */
    .table-modern {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack layout for mobile */
    .mobile-stack {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .mobile-full-width {
        width: 100% !important;
    }

    /* Hide on mobile */
    .hidden-mobile {
        display: none !important;
    }

    /* Navigation adjustments */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: none;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        border: none;
        border-bottom: 2px solid transparent;
    }

    /* Timeline adjustments */
    .timeline-item {
        margin-left: 0.5rem;
        padding: 0.75rem;
    }

    /* Upload area adjustments */
    .upload-area {
        padding: 1rem !important;
    }

    /* Grid adjustments */
    .grid {
        gap: 1rem;
    }

    /* Hero section mobile */
    .hero-section {
        min-height: 70vh;
    }

    .carousel-caption {
        padding: 1rem;
    }

    .carousel-caption h1 {
        font-size: 1.875rem;
        line-height: 1.2;
    }

    .carousel-caption p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    .container {
        padding: 0 0.75rem;
    }

    /* Extra small buttons for tight spaces */
    .btn-xs {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        min-height: 32px;
    }

    /* Full width modals on small screens */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 1rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Case header mobile */
    .case-header {
        flex-direction: column;
        gap: 1rem;
    }

    .case-actions {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .case-actions .btn {
        width: 100%;
    }

    /* Typography adjustments */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }

    /* Reduce hero text size */
    .carousel-caption h1 {
        font-size: 1.5rem;
    }

    .carousel-caption p {
        font-size: 0.875rem;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    /* Larger touch targets */
    a, button, input, select, textarea {
        min-height: 44px;
    }

    /* Improved tap targets */
    .icon-button {
        padding: 0.75rem;
        min-height: 44px;
        min-width: 44px;
    }

    /* Better spacing for touch */
    .list-group-item {
        padding: 1rem;
    }

    /* Improved dropdown spacing */
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 60vh;
    }

    .mobile-nav-modern {
        padding: 0.25rem 1rem;
    }

    .mobile-nav-item {
        padding: 0.375rem;
    }

    .mobile-nav-item .label {
        display: none; /* Hide labels in landscape */
    }
}

/* Print styles */
@media print {
    .mobile-nav-modern,
    .btn,
    .nav-tabs,
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators {
        display: none !important;
    }

    .card-enhanced {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* Hero Section and Carousel */
.hero-section {
    height: 600px;
    overflow: hidden;
}

.carousel {
    height: 100%;
}

.carousel-inner {
    height: 100%;
}

.carousel-item {
    height: 100%;
    background-size: cover !important;
    background-position: center !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-caption {
    position: relative;
    right: auto;
    left: auto;
    bottom: auto;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
}

.carousel-caption h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.carousel-caption p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.carousel-indicators {
    margin-bottom: 2rem;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
    .hero-section {
        height: 500px;
    }

    .carousel-caption h1 {
        font-size: 2.5rem;
    }

    .carousel-caption p {
        font-size: 1.2rem;
    }

    .carousel-caption .btn {
        font-size: 1rem;
        padding: 0.5rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        height: 400px;
    }

    .carousel-caption h1 {
        font-size: 2rem;
    }

    .carousel-caption p {
        font-size: 1rem;
    }
}

/* ========================================
   MODERN BUTTON SYSTEM
   ======================================== */

/* Primary Action Buttons */
.btn-primary-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

/* Full width buttons - applies to all modern button types */
.btn-primary-modern.w-full,
.btn-secondary-modern.w-full,
.btn-ghost-modern.w-full,
.btn-destructive-modern.w-full,
.w-full .btn-primary-modern,
.w-full .btn-secondary-modern,
.w-full .btn-ghost-modern,
.w-full .btn-destructive-modern,
.w-full.btn-primary-modern,
.w-full.btn-secondary-modern,
.w-full.btn-ghost-modern,
.w-full.btn-destructive-modern {
    display: flex !important;
    width: 100% !important;
    margin-bottom: 0.75rem;
}

/* Override for button containers with proper spacing */
.space-y-4 > .btn-primary-modern,
.space-y-4 > .btn-secondary-modern,
.space-y-4 > .btn-ghost-modern,
.space-y-4 > .btn-destructive-modern,
.space-y-3 > .btn-primary-modern,
.space-y-3 > .btn-secondary-modern,
.space-y-3 > .btn-ghost-modern,
.space-y-3 > .btn-destructive-modern {
    display: flex !important;
    width: 100% !important;
}

/* Specific fix for Quick Actions card buttons */
.card-enhanced .card-body-enhanced .space-y-4 a,
.card-enhanced .card-body-enhanced .space-y-3 a {
    display: block !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
}

/* Force all modern buttons in cards to be full width */
.card-enhanced a[class*="btn-"],
.card-enhanced button[class*="btn-"] {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

/* ========================================
   HERO CAROUSEL IMPROVEMENTS
   ======================================== */

/* Modern carousel indicators */
.carousel-indicators {
    margin-bottom: 0;
}

.carousel-indicators button {
    border: none;
    outline: none;
    cursor: pointer;
}

.carousel-indicators button:focus,
.carousel-indicators button:active {
    outline: none;
    box-shadow: none;
}

.carousel-indicators button.active {
    background-opacity: 1 !important;
    transform: scale(1.2);
}

/* Ensure proper spacing between hero elements */
.hero-scroll-indicator {
    bottom: 1.5rem;
}

.hero-carousel-dots {
    bottom: 5rem;
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(96, 108, 56, 0.3);
    color: white;
    text-decoration: none;
}

.btn-primary-modern:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--primary);
    ring-offset: 2px;
}

.btn-primary-modern:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Secondary Action Buttons */
.btn-secondary-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 2px solid var(--primary);
    color: var(--primary);
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

.btn-secondary-modern:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(96, 108, 56, 0.2);
    text-decoration: none;
}

/* Destructive Actions */
.btn-destructive-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

.btn-destructive-modern:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
    color: white;
    text-decoration: none;
}

/* Ghost Buttons */
.btn-ghost-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    color: #374151;
    background: transparent;
    border: none;
    transition: all 0.2s ease-out;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

.btn-ghost-modern:hover {
    background: #f3f4f6;
    color: var(--primary);
    text-decoration: none;
}

/* Button Size Variants */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 52px;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
    min-height: 60px;
}

/* ========================================
   ENHANCED CARD SYSTEM
   ======================================== */

.card-enhanced {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-enhanced:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-4px);
}

.card-header-enhanced {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.card-header-enhanced h2,
.card-header-enhanced h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.card-body-enhanced {
    padding: 1.5rem;
}

/* Metric Cards */
.metric-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-change {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.metric-change.positive {
    color: #059669;
}

.metric-change.negative {
    color: #dc2626;
}

/* ========================================
   MODERN FORM SYSTEM
   ======================================== */

.form-group-modern {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.form-input-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #111827;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-height: 44px;
}

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

.form-input-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(96, 108, 56, 0.1);
}

.form-input-modern:focus + .form-label-modern {
    color: var(--primary);
}

/* Form Validation States */
.form-input-valid {
    border-color: #059669;
}

.form-input-valid:focus {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-input-invalid {
    border-color: #dc2626;
}

.form-input-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-error-message {
    font-size: 0.875rem;
    color: #dc2626;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.form-success-message {
    font-size: 0.875rem;
    color: #059669;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

/* ========================================
   ICON SYSTEM
   ======================================== */

.icon-xs { width: 0.75rem; height: 0.75rem; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.25rem; height: 1.25rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.icon-xl { width: 2rem; height: 2rem; }
.icon-2xl { width: 3rem; height: 3rem; }

.icon-primary { color: var(--primary); }
.icon-secondary { color: var(--secondary); }
.icon-accent { color: var(--accent); }
.icon-success { color: #059669; }
.icon-warning { color: #d97706; }
.icon-error { color: #dc2626; }
.icon-muted { color: #6b7280; }
.icon-white { color: white; }

.icon-interactive {
    transition: color 0.2s ease;
}

.icon-interactive:hover {
    color: var(--primary);
}

.icon-button {
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}

.icon-button:hover {
    background: #f3f4f6;
}

.icon-button:hover .icon-interactive {
    color: var(--primary);
}

/* ========================================
   STATUS INDICATORS
   ======================================== */

.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    text-shadow: none;
}

/* Standard status indicators for light backgrounds */
.status-active {
    background: #166534;
    color: #ffffff;
    border-color: #15803d;
}

.status-pending {
    background: #d97706;
    color: #ffffff;
    border-color: #ea580c;
}

.status-inactive {
    background: #6b7280;
    color: #ffffff;
    border-color: #9ca3af;
}

.status-closed {
    background: #dc2626;
    color: #ffffff;
    border-color: #ef4444;
}

/* Alternative light status indicators for dark backgrounds */
.status-indicator.status-light {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    font-weight: 700;
    text-shadow: none;
}

.status-indicator.status-light.status-active {
    color: #166534;
    background: rgba(220, 252, 231, 0.95);
    border-color: #166534;
}

.status-indicator.status-light.status-pending {
    color: #d97706;
    background: rgba(254, 243, 199, 0.95);
    border-color: #d97706;
}

.status-indicator.status-light.status-inactive {
    color: #374151;
    background: rgba(243, 244, 246, 0.95);
    border-color: #6b7280;
}

.status-indicator.status-light.status-closed {
    color: #dc2626;
    background: rgba(254, 226, 226, 0.95);
    border-color: #dc2626;
}

/* ========================================
   ENHANCED ANIMATIONS
   ======================================== */

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Staggered fade-in for lists */
.stagger-fade > * {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.stagger-fade > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade > *:nth-child(6) { animation-delay: 0.6s; }

/* Loading States */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

.loading-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Pulse animation for CTA buttons */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(96, 108, 56, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(96, 108, 56, 0); }
    100% { box-shadow: 0 0 0 0 rgba(96, 108, 56, 0); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* 3D Hover effect */
.hover-3d {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-3d:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Animated underline for links */
.animated-underline {
    position: relative;
    text-decoration: none;
}

.animated-underline:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.animated-underline:hover:after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Multi-layer shadow for depth */
.depth-shadow {
    box-shadow:
        0 1px 1px rgba(0,0,0,0.03),
        0 2px 2px rgba(0,0,0,0.03),
        0 4px 4px rgba(0,0,0,0.03),
        0 8px 8px rgba(0,0,0,0.03),
        0 16px 16px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.depth-shadow:hover {
    box-shadow:
        0 1px 1px rgba(0,0,0,0.05),
        0 2px 2px rgba(0,0,0,0.05),
        0 4px 4px rgba(0,0,0,0.05),
        0 8px 8px rgba(0,0,0,0.05),
        0 16px 16px rgba(0,0,0,0.05),
        0 32px 32px rgba(0,0,0,0.05);
}

/* Modern glassmorphism */
.glassmorphism {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ========================================
   NOTIFICATION SYSTEM
   ======================================== */

.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    max-width: 24rem;
    space-y: 1rem;
}

.notification {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1rem;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left: 4px solid #059669;
}

.notification.error {
    border-left: 4px solid #dc2626;
}

.notification.warning {
    border-left: 4px solid #d97706;
}

.notification.info {
    border-left: 4px solid #2563eb;
}

/* ========================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS
   ======================================== */

/* Touch-friendly interactions */
.touch-friendly {
    min-height: 44px; /* iOS recommended minimum */
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(96, 108, 56, 0.1);
}

/* Mobile-friendly button sizing */
@media (max-width: 767px) {
    .btn-primary-modern,
    .btn-secondary-modern,
    .btn-ghost-modern,
    .btn-destructive-modern {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    /* Smaller action buttons for mobile */
    .btn-sm {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Mobile table alternatives */
.table-mobile {
    display: none;
}

@media (max-width: 1023px) {
    .table-desktop {
        display: none;
    }

    .table-mobile {
        display: block;
    }
}

/* Text truncation for mobile */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile modal improvements */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-lg {
        max-width: calc(100% - 1rem);
    }

    .modal-xl {
        max-width: calc(100% - 1rem);
    }
}

/* Form improvements for mobile */
@media (max-width: 767px) {
    .form-group-modern {
        margin-bottom: 1rem;
    }

    .form-input-modern,
    .form-select-modern,
    .form-textarea-modern {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Flash notification mobile positioning */
@media (max-width: 767px) {
    #flash-notification-container {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        justify-content: stretch;
    }

    .notification-message {
        max-width: none;
        width: 100%;
    }
}

/* Touch feedback for interactive elements */
.card-enhanced:active,
.touch-friendly:active {
    transform: scale(0.98);
    transition: transform 0.1s ease-in-out;
}

/* Improved mobile navigation spacing */
@media (max-width: 767px) {
    .mobile-nav-modern {
        padding: 0.75rem 0.5rem;
    }

    .mobile-nav-item {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Responsive container improvements */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Status indicators mobile sizing */
@media (max-width: 767px) {
    .status-indicator {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ========================================
   ACCESSIBILITY & CONTRAST IMPROVEMENTS
   ======================================== */

/* Enhanced contrast for gray text */
.text-gray-400 {
    color: #6b7280 !important; /* Darker gray for better contrast */
}

.text-gray-300 {
    color: #4b5563 !important; /* Much darker for readability */
}

/* Better contrast for icons and secondary text */
.text-gray-secondary {
    color: #374151 !important; /* Dark gray with good contrast */
}

/* Enhanced muted text that's still readable */
.text-muted-readable {
    color: #6b7280 !important;
    font-weight: 500;
}

/* Improved tab styling for better visibility */
.tab-button {
    transition: all 0.2s ease-in-out;
}

.tab-button:not(.active) {
    color: #4b5563 !important; /* Darker gray for inactive tabs */
}

.tab-button:hover {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Better empty state styling */
.empty-state-icon {
    color: #6b7280 !important; /* Better contrast for empty state icons */
}

.empty-state-text {
    color: #374151 !important; /* Darker text for empty states */
}

/* Improved form placeholder and input styling */
.form-input-modern::placeholder {
    color: #6b7280 !important;
    opacity: 1;
}

/* Better search icon contrast */
.search-icon {
    color: #6b7280 !important;
}

/* Enhanced card subtitle readability */
.card-subtitle {
    color: #4b5563 !important;
    font-weight: 500;
}

/* Better contrast for data labels in mobile cards */
.data-label {
    color: #374151 !important;
    font-weight: 600;
}

.data-value {
    color: #111827 !important;
    font-weight: 500;
}

/* ========================================
   AUTH PAGES - LOGIN & REGISTER MOBILE
   ======================================== */

/* Auth page container - ensure proper viewport handling */
.auth-page-container {
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari */
}

/* Mobile-specific auth form optimizations */
@media (max-width: 640px) {
    /* Ensure form inputs don't zoom on iOS (font-size >= 16px) */
    input[type="email"],
    input[type="password"],
    input[type="text"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Better touch targets for form inputs */
    .auth-form input,
    .auth-form select,
    .auth-form textarea {
        min-height: 48px;
        padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    }

    /* Compact spacing for auth forms on mobile */
    .auth-form .space-y-6 {
        gap: 1rem;
    }

    /* Ensure video background doesn't cause scroll issues */
    video.auth-video-bg {
        position: fixed;
        min-width: 100%;
        min-height: 100%;
    }
}

/* Small mobile devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    /* Extra compact form layout */
    .auth-form-card {
        padding: 1rem !important;
    }

    .auth-form-card h2 {
        font-size: 1.5rem !important;
    }

    .auth-form-card .space-y-4,
    .auth-form-card .space-y-6 {
        gap: 0.75rem !important;
    }

    /* Smaller labels on tiny screens */
    .auth-form-card label {
        font-size: 0.8125rem;
    }
}

/* Landscape mobile adjustments for auth pages */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-page-container {
        min-height: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .auth-form-header {
        margin-bottom: 0.5rem !important;
    }

    .auth-form-header h2 {
        font-size: 1.25rem !important;
    }

    .auth-form-header p {
        display: none; /* Hide subtitle in landscape */
    }
}

/* Ensure proper safe area handling for notched devices */
@supports (padding: max(0px)) {
    .auth-page-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Auth form input icons alignment */
.auth-input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
    transition: color 0.2s ease;
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--primary);
}

/* Prevent form card overflow on mobile */
@media (max-width: 640px) {
    .auth-form-card {
        max-width: calc(100vw - 2rem);
        overflow-x: hidden;
    }

    /* Hide decorative elements that might overflow */
    .auth-form-card .decorative-blob {
        display: none !important;
    }
}

/* ========================================
   MOBILE SELECT DROPDOWN FIX
   ======================================== */

/* Ensure select dropdowns display properly on mobile */
@media (max-width: 640px) {
    /* Reset select to native styling for better mobile UX */
    select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: #fff !important;
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 48px;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        padding-right: 2.5rem !important;
        line-height: 1.5;
        cursor: pointer;
    }

    /* Custom dropdown arrow for mobile */
    select {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1.25em 1.25em;
    }

    /* Ensure select text is visible and not cut off */
    select option {
        padding: 12px 16px;
        font-size: 16px;
        line-height: 1.5;
        background-color: #fff;
        color: #111827;
    }

    /* Fix for relative positioned parent containers */
    .relative select {
        position: relative;
        z-index: 1;
    }

    /* Ensure icon container doesn't interfere with select */
    .relative .pointer-events-none {
        z-index: 2;
    }
}

/* iOS-specific select fixes */
@supports (-webkit-touch-callout: none) {
    select {
        -webkit-appearance: none;
        background-color: #fff !important;
    }

    /* Ensure select options are readable on iOS */
    select option {
        color: #000;
        background-color: #fff;
    }
}