/*
 * Modernized Global Styling for Work Order System
 *
 * Enhanced with modern design principles, improved typography, 
 * contemporary color palette, and better visual hierarchy while
 * preserving all existing functionality.
 */

/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --success-color: #22c55e;
    --success-dark: #16a34a;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --background-primary: #ffffff;
    --background-secondary: #f8fafc;
    --background-tertiary: #f1f5f9;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease-in-out;
}

/* Utility classes */
.hidden-by-menu {
    display: none !important;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-weight: 400;
    min-height: 100vh;
}

/* Container styling with modern card-like appearance */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Header row for welcome message and inline safety sign */
.header-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.header-row h1 {
    margin: 0;
    flex: 0 0 auto;
}

/* Digital Safety Sign */
.safety-sign {
    background: #000000;
    border: 8px solid #dc2626;
    border-radius: 12px;
    margin: 2rem 0;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3), 
                0 0 20px rgba(220, 38, 38, 0.2),
                inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Inline safety sign variant - smaller and compact */
.safety-sign-inline {
    margin: 0;
    margin-left: auto;
    padding: 0.75rem 1rem;
    border-width: 4px;
    border-radius: 8px;
    flex: 0 0 auto;
    min-width: 200px;
}

.safety-sign-inline .safety-sign-number {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: center;
    gap: 4px;
    font-family: 'Courier New', 'Consolas', monospace;
    font-weight: 700;
}

.safety-sign-inline .safety-sign-number .digit {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid #dc2626;
    border-radius: 4px;
    padding: 2px 8px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.8),
        0 0 8px rgba(220, 38, 38, 0.4);
}

.safety-sign-inline .safety-sign-text {
    font-size: 0.75rem;
    line-height: 1.1;
}

.safety-sign::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(220, 38, 38, 0.1) 50%, transparent 51%);
    pointer-events: none;
}

.safety-sign-content {
    position: relative;
    z-index: 2;
}

.safety-sign-number {
    font-family: 'Inter', 'Arial Black', sans-serif;
    font-size: clamp(4rem, 8vw, 8rem);
    font-weight: 900;
    color: #dc2626;
    text-shadow: 
        0 0 10px #dc2626,
        0 0 20px #dc2626,
        0 0 30px #dc2626,
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
    margin-bottom: 0.5rem;
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.safety-sign-text {
    font-family: 'Inter', 'Arial Black', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 800;
    color: #dc2626;
    text-shadow: 
        0 0 5px #dc2626,
        0 0 10px #dc2626,
        1px 1px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000;
    letter-spacing: 0.1em;
    line-height: 1.2;
}

/* Responsive adjustments for mobile */
@media (max-width: 1024px) {
    .safety-sign {
        margin: 1.5rem 0;
        padding: 1.5rem;
        border-width: 6px;
    }
    
    .safety-sign-number {
        font-size: clamp(3rem, 12vw, 6rem);
    }
    
    .safety-sign-text {
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
}

/* Modern navigation bar */
.navbar {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Dot menu button (3 vertical dots) - hidden by default, shown only on mobile */
.navbar-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.navbar-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hamburger-line {
    width: 5px;
    height: 5px;
    background-color: #fff;
    border-radius: 50%;
    transition: var(--transition);
}

/* Dot menu animation when active - subtle scale effect */
.navbar-toggle.active .hamburger-line {
    background-color: #fff;
    transform: scale(1.1);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
    transform: scale(1.3);
}

/* Navigation links container */
.navbar-links {
    display: flex;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.navbar a {
    color: #fff;
    margin-right: 1.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    text-decoration: none;
}

.navbar a:active {
    transform: translateY(0);
}

/* Base username styling (for legacy pages) */
.navbar .nav-user,
.navbar-links .nav-user {
    margin-left: auto;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Mobile username (just name) - hidden on desktop */
.navbar .nav-user-mobile {
    display: none;
}

/* Desktop username (full text with role) - uses base styling */
.navbar-links .nav-user-desktop {
    margin-left: auto;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.navbar .logout-link {
    margin-left: 1rem;
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: #fff;
    transition: var(--transition);
    font-weight: 500;
}

.navbar .logout-link:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile navbar wrapper - visible container for hamburger and mobile username */
.navbar-mobile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile-specific navbar layout */
@media (max-width: 1024px) {
    .navbar-mobile {
        justify-content: space-between;
        width: 100%;
    }
    
    /* Show hamburger menu on mobile */
    .navbar-toggle {
        display: flex;
    }
    
    /* Show mobile username */
    .navbar .nav-user-mobile {
        display: block;
        font-weight: 600;
        color: white;
        font-size: 1rem;
    }
    
    /* Hide desktop username on mobile */
    .navbar-links .nav-user-desktop {
        display: none;
    }
}

/* Modern table styles */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

thead tr {
    background: linear-gradient(135deg, var(--background-tertiary) 0%, var(--border-light) 100%);
}

th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    white-space: nowrap;
}

td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
    vertical-align: top;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:nth-child(odd) {
    background-color: rgba(248, 250, 252, 0.5);
}

tbody tr:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.05) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

/* Responsive table wrapper */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Filter controls styling */
.filter-controls {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-light);
}

.filter-label:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.filter-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

.filter-label span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Dashboard specific styling */
.hall-of-fame {
    display: flex;
    gap: 2rem;
    margin: 3rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.hof-card {
    flex: 1;
    max-width: 320px;
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    min-width: 280px;
    position: relative;
    overflow: hidden;
}

.hof-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hof-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hof-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 700;
}

.hof-card.ansvarlig::before {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.hof-card.entreprenor::before {
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
}

.hof-card p {
    margin: 0.75rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.hof-card p strong {
    font-size: 1.25rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

/* Status cards enhancement */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.card {
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    color: #fff;
    text-align: center;
    font-size: 1.375rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card:hover::before {
    opacity: 1;
}

.card.planlagt {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.card.planlagt:hover {
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.4);
}

.card.aktiv {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.card.aktiv:hover {
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
}

.card.afsluttet {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    box-shadow: 0 10px 30px rgba(107, 114, 128, 0.3);
}

.card.afsluttet:hover {
    box-shadow: 0 20px 40px rgba(107, 114, 128, 0.4);
}

/* Charts enhancement */
.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.chart-container {
    background: var(--background-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.chart-container h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

/* Dashboard sections spacing */
.dashboard-section {
    margin: 3rem 0;
    padding: 2rem 0;
}

.dashboard-section:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.dashboard-section h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.dashboard-section h3 {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
}

/* Modern button system */
a.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.75rem; /* Larger padding for better touch targets */
    margin: 0.25rem 0.5rem 0.25rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem; /* Slightly larger for mobile readability */
    font-weight: 500;
    letter-spacing: 0.025em;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    min-width: auto;
    min-height: 48px; /* Apple's recommended minimum touch target */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
}

/* Button hover effects */
a.button:hover,
button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

a.button:active,
button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Button variants */
a.button.button-danger,
button.button-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
}

a.button.button-danger:hover,
button.button-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, #b91c1c 100%);
}

a.button.button-secondary,
button.button-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, var(--text-primary) 100%);
}

a.button.button-success,
button.button-success {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
}

/* Buttons in table cells */
td a.button,
td button {
    margin: 0.125rem 0.25rem;
    padding: 0.5rem 0.75rem; /* Larger touch targets */
    vertical-align: middle;
    white-space: nowrap;
    font-size: 0.8rem;
}

/* Make approval buttons in table cells extra compact to match status icons */
td button.button-success.button-sm {
    padding: 2px 4px;
    font-size: 0.9rem;
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    line-height: 1;
    vertical-align: middle;
    border-radius: 4px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
}

/* Button size variants */
.button-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.button-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Modern form styling */
form {
    background: var(--background-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

form > div {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 1rem 1.25rem; /* Larger padding for better touch targets */
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem; /* Better readability on mobile */
    transition: var(--transition);
    background: var(--background-primary);
    color: var(--text-primary);
    font-family: inherit;
    cursor: text;
    min-height: 48px; /* Apple's recommended minimum touch target */
    -webkit-appearance: none; /* Remove iOS default styling */
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    touch-action: manipulation;
}

input[type="file"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--background-primary);
    color: var(--text-primary);
    font-family: inherit;
    min-height: 48px; /* Apple's recommended minimum touch target */
    -webkit-appearance: none; /* Remove iOS default styling */
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    touch-action: manipulation;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus,
input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--background-primary);
}

/* Modern file input styling - Clean and centered */
.file-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none !important;
    z-index: -1;
    width: 0;
    height: 0;
}

.file-input-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--background-primary) 0%, var(--background-secondary) 100%);
    cursor: pointer;
    transition: var(--transition);
    min-height: 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.file-input-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: var(--transition);
}

.file-input-display:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(59, 130, 246, 0.05) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-style: solid;
}

