/* Modern Theme Styles - 2025 Design Trends - OPTIMIZED v20250807-1622 */

/* PERFORMANCE OPTIMIZATIONS - Faster tab switching */
* {
    will-change: auto;
}

/* Reduce animations for better performance */
.fade, .modal.fade .modal-dialog {
    transition: opacity 0.15s linear, transform 0.15s ease-out;
}

/* Optimize transitions */
.btn, .card, .modal {
    transition: all 0.2s ease;
}

/* Disable heavy animations on mobile */
@media (max-width: 768px) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* HIDE STATISTICS CARDS ON MOBILE - completely remove them */
    .row.mb-4.g-3 {
        display: none !important;
    }
    
    /* Statistics cards are now completely hidden on mobile - remove all related styles */
    
    /* Force menu buttons to be in one line on mobile */
    .d-flex.justify-content-between.align-items-center .d-flex.flex-column.flex-md-row.gap-2 {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
    
    /* Make buttons smaller on mobile to fit in one line */
    .d-flex.justify-content-between.align-items-center .btn-sm {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
        white-space: nowrap !important;
    }
    
    /* Hide text in user management button on very small screens */
    .d-flex.justify-content-between.align-items-center .btn-sm .d-none.d-sm-inline {
        display: none !important;
    }
    
    /* Smaller filter buttons for mobile - one line layout */
    .btn-group.btn-group-sm .btn {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.35rem !important;
        white-space: nowrap !important;
        min-width: auto !important;
    }
    
    /* Ensure filter buttons stay in one line */
    .btn-group.btn-group-sm {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 1px !important;
    }
    
    /* Better mobile card header layout */
    .card-header .d-flex.flex-column.flex-md-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    /* Card header title smaller on mobile */
    .card-header h5 {
        font-size: 1rem !important;
    }
    
    /* Hide pagination completely on mobile */
    .pagination {
        display: none !important;
    }
    
    /* Responsive container - mobile 100% */
    .responsive-container {
        width: 100% !important;
        margin: 0 auto !important;
    }
}

/* Tablet screens - 768px to 1023px */
@media (min-width: 769px) and (max-width: 1023px) {
    /* Responsive container - tablet 105% - centered with negative margins */
    .responsive-container {
        width: 105% !important;
        margin-left: -2.5% !important;
        margin-right: -2.5% !important;
    }
}

