/* Lazer Logistics Management Portal - Main Stylesheet */
/* Cleaned and consolidated for better maintainability */

/* =========================================
   CSS VARIABLES
   ========================================= */

:root {
    /* Colors */
    --color-red: #dc3545;
    --color-orange: #fd7e14;
    --color-yellow: #ffc107;
    --color-teal: #20c997;
    --color-green: #28a745;
    --color-blue: #007bff;
    --color-gray: #6c757d;
    --color-primary: #2c5aa0;
    --color-primary-dark: #1e3d6f;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #e0e0e0;
    --color-bg-light: #f8f9fa;
    --color-bg-main: #f5f5f5;
    
    /* Brand Colors */
    --brand-gradient-start: #f17171ff;
    --brand-gradient-end: #a11a05ff;
    --brand-orange: #F2822C;
    --brand-orange-hover: #F25F2C;
    
    /* Layout */
    --header-height: 80px;
    --sidebar-width: 250px;
    --border-radius: 8px;
    --border-radius-small: 4px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* =========================================
   RESET AND BASE STYLES
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-bg-main);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */

.mb-1 { margin-bottom: 1rem; }
.mb-1-5 { margin-bottom: 1.5rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.p-1 { padding: 1rem; }
.p-1-5 { padding: 1.5rem; }
.p-2 { padding: 2rem; }

.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 1rem; }
.gap-1-5 { gap: 1.5rem; }

/* Spacer utilities */
.section-spacer { height: 2rem; margin: 1rem 0; }
.section-spacer-lg { height: 3rem; margin: 1.5rem 0; }
.section-spacer-sm { height: 1rem; margin: 0.5rem 0; }
.centered-hr { width: 80%; margin: 1rem auto; border: 1px solid var(--color-border); }

/* =========================================
   HEADER STYLES
   ========================================= */