.file-input-display:hover::before {
    left: 100%;
}

.file-input-display:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.file-input-wrapper:focus-within .file-input-display {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    border-style: solid;
}

.file-icon {
    font-size: 2rem;
    color: var(--primary-color);
    transition: var(--transition);
    pointer-events: none;
}

.file-input-display:hover .file-icon {
    transform: scale(1.1);
    color: var(--primary-dark);
}

.file-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: none;
    user-select: none;
}

.file-text.has-file {
    color: var(--text-primary);
    font-weight: 600;
}

.file-text.has-file + .file-icon {
    color: var(--secondary-color);
}

/* Additional styling for when file is selected */
.file-input-display.has-file {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: var(--secondary-color);
    border-style: solid;
}

.file-input-display.has-file:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.15) 100%);
}

input[type="text"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="password"]:hover,
textarea:hover,
select:hover {
    border-color: var(--primary-light);
}

textarea {
    min-height: 6rem;
    resize: vertical;
}

/* Checkbox and radio styling */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

/* Form groups */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

/* Ensure form elements are always interactive */
.form-group input,
.form-group textarea,
.form-group select {
    position: relative;
    z-index: 2;
    pointer-events: auto !important;
}

.card .form-group input,
.card .form-group textarea,
.card .form-group select {
    pointer-events: auto !important;
    user-select: auto !important;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* Special button styling for saving WOs */
button[name="save_wo"] {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: #fff;
    font-weight: 600;
}
button[name="save_wo"]:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Modern parse log style */
#parseLog {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--background-tertiary);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    white-space: pre-wrap;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Field OK/missing indicators used during PDF parsing */
.field-ok {
    border: 2px solid green !important;
    background: #f6fff6 url('data:image/svg+xml;utf8,✔') no-repeat right 8px center;
    background-size: 14px;
}
.field-missing {
    border: 2px solid red !important;
    background: #fff6f6 url('data:image/svg+xml;utf8,✘') no-repeat right 8px center;
    background-size: 14px;
}

/* Modern status badge system */
.status-planlagt {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
}
.status-aktiv {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%) !important;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
}
.status-afsluttet {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--text-secondary) 0%, var(--text-primary) 100%) !important;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
}

/* Fix for status classes applied to select elements - ensure dropdown options are visible */
select.status-planlagt,
select.status-aktiv,
select.status-afsluttet {
    color: #ffffff !important;
    font-weight: 600;
}

select.status-planlagt option,
select.status-aktiv option,
select.status-afsluttet option {
    color: var(--text-primary) !important;
    background: var(--background-primary) !important;
    padding: 0.5rem !important;
    font-weight: normal !important;
    text-transform: none !important;
}

select.status-planlagt option:hover,
select.status-aktiv option:hover,
select.status-afsluttet option:hover {
    background: var(--primary-light) !important;
    color: #ffffff !important;
}

/* Indicate parse log states used when parsing PDFs */
.found {
    color: green;
}
.missing {
    color: red;
}

/* Kompakt WO tabel styling */
#arbejdstilladelseTable {
    font-size: 0.8rem;
}

#arbejdstilladelseTable th {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
}

#arbejdstilladelseTable td {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
}

/* Godkendelser kolonne - mere kompakt */
#arbejdstilladelseTable th:nth-child(7) {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    white-space: normal;
    word-break: keep-all;
    line-height: 1.2;
}

#arbejdstilladelseTable td:nth-child(7) {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    font-size: 0.7rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Add spacing between approval rows in table cell */
#arbejdstilladelseTable td:nth-child(7) > div {
    margin-bottom: 16px;
    line-height: 1.5;
    display: table;
    width: 100%;
    table-layout: fixed;
    border-spacing: 0;
}

#arbejdstilladelseTable td:nth-child(7) > div > * {
    display: table-cell;
    vertical-align: middle;
}

#arbejdstilladelseTable td:nth-child(7) > div:last-child {
    margin-bottom: 0;
}

#arbejdstilladelseTable td:nth-child(7) strong {
    font-size: 0.65rem;
    font-weight: 600;
    width: 38px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#arbejdstilladelseTable td:nth-child(7) .approval-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    width: 20px;
    padding: 0;
    line-height: 1;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    background: none !important;
    border: none !important;
}

#arbejdstilladelseTable td:nth-child(7) button {
    display: table-cell;
}

/* Handlinger kolonne - uniforme knapper */
.col-actions .button,
.col-actions a.button,
.col-actions button.button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    padding: 2px 10px !important;
    font-size: 0.875rem !important;
    border-radius: 0.5rem !important;
    margin: 0.1rem !important;
    width: 88px !important;
    height: auto !important;
    min-height: 26px !important;
    box-sizing: border-box !important;
}

/* Ikoner må ikke skubbe højden */
.col-actions .button i { 
    margin: 0 2px; 
}

/* Responsive forbedringer */
@media screen and (max-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 1rem;
    }
    
    #arbejdstilladelseTable {
        font-size: 0.75rem;
    }
    
    #arbejdstilladelseTable th,
    #arbejdstilladelseTable td {
        padding: 0.3rem 0.4rem;
    }
}