/* Desktop screens - 1024px and above */
@media (min-width: 1024px) {
    /* Responsive container - desktop 110% - centered with negative margins */
    .responsive-container:not(.row) {
        width: 110% !important;
        margin-left: -5% !important;
        margin-right: -5% !important;
    }
    
    /* Keep stats row at 100% to maintain Bootstrap grid alignment */
    .row.responsive-container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Extra large screens - 1400px and above */
@media (min-width: 1400px) {
    /* Responsive container - extra large 115% - centered with negative margins */
    .responsive-container:not(.row) {
        width: 115% !important;
        margin-left: -7.5% !important;
        margin-right: -7.5% !important;
    }
    
    /* Keep stats row at 100% to maintain Bootstrap grid alignment */
    .row.responsive-container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Ultra-wide screens - 1800px and above */
@media (min-width: 1800px) {
    /* Responsive container - ultra-wide 120% - centered with negative margins */
    .responsive-container:not(.row) {
        width: 120% !important;
        margin-left: -10% !important;
        margin-right: -10% !important;
    }
    
    /* Keep stats row at 100% to maintain Bootstrap grid alignment */
    .row.responsive-container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Navbar responsive container - matches responsive-container width but without negative margins */
@media (min-width: 769px) and (max-width: 1023px) {
    .navbar-responsive-container {
        max-width: 1050px !important;
    }
}

@media (min-width: 1024px) {
    .navbar-responsive-container {
        max-width: 1210px !important;
    }
}

@media (min-width: 1400px) {
    .navbar-responsive-container {
        max-width: 1495px !important;
    }
}

@media (min-width: 1800px) {
    .navbar-responsive-container {
        max-width: 1800px !important;
    }
}

/* ============================================================================== */
/* REST OF CSS CONTINUES BELOW - KEEPING ALL EXISTING STYLES INTACT */
/* ============================================================================== */

/* Theme colors and variables */
:root {
    --primary-color: #198754;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* Base styling */
body {
    background-color: #f8f9fa;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark theme support */
body.dark-theme {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

body.dark-theme .card {
    background-color: #16213e;
    border-color: #0f3460;
}

body.dark-theme .table {
    color: #e0e0e0;
}

body.dark-theme .table thead th {
    background-color: #0f3460;
    border-color: #0f3460;
}

/* Card styling improvements */
.card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem;
}

body.dark-theme .card-header {
    background-color: #0f3460;
    border-bottom-color: #0f3460;
}

/* Button styling */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Modal styling */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Table styling */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: none;
    padding: 0.75rem;
}

body.dark-theme .table thead th {
    background-color: #0f3460;
}

.table tbody td {
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
}

body.dark-theme .table tbody td {
    border-color: #0f3460;
}

/* Badge styling */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 0.25rem;
}

/* Form styling */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #d3d3d3;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

body.dark-theme .form-control, body.dark-theme .form-select {
    background-color: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-theme .form-control:focus, body.dark-theme .form-select:focus {
    background-color: #16213e;
    border-color: #667eea;
    color: #e0e0e0;
}

/* Navigation styling */
.navbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.nav-link {
    color: #6c757d !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #667eea !important;
}

.nav-link.active {
    color: #667eea !important;
    font-weight: 600;
}

/* Dashboard tile styling */
.dashboard-tile-all, .dashboard-tile-new, .dashboard-tile-progress, .dashboard-tile-completed, .dashboard-tile-users, .dashboard-tile-comments {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.dashboard-tile-all:hover, .dashboard-tile-new:hover, .dashboard-tile-progress:hover, .dashboard-tile-completed:hover, .dashboard-tile-users:hover, .dashboard-tile-comments:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
}

.dashboard-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.dashboard-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

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

/* Toast styling - Improved */
.toast {
    background: rgba(0, 0, 0, 0.85);
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.toast-header {
    background: transparent;
    border: none;
    color: white;
}

.toast-body {
    padding: 1rem;
    color: white;
    line-height: 1.5;
}

/* Pagination styling */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 0.25rem;
    margin: 0 0.125rem;
    color: #667eea;
    border: 1px solid #e0e0e0;
}

.page-link:hover {
    color: #fff;
    background-color: #667eea;
    border-color: #667eea;
}

.page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

/* Dropdown menu styling */
.dropdown-menu {
    border-radius: 0.375rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item:hover {
    background-color: #f0f0f0;
    color: #667eea;
}

body.dark-theme .dropdown-menu {
    background-color: #16213e;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

body.dark-theme .dropdown-item {
    color: #e0e0e0;
}

body.dark-theme .dropdown-item:hover {
    background-color: #0f3460;
    color: #667eea;
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-size: 0.875rem;
}

.breadcrumb-item.active {
    color: #6c757d;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #764ba2;
}

/* Input group styling */
.input-group .form-control:focus ~ .input-group-text {
    border-color: #667eea;
}

/* List group styling */
.list-group-item {
    border: 1px solid #e0e0e0;
    background-color: #fff;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item.active {
    background-color: #667eea;
    border-color: #667eea;
}

body.dark-theme .list-group-item {
    background-color: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-theme .list-group-item:hover {
    background-color: #0f3460;
}

/* Spinner styling */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25em;
}

.spinner-border.spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
}

/* Progress bar styling */
.progress {
    height: 0.5rem;
    background-color: #e0e0e0;
    border-radius: 0.25rem;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Card text styling */
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

body.dark-theme .card-title {
    color: #e0e0e0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
}

body.dark-theme .card-subtitle {
    color: #999;
}

.card-text {
    color: #6c757d;
    font-size: 0.9rem;
}

body.dark-theme .card-text {
    color: #bbb;
}

/* Link styling */
a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

body.dark-theme a {
    color: #667eea;
}

body.dark-theme a:hover {
    color: #8b9dd9;
}

/* Text utilities */
.text-muted {
    color: #6c757d !important;
}

body.dark-theme .text-muted {
    color: #999 !important;
}

.text-primary {
    color: #667eea !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

/* Background utilities */
.bg-light {
    background-color: #f8f9fa !important;
}

body.dark-theme .bg-light {
    background-color: #0f3460 !important;
}

.bg-white {
    background-color: #fff !important;
}

body.dark-theme .bg-white {
    background-color: #16213e !important;
}

.bg-primary {
    background-color: #667eea !important;
}

.bg-success {
    background-color: #28a745 !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-info {
    background-color: #17a2b8 !important;
}

/* Utility margin and padding */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Flexbox utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-start {
    justify-content: flex-start;
}

.justify-content-end {
    justify-content: flex-end;
}

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

.align-items-start {
    align-items: flex-start;
}

.align-items-end {
    align-items: flex-end;
}

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

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

.flex-wrap {
    flex-wrap: wrap;
}

.flex-fill {
    flex: 1 1 auto;
}

.flex-grow-1 {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* Grid utilities */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}

@media (min-width: 768px) {
    .container { max-width: 720px; }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

/* Row and column utilities */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

@media (min-width: 576px) {
    .d-sm-none { display: none; }
    .d-sm-block { display: block; }
    .d-sm-inline { display: inline; }
    .d-sm-inline-block { display: inline-block; }
}

@media (min-width: 768px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
    .d-md-inline { display: inline; }
    .d-md-inline-block { display: inline-block; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none; }
    .d-lg-block { display: block; }
    .d-lg-inline { display: inline; }
    .d-lg-inline-block { display: inline-block; }
}

@media (min-width: 1200px) {
    .d-xl-none { display: none; }
    .d-xl-block { display: block; }
    .d-xl-inline { display: inline; }
    .d-xl-inline-block { display: inline-block; }
}

/* Visibility utilities */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Overflow utilities */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }

/* Border utilities */
.border { border: 1px solid #e0e0e0; }
.border-0 { border: 0; }
.border-top { border-top: 1px solid #e0e0e0; }
.border-end { border-right: 1px solid #e0e0e0; }
.border-bottom { border-bottom: 1px solid #e0e0e0; }
.border-start { border-left: 1px solid #e0e0e0; }

.rounded { border-radius: 0.25rem; }
.rounded-1 { border-radius: 0.25rem; }
.rounded-2 { border-radius: 0.25rem; }
.rounded-3 { border-radius: 0.375rem; }

/* Shadow utilities */
.shadow { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175); }

/* Text utilities */
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-end { text-align: end; }
.text-justify { text-align: justify; }

.fw-normal { font-weight: 400; }
.fw-bold { font-weight: 700; }
.fw-bolder { font-weight: 800; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.text-decoration-none { text-decoration: none; }
.text-decoration-underline { text-decoration: underline; }
.text-decoration-line-through { text-decoration: line-through; }

/* Float utilities */
.float-start { float: left; }
.float-end { float: right; }
.float-none { float: none; }

/* Position utilities */
.position-static { position: static; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Object fit utilities */
.object-fit-contain { object-fit: contain; }
.object-fit-cover { object-fit: cover; }
.object-fit-fill { object-fit: fill; }
.object-fit-scale-down { object-fit: scale-down; }

/* Aspect ratio utilities */
.aspect-ratio-1x1 { aspect-ratio: 1 / 1; }
.aspect-ratio-16x9 { aspect-ratio: 16 / 9; }
.aspect-ratio-4x3 { aspect-ratio: 4 / 3; }

/* Sizing utilities */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.h-100 { height: 100%; }
.h-auto { height: auto; }

.min-vw-100 { min-width: 100vw; }
.min-vh-100 { min-height: 100vh; }

.max-w-100 { max-width: 100%; }
.max-h-100 { max-height: 100%; }

/* Line height utilities */
.lh-1 { line-height: 1; }
.lh-sm { line-height: 1.25; }
.lh-base { line-height: 1.5; }
.lh-lg { line-height: 1.75; }
.lh-xl { line-height: 2; }

/* Letter spacing utilities */
.ls-1 { letter-spacing: 0.025em; }
.ls-2 { letter-spacing: 0.05em; }

/* Word spacing utilities */
.ws-1 { word-spacing: 0.1em; }
.ws-2 { word-spacing: 0.2em; }

/* White space utilities */
.ws-nowrap { white-space: nowrap; }
.ws-normal { white-space: normal; }
.ws-pre { white-space: pre; }
.ws-pre-wrap { white-space: pre-wrap; }
.ws-pre-line { white-space: pre-line; }

/* Cursor utilities */
.cursor-auto { cursor: auto; }
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-text { cursor: text; }
.cursor-move { cursor: move; }
.cursor-help { cursor: help; }

/* Transition utilities */
.transition { transition: all 0.3s ease; }
.transition-none { transition: none; }

/* Transform utilities */
.translate-x-0 { transform: translateX(0); }
.translate-x-full { transform: translateX(100%); }
.translate-y-0 { transform: translateY(0); }
.translate-y-full { transform: translateY(100%); }

.scale-75 { transform: scale(0.75); }
.scale-100 { transform: scale(1); }
.scale-125 { transform: scale(1.25); }
.scale-150 { transform: scale(1.5); }

.rotate-0 { transform: rotate(0deg); }
.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }

/* Opacity utilities */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Z-index utilities */
.z-0 { z-index: 0; }
.z-1 { z-index: 1; }
.z-auto { z-index: auto; }

/* Interaction utilities */
.user-select-all { user-select: all; }
.user-select-auto { user-select: auto; }
.user-select-none { user-select: none; }

.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Print utilities */
@media print {
    .d-print-none { display: none; }
    .d-print-block { display: block; }
    .d-print-inline { display: inline; }
    .d-print-inline-block { display: inline-block; }
}

/* Animation utilities */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================================== */
/* CUSTOM STYLES FOR APPLICATION FEATURES */
/* ============================================================================== */

/* Photo thumbnails on modal */
.photo-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 5px;
}

.photo-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Modal customizations */
.modal-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.modal-body {
    background-color: white;
}

body.dark-theme .modal-content {
    background-color: #16213e;
}

body.dark-theme .modal-body {
    background-color: #16213e;
    color: #e0e0e0;
}

/* Request list table adjustments */
#requestsTable {
    font-size: 13px;
}

#requestsTable th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#requestsTable .badge {
    font-size: 11px;
    padding: 0.25em 0.4em;
}

/* Column width optimization */
#requestsTable td:nth-child(1) { width: 7% !important; }
#requestsTable td:nth-child(2) { width: 16% !important; }
#requestsTable td:nth-child(3) { width: 12% !important; }
#requestsTable td:nth-child(4) { width: 12% !important; }
#requestsTable td:nth-child(5) { width: 10% !important; }
#requestsTable td:nth-child(6) { width: 10% !important; }
#requestsTable td:nth-child(7) { width: 15% !important; }
#requestsTable td:nth-child(8) { width: 8% !important; }
#requestsTable td:nth-child(9) { width: 10% !important; }

/* ID column styling */
#requestsTable td:nth-child(1) {
    font-weight: 600;
    color: #667eea;
}

/* Resize table columns based on viewport */
@media (max-width: 768px) {
    #requestsTable {
        font-size: 11px;
    }
    
    #requestsTable th, #requestsTable td {
        padding: 0.5rem 0.25rem;
    }
}

/* Request detail modal */
.detail-modal {
    border-radius: 0.5rem;
    overflow: hidden;
}

.detail-modal .modal-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.detail-modal .modal-body {
    padding: 1.5rem;
}

/* Status badge colors */
.badge.badge-new,
.badge.status-badge-new,
span.badge.status-badge-new,
.status-badge-new {
    background-color: #FF0000 !important;
    color: white !important;
    display: inline-block !important;
    padding: 0.25em 0.5em !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: baseline !important;
    border-radius: 0.25rem !important;
}

.badge.badge-progress,
.badge.status-badge-progress,
span.badge.status-badge-progress,
.status-badge-progress {
    background-color: #FFB722 !important;
    color: #000 !important;
    display: inline-block !important;
    padding: 0.25em 0.5em !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: baseline !important;
    border-radius: 0.25rem !important;
}

.badge.badge-completed,
.badge.status-badge-completed,
span.badge.status-badge-completed,
.status-badge-completed {
    background-color: #158997 !important;
    color: white !important;
    display: inline-block !important;
    padding: 0.25em 0.5em !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: baseline !important;
    border-radius: 0.25rem !important;
}

.badge.badge-scheduled,
.status-badge-scheduled {
    background-color: #17a2b8 !important;
    color: white !important;
    display: inline-block !important;
    padding: 0.25em 0.5em !important;
    font-size: 12px !important;
}

.badge.badge-canceled,
.badge.status-badge-cancelled,
span.badge.status-badge-cancelled,
.status-badge-cancelled {
    background-color: #6c757d !important;
    color: white !important;
    display: inline-block !important;
    padding: 0.25em 0.5em !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: baseline !important;
    border-radius: 0.25rem !important;
}

/* Chart styling */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

body.dark-theme .chart-title {
    color: #e0e0e0;
}

/* Calendar styling */
.calendar-container {
    margin-top: 2rem;
}

.calendar-event {
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* File upload styling */
.file-upload-area {
    border: 2px dashed #d3d3d3;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: #667eea;
    background-color: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

body.dark-theme .file-upload-area {
    border-color: #0f3460;
    background-color: transparent;
}

body.dark-theme .file-upload-area:hover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

/* Message styling */
.message {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
}

.message-sender {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

.message-recipient {
    background-color: #f3e5f5;
    border-left: 4px solid #9c27b0;
    color: #4a148c;
}

body.dark-theme .message-sender {
    background-color: rgba(33, 150, 243, 0.1);
    color: #64b5f6;
}

body.dark-theme .message-recipient {
    background-color: rgba(156, 39, 176, 0.1);
    color: #ce93d8;
}

/* Notification styling */
.notification {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    border-left: 4px solid #667eea;
}

.notification.success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.notification.danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.notification.warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.notification.info {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

body.dark-theme .notification {
    border-left-color: #667eea;
}

body.dark-theme .notification.success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #86efac;
}

body.dark-theme .notification.danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #f87171;
}

body.dark-theme .notification.warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #fbbf24;
}

body.dark-theme .notification.info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left-color: #17a2b8;
    color: #67e8f9;
}

/* Icon styling */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5rem;
    vertical-align: -0.125em;
}

.icon-lg {
    width: 1.5em;
    height: 1.5em;
}

.icon-xl {
    width: 2em;
    height: 2em;
}

/* Loading indicator */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.dark-theme .skeleton {
    background: linear-gradient(90deg, #2a2a3e 25%, #3a3a4e 50%, #2a2a3e 75%);
}

/* Tooltip styling */
.tooltip-help {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted #667eea;
}

.tooltip-help .tooltip-text {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 10000;
    bottom: 125%;
    left: 50%;
    margin-left: -90px;
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 180px;
    font-size: 12px;
    font-weight: normal;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
}

.tooltip-help:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-help .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #16213e;
}

/* Image styling */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img.img-responsive {
    width: 100%;
    height: auto;
}

img.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
}

/* Video styling */
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Code styling */
code {
    background-color: #f4f4f4;
    color: #d63384;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
}

body.dark-theme code {
    background-color: #0f3460;
    color: #b8a7ff;
}

pre {
    background-color: #f4f4f4;
    color: #333;
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
}

body.dark-theme pre {
    background-color: #0f3460;
    color: #e0e0e0;
}

pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* Blockquote styling */
blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin-left: 0;
    margin-right: 0;
    color: #6c757d;
}

body.dark-theme blockquote {
    border-left-color: #667eea;
    color: #999;
}

/* Separator styling */
hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1rem 0;
}

body.dark-theme hr {
    border-top-color: #0f3460;
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }
    
    a, a:visited { text-decoration: underline; }
    a[href]:after { content: " (" attr(href) ")"; }
    abbr[title]:after { content: " (" attr(title) ")"; }
    img { max-width: 100%; }
    @page { margin: 0.5cm; }
    p, h2, h3 { orphans: 3; widows: 3; }
    h2, h3 { page-break-after: avoid; }
}

/* Focus visibility for accessibility */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Mobile-specific optimizations */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding-right: 10px;
        padding-left: 10px;
    }
    
    .row {
        margin-right: -10px;
        margin-left: -10px;
    }
    
    .col {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* Tablet-specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    body {
        font-size: 15px;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    body {
        font-size: 16px;
    }
}

/* Table styling - Enhanced */
.table-hover tbody tr:hover {
    background-color: #f5f5f5;
}

body.dark-theme .table-hover tbody tr:hover {
    background-color: #0f3460;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa;
}

body.dark-theme .table-striped tbody tr:nth-of-type(odd) {
    background-color: #16213e;
}

.table-bordered {
    border: 1px solid #e0e0e0;
}

body.dark-theme .table-bordered {
    border-color: #0f3460;
}

/* Company name font size in client column */
#requestsTable td:nth-child(2) small.text-muted {
    font-size: 0.70em !important;
}