.header {
    background: linear-gradient(135deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 70px;
    width: auto;
    background: white;
    padding: 5px;
    border-radius: 5px;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-info {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* =========================================
   LAYOUT CONTAINER
   ========================================= */

.container {
    display: flex;
    min-height: 100vh;
    margin-top: var(--header-height);
}

/* =========================================
   SIDEBAR STYLES
   ========================================= */

.sidebar {
    width: var(--sidebar-width);
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    box-shadow: var(--box-shadow);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
}

.sidebar h3 {
    padding: 0 1.5rem 1rem;
    font-size: 1.1rem;
    color: #bdc3c7;
    border-bottom: 1px solid #34495e;
    margin-bottom: 1rem;
}

.menu-item {
    display: block;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.menu-item:hover {
    background-color: #34495e;
    padding-left: 2rem;
}

.menu-item.active {
    background-color: #5a6c7d;
    border-left: 4px solid #3498db;
}

.menu-item.has-submenu::after {
    content: '\25B6';
    position: absolute;
    right: 1.5rem;
    transition: transform 0.3s ease;
}

.menu-item.has-submenu.open::after {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #1a252f;
}

.submenu.open {
    max-height: 1000px;
}

.submenu-item {
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.6rem 3rem;
    transition: var(--transition);
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.submenu-item:hover {
    background-color: #34495e;
    color: white;
    padding-left: 3.5rem;
}

.submenu-item.active {
    background-color: #4a5d6e;
    color: white;
    border-left: 4px solid #3498db;
}

/* Nested submenu items (3rd level) */
a.nested-submenu-item,
a.nested-submenu-item:link,
a.nested-submenu-item:visited,
a.nested-submenu-item:active {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 3rem 0.6rem 4rem;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
    min-height: 44px;
    transition: all 0.3s ease;
    background-color: transparent;
}

a.nested-submenu-item:hover {
    background-color: #34495e;
    color: white;
    padding-left: 4.5rem;
}

.sidebar.mobile-open {
    transform: translateX(0);
}

/* =========================================
   MAIN CONTENT STYLES
   ========================================= */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    background: white;
    min-height: calc(100vh - var(--header-height) - 80px);
}

.page-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content-section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--color-border);
}

.content-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* =========================================
   UNIVERSAL FORM ELEMENTS
   ========================================= */

/* Universal Input Styles */
.form-input,
.form-select,
.form-textarea,
.search-input,
.filter-select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s ease;
    background: white;
    min-height: 44px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label,
.filter-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* Universal Radio Button Styles */
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
    border: none !important;
    outline: 1 solid black !important;
    box-shadow: none !important;
    background: none !important;
}

input[type="radio"]:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* For WebKit browsers (Chrome, Safari, Edge) */
input[type="radio"]::-webkit-outer-spin-button,
input[type="radio"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="radio"]:disabled {
    opacity: 1;
    cursor: not-allowed;
}

input[type="radio"]:disabled:checked {
    opacity: 1 !important;
    accent-color: var(--color-primary-dark) !important;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(30, 61, 111, 0.3);
}

/* Universal Label Styles for Radio Buttons */
.scale-label,
.radio-label {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-weight: 500;
    cursor: pointer;
}

.scale-label {
    font-size: 0.8rem;
    text-align: center;
}

input[type="radio"]:disabled:checked + .scale-label,
input[type="radio"]:disabled:checked + .radio-label {
    font-weight: 700;
    color: var(--color-primary-dark) !important;
}

/* =========================================
   FLUID/HYDRAULIC/INSPECTION CONTAINERS
   ========================================= */

.fluid-checks-container {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 1rem 0;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

/* Universal Item Styles */
.fluid-item,
.inspection-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.fluid-item:last-child,
.inspection-item:last-child {
    border-bottom: none;
}

.fluid-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 2rem;
}

.inspection-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.fluid-label,
.inspection-label {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.95rem;
}

.inspection-label {
    margin-bottom: 0.75rem;
}

/* =========================================
   SCALE LAYOUTS
   ========================================= */

.likert-scale {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    align-items: center;
    max-width: 600px;
}

.hydraulic-scale {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.8rem;
    align-items: center;
    max-width: 800px;
}

.pass-fail-options {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.scale-option,
.radio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.radio-option {
    flex-direction: row;
}

/* Hover effects for scale options */
.scale-option:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.scale-option:hover .scale-label {
    font-weight: 600;
}

/* =========================================
   COLOR CODING SYSTEMS
   ========================================= */

/* Fluid Level Colors (1-6: Empty to N/A) */
.scale-option:nth-child(1) .scale-label { color: var(--color-red); }
.scale-option:nth-child(2) .scale-label { color: var(--color-orange); }
.scale-option:nth-child(3) .scale-label { color: var(--color-yellow); }
.scale-option:nth-child(4) .scale-label { color: var(--color-teal); }
.scale-option:nth-child(5) .scale-label { color: var(--color-green); }
.scale-option:nth-child(6) .scale-label { color: var(--color-gray); }

/* Hydraulic Scale Colors (1-10: 1-8, Cold/Full, N/A) */
.hydraulic-scale .scale-option:nth-child(1) .scale-label,
.hydraulic-scale .scale-option:nth-child(2) .scale-label { color: var(--color-red); }
.hydraulic-scale .scale-option:nth-child(3) .scale-label,
.hydraulic-scale .scale-option:nth-child(4) .scale-label { color: var(--color-yellow); }
.hydraulic-scale .scale-option:nth-child(5) .scale-label,
.hydraulic-scale .scale-option:nth-child(6) .scale-label { color: var(--color-teal); }
.hydraulic-scale .scale-option:nth-child(7) .scale-label,
.hydraulic-scale .scale-option:nth-child(8) .scale-label { color: var(--color-green); }
.hydraulic-scale .scale-option:nth-child(9) .scale-label { color: var(--color-blue); }
.hydraulic-scale .scale-option:nth-child(10) .scale-label { color: var(--color-gray); }

/* Pass/Fail Colors */
input[type="radio"][value="Pass"]:checked + .radio-label {
    color: var(--color-green) !important;
}

input[type="radio"][value="Fail"]:checked + .radio-label {
    color: var(--color-red) !important;
}

input[type="radio"][value="Pass"]:checked {
    accent-color: var(--color-green) !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

input[type="radio"][value="Fail"]:checked {
    accent-color: var(--color-red) !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

/* =========================================
   TAB STYLES
   ========================================= */

.tab-container {
    margin-bottom: 1rem;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.tab-button {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-bottom: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-light);
    transition: var(--transition);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-right: 2px;
    min-height: 44px;
}

.tab-button:hover {
    background: #e9ecef;
    color: var(--color-text);
}

.tab-button.active {
    background: white;
    color: #2c3e50;
    border-color: #2c3e50;
    font-weight: 600;
    position: relative;
    top: 2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.tab-status.pretrip {
    background: #cce5ff;
    color: #0066cc;
}

.tab-status.posttrip {
    background: #ffe6cc;
    color: #cc6600;
}

/* =========================================
   INFO CARDS GRID
   ========================================= */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.info-card {
    background: linear-gradient(135deg, #474747 0%, #28282a 100%);
    color: white;
    padding: 0.5rem 1.5rem 0.0rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =========================================
   SITES INFO CARDS GRID
   ========================================= */

.sites-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.sites-info-card {
    background: linear-gradient(135deg, #474747 0%, #28282a 100%);
    color: white;
    /*padding: 0.5rem 1.5rem 0.0rem 1.5rem;*/
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sites-info-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.sites-info-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =========================================
   SEARCH AND FILTER STYLES
   ========================================= */

.search-filter-container {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
}

.search-filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-group {
    flex: 1;
    min-width: 250px;
}

.filter-group {
    min-width: 150px;
}

.search-input {
    padding-left: 2.5rem;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.clear-filters-btn {
    padding: 0.4rem 0.75rem;
    background: #fd7860;
    color: white;
    border: 1px solid #000000;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.3s ease;
    min-height: 44px;
}

.clear-filters-btn:hover {
    background: #e66750;
}

.results-summary {
    margin-top: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 5px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* =========================================
   ACTION BUTTON STYLES
   ========================================= */

.action-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    background-color: #007bff;
    color: white;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
    line-height: 1.2;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background-color: #0056b3;
}

.action-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.action-btn-primary { background: #3498db; color: white; }
.action-btn-primary:hover { background: #2980b9; }

.action-btn-success { background: #2ecc71; color: white; }
.action-btn-success:hover { background: #27ae60; }

.action-btn-danger { background: #e74c3c; color: white; }
.action-btn-danger:hover { background: #c0392b; }

.action-btn-warning { background: #f39c12; color: white; }
.action-btn-warning:hover { background: #e67e22; }

.action-btn-secondary { background: #95a5a6; color: white; }
.action-btn-secondary:hover { background: #7f8c8d; }

/* Disabled button state */
.action-btn:disabled,
.action-btn-primary:disabled,
.action-btn-secondary:disabled,
.action-btn-success:disabled,
.action-btn-danger:disabled,
.action-btn-warning:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
}

.action-btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius-small);
    min-height: 44px;
}

/* =========================================
   STATUS BADGE SYSTEM
   ========================================= */

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.status-default { background: white; }
.status-active { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-inactive { background: #f8d7da; color: #721c24; }
.status-pretrip { background: #bbdac0; color: #5c5c5c; }
.status-posttrip { background: #bfc8d8; color: #5c5c5c; }

.count-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9em;
    text-align: center;
    min-width: 24px;
}

.count-any { background-color: #e0e0e0; color: #585858; border: 1px solid #c7c7c7; }
.count-low { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.count-medium { background-color: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.count-high { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* =========================================
   TABLE STYLES - MOBILE FIRST APPROACH
   ========================================= */

.table-container {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: auto;
}

.responsive-table th,
.responsive-table td {
    padding: 1rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.responsive-table th {
    background: #474747;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.responsive-table td {
    font-size: 0.95rem;
}

.responsive-table tbody tr:hover {
    background-color: var(--color-bg-light);
}

.text-sm td {
    font-size: smaller;
}
.text-sm th {
    font-size: smaller;
}

/* Desktop column widths */
@media (min-width: 769px) {
    .responsive-table {
        min-width: 800px;
    }
    
    .responsive-table th:nth-child(1), 
    .responsive-table td:nth-child(1) { width: 15%; min-width: 120px; }
    .responsive-table th:nth-child(2), 
    .responsive-table td:nth-child(2) { width: 20%; min-width: 150px; }
    .responsive-table th:nth-child(3), 
    .responsive-table td:nth-child(3) { width: 15%; min-width: 100px; }
    .responsive-table th:nth-child(4), 
    .responsive-table td:nth-child(4) { width: 25%; min-width: 180px; }
    .responsive-table th:nth-child(5), 
    .responsive-table td:nth-child(5) { width: 25%; min-width: 150px; }
}

/* Tablet layout */
@media (max-width: 768px) and (min-width: 481px) {
    .responsive-table {
        min-width: 600px;
        font-size: 0.9rem;
    }
    
    .responsive-table th,
    .responsive-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .responsive-table th:nth-child(1), 
    .responsive-table td:nth-child(1) { width: 20%; min-width: 100px; }
    .responsive-table th:nth-child(2), 
    .responsive-table td:nth-child(2) { width: 25%; min-width: 120px; }
    .responsive-table th:nth-child(3), 
    .responsive-table td:nth-child(3) { width: 15%; min-width: 80px; }
    .responsive-table th:nth-child(4), 
    .responsive-table td:nth-child(4) { width: 20%; min-width: 140px; }
    .responsive-table th:nth-child(5), 
    .responsive-table td:nth-child(5) { width: 20%; min-width: 140px; }
    
    /* Smaller button for tablet */
    .action-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        white-space: nowrap;
    }
}

/* Mobile layout - CARD STYLE */
@media (max-width: 480px) {
    .table-container {
        overflow: visible;
    }
    
    .responsive-table {
        display: block;
        width: 100%;
        border: none;
        background: transparent;
    }
    
    .responsive-table thead {
        display: none;
    }
    
    .responsive-table tbody {
        display: block;
        width: 100%;
    }
    
    .responsive-table tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: white;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .responsive-table td {
        display: block;
        border: none;
        padding: 0.5rem 0;
        text-align: left;
        position: relative;
        padding-left: 35%;
        min-height: 40px;
        word-wrap: break-word;
        overflow-wrap: anywhere;
    }
    
    .responsive-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 0.5rem;
        width: 30%;
        font-weight: bold;
        color: #666;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .responsive-table td:last-child {
        border-bottom: none;
        padding-top: 1rem;
        padding-left: 0;
        text-align: center;
    }
    
    .responsive-table td:last-child:before {
        display: none;
    }
    
    /* Mobile action button */
    .responsive-table .action-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 6px;
        font-weight: 500;
    }
    
    /* Empty state for mobile cards */
    .responsive-table .empty-state {
        display: block;
        text-align: center;
        padding: 2rem 1rem;
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        color: #666;
        margin: 1rem 0;
    }
}

/* =========================================
   PAGINATION STYLES
   ========================================= */

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-buttons {
    display: flex;
    gap: 0.25rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    color: var(--color-text);
    cursor: pointer;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
    transition: var(--transition);
    min-height: 44px;
}

.page-btn:hover:not(:disabled) {
    background: var(--color-bg-light);
    border-color: #999;
}

.page-btn.active {
    background: linear-gradient(135deg, #cecfcfff 0%, #868686ff 100%);
    color: white;
    border-color: #667eea;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-bg-light);
}

.records-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* =========================================
   LOADING INDICATOR
   ========================================= */

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
}

#loadingOverlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(255, 255, 255, 0.95) !important;
    z-index: 999999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

#loadingOverlay.hidden {
    display: none !important;
}

.spinner-container {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--color-border);
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--brand-gradient-end);
    border-radius: 50%;
    animation: spinOnly 1s linear infinite;
    margin: 0 auto 1rem auto;
}

.spinner-text {
    color: var(--color-text-light);
    font-size: 1rem;
    margin-top: 0.5rem;
}

@keyframes spinOnly {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================================
   MODAL STYLES
========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-container {
    background: white;
    border-radius: var(--border-radius);
    max-width: 95vw;
    max-height: 90vh;
    width: 1200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.details-btn {
    background-color: #fd7860;
    color: white;
}

.details-btn:hover {
    background-color: #fd5757;
}

.defects-table-container {
    overflow-x: auto;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-table th,
.modal-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.modal-table th {
    background: #474747;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-table tbody tr:hover {
    background-color: #f8f9fa;
}

.defect-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.defect-badge {
    background: #e74c3c;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}


.modal-large {
    max-width: 90vw;
    width: 1000px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg-light);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text-light);
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
}

.modal-close:hover {
    background: #f0f0f0;
    color: var(--color-text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: var(--color-bg-light);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}
/* =========MODAL 3=========================*/
#level3DetailModal .modal-table td {
    vertical-align: top;
    max-width: 200px;
    word-wrap: break-word;
}

/*#level3DetailModal .modal-table td:last-child {
    max-width: 15vw;
}*/
#level3DetailModal .modal-table td:nth-child(1) { width: 10%; }
#level3DetailModal .modal-table td:nth-child(2) { width: 10%; }
#level3DetailModal .modal-table td:nth-child(3) { width: 45%; } /* Largest */
#level3DetailModal .modal-table td:nth-child(4) { width: 20%; }
#level3DetailModal .modal-table td:nth-child(5) { width: 15%; }


.level3-row {
    font-size: 0.7em;
}

.level3-row td {
    padding: 0.6rem 0.75rem;
}
/* =========================================
/* =========================================
   END OF MODAL STYLES
========================================= */

/* =========================================
   INVOICE MODAL STYLES
========================================= */
/* Invoice Modal Styles */
/* ID link styling for clickable invoice IDs */
.id-link {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.id-link:hover {
    background-color: #e3f2fd;
    text-decoration: underline;
}

.id-separator {
    color: #666;
    margin: 0 2px;
}

.invoice-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}
/* =========================================
   END OF INVOICE MODAL STYLES
========================================= */


/* =========================================
   SUMMARY STYLES
   ========================================= */

.truck-summary {
    background: var(--color-bg-light);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-left: 3px solid var(--brand-orange);
    background-color: var(--color-bg-light);
}

.summary-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.summary-value {
    font-size: 1.1rem;
    color: #212529;
    margin-left: 0.25rem;
}

/* Special summary layouts */
#level3Summary,
#truckSummary {
    display: flex !important;
    gap: 0 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: var(--border-radius) !important;
    overflow: hidden !important;
}

#level3Summary .summary-item,
#truckSummary .summary-item {
    flex: 1 !important;
    margin: 0 !important;
    padding: 15px !important;
    border-right: 1px solid #dee2e6 !important;
    background: var(--color-bg-light) !important;
}

#level3Summary .summary-item:last-child,
#truckSummary .summary-item:last-child {
    border-right: none !important;
}

/* =========================================
   FOOTER STYLES
   ========================================= */

.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-left: var(--sidebar-width);
    box-shadow: var(--box-shadow);
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* =========================================
   SPECIAL COMPONENTS
   ========================================= */

/* Date picker styling */
input[type="date"].filter-select {
    width: 140px;
    min-width: 120px;
    height: 42px;
    color: var(--color-text);
    font-size: 16px;
}

.date-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-inputs span {
    color: var(--color-text-light);
    font-size: 0.9rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    height: 42px;
}

.date-clear-btn,
button[onclick*="clearDateRange"] {
    padding: 0.8rem;
    border: 1px solid #ddd;
    background: var(--color-bg-light);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 0.8rem;
    min-width: 32px;
    height: 42px;
    color: var(--color-text-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;
}

.date-clear-btn:hover,
button[onclick*="clearDateRange"]:hover {
    background: #e9ecef;
    border-color: #aaa;
    color: var(--color-text);
}

/* Image modal styles */
.image-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    overflow: hidden;
}

.image-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-carousel {
    position: relative;
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Image Carousel Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    -webkit-user-select: none;
    user-select: none;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.carousel-nav:disabled {
    background: rgba(128, 128, 128, 0.5);
    color: #666;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
    opacity: 0.6;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* Full Screen Image Modal Close Button */
.image-modal-overlay .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    min-width: 44px;
    min-height: 44px;
}

.image-modal-overlay .modal-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Utility classes for special layouts */
.mobile-responsive-layout {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.results-summary-box {
    background: var(--color-bg-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    width: 250px;
    flex: 0 0 250px;
}

.search-controls-container {
    flex: 1;
    min-width: 300px;
}

.results-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.results-number {
    font-size: 3rem;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

.results-label {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

/* Print styles */
@media print {
    .print-button,
    .tab-nav {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
}
/* =========================================
   FAILURE MODAL
   ========================================= */
/* Failure Detail Modal Styles */
        .failure-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
        }

        .failure-modal-container {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            width: 90vw;
            max-width: 800px;
            max-height: 90vh;
            overflow: hidden;
        }

        .failure-modal-header {
            background: #f8f9fa;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .failure-modal-header h3 {
            margin: 0;
            color: #2c3e50;
            font-size: 1.2rem;
        }

        .failure-modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #666;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.2s ease;
            min-width: 44px;
            min-height: 44px;
        }

        .failure-modal-close:hover {
            background-color: #e0e0e0;
            color: #333;
        }

        .failure-modal-body {
            padding: 2rem 2.5rem;
            max-height: 70vh;
            overflow-y: auto;
            background: #fefefe;
        }

        .failure-memo {
            background: white;
            padding: 2rem;
            border: 1px solid #d0d0d0;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
        }

        .memo-header {
            border-bottom: 2px solid #333;
            padding-bottom: 1rem;
            margin-bottom: 1.5rem;
        }

        .memo-title {
            font-size: 1.4rem;
            font-weight: bold;
            color: #333;
            margin: 0 0 0.5rem 0;
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .memo-subtitle {
            text-align: center;
            color: #666;
            font-size: 0.9rem;
            font-style: italic;
        }

        .memo-section {
            margin-bottom: 1.5rem;
        }

        .memo-section-title {
            font-size: 1.1rem;
            font-weight: bold;
            color: #2c3e50;
            margin: 0 0 0.75rem 0;
            padding-bottom: 0.25rem;
            border-bottom: 1px solid #e0e0e0;
            text-transform: uppercase;
            font-size: 0.95rem;
            letter-spacing: 0.5px;
        }

        .memo-field-row {
            display: flex;
            margin-bottom: 0.5rem;
            align-items: flex-start;
        }

        .memo-field-label {
            font-weight: 600;
            color: #444;
            min-width: 140px;
            flex-shrink: 0;
            margin-right: 1rem;
            font-size: 0.9rem;
        }

        .memo-field-value {
            color: #333;
            word-wrap: break-word;
            flex: 1;
            font-size: 0.9rem;
        }

        .memo-field-value.empty {
            color: #999;
            font-style: italic;
        }

        .memo-field-value.json-data {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 3px;
            padding: 0.75rem;
            font-family: 'Courier New', monospace;
            font-size: 0.8rem;
            white-space: pre-wrap;
            max-height: 150px;
            overflow-y: auto;
            margin-top: 0.25rem;
        }

        .memo-field-value a {
            color: #0066cc;
            text-decoration: none;
        }

        .memo-field-value a:hover {
            text-decoration: underline;
        }

        .failure-modal-footer {
            background: #f8f9fa;
            padding: 1rem 1.5rem;
            border-top: 1px solid #e0e0e0;
            text-align: right;
        }

        .view-failure-btn {
            background: #007bff;
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
            transition: background-color 0.2s ease;
            min-height: 44px;
        }

        .view-failure-btn:hover {
            background: #0056b3;
        }

        .close-failure-btn {
            background: #6c757d;
            color: white;
            border: none;
            padding: 0.5rem 1.5rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: background-color 0.2s ease;
            min-height: 44px;
        }

        .close-failure-btn:hover {
            background: #545b62;
        }

        /* Special styling for different data types */
        .failure-detail-item.highlight {
            border-left: 4px solid #007bff;
            background: #f0f8ff;
        }

        .failure-detail-item.warning {
            border-left: 4px solid #ffc107;
            background: #fffbf0;
        }

        .failure-detail-item.error {
            border-left: 4px solid #dc3545;
            background: #fff5f5;
        }

/* =============================================
    Z-INDEX HIERARCHY VALIDATION
================================================*/
/* 
Current z-index stack (highest to lowest):
1. Image Modal: 999999 (highest priority)
2. Ignore Modal: 99999 (second priority) 
This hierarchy is correct for typical use cases.
*/

/* =============================================
    IGNORE MODAL - ENHANCED MOBILE RESPONSIVENESS
================================================*/
.ignore-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    /* Enhanced for mobile */
    overflow-y: auto;
}

.ignore-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    /* Enhanced for mobile */
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Tablet Breakpoint */
@media (max-width: 1024px) {
    .col-priority-6,
    .col-priority-7 {
        display: none;
    }
}

/* Medium Tablet */
@media (max-width: 900px) {
    .col-priority-5 {
        display: none;
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    /* Hide columns */
    .col-priority-4 { display: none; }
    
    /* Header adjustments */
    .mobile-menu-toggle { display: block; }
    .header { 
        padding: 1rem; 
        height: 60px;
    }
    .header h1 { font-size: 1.4rem; }
    .header-info { font-size: 0.8rem; display: none; }
    .header-logo { height: 30px; }
    
    /* Layout adjustments */
    .container { margin-top: 60px; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        top: 60px;
        width: 280px;
    }
    
    .main-content, .footer {
        margin-left: 0;
        padding: 1rem;
    }
    
    .content-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Form and filter adjustments */
    .search-filter-container {
        padding: 1rem;
    }
    
    .search-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .search-group, .filter-group {
        min-width: 100%;
        width: 100%;
    }
    
    .search-input,
    .filter-select {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom */
        width: 100%;
    }
    
    .clear-filters-btn {
        width: 100%;
        min-height: 44px;
        margin-top: 0.5rem;
    }
    
    /* Scale adjustments */
    .fluid-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .likert-scale {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .hydraulic-scale {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
    
    .pass-fail-options {
        gap: 1.5rem;
    }
    
    input[type="radio"] {
        width: 16px;
        height: 16px;
    }
    
    .scale-label, .radio-label {
        font-size: 0.7rem;
    }
    
    /* Tab adjustments */
    .tab-nav { 
        flex-direction: column; 
        gap: 2px;
    }
    .tab-button {
        width: 100%;
        margin: 0;
        border-radius: var(--border-radius);
        border: 1px solid var(--color-border);
        text-align: center;
        min-height: 44px;
    }
    .tab-button.active { 
        top: 0; 
        border-color: #2c3e50;
    }
    
    /* Grid adjustments */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-card { 
        padding: 1rem; 
        text-align: left;
    }
    
    /* Pagination adjustments */
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.5rem;
    }
    
    .pagination-buttons {
        order: 1;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-info {
        order: 2;
        text-align: center;
        font-size: 0.8rem;
    }
    
    .page-btn { 
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem 0.5rem;
    }
    
    .records-per-page {
        order: 3;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .records-per-page select {
        min-height: 44px;
        font-size: 16px;
    }
    
    .action-buttons { 
        gap: 0.75rem;
        justify-content: center;
    }
    
    .action-buttons .action-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile responsive layout adjustments */
    .mobile-responsive-layout {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .results-summary-box {
        width: 100% !important;
        min-width: 100% !important;
        margin-bottom: 1rem;
        order: 1;
        text-align: center;
    }
    
    .search-controls-container {
        min-width: 100% !important;
        order: 2;
    }
    
    /* Date controls mobile layout */
    .date-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    
    .date-inputs {
        display: flex;
        gap: 0.5rem;
        align-items: center;
        justify-content: space-between;
    }
    
    .date-inputs input[type="date"] {
        flex: 1;
        min-width: 0;
        width: auto !important;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .date-clear-btn,
    button[onclick*="clearDateRange"] {
        flex-shrink: 0;
        min-height: 44px; /* Touch target */
    }
    
    /* Modal mobile responsiveness */
    .modal-container {
        max-width: 95vw;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-table {
        font-size: 0.85rem;
    }
    
    .modal-table th,
    .modal-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Image modal mobile */
    .image-modal-overlay .modal-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .carousel-image {
        max-width: 95%;
        max-height: 85%;
    }
    
    /* Ignore modal mobile */
    .ignore-modal-container {
        width: 95%;
        max-width: none;
        max-height: 95vh;
        top: 2.5vh;
        transform: translateX(-50%);
        position: fixed;
    }
    
    .ignore-modal-header {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .ignore-modal-title {
        font-size: 1rem;
    }
    
    .ignore-modal-body {
        padding: 0.75rem;
    }
    
    .ignore-modal-footer {
        padding: 0.75rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .ignore-modal-footer button {
        width: 100%;
        margin: 0;
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
    
    .ignore-notes-textarea {
        font-size: 16px;
        min-height: 100px;
    }
    
    .ignore-info-box.dvir-list {
        max-height: 80px;
        font-size: 0.8rem;
    }
    
    /* Failure modal mobile */
    .failure-modal-container {
        width: 95vw;
        max-height: 95vh;
    }
    
    /* Site Dock Walks Modal - Mobile */
    #siteDockwalksModal .modal-container {
        width: 95vw;
        max-width: none;
        max-height: 95vh;
        margin: 2.5vh auto;
        overflow-y: auto;
    }
    
    #siteDockwalksModal .modal-header h3 {
        font-size: 1.1rem;
        line-height: 1.2;
        padding-right: 3rem;
    }
    
    #siteDockwalksModal .info-table {
        font-size: 0.85rem;
    }
    
    #siteDockwalksModal .info-table td {
        padding: 0.4rem 0.6rem;
    }
    
    #siteDockwalksModal .info-table .label {
        min-width: 80px;
        font-size: 0.8rem;
    }
    
    #siteDockwalksModal .responsive-table {
        font-size: 0.75rem;
    }
    
    #siteDockwalksModal .responsive-table th,
    #siteDockwalksModal .responsive-table td {
        padding: 0.4rem 0.3rem;
        min-width: 60px;
    }
    
    #siteDockwalksModal .action-btn-small {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    #siteDockwalksModal .dockwalks-table-container {
        overflow-x: auto;
    }
    
    .failure-modal-header,
    .failure-modal-body,
    .failure-modal-footer {
        padding: 1rem;
    }
    
    /* Typography mobile scaling */
    .page-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .content-section h3 {
        font-size: 1.2rem;
    }
    
    /* Status badge mobile sizing */
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .count-badge {
        font-size: 0.8rem;
        padding: 2px 6px;
        min-width: 20px;
    }
}

/* Small Mobile Breakpoint */
@media (max-width: 600px) {
    .col-priority-3 { display: none; }
    
    .date-inputs {
        flex-wrap: wrap;
    }
    
    .date-inputs input[type="date"] {
        width: 100% !important;
        min-width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .date-inputs span {
        display: none; /* Hide "to" text on very small screens */
    }
}

/* Extra Small Mobile Breakpoint */
@media (max-width: 480px) {
    .col-priority-2 { display: none; }
    
    .header {
        padding: 0.5rem 1rem;
        height: 60px;
    }
    
    .container { margin-top: 60px; }
    .sidebar { 
        top: 60px; 
        width: 280px; 
    }
    
    .header h1 { font-size: 1.2rem; }
    .main-content {
        padding: 0.5rem;
        min-height: calc(100vh - 60px - 60px);
    }
    
    .content-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .menu-item, .submenu-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .submenu-item { 
        padding: 0.8rem 3rem; 
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .records-per-page { margin-bottom: 0.5rem; }
    
    .hydraulic-scale {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    /* Small mobile ignore modal */
    .ignore-modal-container {
        width: 98%;
        max-height: 98vh;
        top: 1vh;
        border-radius: 4px;
    }
    
    .ignore-modal-header {
        padding: 0.5rem;
    }
    
    .ignore-modal-body {
        padding: 0.5rem;
    }
    
    .ignore-modal-footer {
        padding: 0.5rem;
    }
    
    .ignore-warning-message {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .ignore-info-section p {
        font-size: 0.9rem;
    }
    
    /* Typography extra small mobile */
    .page-title {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .content-section h3 {
        font-size: 1.1rem;
    }
}

/* =========================================
   DOCK WALKS TABLE CUSTOM WIDTHS
   ========================================= */

/* Desktop dock walks table column widths */
@media (min-width: 769px) {
    .dockwalks-table .responsive-table {
        min-width: 1200px;
    }
    
    .dockwalks-table .responsive-table th:nth-child(1), 
    .dockwalks-table .responsive-table td:nth-child(1) { width: 6%; min-width: 50px; }  /* Submission ID */
    .dockwalks-table .responsive-table th:nth-child(2), 
    .dockwalks-table .responsive-table td:nth-child(2) { width: 18%; min-width: 150px; }   /* Status */
    .dockwalks-table .responsive-table th:nth-child(3), 
    .dockwalks-table .responsive-table td:nth-child(3) { width: 18%; min-width: 150px; } /* Customer */
    .dockwalks-table .responsive-table th:nth-child(4), 
    .dockwalks-table .responsive-table td:nth-child(4) { width: 8%; min-width: 70px; } /* Address */
    .dockwalks-table .responsive-table th:nth-child(5), 
    .dockwalks-table .responsive-table td:nth-child(5) { width: 6%; min-width: 50px; } /* City */
    .dockwalks-table .responsive-table th:nth-child(6), 
    .dockwalks-table .responsive-table td:nth-child(6) { width: 6%; min-width: 50px; }   /* State */
    .dockwalks-table .responsive-table th:nth-child(7), 
    .dockwalks-table .responsive-table td:nth-child(7) { width: 15%; min-width: 130px; }   /* ZIP */
    .dockwalks-table .responsive-table th:nth-child(8), 
    .dockwalks-table .responsive-table td:nth-child(8) { width: 15%; min-width: 130px; } /* Completed By */
    .dockwalks-table .responsive-table th:nth-child(9), 
    .dockwalks-table .responsive-table td:nth-child(9) { width: 16%; min-width: 140px; } /* Created Date */
}

/* Tablet dock walks table layout */
@media (max-width: 768px) and (min-width: 481px) {
    .dockwalks-table .responsive-table {
        min-width: 900px;
        font-size: 0.85rem;
    }
    
    .dockwalks-table .responsive-table th,
    .dockwalks-table .responsive-table td {
        padding: 0.6rem 0.4rem;
    }
    
    .dockwalks-table .responsive-table th:nth-child(1), 
    .dockwalks-table .responsive-table td:nth-child(1) { width: 12%; min-width: 80px; }  /* Submission ID */
    .dockwalks-table .responsive-table th:nth-child(2), 
    .dockwalks-table .responsive-table td:nth-child(2) { width: 10%; min-width: 70px; }  /* Status */
    .dockwalks-table .responsive-table th:nth-child(3), 
    .dockwalks-table .responsive-table td:nth-child(3) { width: 20%; min-width: 120px; } /* Customer */
    .dockwalks-table .responsive-table th:nth-child(4), 
    .dockwalks-table .responsive-table td:nth-child(4) { width: 22%; min-width: 150px; } /* Address */
    .dockwalks-table .responsive-table th:nth-child(5), 
    .dockwalks-table .responsive-table td:nth-child(5) { width: 14%; min-width: 90px; }  /* City */
    .dockwalks-table .responsive-table th:nth-child(6), 
    .dockwalks-table .responsive-table td:nth-child(6) { width: 6%; min-width: 40px; }   /* State */
    .dockwalks-table .responsive-table th:nth-child(7), 
    .dockwalks-table .responsive-table td:nth-child(7) { width: 8%; min-width: 60px; }   /* ZIP */
    .dockwalks-table .responsive-table th:nth-child(8), 
    .dockwalks-table .responsive-table td:nth-child(8) { width: 0; display: none; }      /* Completed By - hidden on tablet */
    .dockwalks-table .responsive-table th:nth-child(9), 
    .dockwalks-table .responsive-table td:nth-child(9) { width: 18%; min-width: 120px; } /* Created Date */
}

/* Mobile dock walks table layout - card style */
@media (max-width: 480px) {
    .dockwalks-table .responsive-table tr {
        margin-bottom: 1.2rem;
        padding: 1.2rem;
    }
    
    /* Ensure all 9 columns show properly in card format */
    .dockwalks-table .responsive-table td:nth-child(1):before { content: "Submission ID: "; }
    .dockwalks-table .responsive-table td:nth-child(2):before { content: "Status: "; }
    .dockwalks-table .responsive-table td:nth-child(3):before { content: "Customer: "; }
    .dockwalks-table .responsive-table td:nth-child(4):before { content: "Address: "; }
    .dockwalks-table .responsive-table td:nth-child(5):before { content: "City: "; }
    .dockwalks-table .responsive-table td:nth-child(6):before { content: "State: "; }
    .dockwalks-table .responsive-table td:nth-child(7):before { content: "ZIP: "; }
    .dockwalks-table .responsive-table td:nth-child(8):before { content: "Completed By: "; }
    .dockwalks-table .responsive-table td:nth-child(9):before { content: "Created: "; }
    
    /* Status badges in mobile cards */
    .dockwalks-table .status-badge {
        display: inline-block;
        margin-top: 2px;
    }
}

/* =========================================
   INFO TABLE STYLES (for modals and details)
   ========================================= */

.info-table {
    width: auto;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: white;
}

.info-table td {
    padding: 8px 12px;
    border: 1px solid #ccc;
    vertical-align: top;
    font-size: 12px;
    line-height: 1.4;
}

.info-table .label {
    font-weight: bold;
    background-color: #f5f5f5;
    width: auto;
    white-space: nowrap;
    color: #333;
}

/* Mobile responsive info table */
@media (max-width: 768px) {
    .info-table {
        font-size: 11px;
    }
    
    .info-table td {
        padding: 6px 8px;
    }
    
    .info-table .label {
        font-size: 11px;
    }
}

/* Accessibility and Touch Targets */
@media (max-width: 768px) {
    /* Ensure all interactive elements meet 44px minimum */
    button,
    .action-btn,
    .page-btn,
    .tab-button,
    input[type="submit"],
    input[type="button"],
    .menu-item,
    select {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Form elements mobile optimization */
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
}

/* Focus indicators for keyboard navigation */
.ignore-modal-close:focus,
.ignore-btn-cancel:focus,
.ignore-btn-submit:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.ignore-notes-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Improved contrast for better readability */
.ignore-warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ignore-modal-container {
        border: 2px solid #000;
    }
    
    .ignore-warning-message {
        border: 2px solid #856404;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ignore-modal-close,
    .ignore-btn-cancel,
    .ignore-btn-submit,
    .ignore-notes-textarea {
        transition: none;
    }
}

/* Dock Walk Details Modal Styles */
.dockwalk-details {
    padding: 1rem 0;
}

.dockwalk-details h4 {
    margin: 1.5rem 0 1rem 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.item-label {
    font-weight: 500;
    color: #495057;
}

.item-status {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
}

.item-status.pass {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.item-status.fail {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.item-status.na {
    background: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

.notes-section {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    white-space: pre-line;
    font-family: inherit;
}

/* Dock Walk Notes - Ledger/List Format */
.dockWalksNotes {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dockWalksNotes .note-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.dockWalksNotes .note-item:last-child {
    border-bottom: none;
}

.dockWalksNotes .note-item:nth-child(even) {
    background: #f8f9fa;
}

.dockWalksNotes .note-marker {
    color: #6c757d;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 20px;
    text-align: center;
    padding-top: 0.125rem;
}

.dockWalksNotes .note-content {
    flex: 1;
    color: #495057;
    line-height: 1.5;
    word-wrap: break-word;
}

.images-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.image-item {
    padding: 1rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.image-item h5 {
    margin: 0 0 0.5rem 0;
    color: #dc3545;
    font-size: 1rem;
}

.image-item img {
    display: block;
    margin: 0.5rem 0;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.image-item p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* =========================================
   SITE.CFM STYLES
   ========================================= */

/* Base layout for site cards */
.cards-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* =========================================
   SITE.CFM MOBILE RESPONSIVE STYLES
   ========================================= */

/* Tablet and below (1024px) */
@media (max-width: 1024px) {
    .cards-row {
        flex-direction: column;
    }

    .sites-info-card {
        width: 100% !important;
        margin-bottom: 15px;
    }

    .mgmt-section {
        max-width: 100%;
    }
}

/* Mobile devices (768px and below) */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }

    .main-content {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Stack all cards vertically */
    .cards-row {
        flex-direction: column;
        gap: 15px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .sites-info-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 15px 0;
        overflow-x: hidden;
    }

    .card-body {
        max-width: 100%;
        overflow-x: auto;
    }

    /* Make tables scrollable horizontally */
    .mgmt-table-container {
        overflow-x: auto;
    }

    .mgmt-table-container table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    /* Adjust form layouts */
    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100% !important;
        margin-bottom: 15px;
    }

    .mgmt-form-row {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .mgmt-form-row label {
        width: 100%;
        margin-bottom: 5px;
        text-align: left !important;
    }

    .mgmt-field-container {
        width: 100% !important;
    }

    /* Geofence map responsive - full width */
    .site-geofence-map-container {
        height: 400px !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Override inline flex styles on map container */
    .card-body > div[style*="display: flex"] {
        display: block !important;
        gap: 0 !important;
    }

    /* Make map section full width, override inline flex: 2 */
    .card-body > div > div[style*="flex: 2"] {
        flex: none !important;
        width: 100% !important;
    }

    /* Hide coordinates section */
    .card-body > div > div[style*="flex: 1"] {
        display: none !important;
    }

    .coordinate-display-section {
        display: none !important;
    }

    /* Remove card-body padding for map to be truly full width */
    .sites-info-card:has(.site-geofence-map-container) .card-body {
        padding: 0 !important;
    }

    /* Adjust buttons */
    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-header > div {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Coordinate table adjustments */
    .coordinate-col {
        font-size: 0.75rem;
        padding: 6px;
    }

    /* Checkboxes section */
    .checkboxes-section {
        flex-direction: column;
    }

    .checkbox-group {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Small phones (480px and below) */
@media (max-width: 480px) {
    .sites-info-card h3 {
        font-size: 1rem;
    }

    input[type="text"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .mgmt-table-container table {
        font-size: 0.75rem;
    }

    .mgmt-table-container th,
    .mgmt-table-container td {
        padding: 6px 4px;
    }

    .site-geofence-map-container {
        height: 350px !important;
    }

    .coordinate-col {
        font-size: 0.7rem;
        padding: 4px;
    }

    .coordinate-rows {
        max-height: 200px;
    }
}