@media screen and (max-width: 768px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.75rem; /* Extend table to edge on mobile */
        border-radius: 0;
    }
    
    table {
        font-size: 0.85rem;
        border-radius: 0;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        min-width: 100px; /* Ensure readable column width */
    }
    
    th {
        font-size: 0.8rem;
        font-weight: 700;
        white-space: nowrap;
        position: sticky;
        top: 0;
        background: linear-gradient(135deg, var(--background-tertiary) 0%, var(--border-light) 100%);
        z-index: 10;
    }
    
    /* Make action columns more compact on mobile */
    td:last-child,
    th:last-child {
        min-width: 120px;
        text-align: center;
    }
    
    /* Improve mobile table buttons */
    td a.button,
    td button {
        display: block;
        width: 100%;
        margin: 0.25rem 0;
        padding: 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
        text-align: center;
    }
    
    /* Add zebra striping emphasis on mobile */
    tbody tr:nth-child(odd) {
        background-color: rgba(59, 130, 246, 0.03);
    }
    
    tbody tr:hover {
        background-color: rgba(59, 130, 246, 0.05);
        transform: none; /* Disable hover transform on mobile */
    }
    
    #arbejdstilladelseTable {
        min-width: 100%;
    }
}

/* When printing, hide the navigation bar so the printout is clean */
@media print {
    .navbar {
        display: none !important;
    }
}

/* Map container with modern styling */
#map {
    height: 500px;
    margin-bottom: 1.5rem;
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.875rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.5rem;
}

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

/* Card components */
.card {
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--background-tertiary) 0%, var(--border-light) 100%);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
}

/* Alert/message components */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--secondary-color);
    color: var(--secondary-dark);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-dark);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Loading states and animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Enhanced Responsive Design */