/* Fault description text - limit to 4 lines with tooltip */
.fault-description-text {
    max-height: 4.8em !important; /* Better spacing for 4 lines */
    line-height: 1.2 !important; /* Better line spacing */
    overflow: hidden !important;
    display: -webkit-box !important;
    word-wrap: break-word !important;
    /* Webkit browsers - primary method */
    -webkit-line-clamp: 4 !important;
    -webkit-box-orient: vertical !important;
    /* Fallback for other browsers */
    text-overflow: ellipsis !important;
}

/* Add cursor help to the cell containing fault description */
#requestsTable td:nth-child(7) {
    cursor: help !important;
    position: relative;
}

/* Custom tooltip for fault description */
.custom-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 250px;
    width: max-content;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: normal;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-align: left !important; /* Fix alignment to left */
}

/* Also fix the JavaScript generated tooltip popup */
.custom-tooltip-popup {
    text-align: left !important;
}

.custom-tooltip.show {
    opacity: 1;
}

/* Arrow for tooltip */
.custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Reduce reflow during updates */
.btn {
    min-height: 31px;
}

/* Optimize modal transitions and fix modal sizing */
.modal {
    transition: opacity 0.2s ease;
}

.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
}

/* Fix modal sizing - ensure modals fit on screen */
.modal-dialog {
    max-height: 90vh;
    display: flex;
    align-items: center;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    flex-shrink: 0;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    flex-shrink: 0;
}

