.sr-link {
    color: var(--link-color, var(--primary, #2563eb)) !important;
    text-decoration: underline;
    cursor: pointer;
}
/* HVAC Platform - Vanilla HTML/CSS Version */

:root {
    /* Light theme variables */
    --primary-bg: #ffffff;
    --secondary-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --primary-color: #3182ce;
    --primary-hover: #2c5aa0;
    --success-color: #38a169;
    --danger-color: #e53e3e;
    --warning-color: #d69e2e;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Dark theme variables */
body.dark-mode {
    --primary-bg: #1a202c;
    --secondary-bg: #2d3748;
    --card-bg: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --primary-color: #4299e1;
    --primary-hover: #3182ce;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-bg);
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.flex {
    display: flex;
}

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

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

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

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

/* Added: allow right alignment for flex containers (used by Work Orders toolbar) */
.justify-end {
    justify-content: flex-end;
}

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

.text-center { text-align: center; }
.w-full { width: 100%; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }

/* Grid Utilities */
.grid {
    display: grid;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.input-group {
    position: relative;
}

.input-group .form-input {
    padding-right: 2.5rem;
}

.input-group-append {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--border-color);
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #c53030;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #2f855a;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.2rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Cards */
/* SR link line styling for Job Card Summary blocks */
.sr-link-line {
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.1;
}

/* Increase specificity to override parent card text sizes in info-value blocks */
.info-value .sr-link-line {
    font-size: 0.75rem;
}

.sr-link-line .sr-link {
    color: var(--link-color, var(--primary, #2563eb));
    text-decoration: underline;
    cursor: pointer;
}

.sr-link-line .sr-link:hover {
    text-decoration: underline;
}

/* Ensure blue link color even inside muted containers */
.text-muted .sr-link,
.sr-link:visited {
    color: var(--link-color, var(--primary, #2563eb));
}
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 0;
}

/* Navigation */
.nav {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-brand:hover {
    color: var(--primary-hover);
    border-color: rgba(0, 0, 0, 0.12);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.12);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

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

.loading-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background-color: #f0fff4;
    border-color: var(--success-color);
    color: #22543d;
}

.alert-error {
    background-color: #fed7d7;
    border-color: var(--danger-color);
    color: #742a2a;
}

.alert-warning {
    background-color: #fefcbf;
    border-color: var(--warning-color);
    color: #744210;
}

.alert-info {
    background-color: #bee3f8;
    border-color: var(--primary-color);
    color: #2a4365;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.toast {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

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

/* Dashboard specific styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #4299e1);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: none;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--secondary-bg);
    font-weight: 600;
    color: var(--text-primary);
}

.table tr:hover {
    background-color: var(--secondary-bg);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
}

.badge-success {
    background-color: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background-color: #fed7aa;
    color: #92400e;
}

.badge-danger {
    background-color: #fed7d7;
    color: #742a2a;
}

.badge-info {
    background-color: #bee3f8;
    color: #2a4365;
}

.badge-purple {
    background-color: #d8b4fe;
    color: #581c87;
}

.badge-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.badge-primary {
    background-color: #c6f6d5;
    color: #22543d;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .stats-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Enhanced Mobile Navigation */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    .nav-menu.mobile-show {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem;
        border-radius: 8px;
        display: block;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.2rem;
        padding: 0.5rem;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.2s;
    }
    
    .mobile-menu-toggle:hover {
        background-color: var(--secondary-bg);
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .btn-large {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    /* Touch-friendly navigation */
    .nav-link {
        min-height: 44px;
        padding: 1rem 1.5rem;
        display: flex;
        align-items: center;
        font-size: 1rem;
    }
    
    /* Ensure dropdown menus work well on small screens */
    .dropdown-menu {
        min-width: 200px;
        max-width: calc(100vw - 40px);
    }
}

/* Utility classes */
.hidden { display: none !important; }
.visible { display: block !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* Mobile Navigation Styles */
.mobile-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav-link:hover {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.12);
}

.mobile-nav-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.table-responsive table {
    min-width: 600px;
}

@media (max-width: 768px) {
    .table-mobile-cards {
        display: block;
    }
    
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tbody {
        display: block;
    }
    
    .table-mobile-cards tr {
        display: block;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow);
    }
    
    .table-mobile-cards td {
        display: block;
        text-align: left;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .table-mobile-cards td:last-child {
        border-bottom: none;
    }
    
    .table-mobile-cards td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--text-secondary);
        display: inline-block;
        min-width: 120px;
    }
}

/* Enhanced Form Controls */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    input[type="text"],
    input[type="email"], 
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
        min-height: 44px;
        width: 100%;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        background-color: var(--card-bg);
        color: var(--text-primary);
    }
    
    textarea {
        min-height: 120px;
        resize: vertical;
    }
    
    /* Touch-friendly checkboxes and radio buttons */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 0.5rem;
    }
    
    label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        display: block;
        font-weight: 500;
        color: var(--text-primary);
    }
}

/* Touch Enhancement Classes */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-feedback:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Mobile-specific utility classes */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-flex {
        display: flex;
    }
    
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full-width {
        width: 100%;
    }
    
    .mobile-text-center {
        text-align: center;
    }
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Enhanced Mobile Navigation Styles */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--primary-bg);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--secondary-bg);
}

.mobile-nav-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.mobile-nav-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.mobile-nav-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

.mobile-nav-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-bg);
}

.mobile-dark-mode-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.mobile-logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mobile-logout-btn:hover {
    background: #dc2626;
}

/* Touch feedback styles */
.touch-active {
    background-color: var(--border-color) !important;
    transform: scale(0.98);
}

.focused {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1) !important;
    outline: none;
}

/* Improved dropdown behavior on mobile */
@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        z-index: 1060;
    }
    
    .dropdown-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
    
    /* Improve notification dropdown on mobile */
    #notifications-dropdown .dropdown-menu {
        min-width: unset;
        max-width: unset;
    }
}

/* Better modal behavior on mobile */
@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 0;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        background: var(--card-bg);
        z-index: 1;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1.5rem;
        border-top: 1px solid var(--border-color);
        position: sticky;
        bottom: 0;
        background: var(--card-bg);
        z-index: 1;
    }
}

/* Improved card layouts for mobile */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 1rem 1.5rem;
        font-weight: 600;
        border-bottom: 1px solid var(--border-color);
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .card-footer {
        padding: 1rem 1.5rem;
        border-top: 1px solid var(--border-color);
        background: var(--secondary-bg);
    }
}

/* Enhanced loading states for mobile */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