/* Large tablets and small desktops (992px and below) */
@media (max-width: 992px) {
    .charts {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .hall-of-fame {
        justify-content: center;
    }
    
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Tablet and medium screens (768px and below) */
@media (max-width: 1024px) {
    .container {
        padding: 1rem;
        padding-top: 5px;
        margin-top: 0;
        margin-bottom: 0.5rem;
    }
    
    /* Enhanced navbar for tablets */
    .navbar {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .navbar a {
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        white-space: normal;
        text-align: center;
        min-width: auto;
    }
    
    .navbar .nav-user {
        width: 100%;
        margin-left: 0;
        margin-top: 0.75rem;
        font-size: 0.875rem;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
        text-align: center;
    }
    
    .navbar .logout-link {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    /* Enhanced dashboard for tablets */
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
        margin: 2rem 0;
    }
    
    .card {
        padding: 2rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .hall-of-fame {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .hof-card {
        max-width: 400px;
        min-width: 300px;
    }
    
    /* Enhanced charts for tablets */
    .charts {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .chart-container {
        min-width: auto;
        padding: 1.5rem;
    }
    
    /* Enhanced tables for tablets */
    .table-wrapper {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Override for Godkendelser column header - allow wrapping but keep words intact */
    #arbejdstilladelseTable th:nth-child(7) {
        white-space: normal !important;
        word-break: keep-all !important;
    }
    
    /* Override for Godkendelser column data - allow word breaking for long content */
    #arbejdstilladelseTable td:nth-child(7) {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }
    
    /* Enhanced filter controls - hidden on mobile */
    .filter-controls {
        display: none !important;
        margin: 0;
        padding: 0;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .filter-label {
        justify-content: center;
        padding: 0.75rem 1rem;
    }
    
    /* Enhanced forms */
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: auto;
        margin-bottom: 1rem;
    }
    
    /* Enhanced typography */
    h1 {
        font-size: 2rem;
        text-align: center;
    }
    
    h2 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Enhanced buttons */
    .button-lg {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }
    
    a.button,
    button {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        min-height: 44px; /* Touch-friendly */
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
        margin: 0;
        border-radius: 0;
    }
    
    /* Mobile typography improvements */
    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    /* Improve mobile button spacing */
    a.button,
    button {
        width: 100%;
        margin: 0.5rem 0;
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Better mobile form experience */
    form {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    label {
        font-size: 1rem;
        font-weight: 600;
    }
    
    /* Mobile card improvements */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile dashboard improvements */
    .dashboard {
        gap: 1rem;
    }
    
    .dashboard-section {
        margin: 1.5rem 0;
        padding: 1rem 0;
    }
    
    /* Mobile navigation - Show dot menu, hide desktop nav */
    .navbar-toggle {
        display: flex !important; /* Show dot menu on mobile */
        position: relative;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
        min-height: 32px;
        min-width: 32px;
        padding: 0.25rem;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        z-index: 10;
    }
    
    .navbar {
        padding: 0.5rem 1rem;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        position: sticky;
        top: 0;
        min-height: 44px;
        gap: 0.5rem;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        z-index: 100;
        backdrop-filter: blur(10px);
        box-shadow: var(--shadow-md);
    }
    
    /* Mobile username display next to dot menu */
    .navbar .nav-user-mobile {
        display: inline-block !important;
        margin: 0;
        font-size: 0.9rem;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.95);
        flex-shrink: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Backdrop overlay when menu is open */
    .navbar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 280px;
        width: calc(100vw - 280px);
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease-out;
        pointer-events: auto;
    }
    
    .navbar-backdrop.active {
        display: block;
        opacity: 1;
    }
    
    /* Adjust backdrop for small screens where menu is narrower */
    @media (max-width: 330px) {
        .navbar-backdrop {
            left: 85%;
            width: 15%;
        }
    }
    
    /* Hide navigation links by default on mobile */
    .navbar-links {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85%;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        flex-direction: column;
        padding: 5rem 1.5rem 1rem 1.5rem;
        box-shadow: var(--shadow-xl);
        z-index: 1000;
        backdrop-filter: blur(20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
    }
    
    /* Show navigation links when active with slide-in animation */
    .navbar-links.active {
        display: flex;
        animation: slideIn 0.3s ease-out forwards;
    }
    
    @keyframes slideIn {
        from {
            transform: translateX(-100%);
        }
        to {
            transform: translateX(0);
        }
    }
    
    .navbar-links a:not(.nav-user) {
        padding: 0.75rem 1.25rem;
        margin: 0.15rem 0;
        border-radius: var(--radius-md);
        font-size: 0.95rem;
        font-weight: 500;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        transition: var(--transition);
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        text-decoration: none;
        color: #fff;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        touch-action: manipulation;
    }
    
    .navbar-links a:not(.nav-user):hover,
    .navbar-links a:not(.nav-user):active {
        background: rgba(255, 255, 255, 0.25);
        transform: translateX(4px);
        box-shadow: var(--shadow-sm);
    }
    
    /* Hide desktop username from foldable menu (mobile shows username in header) */
    .navbar-links .nav-user-desktop {
        display: none !important;
    }
    
    .navbar-links .logout-link {
        margin: 0.5rem 0 0.5rem 0;
        background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
        font-weight: 600;
        box-shadow: var(--shadow-sm);
    }
    
    .navbar-links .logout-link:hover {
        background: linear-gradient(135deg, var(--danger-dark) 0%, #b91c1c 100%);
        transform: translateX(4px) scale(1.02);
    }
    
    /* Mobile dashboard */
    .dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .card {
        padding: 2rem 1rem;
        font-size: 1rem;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .hall-of-fame {
        margin: 2rem 0;
        gap: 1rem;
    }
    
    .hof-card {
        min-width: auto;
        max-width: none;
        padding: 1.5rem;
    }
    
    /* Mobile charts */
    .charts {
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .chart-container h2 {
        font-size: 1rem;
    }
    
    /* Mobile tables */
    .table-wrapper {
        margin: 0 -0.75rem;
        border-radius: 0;
        box-shadow: none;
        border: 1px solid var(--border-light);
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    td a.button,
    td button {
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
        margin: 0.125rem;
        min-height: 36px;
    }
    
    /* Mobile filter controls - hidden on mobile */
    .filter-controls {
        display: none !important;
        margin: 0;
        padding: 0;
    }
    
    .filter-label {
        padding: 0.75rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    
    /* Mobile forms */
    form {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
    }
    
    input[type="text"],
    input[type="tel"],
    input[type="date"],
    input[type="password"],
    textarea,
    select,
    input[type="file"] {
        padding: 1rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    label {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile typography */
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.375rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    h3 {
        font-size: 1.125rem;
        line-height: 1.4;
    }
    
    /* Mobile buttons */
    .button-lg {
        padding: 1rem;
        font-size: 0.9rem;
        width: 100%;
        min-height: 48px;
    }
    
    a.button,
    button {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        min-height: 44px;
        width: 100%;
        margin: 0.25rem 0;
    }
    
    /* Mobile alerts */
    .alert {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: var(--radius-md);
        font-size: 0.875rem;
    }
    
    /* Mobile sections */
    .dashboard-section {
        margin: 2rem 0;
        padding: 1rem 0;
    }
    
    .dashboard-section h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    /* Map adjustments */
    #map {
        height: 250px;
        margin: 0 -0.75rem;
        border-radius: 0;
    }
    
    /* Mobile table scrolling hint */
    .table-wrapper::after {
        content: "Swipe for more →";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: var(--text-secondary);
        padding: 0.5rem;
        background: var(--background-secondary);
        margin-top: -1px;
    }
    
    /* Mobile-specific touch optimizations */
    .card,
    .hof-card,
    .filter-label,
    a.button,
    button {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }
    
    /* Mobile status indicators optimization */
    .status-planlagt,
    .status-aktiv,
    .status-afsluttet {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        white-space: nowrap;
    }
}

/* Extra small mobile devices (360px and below) */
@media (max-width: 360px) {
    .container {
        padding: 0.5rem;
    }
    
    .navbar {
        padding: 0.5rem;
    }
    
    .card {
        padding: 1.5rem 0.75rem;
        font-size: 0.9rem;
        min-height: 100px;
    }
    
    .hof-card {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .chart-container {
        padding: 0.75rem;
    }
    
    th, td {
        padding: 0.375rem 0.125rem;
        font-size: 0.7rem;
    }
    
    td a.button,
    td button {
        padding: 0.375rem 0.5rem;
        font-size: 0.65rem;
        min-height: 32px;
    }
}

/* Touch-friendly enhancements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    a.button,
    button,
    .filter-label,
    .card,
    .hof-card {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .hof-card:hover,
    .chart-container:hover,
    tbody tr:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    /* Add active states for touch feedback */
    .card:active,
    .hof-card:active,
    a.button:active,
    button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Print styles */
@media print {
    .navbar,
    .print-btn {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }
    
    table {
        border-collapse: collapse;
        width: 100%;
        box-shadow: none;
    }
    
    th, td {
        border: 1px solid #000;
        padding: 8pt;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    h1, h2, h3 {
        color: #000 !important;
        background: none !important;
        -webkit-text-fill-color: initial !important;
    }
}

/* Header section with view toggle */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-section h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
}

/* View toggle buttons */
.view-toggle {
    display: flex;
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.view-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.view-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* Card view container - Clean and spacious layout */
.card-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); /* Larger minimum for better readability */
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
    align-items: start;
    padding: 1rem 0;
}

/* Ensure maximum 2 columns on larger screens */
@media (min-width: 1025px) {
    .card-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Individual work permit card - Clean and readable design with better separation */
.work-permit-card {
    background: #ffffff;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    min-height: auto;
    display: flex;
    flex-direction: column;
    height: fit-content;
    margin-bottom: 1.5rem;
}

.work-permit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

/* Card header - Clear header with AT number and description */
.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem 2rem;
    border-bottom: none;
    position: relative;
    flex-shrink: 0;
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-title-text {
    flex: 1;
}

.card-title h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card-header-description {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card-p-description {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.card-status {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* Horizontal divider between header and content */
.card-divider {
    margin: 0;
    border: none;
    border-top: 2px solid var(--border-light);
    opacity: 0.5;
}

/* Card content - Spacious and readable */
.card-content {
    padding: 1.5rem 2rem;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Add spacing between sections */
}

.card-description {
    margin-bottom: 0.375rem;
    flex-shrink: 0;
}

.card-description h4 {
    margin: 0 0 0.375rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-description p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.3;
    font-size: 0.75rem;
    word-wrap: break-word;
}

.p-description {
    background: var(--background-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary-color);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* Card details - Ultra compact */
.card-details {
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-light);
    gap: 0.25rem;
    font-size: 0.75rem;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    min-width: 70px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: right;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card approvals section - Ultra compact */
.card-approvals {
    background: var(--background-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    border-top: 1px solid #eeeeee;
    flex-shrink: 0;
}

.card-approvals h4 {
    margin: 0 0 0.375rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.approval-grid {
    display: grid;
    gap: 0.25rem;
}

.approval-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.375rem;
    background: var(--background-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    gap: 0.25rem;
}

.approval-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.75rem;
    min-width: 50px;
    flex-shrink: 0;
}

.approval-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.375rem;
    border-radius: var(--radius-sm);
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.approval-status.approved {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.approval-status.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* Card actions - Clean and spacious */
.card-actions {
    padding: 1rem 2rem;
    background: var(--background-tertiary);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 0;
}

.card-actions .button {
    margin: 0;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    min-width: auto;
    white-space: nowrap;
    border-radius: var(--radius-md);
}

/* Status indicators for cards */
.card-status.status-planlagt {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.card-status.status-aktiv {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.card-status.status-afsluttet {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 1px solid #d1d5db;
}

/* Ultra compact approval buttons for card view */
.ajax-approve-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: auto;
    margin-top: 0.25rem;
}

.ajax-approve-btn:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.ajax-approve-btn:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
}

/* Hide P-description on compact cards to save space */
.card-view .p-description {
    display: none;
}

/* Enhanced responsive design for card view */
/* Large desktop: 3 columns (≥1024px) - default grid already set */

/* Tablet: 2 columns (<1024px) */
@media (max-width: 1023px) {
    .card-view {
        grid-template-columns: repeat(2, 1fr); /* 2 cards per row on tablets */
        gap: 1.5rem;
    }
    
    /* Show P-description on tablets since there's space per card */
    .card-view .p-description {
        display: block;
    }
    
    /* Adjust card spacing for tablets */
    .card-header {
        padding: 1.25rem 1.5rem;
    }
    
    .card-content {
        padding: 1.25rem 1.5rem;
        gap: 1.25rem;
    }
    
    .card-actions {
        padding: 1rem 1.5rem;
    }
}

/* Small tablets and large phones */
@media (max-width: 1024px) {
    .header-section {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .view-toggle {
        align-self: center;
        min-width: 280px;
    }
    
    .card-view {
        grid-template-columns: repeat(2, 1fr); /* 2 cards per row on small tablets */
        gap: 1rem;
    }
    
    .work-permit-card {
        margin: 0 0 1rem 0;
    }
    
    .card-header {
        padding: 1rem 1.25rem;
    }
    
    .card-title h3 {
        font-size: 1.125rem;
    }
    
    .card-header-description {
        font-size: 0.875rem;
    }
    
    .card-content {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    
    .card-actions {
        padding: 0.75rem 1.25rem;
        gap: 0.5rem;
    }
    
    .card-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .detail-label {
        min-width: auto;
        font-size: 0.75rem;
    }
    
    .detail-value {
        text-align: left;
        font-size: 0.75rem;
    }
    
    .approval-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .approval-label {
        min-width: auto;
        font-size: 0.75rem;
    }
    
    .approval-status {
        text-align: center;
        font-size: 0.75rem;
    }
    
    .card-actions {
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

/* Very small screens: 1 column (<480px) */
@media (max-width: 480px) {
    .card-view {
        grid-template-columns: 1fr; /* 1 card per row on very small screens */
        gap: 0.75rem;
        margin: 0 -0.5rem;
        padding: 0.25rem 0.5rem;
    }
    
    .container {
        padding: 0.5rem;
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .work-permit-card {
        margin: 0 0 1rem 0;
        border-radius: var(--radius-md);
    }
    
    .card-header {
        padding: 1.25rem 1.5rem;
    }
    
    .card-title h3 {
        font-size: 1.1rem;
    }
    
    .card-header-description {
        font-size: 0.875rem;
    }
    
    .card-content {
        padding: 1.25rem 1.5rem;
        gap: 1.25rem;
    }
    
    .card-actions {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .card-actions .button {
        width: 100%;
        text-align: center;
        font-size: 0.9rem;
        padding: 1rem;
    }
    
    .view-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Notification System Styles */
.notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    max-width: 400px;
    word-wrap: break-word;
}

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

.notification-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
    color: white;
    border-color: rgba(34, 197, 94, 0.3);
}

.notification-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: white;
    border-color: rgba(239, 68, 68, 0.3);
}

.notification-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
    color: white;
    border-color: rgba(245, 158, 11, 0.3);
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
    opacity: 0.8;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive notifications */
@media (max-width: 1024px) {
    .notification-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification-show {
        transform: translateY(0);
    }
}

/* Enhanced approval button styles */
.ajax-approve-btn {
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.ajax-approve-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.ajax-approve-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Time Tracking Styles */
.card-time-tracking {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-top: 1px solid #eeeeee;
}

.card-time-tracking h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
}

.time-entry-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.time-input-group {
    display: flex;
    flex-direction: column;
}

.time-input-group.full-width {
    grid-column: 1 / -1;
}

.time-input-group label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #495057;
}

.time-date-input,
.time-hours-input,
.time-desc-input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.time-date-input:focus,
.time-hours-input:focus,
.time-desc-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.time-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.time-history {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.time-history h5 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1rem;
}

.time-summary {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #e9ecef;
    border-radius: 4px;
    text-align: center;
}

.time-entries-list {
    max-height: 300px;
    overflow-y: auto;
}

.time-entry-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    align-items: center;
}

.time-entry-date {
    font-weight: 600;
    color: #495057;
}

.time-entry-hours {
    color: #007bff;
    font-weight: 600;
}

.time-entry-user {
    color: #6c757d;
    font-size: 0.9rem;
}

.time-entry-desc {
    grid-column: 1 / -1;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.25rem;
}

.loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.error {
    color: #dc3545;
    font-weight: 600;
}

/* Mobile-first responsive redesign for PTW cards */
@media (max-width: 1024px) {
    /* Ultra-compact card for one-screen viewing */
    .work-permit-card {
        margin-bottom: 0.5rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Minimal header - PTW number and status on one line */
    .card-header {
        padding: 0.5rem 0.75rem;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }
    
    .card-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .card-title h3 {
        font-size: 0.875rem;
        margin: 0;
        font-weight: 700;
        line-height: 1.2;
    }
    
    .card-status {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Hide description by default on mobile, show on expand */
    .card-header-description {
        font-size: 0.75rem;
        line-height: 1.3;
        margin: 0.25rem 0 0 0;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .card-header-description.expanded {
        -webkit-line-clamp: unset;
    }
    
    .card-p-description {
        padding: 0.375rem 0.5rem;
        margin-top: 0.375rem;
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    /* Remove divider to save space */
    .card-divider {
        display: none;
    }
    
    /* Minimal content padding */
    .card-content {
        padding: 0.5rem 0.75rem;
        gap: 0.25rem;
    }
    
    /* Entrepreneur section - ultra compact, one line */
    .card-details {
        margin: 0;
        padding: 0.25rem 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .card-details .detail-item {
        padding: 0.125rem 0;
        font-size: 0.7rem;
        border-bottom: none;
    }
    
    .detail-label {
        font-size: 0.7rem;
        min-width: 50px;
    }
    
    .detail-value {
        font-size: 0.7rem;
    }
    
    .detail-value small {
        display: none; /* Hide contact info to save space */
    }
    
    /* Approvals - collapsed by default, show summary */
    .card-approvals {
        margin: 0;
        padding: 0.375rem 0.5rem;
        background: transparent;
        border-top: 1px solid #f0f0f0;
        border-radius: 0;
    }
    
    .card-approvals-header {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }
    
    .card-approvals h4 {
        font-size: 0.75rem;
        margin: 0;
        font-weight: 600;
    }
    
    .approvals-summary {
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    .toggle-icon {
        font-size: 0.65rem;
        color: var(--text-secondary);
        transition: transform 0.2s;
    }
    
    .toggle-icon.expanded {
        transform: rotate(180deg);
    }
    
    /* Hide approval grid by default on mobile */
    .approval-grid {
        display: none;
        margin-top: 0.375rem;
        gap: 0.25rem;
    }
    
    .approval-grid.expanded {
        display: grid;
    }
    
    .approval-item {
        padding: 0.25rem 0.375rem;
        font-size: 0.7rem;
    }
    
    .approval-label {
        font-size: 0.7rem;
        min-width: 35px;
    }
    
    .approval-status {
        font-size: 0.65rem;
        padding: 0.125rem 0.25rem;
    }
    
    .btn-approve-card {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Time tracking - collapsed by default, show summary */
    .card-time-tracking {
        margin: 0;
        padding: 0.375rem 0.5rem;
        background: transparent;
        border-top: 1px solid #f0f0f0;
        border-radius: 0;
    }
    
    .card-time-header {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }
    
    .card-time-tracking h4 {
        font-size: 0.75rem;
        margin: 0;
        font-weight: 600;
    }
    
    .time-summary {
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    /* Hide time entry section by default on mobile */
    .time-entry-section {
        display: none;
        margin-top: 0.375rem;
    }
    
    .time-entry-section.expanded {
        display: block;
    }
    
    .time-entry-form {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .time-input-group {
        margin-bottom: 0.25rem;
    }
    
    .time-input-group label {
        font-size: 0.7rem;
        margin-bottom: 0.125rem;
    }
    
    .time-date-input,
    .time-hours-input,
    .time-desc-input {
        font-size: 0.75rem;
        padding: 0.375rem;
    }
    
    .time-actions {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .time-actions .button {
        font-size: 0.7rem;
        padding: 0.375rem 0.75rem;
        width: 100%;
    }
    
    .time-entry-item {
        grid-template-columns: 1fr;
        text-align: left;
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .time-entry-desc {
        grid-column: 1;
    }
    
    .time-view-notice {
        font-size: 0.7rem;
        padding: 0.375rem;
    }
    
    /* Override form-group margins */
    .card-details .form-group,
    .card-approvals .form-group,
    .card-time-tracking .form-group {
        margin-bottom: 0.25rem;
    }
    
    /* Card actions - horizontal side-by-side buttons on mobile */
    .card-actions {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 6px;
        padding: 0.5rem;
        margin-top: 0 !important;
        border-top: none !important;
        background: transparent !important;
        flex-wrap: nowrap;
    }
    
    .card-actions .button,
    .card-actions .handlinger-btn {
        flex: 1;
        font-size: 0.7rem;
        padding: 0.5rem 0.375rem;
        min-width: 0;
        height: 40px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }
}

/* Dashboard Time Tracking Styles */
.time-overview {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.time-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.time-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.time-card.total-hours {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.time-card.active-workers {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.time-card.projects-with-time {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.time-card-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.time-card-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

.time-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.top-work-orders-by-hours,
.top-contractors-by-hours {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.top-work-orders-by-hours h3,
.top-contractors-by-hours h3 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.2rem;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.top-item:hover {
    background: #e2e8f0;
}

.top-item .medal {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.top-content {
    flex: 1;
}

.top-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.top-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.top-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-stats span {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.top-stats .hours {
    background: #dbeafe;
    color: #1e40af;
}

.top-stats .workers,
.top-stats .projects {
    background: #d1fae5;
    color: #065f46;
}

.top-stats .avg {
    background: #fef3c7;
    color: #92400e;
}

.no-time-data {
    text-align: center;
    padding: 3rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.no-time-data p {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0;
}

/* Custom Modal Styles */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  margin: 1rem;
  text-align: center;
}

.modal-content p {
  margin: 0 0 1.5rem 0;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--text-color);
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

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

.btn-yes:hover {
  background: #27ae60;
  transform: translateY(-1px);
}

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

.btn-no:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

.btn-ok {
  background: var(--primary-color);
  color: white;
  min-width: 100px;
}

.btn-ok:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Responsive adjustments for dashboard time tracking */
@media (max-width: 1024px) {
    .time-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .time-overview {
        gap: 1rem;
    }
    
    .top-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .top-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .top-item .medal {
        align-self: center;
    }
}

/* ========================================
 * Custom Leaflet Map Markers with SJA Indicators
 * ======================================== */

/* Leaflet divIcon SJA indicators - using different approach */
/* Base marker styling for divIcon elements */
div.custom-marker-black {
    position: relative !important;
    width: 25px !important;
    height: 41px !important;
    background-size: 25px 41px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Green marker with SJA indicator */
div.marker-green-black {
    background-image: url('https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png') !important;
}

/* Blue marker with SJA indicator */  
div.marker-blue-black {
    background-image: url('https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png') !important;
}

/* Gray marker with SJA indicator */
div.marker-gray-black {
    background-image: url('https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-grey.png') !important;
}

/* Black circle SJA indicator - positioned as overlay */
div.custom-marker-black::before {
    content: '●' !important;
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    font-size: 12px !important;
    color: #000 !important;
    text-shadow: 0 0 2px #fff, 0 0 4px #fff !important;
    z-index: 1000 !important;
    display: block !important;
}

/* ========================================
 * MOBILE RESPONSIVE DESIGN - PWA OPTIMIZED
 * ======================================== */

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .button,
    .btn,
    a.button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.25rem;
    }
    
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
    }
}

/* Small devices (phones, up to 640px) */
@media (max-width: 640px) {
    body {
        font-size: 14px;
        padding: 0;
    }
    
    .container {
        padding: 0.5rem;
        padding-top: 5px;
        margin: 0 0.5rem 0.5rem 0.5rem;
        border-radius: var(--radius-md);
    }
    
    /* Header adjustments */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* Navigation - mobile first */
    .navbar {
        padding: 0.5rem 1rem;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        backdrop-filter: blur(10px);
        box-shadow: var(--shadow-md);
    }
    
    .navbar-links {
        padding: 5rem 1.5rem 1rem 1.5rem;
    }
    
    .navbar-links a {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    /* Header row - stack on mobile */
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .safety-sign-inline {
        margin-left: 0;
        width: 100%;
        min-width: auto;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Buttons - full width on mobile */
    .button,
    .btn,
    a.button {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    /* EXCEPT card action buttons - those should be horizontal */
    .card-actions .button,
    .card-actions .handlinger-btn,
    .card-actions a.button,
    .card-actions button,
    .card-actions a {
        width: auto !important;
        flex: 1 !important;
        margin-bottom: 0 !important;
    }
    
    .button-sm {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Form adjustments */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Table responsive */
    table {
        font-size: 0.875rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    /* Make tables scroll horizontally */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Grid layouts - single column on mobile */
    .dashboard-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    /* Login page mobile */
    .login-container {
        margin: 2rem auto;
        padding: 0 1rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    /* Work order cards */
    .work-order-card {
        margin-bottom: 1rem;
    }
    
    .work-order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Card actions - horizontal side-by-side on very small screens */
    .card-actions {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 6px;
        flex-wrap: nowrap;
        border-top: none !important;
        background: transparent !important;
        margin-top: 0 !important;
    }
    
    .card-actions .button,
    .card-actions .handlinger-btn,
    .card-actions a {
        flex: 1;
        min-width: 0;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-width: 95vw;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Time tracking mobile */
    .time-input-group {
        flex-direction: column;
    }
    
    .time-input-group label {
        margin-bottom: 0.25rem;
    }
}

/* Medium devices (tablets, 641px to 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-row {
        flex-wrap: wrap;
    }
}

/* Landscape phone optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .container {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        padding: 1rem;
    }
    
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    h1 {
        font-size: 1.25rem;
    }
}

/* PWA Safe Areas - for devices with notches */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* iOS PWA Status Bar */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}

/* Improve touch scrolling */
* {
    -webkit-overflow-scrolling: touch;
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Better tap highlighting */
* {
    -webkit-tap-highlight-color: rgba(30, 64, 175, 0.1);
}

/* Smooth scrolling for PWA */
html {
    scroll-behavior: smooth;
}

/* ============================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 20%, 53%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-8px); }
    70% { transform: translateY(-4px); }
    90% { transform: translateY(-2px); }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

@keyframes checkmark {
    0% { stroke-dashoffset: 50; }
    100% { stroke-dashoffset: 0; }
}

/* Animation utility classes */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out forwards;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-bounce {
    animation: bounce 0.6s ease-in-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Staggered animations for lists */
.stagger-animation > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.4s; }

/* Button ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-ripple:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* Card hover lift effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Enhanced button transitions */
button, .button, [type="submit"], [type="button"] {
    transition: all 0.2s ease;
}

button:active, .button:active, [type="submit"]:active, [type="button"]:active {
    transform: scale(0.98);
}

/* Link hover underline animation */
.link-animated {
    position: relative;
    text-decoration: none;
}

.link-animated::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.link-animated:hover::after {
    width: 100%;
}

/* Success checkmark animation */
.success-checkmark {
    width: 24px;
    height: 24px;
    display: inline-block;
}

.success-checkmark svg {
    stroke: var(--success-color);
    stroke-width: 3;
    fill: none;
}

.success-checkmark svg path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: checkmark 0.4s ease-out forwards;
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

/* Toast notifications with animation */
.toast {
    animation: slideInRight 0.3s ease-out, fadeIn 0.3s ease-out;
}

.toast-exit {
    animation: fadeIn 0.3s ease-out reverse forwards;
}

/* ============================================
   SKELETON LOADING SCREENS
   ============================================ */

/* Base skeleton style */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--background-tertiary) 25%,
        var(--background-secondary) 50%,
        var(--background-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        #374151 25%,
        #4b5563 50%,
        #374151 75%
    );
    background-size: 200% 100%;
}

/* Skeleton shapes */
.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text-sm {
    height: 0.75rem;
}

.skeleton-text-lg {
    height: 1.5rem;
}

.skeleton-title {
    height: 2rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.skeleton-image {
    height: 150px;
    border-radius: var(--radius-md);
}

/* Skeleton card layout */
.skeleton-card-content {
    padding: 1.5rem;
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.skeleton-card-content .skeleton-title {
    margin-bottom: 1.5rem;
}

.skeleton-card-content .skeleton-text:last-child {
    width: 40%;
}

/* Skeleton for PTW cards */
.skeleton-ptw-card {
    background: var(--background-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-ptw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skeleton-ptw-header .skeleton-text {
    width: 30%;
}

.skeleton-ptw-header .skeleton-badge {
    width: 80px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-ptw-body {
    display: grid;
    gap: 0.75rem;
}

.skeleton-ptw-body .skeleton-text:nth-child(1) { width: 80%; }
.skeleton-ptw-body .skeleton-text:nth-child(2) { width: 60%; }
.skeleton-ptw-body .skeleton-text:nth-child(3) { width: 70%; }

.skeleton-ptw-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.skeleton-ptw-footer .skeleton-button {
    flex: 1;
}

/* Skeleton for dashboard stats */
.skeleton-stat-card {
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.skeleton-stat-card .skeleton-number {
    height: 3rem;
    width: 60%;
    margin: 0 auto 0.5rem;
}

.skeleton-stat-card .skeleton-label {
    height: 1rem;
    width: 80%;
    margin: 0 auto;
}

/* Fade content in when loaded */
.content-loaded {
    animation: fadeIn 0.3s ease-out;
}

/* Hide skeleton when content loads */
.skeleton-container.loaded .skeleton {
    display: none;
}

.skeleton-container.loaded .content {
    display: block;
}

.skeleton-container .content {
    display: none;
}

/* ============================================
   BOTTOM NAVIGATION BAR (Mobile)
   ============================================ */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-theme="dark"] .bottom-nav {
    background: #1f2937;
    border-top-color: #374151;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.bottom-nav-links {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    min-width: 60px;
    position: relative;
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 0.25rem;
    transition: transform 0.2s ease;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.bottom-nav-item:hover,
.bottom-nav-item:active {
    color: var(--primary-color);
    background: rgba(30, 64, 175, 0.1);
}

.bottom-nav-item:active svg {
    transform: scale(0.9);
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

/* Create button in bottom nav */
.bottom-nav-item.create-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
    padding: 0;
    min-width: unset;
}

.bottom-nav-item.create-btn svg {
    width: 28px;
    height: 28px;
    margin-bottom: 0;
}

.bottom-nav-item.create-btn span {
    display: none;
}

.bottom-nav-item.create-btn:hover,
.bottom-nav-item.create-btn:active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    transform: scale(1.05);
}

.bottom-nav-item.create-btn::before {
    display: none;
}

/* Show bottom nav on mobile */
@media (max-width: 1024px) {
    .bottom-nav {
        display: block;
    }

    /* Hide top navbar completely on mobile - use bottom nav only */
    .navbar {
        display: none !important;
    }

    /* Hide advanced filters on mobile - more screen space */
    .advanced-filters-wrapper {
        display: none !important;
    }

    /* Adjust body padding - no top navbar, only bottom nav */
    body {
        padding-top: 0;
        padding-bottom: 80px;
    }
}

/* More menu dropdown for mobile */
.more-menu-dropdown {
    display: none;
    position: fixed;
    bottom: 70px;
    right: 1rem;
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    z-index: 1001;
}

.more-menu-dropdown.active {
    display: block;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.more-menu-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s ease;
}

.more-menu-dropdown a:hover {
    background: var(--background-secondary);
}

[data-theme="dark"] .more-menu-dropdown {
    background: #1f2937;
    border-color: #374151;
}

/* ============================================
   PULL TO REFRESH
   ============================================ */

.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-secondary);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    pointer-events: none;
}

.pull-to-refresh.visible {
    transform: translateY(0);
}

.pull-to-refresh.pulling {
    transform: translateY(calc(-100% + var(--pull-distance, 0px)));
}

.pull-to-refresh-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.pull-to-refresh-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.2s ease;
}

.pull-to-refresh.pulling .pull-to-refresh-icon {
    transform: rotate(calc(var(--pull-progress, 0) * 180deg));
}

.pull-to-refresh.refreshing .pull-to-refresh-icon {
    animation: spin 0.8s linear infinite;
}

.pull-to-refresh-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

[data-theme="dark"] .pull-to-refresh {
    background: #374151;
}

/* ============================================
   SWIPE CARD GESTURES
   ============================================ */

.swipe-card {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.swipe-card-content {
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    background: var(--background-primary);
}

.swipe-card.swiping .swipe-card-content {
    transition: none;
}

.swipe-card-actions {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.swipe-card-actions.left {
    left: 0;
    background: linear-gradient(90deg, var(--success-color) 0%, transparent 100%);
}

.swipe-card-actions.right {
    right: 0;
    background: linear-gradient(-90deg, var(--primary-color) 0%, transparent 100%);
}

.swipe-card.swiping .swipe-card-actions {
    opacity: 1;
}

.swipe-action-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    color: var(--success-color);
    box-shadow: var(--shadow-md);
}

.swipe-card-actions.right .swipe-action-icon {
    color: var(--primary-color);
}

.swipe-hint {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    margin-bottom: 0.5rem;
}

.swipe-card:first-child .swipe-hint {
    animation: fadeInUp 0.5s ease-out 2s forwards;
}

/* Swipe feedback colors */
.swipe-card.swipe-approve .swipe-card-content {
    background: rgba(34, 197, 94, 0.1);
}

.swipe-card.swipe-details .swipe-card-content {
    background: rgba(59, 130, 246, 0.1);
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .swipe-card {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ========== INFINITE SCROLL ========== */

.infinite-scroll-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    margin: 1rem 0;
}

.infinite-scroll-loading .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.infinite-scroll-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: infinite-spin 0.8s linear infinite;
}

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

.infinite-scroll-end {
    text-align: center;
    padding: 1.5rem;
    margin: 1rem 0;
}

.infinite-scroll-end .end-message {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--background-secondary);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
}

.infinite-scroll-sentinel {
    height: 1px;
    visibility: hidden;
}

.load-more-btn {
    display: block;
    margin: 1.5rem auto;
    padding: 0.875rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== LAZY LOADING IMAGES ========== */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

.image-placeholder {
    background: linear-gradient(90deg, var(--background-secondary) 25%, var(--border-light) 50%, var(--background-secondary) 75%);
    background-size: 200% 100%;
    animation: image-shimmer 1.5s infinite;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
}

@keyframes image-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Image gallery lazy loading */
.images-grid img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.images-grid img:hover {
    transform: scale(1.02);
}

/* ===========================================
   TUTORIAL SYSTEM STYLES
   =========================================== */

/* Help Button Widget */
.help-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.help-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    color: white;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.help-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
}

.help-trigger svg {
    width: 22px;
    height: 22px;
}

.help-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    z-index: 10000;
    display: none !important;
    flex-direction: column;
    overflow: hidden;
}

.help-dropdown.open {
    display: flex !important;
    animation: dropdownSlide 0.2s ease;
}

.help-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.help-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.help-menu {
    padding: 0.5rem 0;
}

.help-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.help-menu-item:hover {
    background: var(--background-secondary);
}

.help-icon {
    width: 36px;
    height: 36px;
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.help-item-content {
    flex: 1;
    min-width: 0;
}

.help-text {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.help-subtext {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.help-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    background: var(--background-secondary);
}

.help-progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.help-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.help-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Tour Overlay */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    pointer-events: all;
}

.tour-overlay-svg {
    position: absolute;
    top: 0;
    left: 0;
}

/* Tour Tooltip */
.tour-tooltip {
    position: absolute;
    width: 340px;
    max-width: calc(100vw - 2rem);
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 1.25rem;
    z-index: 9999;
    animation: tooltipAppear 0.3s ease;
    border: 1px solid var(--border-light);
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tour-step-indicator {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--background-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.tour-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.tour-tooltip-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tour-tooltip-content {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.tour-tooltip-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.tour-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background: var(--background-secondary);
    color: var(--text-primary);
}

.tour-btn:hover {
    background: var(--background-primary);
    border-color: var(--text-secondary);
}

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

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

/* Highlighted element during tour */
.tour-highlighted {
    position: relative;
    z-index: 9999;
    pointer-events: auto;
    box-shadow: 0 0 0 4px var(--primary-light), 0 0 20px rgba(59, 130, 246, 0.4) !important;
    border-radius: var(--radius-md);
}

/* Tour completion message */
.tour-completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    padding: 2rem 3rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    z-index: 10001;
    animation: tooltipAppear 0.3s ease;
}

.tour-completion-icon {
    width: 64px;
    height: 64px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.tour-completion-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Contextual Tooltips */
.contextual-tooltip {
    position: absolute;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    max-width: 280px;
    z-index: 9000;
    box-shadow: var(--shadow-lg);
    animation: tooltipAppear 0.3s ease;
}

.contextual-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--primary-color);
}

.tooltip-content {
    display: block;
    margin-bottom: 0.5rem;
}

.tooltip-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.tooltip-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tour/Tooltip message */
.tour-message,
.tooltip-message {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--background-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    z-index: 10002;
    animation: tooltipAppear 0.3s ease;
}

/* Fade out animation */
.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes tooltipAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip target highlight */
.tooltip-target-highlight {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 2px;
    border-radius: var(--radius-sm);
    animation: pulseHighlight 1.5s ease-in-out infinite;
}

@keyframes pulseHighlight {
    0%, 100% {
        outline-color: var(--primary-color);
    }
    50% {
        outline-color: var(--primary-light);
    }
}

/* Mobile adjustments for tutorial */
@media (max-width: 1024px) {
    .tour-tooltip {
        position: fixed !important;
        bottom: 100px !important;
        left: 1rem !important;
        right: 1rem !important;
        top: auto !important;
        width: auto !important;
        max-width: none !important;
    }

    .help-dropdown {
        position: fixed;
        top: auto;
        bottom: 80px;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
    }

    .tour-completion-message {
        left: 1rem;
        right: 1rem;
        transform: translate(0, -50%);
        padding: 1.5rem;
    }
}

/* ===================================
   Voice Assistant Widget
   =================================== */

.voice-assistant-widget {
    position: fixed;
    bottom: 90px;
    right: 1rem;
    z-index: 1001;
}

.voice-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.listening {
    background: var(--danger-color);
    animation: voice-pulse 1.5s infinite;
}

.voice-btn.listening .mic-icon {
    display: none;
}

.voice-btn.listening .stop-icon {
    display: block !important;
}

.voice-btn.processing {
    background: var(--warning-color);
}

.voice-btn.processing .mic-icon {
    display: none;
}

.voice-btn.processing .voice-spinner {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.voice-btn.processing .voice-spinner svg {
    animation: spin 1s linear infinite;
}

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

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

/* Conversation mode - continuous listening */
.voice-btn.conversation {
    box-shadow: 0 0 0 3px var(--primary-color), var(--shadow-lg);
}

.voice-btn.conversation::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid white;
    animation: conversation-dot 2s infinite;
}

@keyframes conversation-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes voice-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
}

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

.voice-transcript {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--background-primary);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    min-width: 250px;
    max-width: 320px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    display: none;
    white-space: pre-line;
}

.voice-transcript.active {
    display: block;
}

/* Mobile adjustments for voice widget */
@media (max-width: 1024px) {
    .voice-assistant-widget {
        bottom: 100px;
        right: 0.75rem;
    }

    .voice-btn {
        width: 52px;
        height: 52px;
    }

    .voice-transcript {
        right: -0.5rem;
        min-width: 220px;
        max-width: calc(100vw - 2rem);
    }
}

/* ============================================
   FLOATING PTW COUNTER BADGE (Mobile)
   ============================================ */

.ptw-floating-badge {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s ease;
}

.ptw-floating-badge.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .ptw-floating-badge {
        display: block;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    pointer-events: none;
}

@media (max-width: 480px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background-primary, #fff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.toast-hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================
   LOADING OVERLAY & SPINNERS
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color, #10b981);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
}

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

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Inline loading for cards/sections */
.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary, #6b7280);
}

.loading-inline .spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
    margin-right: 0.75rem;
}