/* Optimize for better performance */
.card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce paint operations */
.badge {
    will-change: contents;
}

/* Improve filters layout for single row display */
@media (min-width: 992px) {
    #filtersContainer .row {
        gap: 0.25rem;
    }
    
    /* Compact layout for single row */
    #filtersContainer .col-lg-1,
    #filtersContainer .col-lg-2,
    #filtersContainer .col-lg-3 {
        flex: 0 0 auto;
        max-width: fit-content;
    }
    
    /* Better spacing for per page selection */
    #perPageSelect {
        min-width: 92px !important;
        max-width: 92px !important;
    }
    
    /* Ensure filter dropdowns have enough space */
    #vehicleFilter,
    #photoFilter {
        min-width: 160px !important;
        padding-right: 2rem !important;
    }
    
    /* Align status filters in one row */
    .btn-group.btn-group-sm {
        gap: 0 !important;
    }
}

/* Admin Panel - Force text sizing */
body[data-page="admin_panel"] #requestsTable,
body[data-page="admin_panel"] #requestsTable th,
body[data-page="admin_panel"] #requestsTable td,
body[data-page="admin_panel"] #requestsTable .badge,
body[data-page="admin_panel"] #requestsTable .btn,
body[data-page="admin_panel"] #requestsTable .text-muted,
body[data-page="admin_panel"] #requestsTable small,
body[data-page="admin_panel"] #requestsTable a,
body[data-page="admin_panel"] #requestsTable strong,
body[data-page="admin_panel"] #requestsTable em,
body[data-page="admin_panel"] .card-body,
body[data-page="admin_panel"] .card-body * {
    font-size: 13px !important;
}

body[data-page="admin_panel"] #requestsTable th {
    font-size: 12px !important;
    font-weight: 600 !important;
}

body[data-page="admin_panel"] #requestsTable .btn {
    font-size: 12px !important;
    padding: 0.25rem 0.4rem !important;
}

body[data-page="admin_panel"] #requestsTable .badge {
    font-size: 11px !important;
    padding: 0.2em 0.4em !important;
}

/* Service Panel - Force text sizing */
body[data-page="service_panel"] #requestsTable,
body[data-page="service_panel"] #requestsTable th,
body[data-page="service_panel"] #requestsTable td,
body[data-page="service_panel"] #requestsTable .badge,
body[data-page="service_panel"] #requestsTable .btn,
body[data-page="service_panel"] #requestsTable .text-muted,
body[data-page="service_panel"] #requestsTable small,
body[data-page="service_panel"] #requestsTable a,
body[data-page="service_panel"] #requestsTable strong,
body[data-page="service_panel"] #requestsTable em,
body[data-page="service_panel"] .card-body,
body[data-page="service_panel"] .card-body p,
body[data-page="service_panel"] .card-body div,
body[data-page="service_panel"] .card-body span,
body[data-page="service_panel"] .table-responsive,
body[data-page="service_panel"] .table-responsive *,
/* Additional selectors for service panel text */
body[data-page="service_panel"] .card-body p,
body[data-page="service_panel"] .card-body div,
body[data-page="service_panel"] .card-body span,
body[data-page="service_panel"] .badge,
body[data-page="service_panel"] .btn,
body[data-page="service_panel"] .text-muted,
body[data-page="service_panel"] small {
    font-size: 13px !important;
}

/* Service Panel - Override specific elements with higher specificity */
body[data-page="service_panel"] #requestsTable th {
    font-size: 13px !important;
    font-weight: 600 !important;
}

body[data-page="service_panel"] #requestsTable .btn {
    font-size: 13px !important;
    padding: 0.25rem 0.4rem !important;
}

body[data-page="service_panel"] #requestsTable .badge {
    font-size: 13px !important;
    padding: 0.2em 0.4em !important;
}

/* Service Panel - Reduce header title font size and align buttons to the right */
.d-flex.justify-content-between.align-items-center h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

.d-flex.justify-content-between.align-items-center .d-flex.flex-column.flex-md-row {
    justify-content: flex-end !important;
}
