/* Local DM Sans & DM Mono (same bundle as PDF export; works offline on native) */
@font-face {
    font-family: 'DM Sans';
    src: url('fonts/DM_Mono%2CDM_Sans/DM_Sans/static/DMSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DM Sans';
    src: url('fonts/DM_Mono%2CDM_Sans/DM_Sans/static/DMSans-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DM Sans';
    src: url('fonts/DM_Mono%2CDM_Sans/DM_Sans/static/DMSans-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DM Sans';
    src: url('fonts/DM_Mono%2CDM_Sans/DM_Sans/static/DMSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DM Mono';
    src: url('fonts/DM_Mono%2CDM_Sans/DM_Mono/DMMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DM Mono';
    src: url('fonts/DM_Mono%2CDM_Sans/DM_Mono/DMMono-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Performance Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* iOS WebView keyboard optimizations */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* CSS Variables for Theme */
:root {
    /* Dark Theme (default) */
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --bg-card: #374151;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #F2F2F7;
    --text-muted: #a0aec0;
    --text-icons: #f1f5f9;
    --border-color: #4a5568;
    --shadow: rgba(0,0,0,0.3);
    --shadow-lg: rgba(0,0,0,0.5);
    
    /* Status colors */
    --status-in-progress: #68d391;
    --status-upcoming: #f6ad55;
    --status-on-hold: #fc8181;
    --status-completed: #9ae6b4;
    --status-all: #4a5568;
    
    /* Accent colors */
    --accent-primary: #68d391;
    --accent-danger: #fc8181;
    --accent-link: #1a202c;
    --accent-green: #68d391;
    --accent-red: #fc8181;
    --accent-blue: #63b3ed;
    --accent-yellow: #f6ad55;
    --accent-purple: #9f7aea;
    
    /* Calendar task status colors */
    --overdue-color: #ef4444;
    --due-soon-color: #f59e0b;
    --completed-color: #10b981;
    
    /* Accent tint for dark backgrounds - stronger for visibility */
    --accent-green-tint: rgba(104, 211, 145, 0.25);
    
    --photo-selection-icon: #ffffff;
    
    /* App typography — DM Sans / DM Mono (+ system fallbacks) */
    --font-family-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --mono: var(--font-family-mono); /* invoice-styles & PDF-style UI */
    
    /* Apple iOS Font Sizes - Simplified (5 sizes only) */
    --font-size-special: 1.625rem;      /* 26px - Large display numbers, prominent stats */
    --font-size-default: 1.0625rem;     /* 17px - Everything (titles, body, buttons, stats) */
    --font-size-base: 0.9375rem;        /* 15px - Alias for default (backward compatibility) */
    --font-size-secondary: 0.9375rem;   /* 15px - Secondary text, labels */
    --font-size-tertiary: 0.8125rem;    /* 13px - Captions, small details */
    --font-size-secondaryallest: 0.625rem;     /* 10px - Tab bar only (don't go smaller) */
    
    /* iOS Letter Spacing (Tracking) */
    --tracking-tight: -0.02em;          /* For large text (≥20px) */
    --tracking-normal: 0;               /* For medium text */
    --tracking-loose: 0.015em;          /* For small text (<17px) */
    
    /* Font Weights - iOS Standard (3-weight system) */
    --font-weight-semibold: 600;        /* Buttons, headlines, titles */
    --font-weight-medium: 500;          /* Emphasized text, labels, captions */
    --font-weight-regular: 400;         /* Body text, descriptions */
    --font-weight-normal: 400;          /* Alias for regular (backward compatibility) */
    
    /* iOS Spacing System (8pt grid) */
    --spacing-xs: 0.25rem;   /* 4pt - Tight spacing */
    --spacing-sm: 0.5rem;    /* 8pt - Small spacing */
    --spacing-md: 1rem;      /* 16pt - Standard spacing */
    --spacing-lg: 1.5rem;    /* 24pt - Large spacing */
    --spacing-xl: 2rem;      /* 32pt - Extra large spacing */
    
    /* iOS Standard Values */
    --touch-target-min: 44px;    /* Minimum touch target */
    --list-row-height: 44px;     /* Standard list row height */
    --section-spacing: 1rem;    /* 16pt between sections */
    --content-padding: 1rem;     /* 16pt content padding */
    --modal-padding: 1rem;      /* 16pt modal padding */
    --card-padding: 1rem;        /* 16pt card padding */
    --card-radius: 16px;         /* Standard card radius */
    --button-padding-v: 0.75rem; /* 12pt vertical button padding */
    --button-padding-h: 1rem;    /* 16pt horizontal button padding */
    
    /* Glass effect variables - GPU optimized */
    --glass-bg-dark: rgba(45, 55, 72, 0.85);
    --glass-bg-light: rgba(255, 255, 255, 0.85);
    --glass-blur: blur(8px) saturate(120%); /* Reduced from 12px/150% for better performance */
    --glass-shadow-dark: none;
    --glass-shadow-light: none;
}

/* Light Theme */
body.light-theme {
    --bg-primary: #f7f7f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f7f7f7;
    --bg-card: #f7f7f7;
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-tertiary: #4a5568;
    --text-muted: #718096;
    --text-icons: #1a202c;
    --border-color: #f0f0f0;
    --shadow: rgba(0,0,0,0.1);
    --shadow-lg: rgba(0,0,0,0.15);
    --accent-link: #1a202c;
    --accent-green: #68d391;
    --accent-red: #fc8181;
    --accent-blue: #63b3ed;
    --accent-yellow: #f6ad55;
    --accent-purple: #9f7aea;
    
    /* Calendar task status colors for light theme */
    --overdue-color: #e53e3e;
    --due-soon-color: #ed8936;
    --completed-color: #38a169;
    
    /* Accent tint for light backgrounds - subtler */
    --accent-green-tint: rgba(104, 211, 145, 0.15);
    
    --photo-selection-icon: #ffffff;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Prevent text selection and dragging on UI elements */
body, button, select, .status-card, .menu-item, .job-site-item, 
h1, h2, h3, h4, h5, h6, p, span, div, label, a, 
.btn, .card, .modal, header, nav, footer, section, article {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input and textarea elements */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* iOS input focus optimization - reduce keyboard warnings */
input:focus, textarea:focus, select:focus {
    /* Prevent iOS zoom on focus */
    font-size: max(16px, var(--font-size-base));
}


/* Prevent image dragging and selection for native app feel */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: auto;
}

/* Prevent SVG and icon selection */
svg, i, .icon {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: var(--font-size-default);
    /* iOS-optimized text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    touch-action: pan-y; /* Allow vertical scrolling only */
    -webkit-overflow-scrolling: touch;
    position: relative;
    
    /* Minimal fix for rendering artifacts */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Solid background - follows light/dark theme */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: var(--bg-primary);
}

/* Hide individual shape divs - not needed */
.shape { display: none; }

/* Fix for iOS WebView scrolling issue */
html, body {
    height: 100vh;
    overflow: hidden;
}

/* App layout */
.app {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain; /* Let our custom pull-to-refresh handle top overscroll */
    will-change: scroll-position;
}

/* Header */
.header {
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    min-height: 48px;
}

/* Light theme header */
body.light-theme .header {
    background: var(--bg-secondary);
}

.header-title {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sync Indicator */
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.95;
    margin-left: 8px;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sync-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0.85;
    letter-spacing: 0.01em;
}

/* Sync states */
.sync-indicator[data-state="synced"] .sync-dot {
    background: #4ade80;
}

.sync-indicator[data-state="syncing"] .sync-dot {
    background: #fbbf24;
    animation: pulse 1.5s ease-in-out infinite;
}

.sync-indicator[data-state="offline"] .sync-dot {
    background: #ef4444;
}

.sync-indicator[data-state="pending"] .sync-dot {
    background: #f59e0b;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Hide sync indicator when using SQLite */
.sync-indicator[data-state="hidden"] {
    display: none;
}

.menu-btn,
.theme-toggle,
.header-icon-btn {
    background: none;
    border: none;
    color: var(--text-icons);
    font-size: var(--font-size-default);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

@media (hover: hover) and (pointer: fine) {
.menu-btn:hover,
.theme-toggle:hover,
.header-icon-btn:hover {
    background-color: var(--bg-card);
    transform: scale(1.1);
    will-change: transform;
}
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* .header-chat-btn uses .header-icon-btn (same as .theme-toggle): 40px, padding 0.5rem, border-radius 12px, background on hover */
.header-chat-btn img {
    display: block;
    object-fit: contain;
    /* Dark theme: white icon (matches --text-icons) */
    filter: brightness(0) invert(1);
}
body.light-theme .header-chat-btn img {
    /* Light theme: black icon (matches --text-icons) */
    filter: brightness(0);
}


.theme-toggle i {
    transition: transform 0.3s ease;
}

.theme-toggle:active i {
    transform: rotate(180deg);
}

/* Main content */
.main-content {
    position: relative;
    z-index: 1; /* Above pull-to-refresh indicator */
    padding: 1rem;
    padding-top: calc(70px + env(safe-area-inset-top, 0px)); /* Space for fixed header + safe area */
    padding-bottom: 100px; /* Space for floating button */
    background: var(--bg-primary); /* Opaque so indicator stays hidden until pull */
}

/* View Container - Multi-view system */
.view-container {
    display: none;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.view-container.active {
    display: block;
    opacity: 1;
    position: relative;
}

/* Slide animations for view transitions */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Apply slide animations */
.view-container.slide-in-right {
    animation: slideInFromRight 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.view-container.slide-in-left {
    animation: slideInFromLeft 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.view-container.slide-out-right {
    animation: slideOutToRight 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.view-container.slide-out-left {
    animation: slideOutToLeft 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Pull to Refresh Indicator - above main content so visible when pulling */
.pull-to-refresh-indicator {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 52px); /* Just below header */
    left: 0;
    right: 0;
    height: 56px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    z-index: 50; /* Above main content so not hidden behind blocks when pulling */
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.1s ease;
    will-change: opacity;
    background: transparent;
}

.refresh-spinner {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
}

.pull-to-refresh-indicator.ready,
.pull-to-refresh-indicator.refreshing {
    opacity: 1 !important;
    visibility: visible !important;
}

.pull-to-refresh-indicator.refreshing .refresh-spinner,
.pull-to-refresh-indicator.ready .refresh-spinner {
    animation: spin 0.8s linear infinite;
}

.refresh-text {
    color: var(--text-secondary);
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
}

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

/* In-modal saving indicator (Create Job Site, etc.) */
.modal-saving-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}
.modal-saving-indicator[hidden] {
    display: none !important;
}
.modal-saving-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color, rgba(255,255,255,0.2));
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.modal-saving-indicator.is-done .modal-saving-spinner {
    animation: none;
    border: none;
    width: auto;
    height: auto;
    color: var(--accent-primary);
}

/* Button in saving state: center spinner + text */
.btn--saving {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
/* Spinner inside primary button (Create Job Site saving state) */
.btn-saving-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}
/* Checkmark when done – same size/style as spinner */
.btn-saving-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* will-change: transform removed — it creates a new containing block which breaks
   position:fixed children (keypad sheet, overlays) by making them position relative
   to this element instead of the viewport */
.main-content {
}

/* View Title - iOS Typography Scale */
.view-title {
    color: var(--text-primary);
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: var(--tracking-tight);
    line-height: 1.15;
}

.view-title i {
    color: var(--primary-color);
    font-size: var(--font-size-default);
    line-height: 1;
}

/* iPhone: Optimized for smaller screens */
@media (max-width: 480px) {
    .view-title {
        font-size: var(--font-size-default);
        margin-bottom: 1.25rem;
        letter-spacing: var(--tracking-tight);
    }
    
    .view-title i {
        font-size: var(--font-size-default);
    }
}

/* Tasks View */
.tasks-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: var(--font-size-base);
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
.filter-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}
}


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

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Task row base – shared with checklist-row and list-task-item */
/* Same layout: checkbox (left) + card (right) */
.task-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.625rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Exit: squeeze / zoom out (shrink then disappear), then task pops in elsewhere */
@-webkit-keyframes task-burst-exit {
    0% {
        opacity: 1;
        -webkit-transform: scale(1, 1) translateZ(0);
        transform: scale(1, 1) translateZ(0);
    }
    50% {
        opacity: 1;
        -webkit-transform: scale(0.92, 0.82) translateZ(0);
        transform: scale(0.92, 0.82) translateZ(0);
    }
    100% {
        opacity: 0;
        -webkit-transform: scale(0.4, 0.2) translateZ(0);
        transform: scale(0.4, 0.2) translateZ(0);
    }
}
@keyframes task-burst-exit {
    0% {
        opacity: 1;
        transform: scale(1, 1) translateZ(0);
    }
    50% {
        opacity: 1;
        transform: scale(0.92, 0.82) translateZ(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.4, 0.2) translateZ(0);
    }
}

/* Enter: pop up in the new place (small → slight overshoot → normal) */
@-webkit-keyframes task-pop-in {
    0% {
        opacity: 0;
        -webkit-transform: scale(0.35, 0.2) translateZ(0);
        transform: scale(0.35, 0.2) translateZ(0);
    }
    65% {
        opacity: 1;
        -webkit-transform: scale(1.06, 1.02) translateZ(0);
        transform: scale(1.06, 1.02) translateZ(0);
    }
    100% {
        opacity: 1;
        -webkit-transform: scale(1, 1) translateZ(0);
        transform: scale(1, 1) translateZ(0);
    }
}
@keyframes task-pop-in {
    0% {
        opacity: 0;
        transform: scale(0.35, 0.2) translateZ(0);
    }
    65% {
        opacity: 1;
        transform: scale(1.06, 1.02) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: scale(1, 1) translateZ(0);
    }
}

/* task-item-exit / task-item-enter: see unified .checklist-row.*-exit/enter block */

/* task-item / list-task-item use .checklist-item for inner card (shared) */
/* Override layout: column for summary/list (base .checklist-item is horizontal for modal) */
.task-item .checklist-item,
.list-task-item .checklist-item {
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    align-items: stretch;
}

/* task-item hover/active: see unified block with checklist-row */

/* Overdue tasks get RED border */
.task-item.overdue:not(.completed) .checklist-item {
    border-left-color: var(--overdue-color);
}

/* Due soon tasks get ORANGE border */
.task-item.due-soon:not(.completed) .checklist-item {
    border-left-color: var(--due-soon-color);
}

/* Completed tasks have GREEN border */
.task-item.completed .checklist-item {
    opacity: 0.7;
    border-left-color: var(--completed-color);
}

.task-item .checklist-checkbox {
    flex-shrink: 0;
}

/* list-task-item now uses checklist-checkbox (left side); task-checkbox removed */

/* Minimalistic icon styling */
.checklist-item i,
.checklist-due-date i,
.checklist-delete i {
    font-size: var(--font-size-secondary);
    opacity: 0.8;
    font-weight: var(--font-weight-normal);
}

.task-item-content {
    flex: 1;
}

/* Calendar / summary view task items - same styling as checklist */
.task-item .list-task-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 0.3rem;
    gap: 0.5rem;
}

.task-item .list-task-title {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-size: var(--font-size-tertiary);
    flex: 1;
    line-height: 1.2;
}

.task-item .list-task-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--font-size-secondary);
    color: var(--text-muted);
    flex-wrap: wrap;
    font-weight: var(--font-weight-medium);
}

.task-item .list-task-job {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--font-size-tertiary);
    color: var(--text-secondary);
}

.task-item .list-task-status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.02em;
}

/* Match donut section colors */
.task-item .list-task-status-badge.overdue {
    background: #fc8181;
    color: white;
}

.task-item .list-task-status-badge.due-soon {
    background: #f6ad55;
    color: white;
}

.task-item .list-task-status-badge.completed {
    background: #38a169;
    color: white;
}

.task-item .list-task-status-badge.normal {
    background: var(--accent-green);
    color: white;
}

.task-item-title {
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.task-item-title.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-secondary);
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
}

.task-job-site {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: var(--font-size-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.task-due-date {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
}

.task-due-date.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.task-due-date.due-soon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.task-due-date:not(.overdue):not(.due-soon):not(.completed) {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.task-due-date.completed {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.task-completed-date {
    font-size: var(--font-size-tertiary);
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.task-completed-date i {
    color: #10b981;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
    margin: 0;
    min-height: 60px;
}

.empty-state i {
    font-size: var(--font-size-special);
    color: var(--border-color);
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: var(--font-size-secondary);
    margin: 0;
    color: var(--text-muted);
}

/* Help View */
.help-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.help-category {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.help-category-title {
    color: var(--text-primary);
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.help-category-title i {
    color: var(--primary-color);
    font-size: var(--font-size-default);
}

.help-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.help-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-green);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
.help-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}
}


@media (hover: hover) and (pointer: fine) {
.help-card:hover::before {
    opacity: 0.03;
}
}


.help-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.help-card-header i {
    color: var(--primary-color);
    font-size: var(--font-size-default);
    flex-shrink: 0;
}

.help-card-header h4 {
    color: var(--text-primary);
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    margin: 0;
    letter-spacing: -0.3px;
}

.help-card-content {
    padding: 1.25rem;
}

.help-card-content p {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.help-card-content p:last-child {
    margin-bottom: 0;
}

.help-card-content strong {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

body.light-theme .help-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .help-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
}
}


body.light-theme .help-card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
}

/* Settings View */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    font-size: var(--font-size-secondary);
}

.settings-card-header {
    cursor: pointer;
    transition: background-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
.settings-card-header:hover {
    background-color: rgba(0, 0, 0, 0.02);
}
}


@media (hover: hover) and (pointer: fine) {
body.light-theme .settings-card-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}
}


/* Company Profile Styles */
.logo-upload-section {
    margin-top: 0.5rem;
}

.logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
    border: 1px dashed var(--border-color);
    border-radius: var(--card-radius);
    background: var(--bg-secondary);
    margin-bottom: 1rem;
    padding: 1rem;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: var(--font-size-secondary);
}

.logo-placeholder i {
    font-size: var(--font-size-special);
    opacity: 0.5;
}

.logo-upload-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.logo-upload-buttons .btn {
    flex: 1;
    min-width: 120px;
}

.form-hint {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

#companyLogoImage {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    border-radius: var(--card-radius-sm);
}

/* Company Profile Modal - Ensure proper spacing */
#companyProfileModal .modal-body {
    padding-bottom: 1.5rem;
}

#companyProfileModal .form-group:last-child {
    margin-bottom: 0.5rem;
}

/* Business Card Modal */
.business-card-modal-content .modal-body {
    padding: 1rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.business-card-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.business-card-qr-hint {
    font-size: var(--font-size-secondary);
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    width: 100%;
}

.business-card-qr-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: transparent;
    margin-bottom: 1rem;
}

body.dark-theme .business-card-qr-wrap {
    background: transparent;
}

.business-card-qr-wrap canvas,
.business-card-qr-wrap img {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 100%;
    border-radius: 8px;
    object-fit: contain;
    background: transparent !important;
}

/* Logo Crop Modal Styles */
.crop-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crop-instructions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--card-radius-sm);
    font-size: var(--font-size-secondary);
}

.crop-instructions i {
    font-size: var(--font-size-default);
}

.crop-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
}

#logoCropCanvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#logoCropCanvas:active {
    cursor: grabbing;
}

.crop-zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.btn-zoom {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--font-size-default);
    transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
.btn-zoom:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}
}


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

.crop-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crop-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-secondary);
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--card-radius-sm);
}

.crop-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.crop-buttons .btn {
    min-width: 100px;
}

.settings-card-content {
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    display: none;
    animation: slideDown 0.3s ease;
}

.settings-card-content.active {
    display: block;
}

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

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-right: 1rem;
}

.setting-item input[type="time"],
.setting-item select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: var(--font-size-secondary);
    min-width: 120px;
}

.setting-item input[type="time"]:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.settings-category {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-category-title {
    color: var(--text-primary);
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    letter-spacing: -0.5px;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
.settings-category-title:hover {
    background: rgba(255, 255, 255, 0.03);
}
}


.settings-category-title span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-category-title i {
    color: #68d391;
    font-size: var(--font-size-secondary);
}

.category-chevron {
    color: var(--text-secondary);
    font-size: var(--font-size-secondary);
    transition: transform 0.3s ease;
}

.settings-category-content {
    display: block;
    overflow: hidden;
    opacity: 1;
}

.settings-category.collapsed .settings-category-content {
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.settings-category.collapsed .category-chevron {
    -webkit-transform: rotate(-90deg);
    transform: rotate(-90deg);
}

.settings-card {
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 1rem;
}

.settings-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-green);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
.settings-card:hover {
}
}


@media (hover: hover) and (pointer: fine) {
.settings-card:hover::before {
    opacity: 0.03;
}
}


.settings-card.danger {
}

.settings-card.danger::before {
    background: var(--accent-red);
}

@media (hover: hover) and (pointer: fine) {
.settings-card.danger:hover {
}
}

/* ========== My Account redesigned (profile header + cards + list groups) ========== */
.account-panel {
    padding-bottom: 2rem;
}

.account-profile-header {
    text-align: center;
    padding: 1.5rem 0 1.25rem;
}

.account-profile-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    margin: 0 auto 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.2s, border-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
.account-profile-logo-wrap:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}
}

.account-profile-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-profile-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.75rem;
}

.account-profile-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.account-profile-name-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.account-profile-name-hint.hidden {
    display: none;
}

.account-support-line {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.account-support-id {
    font-family: var(--font-family-mono);
    letter-spacing: 0.02em;
}

.account-copy-id {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 6px;
}

@media (hover: hover) and (pointer: fine) {
.account-copy-id:hover {
    color: var(--text-primary);
}
}

.account-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.account-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}

.account-plan-card {
    min-height: 90px;
}

.account-action-card {
    width: 100%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

@media (hover: hover) and (pointer: fine) {
.account-action-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}
}

.account-action-card i:first-child {
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.account-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.account-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.account-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.account-card-sub.hidden {
    display: none;
}

.account-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
}

.account-list-group {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.account-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.account-list-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

@media (hover: hover) and (pointer: fine) {
.account-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
}

.account-list-item i:first-child {
    width: 1.25rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.account-list-item > span:nth-of-type(1) {
    flex: 1;
}

.account-list-value {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-family-mono);
}

.account-list-chevron {
    font-size: var(--font-size-secondaryallest);
    color: var(--text-muted);
}

.account-list-copy {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.25rem;
    cursor: pointer;
}

.account-list-item.danger {
    color: var(--accent-danger);
}

.account-list-item.danger i:first-child {
    color: var(--accent-danger);
}

.account-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-version,
.account-last-login {
    display: block;
}


.settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    gap: 1rem;
    border: none;
}

.settings-card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.settings-card-info i {
    color: #68d391;
    font-size: var(--font-size-secondary);
    flex-shrink: 0;
}

.settings-card.danger .settings-card-info i {
    color: #ef4444;
}

.settings-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-card-text h4 {
    color: var(--text-primary);
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    margin: 0;
    letter-spacing: -0.3px;
}

.settings-card-text p {
    color: var(--text-secondary);
    font-size: var(--font-size-secondary);
    margin: 0;
    line-height: 1.5;
}

.setting-btn {
    padding: 0.7rem 1.25rem;
    background: #68d391;
    color: #1a202c;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
.setting-btn:hover {
    background: #48bb78;
    transform: translateY(-2px);
}
}


.setting-btn.danger {
    background: #ef4444;
    color: white;
}

@media (hover: hover) and (pointer: fine) {
.setting-btn.danger:hover {
    background: #dc2626;
}
}


/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

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

.toggle-switch input:checked + .toggle-slider {
    background: #68d391;
    border-color: #68d391;
}

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

/* Language Selector */
.language-selector {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.lang-btn {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 60px;
}

@media (hover: hover) and (pointer: fine) {
.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}
}


.lang-btn.active {
    background: #68d391;
    border-color: #68d391;
    color: #1a202c;
}

@media (max-width: 480px) {
    .language-selector {
        gap: 4px;
    }
    
    .lang-btn {
        flex: 1;
        padding: 0.35rem 0.6rem;
        font-size: var(--font-size-secondary);
        min-width: auto;
    }
}

body.light-theme .settings-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .settings-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
}
}


body.light-theme .settings-card.danger {
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .settings-card.danger:hover {
}
}


body.light-theme .toggle-slider {
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

body.light-theme .toggle-slider:before {
    background-color: #333;
}


body.light-theme .history-section {
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .history-section:hover {
    border-color: rgba(0, 0, 0, 0.12);
}
}


body.light-theme .history-section .section-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .activity-item {
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .activity-item:hover {
    border-color: rgba(0, 0, 0, 0.15);
}
}


body.light-theme .activity-timeline::before {
    background: rgba(104, 211, 145, 0.3);
}

.content-panel {
    background-color: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 1.5rem;
}

/* Light theme glass effect */
body.light-theme .content-panel {
    background-color: var(--glass-bg-light);
}

/* Search */
.search-container {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    outline: none;
    transition: all 0.2s ease;
    min-height: var(--touch-target-min);
    line-height: 1.4;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent-primary);
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-bottom: 1.5rem;
}

.status-card:first-child {
    grid-column: 1 / -1;
}

.status-card {
    padding: var(--spacing-lg) var(--spacing-md);
    border-radius: var(--card-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--touch-target-min);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

@media (hover: hover) and (pointer: fine) {
.status-card:hover {
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}
}


.status-card:active {
    -webkit-transform: scale(0.97);
    transform: scale(0.97);
    -webkit-transition: transform 0.1s ease;
    transition: transform 0.1s ease;
}

.status-card.active {
    -webkit-transform: scale(1);
    transform: scale(1);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.status-card.drag-over {
    transform: scale(1.05);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border: 1px solid rgba(74, 222, 128, 0.8);
    will-change: transform;
    transition: transform 0.15s ease;
}

.status-card.status-dropped {
    animation: statusDropGlow 0.6s ease-out;
    will-change: transform;
}

@keyframes statusDropGlow {
    0% {
        transform: scale(1.1);
    }
    25%, 50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.status-card.all {
    background: #4a5568;
    color: #ffffff;
}

.status-card.in-progress {
    background: var(--accent-blue);
    color: #ffffff;
}

.status-card.upcoming {
    background: #f6ad55;
    color: var(--text-primary);
}

.status-card.on-hold {
    background: #fc8181;
    color: var(--text-primary);
}

.status-card.completed {
    background: #68d391;
    color: var(--text-primary);
}

.status-count {
    font-size: var(--font-size-special);
    font-weight: 900;
    line-height: 1.2;
}

.status-label {
    font-size: var(--font-size-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
}

/* History Button - lower z-index so job-site dropdowns stack above (iOS WebView fix) */
.history-btn {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: var(--button-padding-v) var(--button-padding-h);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
    min-height: var(--touch-target-min);
    line-height: 1.4;
}

@media (hover: hover) and (pointer: fine) {
.history-btn:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
}
}


/* Job Sites Section - stacking above history-btn when dropdown overlaps (iOS WebView fix) */
.job-sites-section {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.section-title {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    line-height: 1.4;
}

.section-title i {
    color: var(--accent-primary);
    font-size: var(--font-size-base);
    width: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Job Sites List - Responsive Grid */
.job-sites-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Tablet: 2-column grid (iPad portrait) */
@media (min-width: 768px) {
    .job-sites-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
        contain: layout style paint;
        will-change: transform;
    }
}

/* Desktop: 3-column grid (iPad landscape, desktop) */
@media (min-width: 1024px) {
    .job-sites-list {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
        contain: layout style paint;
        will-change: transform;
    }
}

/* Large Desktop: 4-column grid (big screens) */
@media (min-width: 1440px) {
    .job-sites-list {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
        contain: layout style paint;
        will-change: transform;
    }
}

/* Extra Large: 5-column grid (ultra-wide monitors) */
@media (min-width: 1920px) {
    .job-sites-list {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--spacing-xl);
        contain: layout style paint;
        will-change: transform;
    }
}

.job-site-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: var(--card-radius);
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    contain: layout style paint;
    will-change: transform;
    min-height: auto;
    background: var(--bg-card);
}

@media (hover: hover) and (pointer: fine) {
.job-site-item:hover {
    transform: translateY(-2px);
}
}


/* Fade in animation for job site items when filtering */
.job-site-item.fade-in {
    -webkit-animation: jobSiteFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation: jobSiteFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@-webkit-keyframes jobSiteFadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(15px);
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

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

.job-site-item.holding {
    -webkit-transform: scale(1.02);
    transform: scale(1.02);
    -webkit-transition: transform 0.15s ease;
    transition: transform 0.15s ease;
}

.job-site-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    will-change: transform, opacity;
    transition: none;
}

/* Grid layout adjustments for tablets and above */
@media (min-width: 768px) {
    .job-site-item {
        height: 100%; /* Equal height cards */
        flex-direction: column; /* Stack content vertically */
        align-items: flex-start;
        min-height: 200px;
        padding: var(--spacing-md);
        justify-content: space-between;
    }
    
    /* Job site info - takes up most space */
    .job-site-info {
        flex: 1;
        width: 100%;
        padding-right: 0;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .job-site-header {
        margin-bottom: var(--spacing-sm);
    }
    
    .job-site-name {
        font-size: var(--font-size-default);
        font-weight: var(--font-weight-semibold);
        margin-bottom: var(--spacing-xs);
        line-height: 1.4;
    }
    
    .job-site-client,
    .job-site-address,
    .job-site-description {
        font-size: var(--font-size-secondary);
        line-height: 1.4;
        margin-bottom: var(--spacing-xs);
        opacity: 0.9;
    }
    
    /* Right side with status and actions */
    .job-site-right {
        width: 100%;
        margin-top: var(--spacing-md);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }
    
    /* Status dropdown - left side */
    .status-select {
        width: 140px;
        margin-right: 0.75rem;
        background: var(--bg-secondary);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 14px;
        padding: 0.6rem 1rem;
        font-size: var(--font-size-tertiary);
        font-weight: var(--font-weight-semibold);
        color: inherit;
        cursor: pointer;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                    background 0.2s ease,
                    border-color 0.2s ease;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: 
            var(--bg-secondary),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' opacity='0.9' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
        background-position: center, right 0.75rem center;
        background-repeat: no-repeat, no-repeat;
        background-size: cover, 12px;
        padding-right: 3.5rem;
        min-width: 160px;
    }
    
    @media (hover: hover) and (pointer: fine) {
    .status-select:hover {
        background: var(--bg-secondary);
        border-color: rgba(255, 255, 255, 0.35);
        transform: translateY(-2px) scale(1.02);
    }
}

    .status-select:active {
        transform: translateY(0) scale(0.98);
    }
    
    .status-select:focus {
        outline: none !important;
        background: var(--bg-secondary);
        border-color: rgba(255, 255, 255, 0.4);
        -webkit-tap-highlight-color: transparent !important;
        -webkit-focus-ring-color: transparent !important;
    }
    
    /* Action buttons - right side */
    .job-site-actions {
        display: flex;
        gap: 0.4rem;
        align-items: center;
    }
    
    .action-btn {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: inherit;
        padding: 0.5rem;
        border-radius: 8px;
        font-size: var(--font-size-tertiary);
        cursor: pointer;
        transition: all 0.2s ease;
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    @media (hover: hover) and (pointer: fine) {
.action-btn:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }
}

    
    .action-btn.delete-btn {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    @media (hover: hover) and (pointer: fine) {
.action-btn.delete-btn:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }
}

    
    /* Task count badge */
    .task-count-badge {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        padding: 0;
        font-size: var(--font-size-tertiary);
        font-weight: var(--font-weight-semibold);
        margin-left: 0;
        min-width: 0;
        justify-content: center;
    }
    
    /* Finance count badge */
    .finance-count-badge {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        padding: 0;
        font-size: var(--font-size-tertiary);
        font-weight: var(--font-weight-semibold);
        margin-left: 0;
        min-width: 0;
        justify-content: center;
    }
    
    /* Make hover effect more subtle in grid */
    @media (hover: hover) and (pointer: fine) {
.job-site-item:hover {
        transform: translateY(-4px) scale(1.02);
    }
}

}

.job-site-item.in-progress {
    background: var(--accent-blue);
    color: #ffffff;
}

.job-site-item.in-progress .job-site-name,
.job-site-item.in-progress .job-site-client,
.job-site-item.in-progress .job-site-address,
.job-site-item.in-progress .job-site-description,
.job-site-item.in-progress .status-badge,
.job-site-item.in-progress i {
    color: #ffffff !important;
}

.job-site-item.upcoming {
    background: #f6ad55;
    color: #ffffff;
}

.job-site-item.upcoming .job-site-name,
.job-site-item.upcoming .job-site-client,
.job-site-item.upcoming .job-site-address,
.job-site-item.upcoming .job-site-description,
.job-site-item.upcoming .status-badge,
.job-site-item.upcoming i {
    color: #ffffff !important;
}

.job-site-item.on-hold {
    background: #fc8181;
    color: #ffffff;
}

.job-site-item.on-hold .job-site-name,
.job-site-item.on-hold .job-site-client,
.job-site-item.on-hold .job-site-address,
.job-site-item.on-hold .job-site-description,
.job-site-item.on-hold .status-badge,
.job-site-item.on-hold i {
    color: #ffffff !important;
}

.job-site-item.completed {
    background: #68d391;
    color: #ffffff;
}

.job-site-item.completed .job-site-name,
.job-site-item.completed .job-site-client,
.job-site-item.completed .job-site-address,
.job-site-item.completed .job-site-description,
.job-site-item.completed .status-badge,
.job-site-item.completed i {
    color: #ffffff !important;
}

/* Job site number colors on status cards */
.job-site-item.in-progress .job-site-number,
.job-site-item.upcoming .job-site-number,
.job-site-item.on-hold .job-site-number,
.job-site-item.completed .job-site-number {
    color: #ffffff !important;
    font-weight: 800;
}


.job-site-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    padding-right: 0.75rem;
}

.job-site-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.job-site-number {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-default);
    color: var(--text-primary);
    letter-spacing: 0.5px;
    display: inline-block;
    flex-shrink: 0;
    opacity: 0.85;
}

.job-site-name {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-default);
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Professional Badge Pills - Transparent */
.job-site-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem 0.3rem 0.55rem;
    border-radius: 6px;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.11);
    border: none;
    color: var(--text-primary);
}

.badge-pill i {
    font-size: var(--font-size-tertiary);
    opacity: 1;
}

/* Light theme adjustments */
body.light-theme .badge-pill {
    color: #FFFFFF;
}

.task-count-badge {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: inherit;
    backdrop-filter: blur(10px);
    min-width: 0;
    justify-content: center;
}

.task-count-badge i {
    font-size: var(--font-size-tertiary);
    opacity: 0.8;
}

.finance-count-badge {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: inherit;
    backdrop-filter: blur(10px);
    min-width: 0;
    justify-content: center;
    margin-left: 0;
}

.finance-count-badge i {
    font-size: var(--font-size-tertiary);
    opacity: 0.8;
}

.task-count {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
}

.job-site-client {
    font-size: var(--font-size-default);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
}

.job-site-client i {
    font-size: var(--font-size-default);
    opacity: 0.8;
    min-width: 16px;
}

.job-site-address {
    font-size: var(--font-size-default);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
}

.job-site-address i {
    font-size: var(--font-size-default);
    opacity: 0.8;
    min-width: 16px;
}

.job-site-description {
    font-size: var(--font-size-default);
    color: var(--text-secondary);
    line-height: 1.4;
    font-weight: var(--font-weight-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 0.25rem;
}

.job-site-right {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.job-site-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.action-btn {
    background: rgba(0,0,0,0);
    border: 4px solid rgba(255,255,255,0.1);
    color: inherit;
    font-size: var(--font-size-default);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (hover: hover) and (pointer: fine) {
.action-btn:hover {
    background-color: rgba(0,0,0,0.3);
    transform: scale(1.15);
}
}


@media (hover: hover) and (pointer: fine) {
.phone-btn:hover {
    background-color: rgba(104, 211, 145, 0.3);
    color: var(--text-primary);
}
}


@media (hover: hover) and (pointer: fine) {
.directions-btn:hover {
    background-color: rgba(66, 153, 225, 0.3);
    color: var(--text-primary);
}
}


.status-select {
    background: var(--bg-tertiary);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: inherit;
    cursor: pointer;
    width: 140px;
    min-width: 140px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.2s ease,
                border-color 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-focus-ring-color: transparent;
    background-image: 
        var(--bg-tertiary),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' opacity='0.85' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-position: center, right 0.75rem center;
    background-repeat: no-repeat, no-repeat;
    background-size: cover, 12px;
    padding-right: 3.5rem;
}

@media (hover: hover) and (pointer: fine) {
.status-select:hover {
    background: var(--bg-tertiary);
    border-color: rgba(0, 0, 0, 0.25);
    transform: translateY(-2px) scale(1.02);
}
}

.status-select:active {
    transform: translateY(0) scale(0.98);
}

.status-select:focus {
    outline: none !important;
    background: var(--bg-tertiary);
    border-color: rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
}

/* Subtle success pulse when status changes (add .status-changed via JS) */
.status-select.status-changed {
    animation: statusChangePulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes statusChangePulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.status-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (hover: hover) and (pointer: fine) {
.delete-btn:hover {
    background-color: rgba(252, 129, 129, 0.4);
    transform: scale(1.1) rotate(90deg);
}
}


/* Floating Add Button */
.floating-add-btn {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    background: var(--accent-green) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    color: var(--text-icons) !important;
    border: none !important;
    font-size: var(--font-size-special) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (hover: hover) and (pointer: fine) {
.floating-add-btn:hover {
    transform: scale(1.15) rotate(90deg);
    background: var(--accent-green) !important;
}
}


.floating-add-btn:active {
    transform: scale(1.05) rotate(90deg);
}

/* Remove all shadows from floating button in all states */
.floating-add-btn {
}

@media (hover: hover) and (pointer: fine) {
    .floating-add-btn:hover,
    .floating-add-btn:active,
    .floating-add-btn:focus {
    }
}


/* Hide floating button when any modal is open */
body.modal-open .floating-add-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent layout shift when modal opens */
body.modal-open {
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
    /* Position fixed prevents any scrollbar-related layout shifts */
    position: relative;
}

/* Side Menu - Capacitor/iOS GPU-accelerated (transform only, no left/width/margin) */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 75%;
    height: 100vh;
    background-color: rgba(31, 41, 55, 0.97);
    z-index: 1000;
    border-right: 1px solid rgba(75, 85, 99, 0.3);
    font-size: var(--font-size-secondary);
    /* GPU layer: translateX + translateZ(0), no backdrop-filter */
    -webkit-transform: translateX(-100%) translateZ(0);
    transform: translateX(-100%) translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
    will-change: transform;
    contain: layout style paint;
    -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-menu.active {
    -webkit-transform: translateX(0) translateZ(0);
    transform: translateX(0) translateZ(0);
}

/* Tablet and up - use fixed width */
@media (min-width: 768px) {
    .side-menu {
        width: 300px;
    }
}

/* Light theme side menu - solid, no transparency */
body.light-theme .side-menu {
    background-color: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid rgba(209, 213, 219, 0.3);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .menu-item:hover {
    background-color: rgba(209, 213, 219, 0.3);
}
}


@media (hover: hover) and (pointer: fine) {
body.light-theme .menu-close:hover {
    background-color: rgba(209, 213, 219, 0.3);
}
}


.menu-header {
    padding: 1.25rem 1.5rem;
    padding-top: calc(env(safe-area-inset-top, 0px) + 1.25rem);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    color: var(--text-primary);
    padding: 0.6rem;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
}

.menu-close {
    background: none;
    border: none;
    color: var(--text-icons);
    font-size: var(--font-size-secondary);
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
.menu-close:hover {
    background-color: rgba(75, 85, 99, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: scale(1.1);
}
}


/* Menu Header Actions Container */
.menu-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Notification Bell Button */
.notification-bell-btn {
    background: none;
    border: none;
    color: var(--text-icons);
    font-size: var(--font-size-secondary);
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
.notification-bell-btn:hover {
    background-color: rgba(75, 85, 99, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: scale(1.1);
}
}


.notification-bell-btn i {
    color: var(--accent-primary);
}

.notification-bell-btn.has-notifications i {
    animation: bellRing 0.5s ease-in-out;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-15deg); }
    75% { transform: rotate(10deg); }
}

/* Announcement Badge */
.announcement-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--accent-red);
    color: white;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-bold);
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.menu-content {
    padding: 1rem;
}

.menu-item {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-secondary);
    min-height: 52px;
}

@media (hover: hover) and (pointer: fine) {
.menu-item:hover {
    background-color: rgba(75, 85, 99, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateX(4px);
}
}


.menu-item.active {
    background-color: var(--primary-color);
    color: white;
}

.menu-item.active i {
    color: white;
}

/* User flow "New" badge (driven by user-flow-features.json; app shows when feature not yet opened) */
.user-flow-badge {
    display: none;
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    font-size: var(--font-size-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 6px;
}
.user-flow-badge.visible {
    display: inline-flex;
    align-items: center;
}
.menu-item.active .user-flow-badge.visible {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

.menu-item i {
    color: var(--accent-primary);
    font-size: var(--font-size-secondary);
    width: 24px;
    text-align: center;
}

/* Overlay - no transition so only the menu animates on web */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: none;
    -webkit-transition: none;
}


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

/* iOS-Style Slide Animations */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Top slide animations for keyboard-friendly modals */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutToTop {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0,0,0,0);
    z-index: 2000;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    touch-action: pan-y;
}

.modal.active {
    display: flex;
}

/* Logo crop modal should appear above company profile modal */
#logoCropModal {
    z-index: 3000 !important;
}

/* Invoice/estimate line type picker (bottom sheet above modals z-index 2000) */
#invoiceLineModePickerOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.22s ease;
}
#invoiceLineModePickerOverlay.visible {
    opacity: 1;
}
#invoiceLineModePickerSheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 22px 22px 0 0;
    z-index: 2600;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    max-width: 430px;
    margin: 0 auto;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
#invoiceLineModePickerSheet.visible {
    transform: translateY(0);
}
#invoiceLineModePickerSheet .tc-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--text-tertiary, #6b7280);
    border-radius: 2px;
    margin: 12px auto 0;
    opacity: 0.5;
}
#invoiceLineModePickerSheet .tc-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}
#invoiceLineModePickerSheet .tc-sheet-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
#invoiceLineModePickerSheet .tc-sheet-cancel {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 4px;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
#invoiceLineModePickerSheet .tc-sheet-body {
    padding: 12px 16px 20px;
}
#invoiceLineModePickerSheet .tc-mode-picker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#invoiceLineModePickerSheet .tc-mode-pick-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.15));
    border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    text-align: left;
    transition: border-color 0.14s, background 0.14s;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    color: inherit;
    cursor: pointer;
}
#invoiceLineModePickerSheet .tc-mode-pick-btn:active {
    border-color: var(--accent-primary, #63b3ed);
}
#invoiceLineModePickerSheet .tc-mode-pick-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#invoiceLineModePickerSheet .tc-mode-pick-icon.simple {
    background: rgba(160, 174, 192, 0.2);
    color: #a0aec0;
}
#invoiceLineModePickerSheet .tc-mode-pick-icon.area {
    background: rgba(104, 211, 145, 0.15);
    color: #68d391;
}
#invoiceLineModePickerSheet .tc-mode-pick-icon.perimeter {
    background: rgba(99, 179, 237, 0.15);
    color: #63b3ed;
}
#invoiceLineModePickerSheet .tc-mode-pick-icon.volume {
    background: rgba(246, 173, 85, 0.15);
    color: #f6ad55;
}
#invoiceLineModePickerSheet .tc-mode-pick-icon.materials {
    background: rgba(252, 129, 129, 0.15);
    color: #fc8181;
}
#invoiceLineModePickerSheet .tc-mode-pick-icon.labor {
    background: rgba(183, 148, 246, 0.15);
    color: #b794f4;
}
#invoiceLineModePickerSheet .tc-mode-pick-icon.custom {
    background: rgba(160, 174, 192, 0.15);
    color: #a0aec0;
}
#invoiceLineModePickerSheet .tc-mode-pick-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
#invoiceLineModePickerSheet .tc-mode-pick-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}
#invoiceLineModePickerSheet .tc-mode-pick-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Add payment modal should always be on top of other modals */
#addPaymentModal {
    z-index: 5000 !important;
}

#addPaymentForm select {
    padding: 1rem 1.25rem !important;
    min-height: 2.75rem;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem !important;
}

#addPaymentForm .form-group:has(select) {
    position: relative;
}

#addPaymentForm .form-group:has(select)::after {
    content: '';
    position: absolute;
    right: 1rem;
    bottom: calc(1.375rem - 6px);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' opacity='0.85' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: transform 0.2s ease;
}

#addPaymentForm .form-group:has(select:focus)::after {
    transform: rotate(180deg);
}

.modal.slide-in {
    background: rgba(0,0,0,0.7);
    animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.slide-out {
    background: rgba(0,0,0,0);
    animation: fadeOut 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.slide-in-top {
    background: rgba(0,0,0,0.7);
    animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.slide-out-top {
    background: rgba(0,0,0,0);
    animation: fadeOut 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    background-color: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px 0 0 24px;
    width: 100vw;
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    border: none;
    will-change: transform;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Light theme modals - solid, no transparency (covers .modal-header and .modal-body) */
body.light-theme .modal-content {
    background-color: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.light-theme .modal-content.large {
    background-color: var(--bg-secondary);
}

/* Left edge swipe indicator */
.modal-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
.modal.active .modal-content:hover::before {
    opacity: 0.3;
}
}


.modal.slide-in .modal-content {
    animation: slideInFromRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal.slide-out .modal-content {
    animation: slideOutToRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Top slide animations for keyboard-friendly modals */
.modal.slide-in-top .modal-content {
    animation: slideInFromTop 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal.slide-out-top .modal-content {
    animation: slideOutToTop 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal-content.large {
    max-width: 100%;
}

/* Desktop: Center modals with max-width */
@media (min-width: 769px) {
    .modal {
        justify-content: center;
        padding: 1rem;
    }
    
    .modal-content {
        max-width: 750px;
        max-height: 90vh;
        height: auto;
        border-radius: 24px;
    }
    
    body.light-theme .modal-content {
    }
    
    .modal-content.large {
        max-width: 750px;
    }
    
    /* Desktop modal body needs adjusted max-height */
    .modal-body {
        max-height: calc(90vh - 200px);
    }
    
    /* Desktop doesn't need slide animation, use fade */
    .modal.slide-in .modal-content {
        animation: none;
        transform: translateX(0);
    }
    
    .modal.slide-out .modal-content {
        animation: none;
    }
}

/* Forms within modals should also use flex */
.modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
/* Don't clip forms that contain the date-time row (fixes Due Date/Time overlap on iOS) */
.modal-content form:has(.date-time-row) {
    overflow: visible !important;
}

/* Modal Header - iOS Style */
.modal-header {
    padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem 0.75rem 1rem;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    background: transparent;
    flex-shrink: 0;
}

/* iPad: Enhanced header spacing (no safe area needed) */
@media (min-width: 768px) {
    .modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    margin: 0;
    line-height: 1.3;
    letter-spacing: var(--tracking-tight);
}

/* iPad: Larger header text */
@media (min-width: 768px) {
    .modal-header h3 {
        font-size: var(--font-size-default);
        letter-spacing: var(--tracking-tight);
    }
}

/* Modal Close Button - iOS Circular Button */
.modal-close {
    background: var(--bg-tertiary);
    border: none;
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-normal);
    cursor: pointer;
    color: var(--text-primary);
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* iPad: Slightly larger close button */
@media (min-width: 768px) {
    .modal-close {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: var(--font-size-default);
    }
}

@media (hover: hover) and (pointer: fine) {
.modal-close:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.08);
}
}


.modal-close:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Modal Body - iOS Optimized */
.modal-body {
    padding: 0.75rem 1rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* Account for header and footer */
    max-height: calc(100vh - 160px);
    scroll-behavior: smooth;
}
/* Allow flex shrink when body contains date-time row (fixes Due Date/Time layout) */
.modal-body:has(.date-time-row) {
    min-width: 0 !important;
}

/* iPad: Enhanced body spacing */
@media (min-width: 768px) {
    .modal-body {
        padding: 1rem 1.5rem 1.5rem;
    }
}

/* Modal Footer - Fixed at bottom */
.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1rem 1rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: auto;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-footer .btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    min-height: 48px; /* Better touch target for mobile */
}

/* iPad: Enhanced footer spacing */
@media (min-width: 768px) {
    .modal-footer {
        padding: 1rem 1.5rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    }
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--tracking-normal);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: var(--tracking-normal);
}

.form-group:not(.date-time-group) input,
.form-group:not(.date-time-group) textarea,
.form-group:not(.date-time-group) select,
#addChecklistEnhancedModal .enhanced-subtask-input,
#addChecklistEnhancedModal .edit-subtask-input,
#editChecklistEnhancedModal .enhanced-subtask-input,
#editChecklistEnhancedModal .edit-subtask-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-tertiary);
    transition: all 0.3s ease;
    box-sizing: border-box;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.form-group:not(.date-time-group) textarea {
    resize: vertical;
}

/* Date input specific styling - iOS WebView optimized (NOT date-time-group) */
.form-group:not(.date-time-group) input[type="date"],
.form-group:not(.date-time-group) input[type="time"] {
    padding: 0.875rem 1rem;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 44px; /* iOS minimum touch target */
    line-height: normal;
    /* iOS WebView optimization */
    touch-action: manipulation;
    -webkit-touch-callout: default;
}

.form-group:not(.date-time-group) input[type="date"]::-webkit-calendar-picker-indicator,
.form-group:not(.date-time-group) input[type="time"]::-webkit-calendar-picker-indicator {
    /* Simplified to reduce iOS WebKit constraint conflicts */
    cursor: pointer;
    opacity: 0.7;
}

@media (hover: hover) and (pointer: fine) {
.form-group:not(.date-time-group) input[type="date"]::-webkit-calendar-picker-indicator:hover,
.form-group:not(.date-time-group) input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
}


.form-group:not(.date-time-group) input:focus,
.form-group:not(.date-time-group) textarea:focus,
.form-group:not(.date-time-group) select:focus,
#addChecklistEnhancedModal .enhanced-subtask-input:focus,
#addChecklistEnhancedModal .edit-subtask-input:focus,
#editChecklistEnhancedModal .enhanced-subtask-input:focus,
#editChecklistEnhancedModal .edit-subtask-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Subtask inputs: no lift on focus (compact row) */
#addChecklistEnhancedModal .enhanced-subtask-input:focus,
#addChecklistEnhancedModal .edit-subtask-input:focus,
#editChecklistEnhancedModal .enhanced-subtask-input:focus,
#editChecklistEnhancedModal .edit-subtask-input:focus {
    transform: none;
}

.form-group:not(.date-time-group) input::placeholder,
.form-group:not(.date-time-group) textarea::placeholder,
#addChecklistEnhancedModal .enhanced-subtask-input::placeholder,
#addChecklistEnhancedModal .edit-subtask-input::placeholder,
#editChecklistEnhancedModal .enhanced-subtask-input::placeholder,
#editChecklistEnhancedModal .edit-subtask-input::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    align-items: center;
}

/* New Job Site form - compact layout on desktop/tablet */
#newJobSiteForm.form-compact-when-wide .form-row {
    margin-bottom: 0.75rem;
}

#newJobSiteForm.form-compact-when-wide .form-row .form-group {
    margin-bottom: 0;
}

/* form-row-1 overrides global .form-row 2-column grid so Info/Status are full width */
#newJobSiteForm .form-row-1 {
    display: block;
    grid-template-columns: unset;
}

#newJobSiteForm .form-row-1 .form-group,
#newJobSiteForm #jobSiteDescription {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    #newJobSiteForm.form-compact-when-wide .form-row-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem 1rem;
    }

    #newJobSiteForm.form-compact-when-wide .form-row-3 {
        display: grid;
        grid-template-columns: 2fr 1fr 0.9fr;
        gap: 0.75rem 1rem;
    }

    #newJobSiteForm.form-compact-when-wide .form-row-1 {
        margin-bottom: 0.75rem;
        width: 100%;
    }

    #newJobSiteForm.form-compact-when-wide .form-row-1 .form-group,
    #newJobSiteForm.form-compact-when-wide .form-row-1 label,
    #newJobSiteForm.form-compact-when-wide #jobSiteDescription {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #newJobSiteForm.form-compact-when-wide .form-row .form-group {
        margin-bottom: 0;
    }

    #newJobSiteForm.form-compact-when-wide .form-group input,
    #newJobSiteForm.form-compact-when-wide .form-group textarea,
    #newJobSiteForm.form-compact-when-wide .form-group select {
        padding: 0.625rem 1rem;
    }

    #newJobSiteForm.form-compact-when-wide .form-group label {
        margin-bottom: 0.35rem;
    }

    #newJobSiteForm.form-compact-when-wide textarea {
        min-height: 3.5rem;
    }
}

/* Checklist modal specific styling (NOT enhanced date-time modals) */
#addChecklistModal .form-group:not(.date-time-group) {
    margin-bottom: 1.25rem;
    width: 100%;
    display: block;
}

#addChecklistModal .form-group:last-of-type {
    margin-bottom: 0;
}

#addChecklistModal .form-group:not(.date-time-group) input {
    display: block;
    width: 100% !important;
}

#addChecklistModal .form-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Force exact same dimensions for both input types (NOT enhanced modals) */
#addChecklistModal input:not(.date-time-row input),
#editChecklistModal input:not(.date-time-row input) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0.875rem 1rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    background-color: var(--bg-tertiary) !important;
    font-size: var(--font-size-base) !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    height: 48px !important;
    display: block !important;
    overflow: hidden !important;
}

/* Date and time inputs - iOS forces minimum width for picker controls (NOT enhanced modals) */
#addChecklistModal input[type="date"]:not(.date-time-row input[type="date"]),
#addChecklistModal input[type="time"]:not(.date-time-row input[type="time"]),
#editChecklistModal input[type="date"]:not(.date-time-row input[type="date"]),
#editChecklistModal input[type="time"]:not(.date-time-row input[type="time"]) {
    height: 48px !important;
    width: 280px !important;
    max-width: 280px !important;
    margin: 0 auto !important;
}

/* Enhanced modals: date/time in flex layout with 12px gap */
.date-time-row {
    display: flex !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.date-time-row > div {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.date-time-row input[type="date"],
.date-time-row input[type="time"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1rem 1.25rem !important;
    box-sizing: border-box !important;
}

/* Prevent date/time inputs from growing or moving on focus/click (global input:focus and form-group focus affect them) */
.date-time-row input[type="date"]:focus,
.date-time-row input[type="time"]:focus {
    transform: none !important;
    font-size: var(--font-size-base) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    transition: none !important;
}

/* iOS WebKit: date/time inputs use inline-flex and ignore width, causing overlap.
   Class .ios-webview is set by script in index.html. Force textfield appearance
   so inputs respect flex width; native picker still opens on tap. */
html.ios-webview .date-time-row input[type="date"],
html.ios-webview .date-time-row input[type="time"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 1rem 1.25rem !important;
    box-sizing: border-box !important;
}

/* Enhanced task modals only: prevent any modal/form/body rules from affecting date-time row.
   Scoped so only these modals get these overrides. */
#addChecklistEnhancedModal .modal-content form,
#editChecklistEnhancedModal .modal-content form {
    overflow: visible !important;
}
#addChecklistEnhancedModal .modal-body,
#editChecklistEnhancedModal .modal-body {
    min-width: 0 !important;
}
#addChecklistEnhancedModal .date-time-group,
#editChecklistEnhancedModal .date-time-group {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}
#addChecklistEnhancedModal .date-time-row,
#editChecklistEnhancedModal .date-time-row {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}
#addChecklistEnhancedModal .date-time-row input[type="date"],
#addChecklistEnhancedModal .date-time-row input[type="time"],
#editChecklistEnhancedModal .date-time-row input[type="date"],
#editChecklistEnhancedModal .date-time-row input[type="time"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 1rem 1.25rem !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
}
#addChecklistEnhancedModal .date-time-row input[type="date"]:focus,
#addChecklistEnhancedModal .date-time-row input[type="time"]:focus,
#editChecklistEnhancedModal .date-time-row input[type="date"]:focus,
#editChecklistEnhancedModal .date-time-row input[type="time"]:focus {
    transform: none !important;
    font-size: var(--font-size-base) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    transition: none !important;
}

/* Enhanced subtask rows (add + edit) – styles from styles.css, no inline */
#addChecklistEnhancedModal .enhanced-subtask-row,
#editChecklistEnhancedModal .enhanced-subtask-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Same appearance/disappearance as .task-item (task-pop-in / task-burst-exit) */
#addChecklistEnhancedModal .enhanced-subtask-row.subtask-row-exit,
#editChecklistEnhancedModal .enhanced-subtask-row.subtask-row-exit {
    -webkit-animation: task-burst-exit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation: task-burst-exit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}
#addChecklistEnhancedModal .enhanced-subtask-row.subtask-row-enter,
#editChecklistEnhancedModal .enhanced-subtask-row.subtask-row-enter {
    opacity: 0;
    -webkit-transform: scale(0.35, 0.2) translateZ(0);
    transform: scale(0.35, 0.2) translateZ(0);
    -webkit-animation: task-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation: task-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Subtask checkbox: spring bounce + draw checkmark + particle burst (translateZ(0) + -webkit- for smooth iOS) */
@keyframes subtask-springBounce {
    0%   { -webkit-transform: scale(1) translateZ(0); transform: scale(1) translateZ(0); }
    30%  { -webkit-transform: scale(1.45) translateZ(0); transform: scale(1.45) translateZ(0); }
    60%  { -webkit-transform: scale(0.88) translateZ(0); transform: scale(0.88) translateZ(0); }
    80%  { -webkit-transform: scale(1.12) translateZ(0); transform: scale(1.12) translateZ(0); }
    100% { -webkit-transform: scale(1) translateZ(0); transform: scale(1) translateZ(0); }
}
@keyframes subtask-particleBurst {
    0%   { opacity: 1; -webkit-transform: translate(0, 0) scale(1) translateZ(0); transform: translate(0, 0) scale(1) translateZ(0); }
    100% { opacity: 0; -webkit-transform: var(--particle-tx, translate(0,0)) scale(0.4) translateZ(0); transform: var(--particle-tx, translate(0,0)) scale(0.4) translateZ(0); }
}

#addChecklistEnhancedModal .enhanced-subtask-checkbox,
#addChecklistEnhancedModal .edit-subtask-checkbox,
#editChecklistEnhancedModal .enhanced-subtask-checkbox,
#editChecklistEnhancedModal .edit-subtask-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}
@media (hover: hover) and (pointer: fine) {
#addChecklistEnhancedModal .enhanced-subtask-checkbox:hover:not(.checked),
#addChecklistEnhancedModal .edit-subtask-checkbox:hover:not(.checked),
#editChecklistEnhancedModal .enhanced-subtask-checkbox:hover:not(.checked),
#editChecklistEnhancedModal .edit-subtask-checkbox:hover:not(.checked) {
    border-color: var(--accent-green, #68d391);
    background: rgba(104, 211, 145, 0.1);
}
}
#addChecklistEnhancedModal .enhanced-subtask-checkbox.checked,
#addChecklistEnhancedModal .edit-subtask-checkbox.checked,
#editChecklistEnhancedModal .enhanced-subtask-checkbox.checked,
#editChecklistEnhancedModal .edit-subtask-checkbox.checked {
    border: none;
    background: var(--accent-green, #4ade6e);
    will-change: transform;
    -webkit-animation: subtask-springBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: subtask-springBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Drawn checkmark (SVG path) */
#addChecklistEnhancedModal .enhanced-subtask-checkbox .checkmark,
#addChecklistEnhancedModal .edit-subtask-checkbox .checkmark,
#editChecklistEnhancedModal .enhanced-subtask-checkbox .checkmark,
#editChecklistEnhancedModal .edit-subtask-checkbox .checkmark {
    width: 13px;
    height: 11px;
    flex-shrink: 0;
    pointer-events: none;
    overflow: visible;
}
#addChecklistEnhancedModal .enhanced-subtask-checkbox .checkmark path,
#addChecklistEnhancedModal .edit-subtask-checkbox .checkmark path,
#editChecklistEnhancedModal .enhanced-subtask-checkbox .checkmark path,
#editChecklistEnhancedModal .edit-subtask-checkbox .checkmark path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: none;
}
#addChecklistEnhancedModal .enhanced-subtask-checkbox.checked .checkmark path,
#addChecklistEnhancedModal .edit-subtask-checkbox.checked .checkmark path,
#editChecklistEnhancedModal .enhanced-subtask-checkbox.checked .checkmark path,
#editChecklistEnhancedModal .edit-subtask-checkbox.checked .checkmark path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}
/* Particles (burst when checked) */
#addChecklistEnhancedModal .enhanced-subtask-checkbox .subtask-particle,
#addChecklistEnhancedModal .edit-subtask-checkbox .subtask-particle,
#editChecklistEnhancedModal .enhanced-subtask-checkbox .subtask-particle,
#editChecklistEnhancedModal .edit-subtask-checkbox .subtask-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 2px;
    left: 50%;
    top: 50%;
    margin-left: -2.5px;
    margin-top: -2.5px;
    pointer-events: none;
    opacity: 0;
}
#addChecklistEnhancedModal .enhanced-subtask-checkbox.checked .subtask-particle,
#addChecklistEnhancedModal .edit-subtask-checkbox.checked .subtask-particle,
#editChecklistEnhancedModal .enhanced-subtask-checkbox.checked .subtask-particle,
#editChecklistEnhancedModal .edit-subtask-checkbox.checked .subtask-particle {
    will-change: transform, opacity;
    -webkit-animation: subtask-particleBurst 0.55s cubic-bezier(0.22, 0.68, 0, 1) forwards;
    animation: subtask-particleBurst 0.55s cubic-bezier(0.22, 0.68, 0, 1) forwards;
}
#addChecklistEnhancedModal .subtask-particle-1, #editChecklistEnhancedModal .subtask-particle-1 { --particle-tx: translate(-22px, -20px); animation-delay: 0s;     background: #4ade6e; }
#addChecklistEnhancedModal .subtask-particle-2, #editChecklistEnhancedModal .subtask-particle-2 { --particle-tx: translate(22px, -20px);  animation-delay: 0.03s; background: #f6ad55; }
#addChecklistEnhancedModal .subtask-particle-3, #editChecklistEnhancedModal .subtask-particle-3 { --particle-tx: translate(-26px, 4px);   animation-delay: 0.05s; background: #63b3ed; }
#addChecklistEnhancedModal .subtask-particle-4, #editChecklistEnhancedModal .subtask-particle-4 { --particle-tx: translate(26px, 4px);    animation-delay: 0.02s; background: #fc8181; }
#addChecklistEnhancedModal .subtask-particle-5, #editChecklistEnhancedModal .subtask-particle-5 { --particle-tx: translate(-12px, 24px);  animation-delay: 0.04s; background: #c084fc; }
#addChecklistEnhancedModal .subtask-particle-6, #editChecklistEnhancedModal .subtask-particle-6 { --particle-tx: translate(12px, 24px);   animation-delay: 0.01s; background: #f472b6; }
/* Layout: wrap fills row; input inside gets form-group styles */
#addChecklistEnhancedModal .subtask-input-wrap,
#editChecklistEnhancedModal .subtask-input-wrap {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: none !important;
    position: relative;
    display: flex;
}
#addChecklistEnhancedModal .subtask-input-wrap .enhanced-subtask-input,
#addChecklistEnhancedModal .subtask-input-wrap .edit-subtask-input,
#editChecklistEnhancedModal .subtask-input-wrap .enhanced-subtask-input,
#editChecklistEnhancedModal .subtask-input-wrap .edit-subtask-input {
    flex: 1 1 0% !important;
    min-width: 0 !important;
}
#addChecklistEnhancedModal .enhanced-subtask-checkbox.checked + .subtask-input-wrap .enhanced-subtask-input,
#addChecklistEnhancedModal .edit-subtask-checkbox.checked + .subtask-input-wrap .edit-subtask-input,
#editChecklistEnhancedModal .enhanced-subtask-checkbox.checked + .subtask-input-wrap .enhanced-subtask-input,
#editChecklistEnhancedModal .edit-subtask-checkbox.checked + .subtask-input-wrap .edit-subtask-input {
    color: var(--text-muted, #4a5568);
    background: var(--accent-green-tint);
}
#addChecklistEnhancedModal .enhanced-subtask-remove,
#addChecklistEnhancedModal .edit-subtask-remove,
#editChecklistEnhancedModal .enhanced-subtask-remove,
#editChecklistEnhancedModal .edit-subtask-remove {
    flex-shrink: 0 !important;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    cursor: pointer;
    font-size: 20px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}
@media (hover: hover) and (pointer: fine) {
#addChecklistEnhancedModal .enhanced-subtask-remove:hover,
#addChecklistEnhancedModal .edit-subtask-remove:hover,
#editChecklistEnhancedModal .enhanced-subtask-remove:hover,
#editChecklistEnhancedModal .edit-subtask-remove:hover {
    background: rgba(0, 0, 0, 0.15);
}
}

/* Desktop/iPad: fixed 410px and center (NOT enhanced modals) */
@media (min-width: 769px) {
    #addChecklistModal input[type="date"]:not(.date-time-row input[type="date"]),
    #addChecklistModal input[type="time"]:not(.date-time-row input[type="time"]),
    #editChecklistModal input[type="date"]:not(.date-time-row input[type="date"]),
    #editChecklistModal input[type="time"]:not(.date-time-row input[type="time"]) {
        width: 410px !important;
        max-width: 410px !important;
        margin: 0 auto !important;
    }
}

/* Simplified picker indicator - reduce constraint conflicts */
#addChecklistModal input[type="date"]::-webkit-calendar-picker-indicator,
#addChecklistModal input[type="time"]::-webkit-calendar-picker-indicator,
#editChecklistModal input[type="date"]::-webkit-calendar-picker-indicator,
#editChecklistModal input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer !important;
    opacity: 0.7 !important;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-family: var(--font-family-sans);
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
.btn:hover {
    transform: translateY(-2px);
    will-change: transform;
}
}


.btn-primary {
    background: var(--accent-green);
    color: #1a202c;
}

@media (hover: hover) and (pointer: fine) {
.btn-primary:hover {
    background: var(--accent-green);
}
}


.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
}

@media (hover: hover) and (pointer: fine) {
.btn-secondary:hover {
    background: var(--bg-card);
}
}


.btn-danger {
    background: var(--accent-danger);
    color: #1a202c;
}

@media (hover: hover) and (pointer: fine) {
.btn-danger:hover {
    background: var(--accent-danger);
    opacity: 0.9;
}
}


/* Trash icon: use <i class="fas fa-trash-alt"></i> inside .btn.btn-danger, or it’s added via ::before */
.btn.btn-danger:not(:has(i))::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f2ed";
    display: inline-block;
    margin-right: 0.5rem;
}

.btn-danger .fa-trash-alt,
.btn-danger i {
    color: currentColor;
}

/* Detail Actions */
/* Job Info Card - Redesigned layout */
.job-info-card {
    background: var(--bg-card);
    border-radius: 20px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.job-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.125rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.625rem;
}

.job-info-header .header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
}

.job-info-header .status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    margin-top: 3px;
    flex-shrink: 0;
}

.job-info-header .header-text {
    flex: 1;
    min-width: 0;
}

.job-info-name {
    color: var(--text-primary);
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.job-info-subtitle {
    font-size: var(--font-size-secondaryallest);
    color: var(--text-muted);
    margin-top: 0.0625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.job-info-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.job-info-card .btn-icon-edit {
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
.job-info-card .btn-icon-edit:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}
}

.job-info-details {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.job-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1.25rem;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-normal);
    line-height: 1.4;
    min-height: 24px;
    transition: background 0.12s ease;
    cursor: default;
}

@media (hover: hover) and (pointer: fine) {
.job-info-item:hover {
    background: var(--bg-tertiary);
}
}

.job-info-item .info-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.job-info-item > i:first-child {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    background: var(--accent-green-tint);
    color: var(--accent-green);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.job-info-item span {
    flex: 1;
    font-size: var(--font-size-tertiary);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.btn-info-action {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--accent-green);
    border: none;
    color: #ffffff;
    padding: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-info-action i {
    color: #ffffff;
}

@media (hover: hover) and (pointer: fine) {
.btn-info-action:hover {
    background: var(--completed-color);
    transform: scale(1.05);
}
}

.job-info-item + .job-info-item {
    border-top: 1px solid var(--border-color);
}

/* Footer with tag (description) */
.job-info-footer {
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.25rem;
}

.job-info-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 0.25rem 0.5625rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

.job-info-tag i {
    color: var(--accent-green);
    font-size: 0.625rem;
}


.detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.detail-actions .btn {
    flex: 1 1 100%;
    min-width: 0;
    justify-content: center;
    padding: var(--button-padding-v) var(--button-padding-h);
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    min-height: var(--touch-target-min);
    border-radius: var(--card-radius);
}

/* Quick Actions button - reference layout */
#quickActionsBtn,
.detail-actions #quickActionsBtn.btn.btn-primary {
    background: var(--accent-green);
    border: none;
    border-radius: 14px;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: auto;
    transition: background 0.15s ease, transform 0.1s ease;
}

#quickActionsBtn i {
    color: rgba(255, 255, 255, 0.85);
}

#quickActionsBtn span {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: #ffffff;
    letter-spacing: -0.01em;
}

@media (hover: hover) and (pointer: fine) {
#quickActionsBtn:hover {
    background: var(--completed-color);
}
#quickActionsBtn:active {
    transform: scale(0.98);
}
}

/* Compact button styling */
.btn-compact {
    padding: 0.75rem 0.875rem;
    font-size: var(--font-size-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 44px;
}

.btn-compact i {
    font-size: var(--font-size-base);
    color: #ffffff;
    flex-shrink: 0;
}

.btn-compact .btn-label {
    font-size: var(--font-size-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Light theme - dark icons for compact buttons */
body.light-theme .btn-compact i {
    color: #1a202c;
}

/* Sections */
.section {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 0;
    margin-bottom: var(--section-spacing);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.section.collapsible {
    background: none;
}

/* Detail content - collapsible sections (reference layout) */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-content .section.collapsible {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 0;
}

.detail-content .section-header {
    display: flex;
    align-items: center;
    padding: 0.8125rem 1rem;
    gap: 0.75rem;
    transition: background 0.12s ease;
    background: var(--bg-tertiary);
    border-bottom: none;
    min-height: 44px;
}

@media (hover: hover) and (pointer: fine) {
.detail-content .section-header:hover {
    background: var(--bg-tertiary);
}
}

.detail-content .section-header .section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.detail-content .section-header .section-title .section-count {
    margin-left: 0.25rem;
}

/* Icon wrap - rounded box with green tint */
.detail-content .section-header .section-title > i:first-child {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    background: var(--accent-green-tint);
    color: var(--accent-green);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-content .section-header .section-title span[data-i18n] {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    letter-spacing: -0.01em;
    flex: 1;
    white-space: nowrap;
}

.detail-content .section-count {
    background: var(--accent-green-tint);
    color: var(--accent-green);
    font-size: var(--font-size-secondaryallest);
    font-weight: var(--font-weight-semibold);
    padding: 0.125rem 0.4375rem;
    border-radius: 6px;
    min-width: 22px;
    text-align: center;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.detail-content .section-count.empty {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.detail-content .toggle-icon {
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.15s ease;
}

.detail-content .section:not(.collapsed) .toggle-icon {
    color: var(--accent-green);
}

.detail-content .section-content {
    border-top: 1px solid var(--border-color);
    padding: 0.875rem 1rem;
}

/* Empty state in detail sections */
.detail-content .empty-state {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
    color: var(--text-muted);
    font-size: var(--font-size-tertiary);
}

/* Task progress bar - reference layout */
.detail-content .task-progress,
.detail-content .checklist-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-content .checklist-progress {
    padding: 0.875rem 1rem;
    margin: 0;
    background: transparent;
    border-radius: 0;
}

.detail-content .section.collapsed .checklist-progress {
    display: none !important;
}

.detail-content .progress-track,
.detail-content .progress-bar-container {
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 99px;
    overflow: hidden;
}

.detail-content .progress-fill,
.detail-content .progress-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--accent-green);
    border-radius: 99px;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
    will-change: transform;
}

.detail-content .progress-label,
.detail-content .progress-text {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Finance rows - reference layout */
.detail-content .finance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3125rem 0;
}

.detail-content .finance-row + .finance-row {
    border-top: 1px solid var(--border-color);
}

.detail-content .finance-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
}

.detail-content .finance-value {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.detail-content .finance-stat-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
}

.detail-content .summary-value.green,
.detail-content .finance-stat-value.green {
    color: var(--accent-green);
}

.detail-content .summary-value.red,
.detail-content .finance-stat-value.red {
    color: var(--accent-red);
}

/* Photo grid - reference layout */
.detail-content .photos-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.375rem;
}

.detail-content .photo-item,
.detail-content .photo-placeholder {
    aspect-ratio: 1;
    border-radius: 8px;
}

.detail-content .photo-item img {
    height: 100%;
    object-fit: cover;
}

.detail-content .photo-placeholder {
    background: var(--accent-green-tint);
    border: 1px dashed var(--accent-green);
    height: 100%;
    width: 100%;
}

.section-header {
    color: var(--text-primary);
    margin: 0 !important;
    padding: 0 var(--spacing-md);
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    height: 44px;
    line-height: 1;
    box-sizing: border-box;
}

@media (hover: hover) and (pointer: fine) {
.section-header:hover {
    background: var(--bg-tertiary);
}
}


.section-header:active {
    opacity: 0.8;
}

/* Light theme specific improvements for sections */
body.light-theme .section {
    border: 1px solid var(--border-color);
}

body.light-theme .section.collapsible {
    background: none;
}

body.light-theme .section-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary) !important;
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .section-header:hover {
    background: var(--bg-tertiary);
}
}


body.light-theme .section-count {
    color: #6a6a6a;
}

body.light-theme .section-header:active {
    opacity: 0.8;
}

/* Light theme improvements for items */
body.light-theme .measurement-item,
body.light-theme .note-item,
body.light-theme .checklist-item,
body.light-theme .transaction-item,
body.light-theme .finance-stat-card,
body.light-theme .finance-progress {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.light-theme .checklist-item {
    background: var(--bg-tertiary);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .measurement-item:hover,
body.light-theme .note-item:hover,
body.light-theme .transaction-item:hover {
    background: var(--bg-tertiary);
}
}


@media (hover: hover) and (pointer: fine) {
body.light-theme .checklist-item:hover {
    transform: translateY(-4px);
}
}


body.light-theme .job-info-card {
    background: var(--bg-secondary);
}

body.light-theme .detail-content .section.collapsible {
    background: var(--bg-secondary);
}

body.light-theme .toggle-icon {
    color: var(--text-icons) !important;
}

body.light-theme .section-content {
    color: #1a202c !important;
}

body.light-theme .section-content * {
    color: #1a202c !important;
}

/* Exceptions: Elements with colored backgrounds should keep white text */
body.light-theme .task-job-site,
body.light-theme .task-job-site *,
body.light-theme .setting-btn,
body.light-theme .setting-btn *,
body.light-theme .filter-btn.active,
body.light-theme .filter-btn.active * {
    color: white !important;
}

/* Additional exceptions for elements outside .section-content */
body.light-theme .task-job-site,
body.light-theme .task-job-site i {
    color: white !important;
}

/* Light theme menu active items - dark text/icons on light background */
body.light-theme .menu-item.active {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

body.light-theme .menu-item.active i {
    color: var(--text-primary) !important;
}

.section-header .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
    flex: 1;
    margin: 0;
    padding: 0;
}

.section-header .section-title i {
    font-size: var(--font-size-default);
    color: var(--accent-primary);
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.section-header .section-title span[data-i18n] {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-tertiary);
    line-height: 1;
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

/* Remove old CSS - all sections now use .section-title wrapper */

.section-header .section-count {
    margin-left: 0.375rem;
}

.section-count {
    background: rgba(203, 203, 203, 0.49);
    color: #ffffff;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px 0 0;
}

.toggle-icon {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    font-size: var(--font-size-secondaryallest);
    flex-shrink: 0;
    width: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    padding: var(--spacing-sm) var(--spacing-md);
    overflow: visible; /* Changed from hidden to visible to ensure gap is visible */
    opacity: 1;
}

.section.collapsed .section-content {
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    opacity: 0;
}

.section h3:not(.section-header) {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: var(--font-size-default);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Photos grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem; /* 16px desktop - accounts for 1px borders (visible gap ~14px) */
}

/* Empty state in photos grid: span full width so it stays centered on wide screens */
.photos-grid .empty-state {
    grid-column: 1 / -1;
}

/* Mobile: 3 columns for compact layout */
@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem; /* 12px mobile - accounts for 1px borders (visible gap ~10px) */
    }
    
    .photo-item {
        border-radius: 6px;
    }
    
    .photo-item img {
        height: 100px;
    }
    
    .photo-placeholder {
        height: 100px;
    }
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-color); /* Restored to original 1px */
    transform-origin: center;
    contain: layout style paint;
    box-sizing: border-box; /* Ensure borders don't affect spacing */
    /* Ensure items don't fill entire grid cell - let gap be visible */
    width: 100%;
    max-width: 100%;
    /* Ensure no margin that could hide gap */
    margin: 0;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s ease,
                border-width 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
.photo-item:hover {
    transform: scale(1.03);
}
}


.photo-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
    backface-visibility: hidden;
}

/* PHASE 2: Photo Placeholder (for lazy loading thumbnails) */
.photo-placeholder {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: var(--font-size-special);
}

.photo-item.loading .photo-placeholder {
    animation: photoItemPulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Photo operation overlay - single overlay for upload/delete */
.photo-operation-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001; /* Above photo viewer (10000) so visible when deleting from fullscreen viewer */
    border-radius: 0;
    min-height: 80px;
}

.photo-operation-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: var(--font-size-tertiary);
}

.photo-operation-spinner {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-top-color: transparent;
    border-radius: 50%;
    animation: financial-lists-spin 0.7s linear infinite;
}

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

/* Photo Selection Styles */
.photo-item.selected {
    border: 1px solid var(--accent-blue);
    transform: scale(0.96);
}

.photo-selection-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    color: white;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-default);
}

.photo-item:not(.selected) .photo-selection-indicator {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: transparent;
}

.photo-item:not(.selected) .photo-selection-indicator i {
    display: none;
}

.photo-item.selected .photo-selection-indicator {
    border: none;
    color: var(--photo-selection-icon);
}

.photo-selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 12px;
    position: sticky;
    z-index: 10;
    animation: slideDown 0.3s ease;
}

.photo-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.photo-selection-toolbar button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-selection-toolbar .btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-tertiary);
}

.photo-selection-toolbar .btn-share {
    background: var(--accent-blue);
    color: white;
}

.photo-selection-toolbar .btn-delete {
    background: var(--accent-danger);
    color: white;
}

@media (hover: hover) and (pointer: fine) {
.photo-selection-toolbar button:hover {
    transform: scale(1.05);
}
}


.photo-selection-toolbar .selection-count {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .photo-selection-toolbar {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .photo-selection-toolbar button {
        padding: 0.4rem 0.8rem;
        font-size: var(--font-size-secondary);
    }
    
    .photo-selection-toolbar .selection-count {
        font-size: var(--font-size-tertiary);
    }
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) and (pointer: fine) {
.photo-item:hover .photo-overlay {
    opacity: 1;
}
}


.photo-actions {
    display: flex;
    gap: 0.5rem;
}

.photo-actions .btn {
    padding: 0.5rem;
    font-size: var(--font-size-secondary);
}

/* Measurements list */
.measurements-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.measurement-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.measurement-item:last-child {
    margin-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
.measurement-item:hover {
    background: var(--bg-secondary);
}
}


.measurement-item:active {
    opacity: 0.8;
}

.measurement-info {
    flex: 1;
    min-width: 0;
}

.measurement-info h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
}

.measurement-value {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: #68d391;
}

.measurement-original {
    font-size: var(--font-size-tertiary);
    color: #a0aec0;
    margin-top: 0.125rem;
}

.measurement-notes {
    color: #cbd5e0;
    font-size: var(--font-size-tertiary);
    margin-top: 0.125rem;
}

.measurement-actions {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-shrink: 0;
}

.measurement-actions .btn {
    padding: 0.5rem;
    font-size: var(--font-size-tertiary);
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notes list */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Checklists */
.checklist-progress {
    padding: 0.75rem 0.875rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin: 0 0.875rem 0.75rem 0.875rem;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--accent-green);
    border-radius: 10px;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
    will-change: transform;
}

.progress-text {
    font-size: var(--font-size-secondary);
    color: var(--text-secondary);
    text-align: center;
    font-weight: var(--font-weight-semibold);
}

.checklist-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

body.light-theme #checklistList {
    background: var(--bg-secondary);
}

/* Row: checkbox (left) + checklist-item; equal horizontal padding */
.checklist-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.625rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.checklist-row:last-child,
.task-item:last-child,
.list-task-item:last-child {
    margin-bottom: 0;
}

/* Unified enter/exit animations (checklist-row reference – used by task-item, list-task-item) */
.checklist-row.checklist-row-exit,
.task-item.task-item-exit,
.list-task-item.list-task-item-exit {
    -webkit-animation: task-burst-exit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation: task-burst-exit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}
.checklist-row.checklist-row-enter,
.task-item.task-item-enter,
.list-task-item.list-task-item-enter {
    opacity: 0;
    -webkit-transform: scale(0.35, 0.2) translateZ(0);
    transform: scale(0.35, 0.2) translateZ(0);
    -webkit-animation: task-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation: task-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Match .task-item styles and layout */
.checklist-item {
    flex: 1;
    min-width: 0;
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    border-left: 1px solid var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.2s ease, opacity 0.25s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    min-height: 50px;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Unified hover/active: checklist-row, task-item, list-task-item – hover/active removed per request */

.checklist-item.completed {
    opacity: 0.7;
}

/* Checklist checkbox: same sizes/styles as enhanced-subtask-checkbox; 44px touch target */
.checklist-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.25s ease, background 0.25s ease, border-width 0.2s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
    padding: 10px;
    margin: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.checklist-checkbox * {
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
.checklist-checkbox:hover:not(.checked) {
    border-color: var(--accent-green, #68d391);
    background: rgba(104, 211, 145, 0.1);
}
}

.checklist-checkbox.checked {
    border-width: 0;
    border-color: transparent;
    background: var(--accent-green, #4ade6e);
    box-shadow: 0 0 0 0 rgba(74, 222, 110, 0.4);
}

/* Spring bounce only on the checkbox we just toggled (.animating), so others don’t re-bounce */
.checklist-checkbox.checked.animating {
    will-change: transform;
    -webkit-animation: subtask-springBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: subtask-springBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Particle burst only when toggling to checked (same as edit-subtask-checkbox) */

.checklist-checkbox .checkmark {
    width: 13px;
    height: 11px;
    flex-shrink: 0;
    pointer-events: none;
    overflow: visible;
}

.checklist-checkbox .checkmark path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: none;
}

.checklist-checkbox.checked .checkmark path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

.checklist-checkbox .subtask-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 2px;
    left: 50%;
    top: 50%;
    margin-left: -2.5px;
    margin-top: -2.5px;
    pointer-events: none;
    opacity: 0;
}

/* Splash only when we just checked (completed) – .animating added by JS on toggle */
.checklist-checkbox.checked.animating .subtask-particle {
    will-change: transform, opacity;
    -webkit-animation: subtask-particleBurst 0.55s cubic-bezier(0.22, 0.68, 0, 1) forwards;
    animation: subtask-particleBurst 0.55s cubic-bezier(0.22, 0.68, 0, 1) forwards;
}

.checklist-checkbox .subtask-particle-1 { --particle-tx: translate(-22px, -20px); animation-delay: 0s;     background: #4ade6e; }
.checklist-checkbox .subtask-particle-2 { --particle-tx: translate(22px, -20px);  animation-delay: 0.03s; background: #f6ad55; }
.checklist-checkbox .subtask-particle-3 { --particle-tx: translate(-26px, 4px);   animation-delay: 0.05s; background: #63b3ed; }
.checklist-checkbox .subtask-particle-4 { --particle-tx: translate(26px, 4px);    animation-delay: 0.02s; background: #fc8181; }
.checklist-checkbox .subtask-particle-5 { --particle-tx: translate(-12px, 24px);  animation-delay: 0.04s; background: #c084fc; }
.checklist-checkbox .subtask-particle-6 { --particle-tx: translate(12px, 24px);   animation-delay: 0.01s; background: #f472b6; }

/* Task checkbox: solid box, visible in both themes (not a hole) */
.task-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 1px solid #718096;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #5a6578;
    flex-shrink: 0;
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
.task-checkbox:hover {
    border-color: var(--accent-green);
    background: rgba(104, 211, 145, 0.25);
}
}

.task-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

/* Light theme: solid light box with visible border */
body.light-theme .task-checkbox {
    background: #e5e7eb;
    border-color: #9ca3af;
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .task-checkbox:hover {
    border-color: var(--accent-green);
    background: rgba(104, 211, 145, 0.2);
}
}

body.light-theme .task-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

/* Checkmark: always present so we can animate opacity/scale when .checked is toggled */
.task-checkbox::after {
    content: '✓';
    color: white;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
    pointer-events: none;
}

.task-checkbox.checked::after {
    opacity: 1;
    transform: scale(1);
}

.checklist-text {
    flex: 1;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1.2;
}

.checklist-item.completed .checklist-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-date {
    font-size: var(--font-size-secondary);
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

/* Due date styling */
.checklist-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.checklist-dates {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Match .list-task-status-badge: pill style, donut colors, white text */
.checklist-due-date,
.completed-date {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.02em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.checklist-due-date.overdue {
    background: #fc8181;
    color: white;
}

.checklist-due-date.due-today,
.checklist-due-date.due-soon {
    background: #f6ad55;
    color: white;
}

.checklist-due-date.due-normal {
    background: var(--accent-green);
    color: white;
}

.completed-date {
    background: #38a169;
    color: white;
}

.checklist-due-date i,
.completed-date i {
    font-size: 0.75em;
    opacity: 0.95;
}

/* Status left border – match .task-item */
.checklist-item.overdue:not(.completed) {
    border-left-color: var(--overdue-color);
}

.checklist-item.due-today:not(.completed) {
    border-left-color: var(--due-soon-color);
}

.checklist-item.due-soon:not(.completed) {
    border-left-color: var(--due-soon-color);
}

.checklist-item.due-normal:not(.completed) {
    border-left-color: var(--accent-primary);
}

.checklist-item.completed {
    border-left-color: var(--completed-color);
}

.checklist-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.checklist-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.625rem;
    min-width: 44px;
    min-height: 44px;
    font-size: var(--font-size-base);
    transition: all 0.2s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
.checklist-delete:hover {
    background: rgba(107, 114, 128, 0.1);
    color: var(--accent-danger);
    opacity: 1;
    transform: scale(1.05);
}
}


.note-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    word-wrap: break-word;
}

.note-item:last-child {
    margin-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
.note-item:hover {
    background: var(--bg-secondary);
}
}


.note-item:active {
    opacity: 0.8;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-title {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-secondary);
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.note-date {
    color: #cbd5e0;
    font-size: var(--font-size-tertiary);
    flex-shrink: 0;
    white-space: nowrap;
}

.note-content {
    color: #e2e8f0;
    line-height: 1.4;
    font-size: var(--font-size-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    white-space: pre-wrap;
}

.note-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-tertiary);
    min-width: auto;
    min-height: 36px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

/* Modern History Modal */
#historyModal {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.history-modal-content {
    max-width: 800px;
    max-height: 90vh;
    height: auto;
    touch-action: pan-y;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    overflow-y: auto;
}

/* Prevent dragging on history modal elements */
#historyModal * {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Allow text selection in input areas if needed */
#historyModal input,
#historyModal textarea {
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: default;
}



/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-section {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.history-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-green);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
.history-section:hover {
    border-color: rgba(255, 255, 255, 0.12);
}
}


@media (hover: hover) and (pointer: fine) {
.history-section:hover::before {
    opacity: 0.03;
}
}


/* History Modal Section Headers */
.history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: none;
    cursor: default;
    padding: 0;
    margin: 0 0 1.5rem 0;
    position: relative;
    z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
.history-section .section-header:hover {
    background: none;
}
}


.history-section .section-header h4 {
    color: var(--text-primary);
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.btn-clear-all {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
.btn-clear-all:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}
}


/* Timeline-Style Activity Feed */
.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(104, 211, 145, 0.2);
}

.activity-item {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #68d391;
    border: 1px solid var(--bg-primary);
    z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
.activity-item:hover {
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.15);
}
}


.activity-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.activity-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-default);
    flex-shrink: 0;
}

.activity-icon.created {
    background: rgba(104, 211, 145, 0.15);
    color: #68d391;
}

.activity-icon.deleted {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.activity-icon.restored {
    background: rgba(104, 211, 145, 0.15);
    color: #68d391;
}

.activity-icon.status_changed {
    background: rgba(104, 211, 145, 0.15);
    color: #68d391;
}

.activity-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-text {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: var(--font-weight-medium);
}

.activity-text strong {
    color: #68d391;
    font-weight: var(--font-weight-semibold);
}

.activity-time {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    white-space: nowrap;
}

.activity-remove {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: var(--font-size-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

@media (hover: hover) and (pointer: fine) {
.activity-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}
}


/* Modern Project Cards */
.history-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #dc2626;
}

@media (hover: hover) and (pointer: fine) {
.project-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}
}


.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-title {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-description {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    line-height: 1.4;
    margin: 0;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    width: fit-content;
}

.project-status.completed {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.project-status.in-progress {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.project-status.upcoming {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.project-status.on-hold {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.project-date {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-restore {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
.btn-restore:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-1px);
}
}


.btn-delete-forever {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
.btn-delete-forever:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}
}


/* Enhanced Empty State */
.section-content .empty-state {
    text-align: center;
    padding: 1.5rem 0.75rem;
    color: var(--text-muted);
    background: transparent;
    border-radius: 0;
    border: none;
}

.section-content .empty-state i {
    font-size: var(--font-size-special);
    margin-bottom: 0.5rem;
    opacity: 0.4;
    color: var(--text-muted);
}

.section-content .empty-state h4 {
    font-size: var(--font-size-secondary);
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
}

.section-content .empty-state p {
    font-size: var(--font-size-tertiary);
    line-height: 1.4;
    color: var(--text-muted);
    max-width: 100%;
    margin: 0;
}

.btn-icon {
    padding: 0.5rem 0.75rem;
    min-width: auto;
    font-size: var(--font-size-base);
}

/* Deleted Sites */
.deleted-sites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.history-info {
    flex: 1;
}

.history-info h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-default);
}

.history-info p {
    color: #cbd5e0;
    margin-bottom: 0.75rem;
    font-size: var(--font-size-base);
}

.history-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.history-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-status.in-progress {
    background: #fef3c7;
    color: #92400e;
}

.history-status.upcoming {
    background: #f6ad55;
    color: #1a202c;
}

.history-status.on-hold {
    background: #fc8181;
    color: #1a202c;
}

.history-date {
    color: #a0aec0;
    font-size: var(--font-size-secondary);
}

.history-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.history-actions .btn {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-secondary);
    justify-content: center;
}

/* Empty states */
.section-content .empty-state {
    text-align: center;
    padding: 1.5rem 0.75rem;
    color: #cbd5e0;
}

.section-content .empty-state i {
    font-size: var(--font-size-special);
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.section-content .empty-state h4 {
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    font-size: var(--font-size-secondary);
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        padding: 0.75rem;
        padding-top: calc(70px + env(safe-area-inset-top, 0px)); /* Space for fixed header + safe area on mobile */
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); /* Space for floating button + safe area on mobile */
    }
    
    .content-panel {
        padding: 1rem;
    }
    
    .floating-add-btn {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: var(--font-size-default);
    }
    
    .legend {
        padding: 0.5rem 0.75rem;
        margin-top: 0.75rem;
    }
    
    .legend-title {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.4rem;
    }
    
    .legend-items {
        gap: 0.5rem;
    }
    
    .legend-item {
        font-size: var(--font-size-tertiary);
        padding: 0.2rem 0.4rem;
    }
    
    .legend-dot {
        width: 6px;
        height: 6px;
    }
    
    .job-site-item {
        padding: 0.6rem 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
    }
    
    .job-site-info {
        padding-right: 0;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .job-site-header {
        margin-bottom: 0.25rem;
    }
    
    .job-site-name {
        font-size: var(--font-size-default);
    }
    
    .task-count-badge {
        padding: 0;
        font-size: var(--font-size-smallest);
    }
    
    .task-count-badge i {
        font-size: var(--font-size-smallest);
    }
    
    .job-site-client,
    .job-site-address {
        font-size: var(--font-size-default);
    }
    
    .job-site-description {
        font-size: var(--font-size-default);
        margin-top: 0.5rem;
        max-width: 100%;
    }
    
    .job-site-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .status-select {
        font-size: var(--font-size-tertiary);
        padding: 0.4rem 0.6rem;
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
        border-radius: 12px;
    }
    
    .job-site-actions {
        gap: 0.3rem;
    }
    
    .detail-actions {
        flex-direction: row;
        gap: 0.4rem;
    }
    
    .detail-actions .btn {
        min-width: auto;
    }
    
    .btn-compact {
        padding: 14px 10px;
        font-size: var(--font-size-base);
        flex-direction: column;
        gap: 4px;
        min-width: 50px;
    }
    
    .btn-compact i {
        font-size: var(--font-size-default);
    }
    
    /* Light theme - dark icons for compact buttons */
    body.light-theme .btn-compact i {
        color: #1a202c;
    }
    
    /* Hide labels on mobile for cleaner look */
    .btn-compact .btn-label {
        display: none;
    }
    
    /* Compact finance buttons on mobile */
    .finance-actions {
        gap: 0.5rem;
        flex-direction: row;
    }
    
    .finance-actions .btn {
        padding: 0.75rem 0.875rem;
        font-size: var(--font-size-tertiary);
        min-height: 44px;
        gap: 0.375rem;
        flex: 1;
    }
    
    .finance-actions .btn i {
        font-size: var(--font-size-secondary);
        flex-shrink: 0;
    }
    
    .finance-actions .btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Finance stat card on mobile */
    .finance-stat-card {
        padding: 0.875rem;
        margin-bottom: 0.875rem;
        border-radius: 10px;
    }
    
    .finance-stat-label {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.375rem;
    }
    
    .finance-stat-value {
        font-size: var(--font-size-default);
        margin-bottom: 0.25rem;
    }
    
    .finance-stat-subtitle {
        font-size: var(--font-size-smallest);
        margin-top: 0.25rem;
    }
    
    /* Compact contract amount save button on mobile */
    .contract-amount-input {
        padding: 12px;
    }
    
    .amount-input-wrapper {
        gap: 4px;
    }
    
    .currency-symbol {
        font-size: var(--font-size-base);
        min-width: 20px;
    }
    
    .amount-input-wrapper input {
        padding: 10px 8px;
        font-size: var(--font-size-base);
        min-width: 0;
    }
    
    .btn-save-contract {
        padding: 10px 12px;
        font-size: var(--font-size-default);
        min-width: 40px;
        flex-shrink: 0;
    }
    
    /* Transaction items on mobile */
    .transaction-item {
        padding: 10px 12px;
        margin-bottom: 8px;
        min-height: 55px;
    }
    
    .transaction-actions {
        margin-left: 8px;
        gap: 6px;
    }
    
    .btn-delete-transaction {
        min-width: 30px;
        height: 30px;
        padding: 5px;
        font-size: var(--font-size-base);
    }
    
    .modal-content {
        margin: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .history-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .history-actions {
        flex-direction: row;
        min-width: auto;
    }
    
    .history-actions .btn {
        flex: 1;
    }
    
    .activity-item {
        padding: 0.75rem;
    }
    
    .activity-info {
        gap: 0.75rem;
    }
    
    .activity-icon {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-base);
    }
    
    .activity-text {
        font-size: var(--font-size-secondary);
    }
    
    .activity-time {
        font-size: var(--font-size-tertiary);
    }
}

@media (max-width: 480px) {
    .status-cards {
        gap: 0.5rem;
    }
    
    .status-card {
        padding: 0.75rem;
    }
    
    /* Mobile status select - smaller and responsive */
    .status-select {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
        font-size: var(--font-size-tertiary);
        padding: 0.3rem 0.4rem;
        padding-right: 2rem;
    }
}

/* Tablet breakpoint for status select */
@media (max-width: 768px) and (min-width: 481px) {
    .status-select {
        width: 140px;
        min-width: 140px;
        padding-right: 3rem;
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .photo-item img {
        height: 100px;
    }
}

/* Photo Viewer - Mobile-First Design */
.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: var(--bg-primary);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    -webkit-transform: scale(0.98);
    transform: scale(0.98);
    -webkit-transition: opacity 0.3s ease, visibility 0s linear 0.3s, -webkit-transform 0.3s ease;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s, transform 0.3s ease;
    overflow: hidden;
    pointer-events: none;
}

.photo-viewer.active {
    opacity: 1;
    visibility: visible;
    -webkit-transform: scale(1);
    transform: scale(1);
    -webkit-transition: opacity 0.3s ease, visibility 0s linear 0s, -webkit-transform 0.3s ease;
    transition: opacity 0.3s ease, visibility 0s linear 0s, transform 0.3s ease;
    pointer-events: auto;
}

.photo-viewer-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    overflow: hidden;
}

.photo-viewer-content img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    pointer-events: auto;
    transition: none;
    transform-origin: center center;
    will-change: transform;
    position: relative;
}

.photo-viewer-content img.dragging {
    transition: none;
}

/* Offline overlay - shown when cloud photo can't load */
.photo-viewer-offline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.9);
    color: #94a3b8;
    z-index: 5;
    padding: 2rem;
}
.photo-viewer-offline-icon {
    opacity: 0.5;
    margin-bottom: 1rem;
}
.photo-viewer-offline-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}
.photo-viewer-offline-hint {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.8;
}

/* Offline placeholder for photo grid thumbnails */
.photo-thumbnail-offline {
    width: 100%;
    height: 100%;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #334155;
    color: #94a3b8;
    font-size: 0.7rem;
}
.photo-thumbnail-offline i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

/* Prevent pull-to-refresh on iOS */
.photo-viewer {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.photo-viewer-close {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    top: max(env(safe-area-inset-top), 20px);
    right: 20px;
    background: rgba(74, 222, 128, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 22px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10002;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(34, 197, 94, 0.2);
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.photo-viewer-close:active {
    transform: scale(0.94);
    opacity: 0.85;
    transition: transform 0.05s ease, opacity 0.05s ease;
}

.photo-viewer-caption {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    top: max(env(safe-area-inset-top), 20px);
    right: 200px;
    background: rgba(74, 222, 128, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 22px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10002;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(34, 197, 94, 0.2);
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.photo-viewer-caption:active {
    transform: scale(0.94);
    opacity: 0.85;
    transition: transform 0.05s ease, opacity 0.05s ease;
}

.photo-viewer-save {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    top: max(env(safe-area-inset-top), 20px);
    right: 140px;
    background: rgba(74, 222, 128, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 22px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10002;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(34, 197, 94, 0.2);
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.photo-viewer-save:active {
    transform: scale(0.94);
    opacity: 0.85;
    transition: transform 0.05s ease, opacity 0.05s ease;
}

.photo-viewer-delete {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    top: max(env(safe-area-inset-top), 20px);
    right: 80px;
    background: rgba(74, 222, 128, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 22px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10002;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(34, 197, 94, 0.2);
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.photo-viewer-delete:active {
    transform: scale(0.94);
    opacity: 0.85;
    transition: transform 0.05s ease, opacity 0.05s ease;
}

.photo-viewer-counter {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 30px);
    bottom: max(env(safe-area-inset-bottom, 10px), 30px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    z-index: 10002;
    border: none;
    pointer-events: none;
}

/* Photo caption display (over thumbnails) */
.photo-caption-display {
    position: fixed;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 85%;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    z-index: 10001;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: 200px;
    overflow-y: auto;
}

.photo-caption-display p {
    color: white;
    margin: 0;
    font-size: var(--font-size-default);
    line-height: 1.5;
    text-align: center;
}

/* Thumbnail Picker */
.thumbnail-picker {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 20px);
    bottom: max(env(safe-area-inset-bottom, 10px), 90px);
    left: 0;
    right: 0;
    height: 80px;
    z-index: 10003;
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.thumbnail-picker::-webkit-scrollbar {
    display: none;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    padding: 0 calc(50vw - 35px);
    height: 100%;
    align-items: center;
    min-width: max-content;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.thumbnail-item.selected {
    width: 70px;
    height: 70px;
    border-color: #68d391;
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Hide controls when zoomed or auto-hidden */
.photo-viewer.hide-controls .photo-viewer-close,
.photo-viewer.hide-controls .photo-viewer-caption,
.photo-viewer.hide-controls .photo-viewer-save,
.photo-viewer.hide-controls .photo-viewer-delete,
.photo-viewer.hide-controls .photo-viewer-edit-toggle,
.photo-viewer.hide-controls .photo-viewer-counter,
.photo-viewer.hide-controls .photo-caption-display,
.photo-viewer.hide-controls .thumbnail-picker {
    opacity: 0;
    pointer-events: none;
}

.photo-viewer.hide-controls .photo-viewer-close,
.photo-viewer.hide-controls .photo-viewer-caption,
.photo-viewer.hide-controls .photo-viewer-save,
.photo-viewer.hide-controls .photo-viewer-delete,
.photo-viewer.hide-controls .photo-viewer-edit-toggle {
    transform: translateX(30px);
}

.photo-viewer.hide-controls .photo-caption-display {
    transform: translateX(-50%) translateY(100px);
}

.photo-viewer.hide-controls .thumbnail-picker {
    transform: translateY(100px);
}

/* Hide controls when zoomed in AND hide-controls is active */
.photo-viewer.zoomed.hide-controls .photo-viewer-close,
.photo-viewer.zoomed.hide-controls .photo-viewer-caption,
.photo-viewer.zoomed.hide-controls .photo-viewer-save,
.photo-viewer.zoomed.hide-controls .photo-viewer-delete,
.photo-viewer.zoomed.hide-controls .photo-viewer-edit-toggle,
.photo-viewer.zoomed.hide-controls .photo-viewer-counter,
.photo-viewer.zoomed.hide-controls .photo-caption-display,
.photo-viewer.zoomed.hide-controls .thumbnail-picker {
    opacity: 0;
    pointer-events: none;
}

/* Caption Modal (slides from bottom) */
.caption-modal {
    z-index: 20000 !important;
}

.caption-modal .modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    margin: 0;
    max-height: 50vh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 20001;
}

.caption-modal.slide-in-top .modal-content {
    animation: slideInFromBottom 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.caption-modal.slide-out-top .modal-content {
    animation: slideOutToBottom 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutToBottom {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

#photoCaptionInput {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-default);
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#photoCaptionInput:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.caption-char-count {
    text-align: right;
    font-size: var(--font-size-base);
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Caption modal specific styling */
.caption-modal .modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    padding-top: calc(env(safe-area-inset-top, 0px) + 1.5rem);
}

.caption-modal .modal-body {
    padding: 1rem 1.5rem;
}

.caption-modal .modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    border-top: 1px solid var(--border-color);
}

.caption-modal .modal-footer .btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
}

/* Completion Warning Modal */
#completionWarningModal {
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

#completionWarningModal.active {
    background: rgba(0, 0, 0, 0.75);
}

.completion-warning-modal {
    max-width: 480px !important;
    width: calc(100% - 1rem);
    max-height: 90vh;
    height: auto !important;
    border-radius: 20px !important;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#completionWarningModal.active .completion-warning-modal {
    transform: scale(1);
    opacity: 1;
}

.completion-warning-modal .modal-body {
    padding: 1.25rem;
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.warning-header {
    background: var(--accent-yellow);
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
}

.warning-header h3 {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    flex: 1;
    margin: 0;
    line-height: 1.3;
}

.warning-header .modal-close {
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.warning-header h3 i {
    font-size: var(--font-size-special);
    color: #ffa726;
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

.warning-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: var(--font-weight-medium);
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.warning-list li {
    padding: 0.85rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 1px solid #ffa726;
    border-radius: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-medium);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

.warning-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-yellow);
}

@media (hover: hover) and (pointer: fine) {
.warning-list li:hover {
    transform: translateX(4px);
}
}


.warning-list li i {
    color: #ffa726;
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 167, 38, 0.1);
    border-radius: 8px;
}

.warning-footer {
    display: flex;
    gap: 0.65rem;
    padding: 1rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    border-top: 1px solid var(--border-color);
    flex-direction: column;
    background: var(--bg-secondary);
}

.warning-footer .btn {
    flex: 1;
    padding: 0.9rem 1.25rem;
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.warning-footer .btn:active {
    transform: scale(0.98);
}

.warning-footer .btn-primary {
    background: var(--accent-green);
    color: #1a202c;
    font-weight: var(--font-weight-semibold);
}

@media (hover: hover) and (pointer: fine) {
.warning-footer .btn-primary:hover {
    background: var(--accent-green);
    transform: translateY(-2px);
}
}


.warning-footer .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

@media (hover: hover) and (pointer: fine) {
.warning-footer .btn-secondary:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
}
}


/* Mobile optimizations */
@media (max-width: 400px) {
    .warning-header h3 {
        font-size: 1rem;
        gap: 0.4rem;
    }
    
    .warning-header h3 i {
        font-size: 1.3rem;
    }
    
    .warning-message {
        font-size: var(--font-size-secondary);
    }
    
    .warning-list li {
        padding: 0.75rem 0.85rem;
        font-size: var(--font-size-tertiary);
    }
    
    .warning-list li i {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
    
    .warning-footer .btn {
        font-size: var(--font-size-secondary);
        padding: 0.85rem 1rem;
    }
}

/* Tablet and desktop */
@media (min-width: 600px) {
    #completionWarningModal {
        padding: 1rem;
    }
    
    .completion-warning-modal {
        width: 90%;
        max-height: 85vh;
    }
    
    .completion-warning-modal .modal-body {
        padding: 1.5rem;
        max-height: 60vh;
    }
    
    .warning-header {
        padding: 1.25rem 1.5rem;
    }
    
    .warning-header h3 {
        font-size: 1.3rem;
        gap: 0.75rem;
    }
    
    .warning-message {
        font-size: var(--font-size-base);
        margin-bottom: 1.5rem;
    }
    
    .warning-list {
        gap: 0.75rem;
    }
    
    .warning-list li {
        padding: 1rem 1.25rem;
        font-size: var(--font-size-base);
        gap: 1rem;
    }
    
    .warning-list li i {
        width: 28px;
        height: 28px;
        font-size: var(--font-size-default);
    }
    
    .warning-footer {
        flex-direction: row;
        gap: 0.75rem;
        padding: 1rem 1.5rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    }
    
    .warning-footer .btn {
        font-size: var(--font-size-base);
        padding: 1rem 1.5rem;
    }
}

/* Completion Celebration Animation - Reusable for payments, invoices, completions */
/* Modal-style: centered card with subtle backdrop */
.completion-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    pointer-events: none;
    padding: 1.5rem;
}

.completion-celebration--dismissible {
    pointer-events: auto;
}

.celebration-content,
.celebration-popup-card,
.payment-popup-card {
    text-align: center;
    animation: celebrationBounce 0.6s ease;
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--card-radius);
    padding: 2rem;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.celebration-checkmark {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
}

.celebration-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 70px;
    height: 70px;
}

.celebration-circle svg {
    width: 100%;
    height: 100%;
}

.celebration-circle circle {
    fill: none;
    stroke: #10b981;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 0 377;
    transform-origin: center;
    animation: drawCircle 1s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.celebration-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2.25rem;
    color: #10b981;
    animation: checkPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.8s forwards;
}

.celebration-text {
    font-size: var(--font-size-default);
    font-weight: 900;
    color: #10b981;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.1s forwards;
}

.celebration-subtext {
    font-size: var(--font-size-default);
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.3s forwards;
}

.celebration-dismiss-btn {
    margin-top: 1.25rem;
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.5s forwards;
    pointer-events: auto;
    background: #10b981;
    color: #fff;
    border: none;
}

body.light-theme .celebration-popup-card {
    background: var(--glass-bg-light);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-theme .celebration-dismiss-btn {
    background: #10b981;
    color: #fff;
}

/* Celebration Animations */
@keyframes drawCircle {
    0% {
        stroke-dasharray: 0 377;
        transform: rotate(-90deg);
    }
    100% {
        stroke-dasharray: 377 377;
        transform: rotate(270deg);
    }
}

@keyframes checkPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes celebrationBounce {
    0% {
        transform: scale(0.3) translateY(100px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

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

/* Measurement Type Selector */
.measurement-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.type-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
.type-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}
}


.type-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.type-icon {
    font-size: var(--font-size-special);
    line-height: 1;
}

.type-label {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

.type-btn.active .type-label {
    color: white;
}

/* Dynamic Dimension Fields */
#dimensionFields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#dimensionFields .form-group {
    margin-bottom: 0;
}

/* Light theme adjustments */
body.light-theme .type-btn {
    background: #f8fafc;
    border-color: #d1d5db;
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .type-btn:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
}
}


body.light-theme .type-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* Add Measurement Button */
.btn-add-measurement {
    background: var(--accent-green);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: #000000;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
.btn-add-measurement:hover {
    background: var(--accent-green);
    transform: translateY(-2px);
}
}


.btn-add-measurement i {
    font-size: var(--font-size-base);
    color: #000000;
}

/* Measurement Fields Container */
#measurementFieldsContainer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.measurement-field-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.measurement-field-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.measurement-field-inputs input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: var(--font-size-default);
    color: var(--text-primary);
    box-sizing: border-box;
}

.measurement-field-inputs input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.measurement-field-label {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: var(--font-weight-semibold);
}

.btn-remove-measurement {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0.5rem;
    font-size: var(--font-size-default);
}

@media (hover: hover) and (pointer: fine) {
.btn-remove-measurement:hover {
    color: #ef4444;
    transform: scale(1.2);
}
}


/* Light theme */
body.light-theme .btn-add-measurement {
    background: var(--accent-green);
    color: #000000;
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .btn-add-measurement:hover {
    background: var(--accent-green);
    transform: translateY(-2px);
}
}


body.light-theme .btn-add-measurement i {
    color: #000000;
}

body.light-theme .measurement-field-row {
    background: #f8fafc;
    border-color: #e5e7eb;
}

body.light-theme .measurement-field-inputs input {
    background: var(--bg-secondary);
    border-color: #d1d5db;
    color: #1a202c;
}

/* Measurement Display */
.measurement-type-icon {
    font-size: var(--font-size-default);
    margin-right: 0.5rem;
}

.measurement-dimensions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dimension-item {
    display: flex;
    gap: 0.5rem;
    font-size: var(--font-size-base);
}

.dimension-label {
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    min-width: 70px;
}

.dimension-value {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-mono);
}

/* 3-Dot Menu for Measurements */
.measurement-item {
    position: relative;
}

.measurement-actions {
    position: relative;
}

.btn-more {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-default);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

@media (hover: hover) and (pointer: fine) {
.btn-more:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
}


.measurement-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: none;
    z-index: 9999;
    min-width: 150px;
    overflow: hidden;
}

.measurement-menu.active {
    display: block;
    animation: slideDown 0.2s ease;
}

.measurement-menu button {
    width: 100%;
    text-align: left;
    padding: 0.875rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

@media (hover: hover) and (pointer: fine) {
.measurement-menu button:hover {
    background: var(--bg-tertiary);
}
}


.measurement-menu button.menu-delete {
    color: #ef4444;
}

@media (hover: hover) and (pointer: fine) {
.measurement-menu button.menu-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}
}


.measurement-menu button i {
    font-size: var(--font-size-base);
    width: 16px;
    text-align: center;
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Light theme */
body.light-theme .measurement-menu {
    background: var(--bg-secondary);
    border-color: #e5e7eb;
}

body.light-theme .measurement-menu button {
    color: #1a202c;
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .measurement-menu button:hover {
    background: #f3f4f6;
}
}


body.light-theme .measurement-menu button.menu-delete {
    color: #dc2626;
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .measurement-menu button.menu-delete:hover {
    background: rgba(220, 38, 38, 0.1);
}
}


/* Light theme */
body.light-theme .btn-add-dim {
    background: #f8fafc;
    border-color: #d1d5db;
    color: #374151;
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .btn-add-dim:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}
}


/* View Mode Tabs */
.view-mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: var(--spacing-md);
    background: var(--bg-tertiary);
    padding: 2px;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.view-mode-tab {
    flex: 1;
    padding: 0.35rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    position: relative;
    min-height: 40px;
    line-height: 1.25;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-i18n="calendarView"] {
    border-radius: 8px;
}

@media (hover: hover) and (pointer: fine) {
.view-mode-tab:hover {
    color: var(--text-primary);
}
}


.view-mode-tab.active {
    background: var(--accent-green);
    color: var(--bg-primary);
    font-weight: var(--font-weight-semibold);
}

.view-mode-tab:active {
    transform: scale(0.98);
}

/* Light theme view tabs */
body.light-theme .view-mode-tab.active {
    color: #1a202c !important;
}

body.light-theme .view-mode-tabs,
body.light-theme .view-mode-tabs.financial-tabs {
    background: var(--bg-card);
}

body.light-theme .segmented-control {
    background: var(--bg-card);
}

/* Calendar View Styles */



.calendar-container {
    /* background: var(--bg-tertiary); */
    /* backdrop-filter: blur(12px); */
    /* -webkit-backdrop-filter: blur(12px); */
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
}

body.light-theme .calendar-container {
    /* background: var(--bg-card); */
    /* backdrop-filter: blur(12px); */
    /* -webkit-backdrop-filter: blur(12px); */
}

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

.calendar-header h3,
#currentMonth {
    font-size: var(--font-size-tertiary);
    color: var(--text-primary);
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: rgba(74, 85, 104, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: var(--font-size-default);
    transition: transform 0.15s ease-out, background 0.15s ease-out-out;
}

body.light-theme .nav-btn {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(203, 213, 224, 0.4);
}

@media (hover: hover) and (pointer: fine) {
.nav-btn:hover {
    background: var(--accent-primary);
    color: #1a202c;
    transform: scale3d(1.1, 1.1, 1);
}
}


@media (hover: hover) and (pointer: fine) {
body.light-theme .nav-btn:hover {
}
}


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

.calendar-day-header {
    text-align: center;
    padding: 0.5rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-tertiary);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: rgba(74, 85, 104, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: transform 0.12s ease-out, background 0.12s ease-out, border-color 0.12s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .calendar-day {
    background: var(--bg-card);
    border: 1px solid rgba(203, 213, 224, 0.4);
}

@media (hover: hover) and (pointer: fine) {
.calendar-day:hover {
    background: rgba(104, 211, 145, 0.15);
    transform: scale3d(1.05, 1.05, 1);
    border-color: var(--accent-primary);
}
}


@media (hover: hover) and (pointer: fine) {
body.light-theme .calendar-day:hover {
    background: rgba(72, 187, 120, 0.1);
    border-color: var(--accent-primary);
}
}


.calendar-day.today {
    border-color: var(--accent-primary);
    background: rgba(104, 211, 145, 0.1);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.selected {
    background: rgba(104, 211, 145, 0.1);
}

body.light-theme .calendar-day.selected {
    background: rgba(72, 187, 120, 0.08);
}

.day-number {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.2rem;
}

.task-indicators {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
}

.task-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.task-dot.overdue {
    background: var(--overdue-color);
}

.task-dot.due-soon {
    background: var(--due-soon-color);
}

.task-dot.completed {
    background: var(--completed-color);
}

.task-dot.normal {
    background: var(--accent-primary);
}

.task-item {
    cursor: grab;
}

.task-item.dragging,
.list-task-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    will-change: transform, opacity;
    transition: none;
}

.calendar-day.drag-over {
    background: rgba(104, 211, 145, 0.3) !important;
    border-color: var(--accent-primary) !important;
    transform: scale3d(1.05, 1.05, 1);
    will-change: transform, background;
    transition: transform 0.15s ease, background 0.15s ease;
}

body.light-theme .calendar-day.drag-over {
    background: rgba(72, 187, 120, 0.3) !important;
}

/* Task drop success animation */
.calendar-day.task-dropped {
    animation: taskDropGlow 0.6s ease-out;
    will-change: transform;
}

@keyframes taskDropGlow {
    0% {
        background: rgba(104, 211, 145, 0.4);
        transform: scale3d(1.1, 1.1, 1);
    }
    25% {
        background: rgba(104, 211, 145, 0.3);
    }
    50% {
        background: rgba(104, 211, 145, 0.2);
    }
    100% {
        background: rgba(74, 85, 104, 0.3);
        transform: scale3d(1, 1, 1);
    }
}

body.light-theme .calendar-day.task-dropped {
    animation: taskDropGlowLight 1.2s ease-out;
}

@keyframes taskDropGlowLight {
    0% {
        background: rgba(72, 187, 120, 0.4);
        transform: scale3d(1.1, 1.1, 1);
    }
    25% {
        background: rgba(72, 187, 120, 0.3);
    }
    50% {
        background: rgba(72, 187, 120, 0.2);
    }
    100% {
        background: rgba(255, 255, 255, 0.5);
        transform: scale3d(1, 1, 1);
    }
}

/* Echo lines effect */
.calendar-day.task-dropped::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    border: 1px solid var(--accent-primary);
    animation: echoLines 1.2s ease-out;
    pointer-events: none;
}

@keyframes echoLines {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.task-details-panel {
    background: rgba(45, 55, 72, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    margin-top: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.25s ease-out;
    opacity: 0;
}

.task-details-panel.active {
    max-height: none;
    opacity: 1;
}

body.light-theme .task-details-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* List: JS-animated in toggleTaskDetails; CSS provides initial/collapsed state only */
.task-details-panel.active .task-list {
    overflow: hidden;
}

.task-details-panel.active:not(.list-expanded) .task-list {
    max-height: 0;
    opacity: 0;
}

.task-details-panel.active.list-expanded .task-list {
    max-height: 80vh;
    opacity: 1;
}

/* Match .legend-item: background, text, chevron style. Margin-bottom transitions in sync with list so gap collapses smoothly */
.task-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--content-padding);
    background: var(--bg-tertiary);
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    transition: transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.task-details-panel.active.list-expanded .task-details-header {
    margin-bottom: 1rem;
}

.task-details-header h4 {
    color: var(--text-primary);
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-medium);
    user-select: none;
}

/* Chevron: match .legend-chevron */
.collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-secondaryallest);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: transform 0.3s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

@media (hover: hover) and (pointer: fine) {
.collapse-btn:hover {
    color: var(--text-primary);
}
}

@media (hover: hover) and (pointer: fine) {
.task-details-header:hover {
    transform: translateX(4px);
}
}

.task-details-header:active {
    transform: translateX(0);
}

.collapse-btn i {
    transition: transform 0.3s ease;
}

.task-details-panel.active.list-expanded .collapse-btn i {
    transform: rotate(180deg);
}

body.light-theme .task-details-header {
    background: var(--bg-card);
}

.legend {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

/* Dark theme: solid background */
body:not(.light-theme) .legend {
    background: transparent;
}

body.light-theme .legend {
    background: transparent;
}

.legend-title {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-align: center;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--font-size-tertiary);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

@media (hover: hover) and (pointer: fine) {
.legend-item:hover {
    transform: translateY(-1px);
}
}


.legend-item:active {
    transform: translateY(0);
}

.legend-item.active {
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* List View Styles */
.list-view-container {
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: visible;
    min-height: 200px;
}

.list-controls {
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.list-sort-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 12px;
    font-size: var(--font-size-tertiary);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.sort-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
.sort-btn:hover {
    color: var(--text-primary);
}
}


.sort-btn.active {
    background: var(--accent-green);
    color: #000000;
    font-weight: var(--font-weight-semibold);
}

.sort-btn.active i {
    color: #000000;
}

.sort-btn:active {
    transform: scale(0.98);
}

.list-filter-dropdown {
    position: relative;
    margin-bottom: 0.75rem;
    z-index: 1000;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
}

@media (hover: hover) and (pointer: fine) {
.filter-dropdown-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-green);
}
}


.filter-dropdown-btn .fa-filter {
    color: var(--accent-green);
}

.filter-dropdown-btn .fa-chevron-down {
    margin-left: auto;
    font-size: var(--font-size-secondaryallest);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg) translateZ(0);
    transform-origin: 50% 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
    flex-shrink: 0;
    flex-grow: 0;
    backface-visibility: hidden;
    contain: layout style;
}

.filter-dropdown-btn.active .fa-chevron-down {
    transform: rotate(180deg) translateZ(0);
}

/* Status select dropdown (job sites) – same look as list filter dropdown */
.status-select-dropdown {
    width: 140px;
    min-width: 140px;
    position: relative;
    z-index: 1;
}

.status-select-dropdown .filter-dropdown-btn {
    padding: 6px 10px;
    min-height: 32px;
    font-size: var(--font-size-tertiary);
    background: color-mix(in srgb, rgba(247, 247, 247, 0.19) 50%, transparent);
    border: 1px solid transparent;
    border-radius: 12px;
}

/* Status label: same text color in light theme as in dark theme */
body.light-theme .status-select-label {
    color: #f7fafc;
}

.status-select-dropdown .filter-dropdown-btn .fa-chevron-down {
    margin-left: auto;
}

/* Menu on top of card and following cards */
.status-select-dropdown .filter-dropdown-menu,
.status-select-dropdown .status-select-menu {
    min-width: 140px;
    z-index: 10001;
    border: 1px solid transparent;
    border-radius: 12px;
}

.filter-dropdown-menu.status-select-menu.active {
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
}

/* When dropdown is open, card can overflow and stacks above others */
.job-site-item.status-dropdown-open {
    z-index: 1000;
    overflow: visible;
    contain: none;
}

/* Allow dropdown to extend outside list when open (iOS WebView: contain:paint clips otherwise) */
.job-sites-list.status-dropdown-open {
    contain: layout style;
    overflow: visible;
}

.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    z-index: 9999;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    min-width: 200px;
}

.filter-dropdown-menu.active {
    display: block;
    animation: dropdownSlideIn 0.2s ease;
}

/* On desktop (hover devices), skip transform in animation to avoid clipping
   when parent has contain/transform - status dropdown works on iPhone/tablet */
@media (hover: hover) and (pointer: fine) {
    .status-select-dropdown .filter-dropdown-menu.active,
    .status-select-dropdown .status-select-menu.active {
        animation: dropdownSlideInDesktop 0.2s ease;
    }
}

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

@keyframes dropdownSlideInDesktop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.filter-dropdown-menu.closing,
.status-select-menu.closing {
    animation: dropdownSlideIn 0.2s ease reverse forwards;
}

@media (hover: hover) and (pointer: fine) {
    .status-select-dropdown .status-select-menu.closing,
    .status-select-menu.closing {
        animation: dropdownSlideInDesktop 0.2s ease reverse forwards;
    }
}

.filter-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    min-height: 32px;
}

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

@media (hover: hover) and (pointer: fine) {
.filter-dropdown-item:hover {
    background: var(--bg-tertiary);
}
}


.filter-dropdown-item.active {
    background: var(--accent-green);
    color: var(--bg-primary);
    font-weight: var(--font-weight-semibold);
}

.filter-count {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    font-size: var(--font-size-tertiary);
    min-width: 20px;
    text-align: center;
    font-weight: var(--font-weight-semibold);
    color: white;
}

.filter-dropdown-item.active .filter-count {
    background: rgba(0, 0, 0, 0.2);
    color: var(--bg-primary);
}

/* All filter counts are now white for consistency */

.list-content {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100px;
    padding-top: 0.5rem;
}

.list-content .empty-state,
.section-content .empty-state {
    padding: 1.5rem 0.75rem;
    margin: 0;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.section-content .empty-state i {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.section-content .empty-state p {
    font-size: var(--font-size-tertiary) !important;
    margin: 0;
    color: var(--text-muted);
}

.list-group {
    margin-bottom: 1rem;
    overflow: hidden;
    width: 100%;
}

/* margin-bottom animated via JS in toggleListGroup */
.list-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

@media (hover: hover) and (pointer: fine) {
.list-group-header:hover {
    background: rgba(104, 211, 145, 0.1);
}
}


body.light-theme .list-group-header {
    border: 1px solid var(--border-color);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .list-group-header:hover {
    background: rgba(72, 187, 120, 0.1);
}
}


.list-group.expanded .list-group-header {
    margin-bottom: 0.75rem;
}

.list-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.list-group-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-group-badge {
    background: var(--accent-primary);
    color: #1a202c;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
}

.list-group-collapse-icon {
    transition: transform 0.3s ease;
    font-size: var(--font-size-secondaryallest);
    color: var(--text-secondary);
}

.list-group.expanded .list-group-collapse-icon {
    transform: rotate(180deg);
}

.collapse-icon,
.collapse-indicator {
    font-size: var(--font-size-secondaryallest);
}

/* list-task-items: JS-animated in toggleListGroup */
.list-task-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 0;
    overflow: hidden;
    opacity: 0;
    width: 100%;
    box-sizing: border-box;
}

.list-group.expanded .list-task-items {
    height: auto;
    opacity: 1;
    margin-top: 0.5rem;
}

/* Same layout as checklist-row (reference): checkbox (left) + card (right) */
/* cursor: grab for list/calendar drag; layout identical to checklist-row */
.list-task-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.625rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    cursor: grab;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    box-sizing: border-box;
}

/* list-task-item uses .checklist-item (layout override above) */

.list-task-item.overdue .checklist-item {
    border-left-color: var(--overdue-color);
}

.list-task-item.due-soon .checklist-item {
    border-left-color: var(--due-soon-color);
}

.list-task-item.completed .checklist-item {
    opacity: 0.7;
    border-left-color: var(--completed-color);
}

.list-task-item.hidden {
    display: none;
}

.list-task-item .checklist-checkbox {
    flex-shrink: 0;
}

.list-task-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 0.3rem;
    gap: 0.5rem;
}

.list-task-title {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-size: var(--font-size-tertiary);
    flex: 1;
    line-height: 1.2;
}

.list-task-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0;
    justify-content: flex-end;
}

.list-task-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--font-size-secondary);
    color: var(--text-muted);
    flex-wrap: wrap;
    font-weight: var(--font-weight-medium);
}

.list-task-date,
.list-task-time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    border: 1px solid transparent;
}

.list-task-date {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-primary);
    border-color: rgba(34, 197, 94, 0.2);
}

.list-task-time {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.list-task-date i,
.list-task-time i {
    font-size: var(--font-size-tertiary);
    opacity: 0.8;
}

.list-task-job {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--font-size-tertiary);
    color: var(--text-secondary);
}

.list-task-status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.02em;
}

.list-task-status-badge.overdue {
    background: #fc8181;
    color: white;
}

.list-task-status-badge.due-soon {
    background: #f6ad55;
    color: white;
}

.list-task-status-badge.completed {
    background: #38a169;
    color: white;
}

.list-task-job {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border-color);
    font-weight: var(--font-weight-semibold);
}

.list-task-status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-tertiary);
}

/* Match donut section colors */
.list-task-status-badge.overdue {
    background: #fc8181;
    color: white;
}

.list-task-status-badge.due-soon {
    background: #f6ad55;
    color: white;
}

.list-task-status-badge.completed {
    background: #38a169;
    color: white;
}

.list-task-status-badge.normal {
    background: var(--accent-green);
    color: white;
}

.empty-list {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.empty-list i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

@media (max-width: 480px) {
    .calendar-grid {
        gap: 0.25rem;
    }

    .calendar-day-header {
        font-size: var(--font-size-tertiary);
        padding: 0.25rem;
    }

    .calendar-day {
        padding: 0.25rem;
    }

    .day-number {
        font-size: var(--font-size-tertiary);
    }

    .task-dot {
        width: 4px;
        height: 4px;
    }

    .task-details-panel.active.list-expanded .task-list {
        max-height: none;
    }

    .task-list {
        padding: 0 0.75rem 0.75rem 0.75rem;
    }

    .task-details-header {
        padding: 0.75rem;
    }

    .filter-dropdown-btn {
        padding: 6px 10px;
        font-size: var(--font-size-secondary);
        min-height: 32px;
    }

    .filter-dropdown-item {
        padding: 6px 10px;
        font-size: var(--font-size-secondary);
        min-height: 28px;
    }

    .list-task-item .checklist-item {
        padding: 0.6rem 0.8rem;
    }
    
    .list-task-title {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.25rem;
    }

    .list-task-meta {
        font-size: var(--font-size-tertiary);
        gap: 0.3rem;
    }
    
    .list-task-header {
        margin-bottom: 0.2rem;
    }
    
    
    .list-task-date,
    .list-task-time {
        font-size: var(--font-size-tertiary);
        gap: 0.2rem;
        padding: 0.15rem 0.35rem;
    }
    
    .list-task-status-badge {
        font-size: var(--font-size-tertiary);
        padding: 0.15rem 0.4rem;
    }
    
    .task-checkbox {
        width: 18px;
        height: 18px;
        min-width: 18px;
        border-radius: 3px;
    }
    
    .task-checkbox.checked::after {
        font-size: var(--font-size-tertiary);
    }
    
    .task-item .list-task-header {
        margin-bottom: 0.2rem;
    }
    
    .task-item .list-task-title {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.25rem;
    }
    
    
    .task-item .list-task-meta {
        font-size: var(--font-size-tertiary);
        gap: 0.3rem;
    }
    
    .task-item .list-task-status-badge {
        font-size: var(--font-size-tertiary);
        padding: 0.15rem 0.4rem;
    }

    .sort-btn {
        font-size: var(--font-size-tertiary);
        padding: 10px 8px;
    }

    .list-group-header {
        padding: 0.6rem 0.75rem;
        font-size: var(--font-size-tertiary);
    }

    .list-group-badge {
        font-size: var(--font-size-tertiary);
        padding: 0.1rem 0.4rem;
    }

    .list-group-collapse-icon {
        font-size: var(--font-size-secondaryallest);
    }

    .list-group-header-right {
        gap: 0.5rem;
    }

    .list-content {
        max-height: 500px;
    }
}

/* ========================================
   FINANCE TRACKING STYLES
   ======================================== */

/* Contract Amount Input */
.contract-amount-input {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.contract-amount-input label {
    display: block;
    color: var(--text-muted);
    font-size: var(--font-size-secondary);
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-semibold);
}

.amount-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.currency-symbol {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}

.amount-input-wrapper input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: var(--font-size-secondary);
    min-height: 44px;
}

.amount-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-save-contract {
    background: var(--accent-primary);
    color: #1a202c;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: var(--font-size-secondary);
    transition: opacity 0.2s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.light-theme .btn-save-contract {
    color: #1a202c;
}

@media (hover: hover) and (pointer: fine) {
.btn-save-contract:hover {
    opacity: 0.9;
}
}


.btn-save-contract:active {
    transform: scale(0.98);
}

/* Finance Progress */
.finance-progress {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-secondary);
    gap: 0.5rem;
}

.progress-label span {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-percentage {
    text-align: center;
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Mobile optimizations for progress bar */
@media (max-width: 480px) {
    .finance-progress {
        padding: 0.625rem;
        margin-bottom: 0.625rem;
    }
    
    .progress-label {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.375rem;
        flex-wrap: wrap;
    }
    
    .progress-label span {
        font-size: var(--font-size-tertiary);
    }
    
    .progress-percentage {
        font-size: var(--font-size-smallest);
    }
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-secondary);
    gap: 0.5rem;
}

.amount-collected {
    color: var(--accent-primary);
    font-weight: var(--font-weight-semibold);
    flex: 1;
    min-width: 0;
}

.amount-remaining {
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
    text-align: right;
}

.progress-percentage {
    text-align: center;
    font-size: var(--font-size-secondary);
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Finance Action Buttons */
/* Finance Stat Card (for Total Invoiced display) */
.finance-stat-card {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.finance-stat-label {
    font-size: var(--font-size-secondary);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.finance-stat-value {
    font-size: var(--font-size-special);
    font-weight: 900;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
    line-height: 1.2;
    word-break: break-word;
}

.finance-stat-subtitle {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.finance-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    width: 100%;
}

.finance-actions .btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    min-height: 44px;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finance-actions .btn i {
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

.btn-payment,
.finance-actions .btn-primary {
    background: var(--accent-primary);
    color: #1a202c;
    border: none;
}

body.light-theme .btn-payment,
body.light-theme .finance-actions .btn-primary {
    color: #1a202c;
}

.btn-spending {
    background: var(--accent-danger);
    color: white;
    border: none;
}

/* Mobile optimizations for finance section */
@media (max-width: 480px) {
    .finance-stat-card {
        padding: 0.875rem;
        margin-bottom: 0.875rem;
        border-radius: 10px;
    }
    
    .finance-stat-label {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.375rem;
    }
    
    .finance-stat-value {
        font-size: var(--font-size-default);
        margin-bottom: 0.25rem;
    }
    
    .finance-stat-subtitle {
        font-size: var(--font-size-smallest);
        margin-top: 0.25rem;
    }
    
    .finance-actions {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        flex-direction: row;
    }
    
    .finance-actions .btn {
        padding: 0.75rem 0.875rem;
        font-size: var(--font-size-tertiary);
        min-height: 44px;
        gap: 0.375rem;
    }
    
    .finance-actions .btn i {
        font-size: var(--font-size-secondary);
    }
    
    .finance-actions .btn span {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================
   Job Site Invoice/Estimate Items - Mobile Optimized
   ============================================ */
.job-site-invoices-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invoice-group {
    margin-bottom: 1rem;
}

.invoice-group:last-child {
    margin-bottom: 0;
}

.invoice-group h4 {
    font-size: var(--font-size-secondary);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 60px;
    margin-bottom: 0.5rem;
}

.invoice-item:last-child {
    margin-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
.invoice-item:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}
}


.invoice-item:active {
    transform: translateY(0);
    opacity: 0.8;
}

/* Left side - Invoice number and status */
.invoice-item > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

/* Right side - Amounts */
.invoice-item > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 50%;
}

.invoice-num {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-size: var(--font-size-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invoice-stat {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.invoice-stat.status-open {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.invoice-stat.status-paid {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.invoice-stat.status-overdue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.invoice-stat.status-draft {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.invoice-stat.status-pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.invoice-stat.status-accepted {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.invoice-stat.status-declined {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.invoice-amt {
    font-size: var(--font-size-primary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-break: break-all;
}

/* Collected and Due amounts in invoice items */
.invoice-item > div:last-child > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: var(--font-size-tertiary);
    word-break: break-all;
}

.empty-invoice-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: var(--font-size-secondary);
}

/* Light theme support for invoice items */
body.light-theme .invoice-item {
    background: var(--bg-card);
    border-color: var(--border-color);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .invoice-item:hover {
    background: var(--bg-tertiary);
}
}


/* Mobile optimization - stack items on very small screens */
@media (max-width: 380px) {
    .invoice-item {
        flex-direction: column;
        align-items: stretch;
        padding: 0.625rem;
    }
    
    .invoice-item > div:first-child,
    .invoice-item > div:last-child {
        max-width: 100%;
    }
    
    .invoice-item > div:last-child {
        align-items: flex-start;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }
    
    .invoice-num {
        font-size: var(--font-size-tertiary);
    }
    
    .invoice-stat {
        padding: 0.125rem 0.375rem;
        font-size: 10px;
    }
    
    .invoice-amt {
        font-size: var(--font-size-secondary);
    }
}

/* Transaction List */
.transactions-list {
    margin-bottom: 0.75rem;
}

.transaction-item {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    min-height: 50px;
    gap: 0.75rem;
}

.transaction-item:last-child {
    margin-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
.transaction-item:hover {
    background: var(--bg-secondary);
}
}


.transaction-item:active {
    opacity: 0.8;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-type {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.transaction-memo {
    font-size: var(--font-size-base);
    margin: 4px 0;
    color: var(--text-primary);
}

.transaction-date {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
}

.transaction-amount {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    margin-right: 0;
    flex-shrink: 0;
}

.transaction-amount.payment {
    color: var(--accent-primary);
}

.transaction-amount.spending {
    color: var(--accent-danger);
}

.payment-type-badge {
    display: inline-block;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-size-tertiary);
    margin-left: 6px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.transaction-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.btn-delete-transaction {
    background: none;
    border: none;
    color: var(--accent-danger);
    cursor: pointer;
    padding: 6px;
    font-size: var(--font-size-default);
    transition: opacity 0.2s;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
.btn-delete-transaction:hover {
    opacity: 0.7;
}
}


/* Finance Summary */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.summary-card {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.summary-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.summary-value {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
}

.summary-value.green {
    color: var(--accent-primary);
}

.summary-value.red {
    color: var(--accent-danger);
}

/* Congratulations Banner */
.congrats-banner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 2000;
    background: var(--accent-green);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    max-width: 90%;
}

.congrats-banner.active {
    display: block;
}

@keyframes popIn {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.congrats-banner h2 {
    font-size: var(--font-size-special);
    margin-bottom: 10px;
    color: #1a202c;
    font-weight: var(--font-weight-semibold);
}

.congrats-banner p {
    font-size: var(--font-size-default);
    color: #1a202c;
    margin-bottom: 20px;
}

.congrats-banner .btn {
    background: white;
    color: #1a202c;
    margin-top: 10px;
}

.congrats-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Financial Overview Styles */

/* Financial Controls - Period & Status Filters */
/* Financial Controls - iOS Design */
.financial-controls {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0 1.75rem 0;
    align-items: center;
    flex-wrap: wrap;
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .financial-controls {
        gap: 1.25rem;
        margin: 2rem 0 2rem 0;
    }
}

/* iPhone: iOS standard spacing */
@media (max-width: 480px) {
    .financial-controls {
        gap: 0.75rem;
        margin: 1.25rem 0 1.5rem 0;
    }
}

/* Control Group - iOS Layout */
.control-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 160px;
}

.control-group.full-width {
    flex: 1 1 100%;
    width: 100%;
}

/* Control Label - iOS Typography */
.control-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: -0.1px;
}

/* iPad: Better readability */
@media (min-width: 768px) {
    .control-label {
        font-size: 0.9375rem;
    }
}

/* iPhone: iOS caption sizing */
@media (max-width: 480px) {
    .control-label {
        font-size: 0.8125rem;
    }
}

/* Financial Select - iOS Picker Style */
.financial-select {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 0;
    min-height: 48px;
    line-height: 1.3;
    letter-spacing: var(--tracking-normal);
}

/* iPad: Enhanced select */
@media (min-width: 768px) {
    .financial-select {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        min-height: 52px;
        border-radius: 14px;
    }
}

/* iPhone: iOS standard sizing */
@media (max-width: 480px) {
    .financial-select {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        min-height: 48px;
    }
}

.financial-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

@media (hover: hover) and (pointer: fine) {
.financial-select:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}
}


/* Financial Tabs - iOS Segmented Control Style */
.financial-tabs {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .financial-tabs {
        margin-bottom: 1.125rem;
    }
}

/* iPhone: iOS standard spacing */
@media (max-width: 480px) {
    .financial-tabs {
        margin-bottom: 0.875rem;
    }
}

/* Financial Report Section - iOS Card Design */
.financial-report-section {
    border-radius: 16px;
    padding: 1.75rem;
    margin: 2rem 0;
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .financial-report-section {
        padding: 2rem;
        margin: 2.5rem 0;
        border-radius: 18px;
    }
}

/* iPhone: iOS standard card */
@media (max-width: 480px) {
    .financial-report-section {
        padding: 1.5rem;
        margin: 1.5rem 0;
        border-radius: 14px;
    }
}

/* Financial Report button inherits from .btn-payroll-report - no overrides needed */

.financial-report-section .report-actions {
    margin-top: var(--spacing-lg);
}


.financial-report-section .archive-count {
    color: var(--text-muted);
    font-weight: var(--font-weight-semibold);
}

/* Financial Overview - iOS Optimized */
.financial-overview {
    padding: 0;
}

/* Overview Grid - iOS Layout */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.875rem;
    margin-bottom: 2rem;
}

/* iPad: Enhanced grid */
@media (min-width: 768px) {
    .overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        margin-bottom: 2.5rem;
    }
}

/* Large screens: 5-column layout for better space use */
@media (min-width: 1024px) {
    .overview-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1rem;
    }

}

/* Tablet: horizontal scroll, ~3–4 cards visible + peek; hidden scrollbar (same pattern as mode-rail) */
@media (min-width: 481px) and (max-width: 1023px) {
    .overview-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 1rem;
        margin-bottom: 2.25rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 0;
        overscroll-behavior-x: contain;
        padding-bottom: 0.25rem;
    }

    .overview-grid::-webkit-scrollbar {
        display: none;
    }

    .overview-grid .big-stat-card {
        flex: 0 0 auto;
        width: calc((100% - 3rem) / 4.15);
        min-width: calc((100% - 3rem) / 4.15);
        max-width: none;
        scroll-snap-align: start;
        box-sizing: border-box;
    }
}

/* iPhone: horizontal scroll — 2 full cards + peek of 3rd (scroll affordance) */
@media (max-width: 480px) {
    .overview-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 0;
        overscroll-behavior-x: contain;
        padding-bottom: 0.25rem;
    }

    .overview-grid::-webkit-scrollbar {
        display: none;
    }

    .overview-grid .big-stat-card {
        flex: 0 0 auto;
        width: calc((100% - 0.75rem) / 2.2);
        min-width: calc((100% - 0.75rem) / 2.2);
        max-width: none;
        scroll-snap-align: start;
        box-sizing: border-box;
    }
    
    .financial-tabs {
        flex-direction: row;
    }
}

/* Big Stat Card - iOS Card Design */
.big-stat-card {
    background: var(--bg-tertiary);
    padding: 1.25rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    cursor: default;
}

/* iPad: Enhanced card */
@media (min-width: 768px) {
    .big-stat-card {
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
    }
}

/* iPhone: iOS compact card */
@media (max-width: 480px) {
    .big-stat-card {
        padding: 1rem 0.75rem;
        border-radius: 12px;
    }
}

@media (hover: hover) and (pointer: fine) {
.big-stat-card:hover {
    transform: translateY(-2px);
}
}



/* Big Stat Label - iOS Typography */
.big-stat-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
}

/* iPad: Enhanced readability */
@media (min-width: 768px) {
    .big-stat-label {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.75rem;
        letter-spacing: 0.1em;
    }
}

/* iPhone: iOS SF Pro style sizing */
@media (max-width: 480px) {
    .big-stat-label {
        font-size: var(--font-size-tertiary);
        margin-bottom: 0.5rem;
        letter-spacing: 0.06em;
    }
}

/* Big Stat Value - Large display size for prominence */
.big-stat-value {
    font-size: var(--font-size-special);
    font-weight: 900;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: var(--tracking-tight);
    position: relative;
    min-height: 1.5em;
}

/* Loading spinner on overview stat cards */
.overview-grid.loading .big-stat-value {
    color: transparent;
    user-select: none;
}

.overview-grid.loading .big-stat-value::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 1px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: financial-stat-spin 0.7s linear infinite;
}

@keyframes financial-stat-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Job list area loading (before skeletons) */
.financial-lists-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    min-height: 140px;
}

.financial-lists-loading.hidden {
    display: none;
}

.financial-lists-loading-spinner {
    width: 28px;
    height: 28px;
    border: 1px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: financial-lists-spin 0.7s linear infinite;
}

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

.financial-lists-loading-text {
    margin: 0;
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
}

/* iPad: Same special size */
@media (min-width: 768px) {
    .big-stat-value {
        font-size: var(--font-size-special);
        margin-bottom: 0.5rem;
        letter-spacing: var(--tracking-tight);
    }
}

/* Big Stat Subtitle - iOS Caption Style */
.big-stat-subtitle {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    line-height: 1.4;
    letter-spacing: var(--tracking-normal);
    font-weight: var(--font-weight-normal);
}

/* iPad: Better readability */
@media (min-width: 768px) {
    .big-stat-subtitle {
        font-size: var(--font-size-tertiary);
    }
}

/* iPhone: iOS standard caption */
@media (max-width: 480px) {
    .big-stat-subtitle {
        font-size: var(--font-size-tertiary);
    }
}


/* Section Title - iOS Typography */
.section-title {
    font-size: var(--font-size-default);
    margin: 2rem 0 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
    padding: 0;
    line-height: 1.3;
    letter-spacing: var(--tracking-normal);
}

/* iPad: Enhanced title */
@media (min-width: 768px) {
    .section-title {
        font-size: var(--font-size-default);
        margin: 2.5rem 0 1.25rem 0;
    }
}

/* iPhone: iOS standard title */
@media (max-width: 480px) {
    .section-title {
        font-size: var(--font-size-secondary);
        margin: 1.5rem 0 1rem 0;
    }
}

/* Section Count Badge - iOS Design */
.section-count {
    background: rgba(203, 203, 203, 0.49);
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    margin-left: 0.625rem;
    margin-right: 10px;
    line-height: 1.2;
}

/* iPad: Larger badge */
@media (min-width: 768px) {
    .section-count {
        padding: 0.4375rem 0.875rem;
        font-size: 0.8125rem;
        border-radius: 8px;
    }
}

/* Job Card - iOS Card Design */
.job-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

/* iPad: Enhanced card */
@media (min-width: 768px) {
    .job-card {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 0;
    }
}

/* iPhone: iOS compact card */
@media (max-width: 480px) {
    .job-card {
        padding: 0.875rem;
        border-radius: 12px;
    }
}

/* Left accent bar - iOS style */
.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--border-color);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) and (pointer: fine) {
.job-card:hover {
    transform: translateY(-2px);
}
}


.job-card:active {
    transform: scale(0.98);
}

/* Status-based accent colors */
.job-card.urgent::before {
    background: var(--accent-red);
    width: 5px;
}

.job-card.warning::before {
    background: var(--accent-yellow);
    width: 5px;
}

.job-card.completed::before {
    background: var(--accent-green);
    width: 5px;
}

/* Job Header - iOS Layout */
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.625rem;
    gap: 0.75rem;
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .job-header {
        margin-bottom: 0.75rem;
    }
}

/* Job Name - iOS Headline */
.job-name {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.375rem;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: var(--tracking-normal);
}

/* iPad: Larger name */
@media (min-width: 768px) {
    .job-name {
        font-size: var(--font-size-default);
        letter-spacing: var(--tracking-normal);
    }
}

/* iPhone: iOS standard headline */
@media (max-width: 480px) {
    .job-name {
        font-size: var(--font-size-secondary);
        letter-spacing: var(--tracking-normal);
    }
}

.job-card .job-site-number {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-right: 0.375rem;
    letter-spacing: -0.1px;
}

/* Job Address - iOS Subheadline */
.job-address {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.1px;
}

/* iPad: Better readability */
@media (min-width: 768px) {
    .job-address {
        font-size: 0.875rem;
    }
}

/* Job Amount - iOS Callout */
.job-amount {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    text-align: right;
    white-space: nowrap;
    line-height: 1.2;
    letter-spacing: var(--tracking-tight);
}

/* iPad: Larger amount */
@media (min-width: 768px) {
    .job-amount {
        font-size: var(--font-size-default);
        letter-spacing: var(--tracking-tight);
    }
}

/* iPhone: iOS callout sizing */
@media (max-width: 480px) {
    .job-amount {
        font-size: var(--font-size-default);
        letter-spacing: var(--tracking-normal);
    }
}

.job-amount.owed {
    color: var(--accent-red);
}

.job-amount.profit {
    color: var(--accent-green);
}

/* Financial job lists - grid layout for tablets+ */
#needsCollectionList,
#fullyPaidList,
#noFinanceList {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Tablet: 2-column grid */
@media (min-width: 768px) {
    #needsCollectionList,
    #fullyPaidList,
    #noFinanceList {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .job-card {
        margin-bottom: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
}

/* Desktop: 3-column grid */
@media (min-width: 1024px) {
    #needsCollectionList,
    #fullyPaidList,
    #noFinanceList {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }
}

/* Job Stats - iOS Design */
.job-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .job-stats {
        gap: 1rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }
}

/* iPhone: iOS standard spacing */
@media (max-width: 480px) {
    .job-stats {
        gap: 0.625rem;
        margin-top: 0.625rem;
        padding-top: 0.625rem;
    }
}

.job-stat {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

/* Job Stat Label - iOS Caption */
.job-stat-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
}

/* iPad: Better readability */
@media (min-width: 768px) {
    .job-stat-label {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
}

/* Job Stat Value - iOS Callout */
.job-stat-value {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.job-stat-value.green {
    color: var(--accent-green);
}

.job-stat-value.red {
    color: var(--accent-red);
}

.job-progress {
    margin-top: var(--spacing-sm);
}

.job-progress .progress-bar-container {
    background: var(--bg-secondary);
    height: 20px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.job-progress .progress-bar-fill {
    background: var(--accent-green);
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
    will-change: transform;
}

.progress-bar-fill.complete {
    background: var(--accent-primary);
}

.job-progress .progress-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    line-height: 1.4;
    gap: var(--spacing-sm);
}


.hidden {
    display: none !important;
}

/* Mobile responsive controls */
@media (max-width: 768px) {
    .financial-controls {
        gap: var(--spacing-sm);
    }
    
    .control-group {
        flex: 1 1 calc(50% - var(--spacing-xs));
        min-width: 140px;
    }
    
    .financial-report-actions {
        justify-content: center;
    }
    
    .financial-report-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .financial-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
        margin: var(--spacing-sm) 0 var(--spacing-md) 0;
    }
    
    .control-group {
        width: 100%;
        min-width: auto;
    }
    
    .control-label {
        font-size: var(--font-size-secondary);
        min-width: 50px;
    }
    
    .financial-select {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-secondary);
        min-height: var(--touch-target-min);
    }
    
    .financial-report-actions {
        margin-bottom: var(--spacing-md);
    }
}

/* Mobile responsiveness for financial overview */
@media (max-width: 768px) {
    .summary-value {
        font-size: var(--font-size-default);
    }
    
    .job-financials {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .view-mode-tabs {
        padding: 2px;
    }
    
    .view-mode-tab {
        padding: 0.3rem 0.4rem;
        font-size: var(--font-size-tertiary);
        min-height: 40px;
    }
}

/* ================================
   LABOR TRACKER STYLES - iOS OPTIMIZED
   ================================ */

/* Labor Tracker Content Panel - Following iOS Spacing */
#laborView .content-panel {
    padding: 1rem;
    max-width: 100%;
}

/* iPad: Enhanced spacing for larger screens */
@media (min-width: 768px) {
    #laborView .content-panel {
        padding: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Large iPad/Desktop: Maximum comfort */
@media (min-width: 1024px) {
    #laborView .content-panel {
        padding: 2.5rem;
        max-width: 1400px;
    }
}

/* View Title - Apple iOS Style (same size as body, heavier weight) */
#laborView .view-title {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.15;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#laborView .view-title i {
    color: var(--accent-green);
    font-size: var(--font-size-default);
    line-height: 1;
}

/* Labor Period Selector - iOS Style */
.labor-period-selector {
    margin-bottom: 1.5rem;
    width: 100%;
}

.period-label {
    display: block;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* Segmented Control - iOS Native Style */
.segmented-control {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    width: 100%;
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.625rem 0.5rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 9px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
.segment-btn:not(.active):hover {
    background: rgba(104, 211, 145, 0.08);
    color: var(--text-primary);
}
}


/* Active segment - solid palette color */
.segment-btn.active {
    background: var(--accent-green);
    color: #000000;
    font-weight: var(--font-weight-semibold);
    transform: none;
}

.segment-btn.active i {
    color: #000000;
}

/* Press feedback: only the already-selected segment looks “pressed” — inactive stays neutral so horizontal scroll doesn’t flash green on each button */
.segment-btn:not(.active):active {
    transform: none;
    background: transparent !important;
    color: var(--text-secondary) !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    opacity: 1;
}

.segment-btn.active:active {
    transform: scale(0.98);
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    opacity: 0.9;
}

.segment-btn:focus {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Labor period segments: horizontal scroll on phone/tablet (~3 full + peek of 4th); hidden scrollbar */
@media (max-width: 1023px) {
    #laborView .segmented-control {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
    }

    #laborView .segmented-control::-webkit-scrollbar {
        display: none;
    }

    #laborView .segmented-control .segment-btn {
        flex: 0 0 auto;
        width: calc(100% / 3.2);
        min-width: calc(100% / 3.2);
        max-width: none;
        scroll-snap-align: start;
        box-sizing: border-box;
        touch-action: pan-x;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Labor Stats Grid - iOS Layout */
.labor-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* iPad: 4-column layout for better space utilization */
@media (min-width: 768px) {
    .labor-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
}

/* iPhone: Optimized gaps following 8pt grid */
@media (max-width: 480px) {
    .labor-stats-grid {
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
}

/* Labor Stat Card - iOS Card Design (matches Financial Overview) */
.labor-stat-card {
    background: var(--bg-tertiary);
    border-radius: 14px;
    padding: 1.25rem 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    cursor: default;
}

/* iPad: Enhanced card */
@media (min-width: 768px) {
    .labor-stat-card {
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
    }
}

/* iPhone: iOS compact card */
@media (max-width: 480px) {
    .labor-stat-card {
        padding: 1rem 0.75rem;
        border-radius: 12px;
    }
}

/* Hover effect - subtle iOS elevation */
@media (hover: hover) and (pointer: fine) {
.labor-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color);
}
}


/* Stat Label - Tertiary text */
.labor-stat-card .stat-label {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    line-height: 1.3;
}

/* Stat Value - Large display size for prominence */
.labor-stat-card .stat-value {
    font-size: var(--font-size-special);
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 0.375rem;
}

.labor-stat-card .stat-value.active {
    color: var(--accent-green);
    animation: pulse-value 2s ease-in-out infinite;
}

@keyframes pulse-value {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* Stat Sublabel - Tertiary text */
.labor-stat-card .stat-sublabel {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    margin-top: 0.375rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

/* Add Employee Section - iOS Layout */
.add-employee-section {
    margin: 1.5rem 0 1.25rem;
    display: flex;
    justify-content: center;
    font-size: var(--font-size-tertiary);
}

/* iPhone: Optimized spacing */
@media (max-width: 480px) {
    .add-employee-section {
        margin: 1.25rem 0 1rem;
    }
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .add-employee-section {
        margin: 2rem 0 1.5rem;
    }
}

/* ================================
   LABOR TRACKER BUTTONS - STANDARDIZED
   ================================ 
   
   All labor tracker buttons now use consistent:
   - Font: SF Pro (Apple) / System Default
   - Weight: Semibold (600) for all buttons
   - Icon sizes: 22px default, 24px iPad, 20px iPhone
   - Font sizes: 17px default, 18px iPad, 15px iPhone
   - Heights: 52px default, 56px iPad, 50px iPhone
   - Letter spacing: -0.2px
   - Transitions: 0.35s cubic-bezier
   
   PRIMARY BUTTONS (Green):
   - .btn-labor-primary
   - .btn-add-employee
   - .btn-payroll-report
   
   SECONDARY BUTTONS (Outlined):
   - .btn-labor-secondary
   - .btn-report-action (with color variants: .blue, .red, .purple)
   - .btn-archived-reports
   
   USAGE:
   <button class="btn-add-employee"><i class="fas fa-user-plus"></i><span>Add Employee</span></button>
   <button class="btn-payroll-report"><i class="fas fa-file-invoice-dollar"></i><span>Get Payroll Report</span></button>
   <button class="btn-report-action blue"><i class="fas fa-download"></i><span>Download PDF</span></button>
   <button class="btn-report-action purple"><i class="fas fa-archive"></i><span>Save to Archive</span></button>
   <button class="btn-archived-reports"><span>View Archived Reports</span><i class="fas fa-chevron-right"></i></button>
   ================================ */

/* Base Style for ALL Labor Tracker Primary Buttons - Apple iOS Standard */
.btn-labor-primary,
.btn-add-employee,
.btn-payroll-report {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1rem 1.75rem;
    min-height: 52px;
    border-radius: 14px;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-tertiary);
    line-height: 1.3;
    background: var(--accent-green);
    color: #000000;
    border: none;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

/* Add Employee Button - uses base styles */
.btn-add-employee {
    /* Inherits all styles from .btn-labor-primary base class */
    justify-content: center; /* Center content */
}

/* iPad: Larger buttons for better accessibility */
/* Mobile: Slightly adjust padding only */
@media (max-width: 480px) {
    .btn-labor-primary,
    .btn-add-employee,
    .btn-payroll-report {
        padding: 0.875rem 1.5rem;
    }
}

/* Hover state - all primary buttons */
@media (hover: hover) and (pointer: fine) {
.btn-labor-primary:hover,
.btn-add-employee:hover,
.btn-payroll-report:hover {
    transform: translateY(-2px);
}
}


/* Active state - all primary buttons */
.btn-labor-primary:active,
.btn-add-employee:active,
.btn-payroll-report:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Icon sizing - one size for all buttons (Apple iOS standard) */
.btn-labor-primary i,
.btn-add-employee i,
.btn-payroll-report i,
.btn-labor-secondary i,
.btn-report-action i,
.btn-archived-reports i {
    font-size: var(--font-size-default);
    min-width: 22px;
    text-align: center;
    line-height: 1;
}

/* Text color for primary buttons */
.btn-labor-primary span,
.btn-add-employee span,
.btn-payroll-report span {
    color: #000000;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.2px;
}

/* Employees List - iOS List Design */
.employees-list {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    min-height: 200px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* iPad: 2-column grid for efficient space use */
@media (min-width: 768px) {
    .employees-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
}

/* Large iPad/Desktop: 3-column grid */
@media (min-width: 1024px) {
    .employees-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* iPhone: iOS standard list spacing */
@media (max-width: 480px) {
    .employees-list {
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
}

/* Empty State - iOS Design */
.section-content .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    text-align: center;
    background: transparent;
    border-radius: 0;
    border: none;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* iPad: More generous spacing */
@media (min-width: 768px) {
    .section-content .empty-state {
        padding: 4rem 2rem;
        font-size: 1rem;
    }
}

/* iPhone: iOS compact empty state */
@media (max-width: 480px) {
    .section-content .empty-state {
        padding: 2.5rem 1rem;
        font-size: 0.9375rem;
    }
}

/* Empty State Icon - iOS SF Symbols Style */
.empty-state-icon {
    font-size: 4rem;
    opacity: 0.25;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* iPad: Larger icon */
@media (min-width: 768px) {
    .empty-state-icon {
        font-size: 5rem;
        margin-bottom: 2rem;
    }
}

/* iPhone: iOS standard icon size */
@media (max-width: 480px) {
    .empty-state-icon {
        font-size: 3.5rem;
        margin-bottom: 1.25rem;
    }
}

/* Employee Item Card - iOS Card Style (matches Job Card) */
.employee-item {
    background: var(--bg-tertiary);
    border-radius: 14px;
    margin-bottom: 0;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

/* iPad: Enhanced card */
@media (min-width: 768px) {
    .employee-item {
        height: 100%;
        min-height: 100px;
        border-radius: 16px;
    }
}

/* iPhone: iOS compact card */
@media (max-width: 480px) {
    .employee-item {
        min-height: 100px;
        border-radius: 12px;
    }
}

/* Hover effect - iOS elevation */
@media (hover: hover) and (pointer: fine) {
.employee-item:hover {
    transform: translateY(-2px);
    border-color: var(--border-color);
}
}


/* Employee Info Section - iOS Layout */
.employee-info {
    flex: 1;
    padding: 1rem 0 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

/* iPad: Enhanced padding for better breathing */
@media (min-width: 768px) {
    .employee-info {
        padding: 1.25rem 0 1.25rem 1.25rem;
        gap: 0.625rem;
    }
}

/* iPhone: iOS standard padding */
@media (max-width: 480px) {
    .employee-info {
        padding: 0.875rem 0 0.875rem 1rem;
        gap: 0.5rem;
    }
}

.employee-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.625rem;
}

/* Employee Name - Default size with semibold weight */
.employee-name {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    flex: 1;
    line-height: 1.3;
}

.employee-secondary-actions {
    position: relative;
    display: flex;
    gap: var(--spacing-xs);
}

/* Menu Toggle Button - iOS Circular Button */
.btn-menu-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* iPad: Slightly larger for better accessibility */
@media (min-width: 768px) {
    .btn-menu-toggle {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 1.0625rem;
    }
}

@media (hover: hover) and (pointer: fine) {
.btn-menu-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: scale(1.05);
}
}


.btn-menu-toggle:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Employee Dropdown Menu - iOS Popover Style */
.employee-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(44px + 0.5rem);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    z-index: 9999;
    min-width: 200px;
    overflow: hidden;
}

/* iPad: Enhanced dropdown */
@media (min-width: 768px) {
    .employee-dropdown-menu {
        top: calc(48px + 0.5rem);
        min-width: 220px;
        border-radius: 16px;
    }
}

/* Dropdown Menu Item - iOS List Item */
.employee-dropdown-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: left;
    min-height: 48px;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

/* iPad: Enhanced menu items */
@media (min-width: 768px) {
    .employee-dropdown-menu .menu-item {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        min-height: 52px;
    }
}

@media (hover: hover) and (pointer: fine) {
.employee-dropdown-menu .menu-item:hover {
    background: var(--bg-secondary);
}
}


.employee-dropdown-menu .menu-item:active {
    background: var(--bg-tertiary);
    transform: scale(0.98);
}

.employee-dropdown-menu .menu-item i {
    width: 24px;
    min-width: 24px;
    font-size: 1.125rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* iPad: Larger icons */
@media (min-width: 768px) {
    .employee-dropdown-menu .menu-item i {
        width: 26px;
        min-width: 26px;
        font-size: 1.1875rem;
    }
}

/* Danger Item - iOS Destructive Action */
.employee-dropdown-menu .menu-item-danger {
    color: var(--accent-danger);
}

@media (hover: hover) and (pointer: fine) {
.employee-dropdown-menu .menu-item-danger:hover {
    background: rgba(252, 129, 129, 0.12);
}
}


/* Action Sheet Modal - iOS Native Style */
.action-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    transition: background 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.action-sheet-overlay.active {
    background: rgba(0, 0, 0, 0.4);
}

/* Action Sheet - iOS Bottom Sheet */
.action-sheet {
    width: 100%;
    background: var(--bg-tertiary);
    border-radius: 24px 24px 0 0;
    padding: 1.25rem;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 500px;
    margin: 0 auto;
}

/* iPad: Enhanced action sheet */
@media (min-width: 768px) {
    .action-sheet {
        border-radius: 28px 28px 0 0;
        padding: 1.5rem;
    }
}

.action-sheet-overlay.active .action-sheet {
    transform: translateY(0);
}

/* Action Sheet Header - iOS Title */
.action-sheet-header {
    font-size: 1.0625rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    padding: 0.625rem 0 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

/* iPad: Larger header */
@media (min-width: 768px) {
    .action-sheet-header {
        font-size: 1.125rem;
        padding: 0.75rem 0 1.25rem;
    }
}

/* Action Sheet Item - iOS Button */
.action-sheet-item {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: none;
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: 52px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

/* iPad: Enhanced items */
@media (min-width: 768px) {
    .action-sheet-item {
        padding: 1.125rem 1.5rem;
        font-size: 1rem;
        min-height: 56px;
        border-radius: 16px;
    }
}

@media (hover: hover) and (pointer: fine) {
.action-sheet-item:hover {
    background: var(--bg-primary);
    transform: translateY(-1px);
}
}


.action-sheet-item:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.action-sheet-item i {
    font-size: 1.375rem;
    width: 30px;
    min-width: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* iPad: Larger icons */
@media (min-width: 768px) {
    .action-sheet-item i {
        font-size: var(--font-size-special);
        width: 32px;
        min-width: 32px;
    }
}

/* Danger Action - iOS Destructive */
.action-sheet-item-danger {
    color: var(--accent-danger);
}

/* Cancel Button - iOS Style */
.action-sheet-cancel {
    background: var(--bg-primary);
    margin-top: 1rem;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
}

/* Employee Details - Tertiary text */
.employee-details {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    line-height: 1.45;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.employee-details span:not(:last-child)::after {
    content: "•";
    margin-left: 0.375rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Employee Stats - iOS Design */
.employee-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--border-color);
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .employee-stats {
        gap: 1.25rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }
}

/* iPhone: iOS standard spacing */
@media (max-width: 480px) {
    .employee-stats {
        gap: 0.875rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
}

/* Employee Hours - Secondary text */
.employee-hours {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--accent-blue);
    line-height: 1.3;
}

/* Employee Earnings - Secondary text */
.employee-earnings {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--accent-green);
    line-height: 1.3;
}

.employee-hours i {
    font-size: 0.875rem;
    opacity: 0.85;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

.employee-earnings i {
    font-size: 0.875rem;
    opacity: 0.85;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

/* iPad: Larger icons */
@media (min-width: 768px) {
    .employee-hours i,
    .employee-earnings i {
        font-size: 1rem;
        min-width: 18px;
    }
}

/* iPhone: iOS standard icon sizing */
@media (max-width: 480px) {
    .employee-hours i,
    .employee-earnings i {
        font-size: 0.875rem;
        min-width: 16px;
    }
}

.employee-clock-status {
    margin-top: var(--spacing-xs);
}

/* Employee Main Actions - iOS Button Design */
.employee-main-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    width: auto;
    min-width: 110px;
}

/* iPad: Larger action area */
@media (min-width: 768px) {
    .employee-main-actions {
        min-width: 130px;
        padding: 1rem;
    }
}

/* iPhone: iOS standard sizing */
@media (max-width: 480px) {
    .employee-main-actions {
        min-width: 105px;
        padding: 0.625rem;
    }
}

/* Clock Button - iOS Prominent Action */
.btn-clock-main {
    width: 100%;
    min-width: 110px;
    height: 100%;
    min-height: 56px;
    border: none;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base) !important;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0 14px 14px 0;
    padding: 0.75rem 0.625rem;
}

/* Mobile: Slightly adjust padding */
@media (max-width: 480px) {
    .btn-clock-main {
        min-width: 105px;
        padding: 0.625rem 0.5rem;
    }
}

@media (hover: hover) and (pointer: fine) {
.btn-clock-main:hover {
    transform: scale(1.02);
}
}


.btn-clock-main:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-clock-main i {
    font-size: 22px !important;
    line-height: 1;
}

.btn-clock-main span {
    font-size: var(--font-size-tertiary) !important;
    line-height: 1.3;
    font-weight: var(--font-weight-semibold);
    text-align: center;
    white-space: nowrap;
}

/* Clock In Button - iOS Green Action */
.btn-clock-main.btn-clock-in {
    border-radius: 14px;
    background: var(--accent-green);
    color: #000000;
}

@media (hover: hover) and (pointer: fine) {
.btn-clock-main.btn-clock-in:hover {
    background: var(--accent-green);
}
}


.btn-clock-main.btn-clock-in:active {
    background: var(--accent-green);
}

/* Clock Out Button - iOS Red Action */
.btn-clock-main.btn-clock-out {
    background: var(--accent-red);
    color: #ffffff;
}

@media (hover: hover) and (pointer: fine) {
.btn-clock-main.btn-clock-out:hover {
    background: var(--accent-red);
}
}


.btn-clock-main.btn-clock-out:active {
    background: var(--accent-red);
}

/* Employee Card Modal Styles - iOS Optimized */
.employee-stats-section {
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .employee-stats-section {
        padding: 2rem;
        margin-bottom: 2rem;
        border-radius: 18px;
    }
}

/* iPhone: iOS standard padding */
@media (max-width: 480px) {
    .employee-stats-section {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
        border-radius: 14px;
    }
}

/* Stats Grid - iOS Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
}

/* iPad: 4-column layout for better space use */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

/* iPhone: Optimized gaps */
@media (max-width: 480px) {
    .stats-grid {
        gap: 0.75rem;
    }
}

/* Stat Card - iOS Card Design */
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border: 1px solid var(--border-color);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* iPad: Enhanced card */
@media (min-width: 768px) {
    .stat-card {
        padding: 1.125rem;
        border-radius: 14px;
    }
}

/* iPhone: iOS compact card */
@media (max-width: 480px) {
    .stat-card {
        padding: 0.875rem;
        gap: 0.75rem;
    }
}

@media (hover: hover) and (pointer: fine) {
.stat-card:hover {
    transform: translateY(-2px);
}
}


/* Stat Icon - iOS Design */
.stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-green);
    color: #000000;
    font-size: 1.375rem;
    flex-shrink: 0;
}

/* iPad: Larger icons */
@media (min-width: 768px) {
    .stat-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        font-size: var(--font-size-special);
        border-radius: 12px;
    }
}

/* iPhone: iOS standard icon sizing */
@media (max-width: 480px) {
    .stat-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: var(--font-size-default);
        border-radius: 10px;
    }
}

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

/* Stat Value - iOS Typography */
.stat-value {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

/* iPad: Larger values */
@media (min-width: 768px) {
    .stat-value {
        font-size: 1.375rem;
        letter-spacing: -0.4px;
    }
}

/* iPhone: iOS standard sizing */
@media (max-width: 480px) {
    .stat-value {
        font-size: 1.125rem;
        letter-spacing: -0.2px;
    }
}

/* Stat Label - iOS Caption Style */
.stat-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
}

/* iPad: Better readability */
@media (min-width: 768px) {
    .stat-label {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
}

/* iPhone: iOS caption sizing */
@media (max-width: 480px) {
    .stat-label {
        font-size: var(--font-size-tertiary);
        letter-spacing: 0.6px;
    }
}

/* Form Row - iOS Side-by-Side Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .form-row {
        gap: 1.25rem;
    }
}

/* iPhone: Stack vertically for better usability */
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Compensation Fields - Smooth iOS Transitions */
.compensation-field {
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Employee Actions Section - iOS Design */
.employee-actions-section {
    display: flex;
    gap: 0.875rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-color);
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .employee-actions-section {
        gap: 1rem;
        margin-top: 2rem;
        padding-top: 2rem;
    }
}

/* iPhone: Stack vertically */
@media (max-width: 480px) {
    .employee-actions-section {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
}

/* Employee Action Button - iOS Secondary Button */
.btn-employee-action {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 50px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

/* iPad: Enhanced button */
@media (min-width: 768px) {
    .btn-employee-action {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 52px;
        border-radius: 14px;
    }
}

/* iPhone: Full width buttons */
@media (max-width: 480px) {
    .btn-employee-action {
        width: 100%;
        padding: 0.875rem 1.125rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }
}

@media (hover: hover) and (pointer: fine) {
.btn-employee-action:hover {
    transform: translateY(-2px);
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}
}


.btn-employee-action:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-employee-action i {
    font-size: var(--font-size-default);
    min-width: 22px;
    text-align: center;
    line-height: 1;
}

/* iPad: Larger icons */
@media (min-width: 768px) {
    .btn-employee-action i {
        font-size: 1.375rem;
        min-width: 24px;
    }
}

/* Delete Button - iOS Destructive Action */
.btn-delete-employee {
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

@media (hover: hover) and (pointer: fine) {
.btn-delete-employee:hover {
    background: rgba(252, 129, 129, 0.12);
    border-color: var(--accent-danger);
}
}


/* Mobile adjustments for employee modal */
@media (max-width: 480px) {
    .employee-stats-section {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }
    
    .stats-grid {
        gap: var(--spacing-sm);
    }
    
    .stat-card {
        padding: var(--spacing-sm);
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 1.125rem;
    }
    
    .stat-value {
        font-size: var(--font-size-base);
    }
    
    .stat-label {
        font-size: var(--font-size-tertiary);
    }
    
    .employee-actions-section {
        flex-direction: column;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-lg);
        padding-top: var(--spacing-lg);
    }
    
    .btn-employee-action {
        width: 100%;
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-base);
        min-height: 48px;
    }
    
    .btn-employee-action i {
        font-size: var(--font-size-default);
        min-width: 22px;
    }
    
    /* Employee item mobile optimizations */
    .employee-item {
        padding: var(--spacing-md);
    }
    
    .employee-info {
        padding: var(--spacing-sm) 0 var(--spacing-sm) var(--spacing-sm);
    }
    
    .employee-main-actions {
        min-width: 100px;
        padding: var(--spacing-sm);
    }
    
    .btn-clock-main {
        min-width: 100px;
        padding: var(--spacing-md);
    }
}

/* Shift Timer - Live timer for clocked-in employees */
.shift-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 12px;
    background: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.shift-timer i {
    color: var(--accent-primary);
    font-size: 1rem;
    min-width: 18px;
    text-align: center;
    animation: rotate-stopwatch 3s linear infinite;
}

.shift-timer .timer-text {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--accent-primary);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* Mobile: Larger shift timer */
@media (max-width: 480px) {
    .shift-timer {
        padding: var(--spacing-sm) var(--spacing-md);
        margin-top: var(--spacing-sm);
    }
    
    .shift-timer i {
        font-size: 1.125rem;
        min-width: 20px;
    }
    
    .shift-timer .timer-text {
        font-size: var(--font-size-base);
    }
}

@keyframes pulse-glow {
    0%, 100% {
    }
    50% {
    }
}

@keyframes rotate-stopwatch {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(20deg); }
    20% { transform: rotate(0deg); }
    30% { transform: rotate(-20deg); }
    40% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Payroll Summary Section */
/* Payroll Summary Section - iOS Card Design */
.payroll-summary-section {
    border-radius: 16px;
    padding: 1.75rem;
    margin-top: 2rem;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .payroll-summary-section {
        padding: 2rem;
        margin-top: 2.5rem;
        border-radius: 18px;
    }
}

/* iPhone: iOS standard card */
@media (max-width: 480px) {
    .payroll-summary-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
        border-radius: 14px;
    }
}

/* Light theme - swap colors so cards are lighter than background */
body.light-theme .labor-stat-card {
    background: var(--bg-card);
}

body.light-theme .employee-item {
    background: var(--bg-secondary);
}

body.light-theme #laborView .content-panel {
    background-color: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

/* Light theme - Financial controls */
body.light-theme .financial-select {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

@media (hover: hover) and (pointer: fine) {
body.light-theme .financial-select:hover {
    border-color: var(--accent-primary);
}
}


body.light-theme .financial-select:focus {
    border-color: var(--accent-primary);
}

/* Light theme - Financial view cards lighter */
body.light-theme .big-stat-card {
    background-color: var(--bg-card);
}

body.light-theme .job-card {
    background: var(--bg-card);
}

body.light-theme .job-progress .progress-bar-container {
    background: var(--border-color);
}

body.light-theme #financialView .content-panel {
    background-color: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

@media (hover: hover) and (pointer: fine) {
.payroll-summary-section:hover {
    transform: translateY(-2px);
}
}


/* Payroll Header - iOS Layout */
.payroll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .payroll-header {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }
}

/* iPhone: iOS standard spacing */
@media (max-width: 480px) {
    .payroll-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Payroll Label - Secondary text */
.payroll-label {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.payroll-label i {
    font-size: 1.125rem;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

/* Payroll Amount - Large display size for prominence */
.payroll-amount {
    font-size: var(--font-size-special);
    font-weight: 900;
    color: var(--accent-primary);
    line-height: 1.15;
}


/* Payroll Report Button */
.btn-payroll-report {
    width: 100%;
    /* Inherits all styles from base class */
}

/* Report Actions - iOS Design */
.report-actions {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-color);
}

/* iPad: Enhanced spacing */
@media (min-width: 768px) {
    .report-actions {
        margin-top: 2rem;
        padding-top: 2rem;
    }
}

/* iPhone: iOS standard spacing */
@media (max-width: 480px) {
    .report-actions {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
}

.report-ready {
    text-align: center;
    color: var(--accent-primary);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    font-size: 1rem;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

/* iPad: Larger text */
@media (min-width: 768px) {
    .report-ready {
        font-size: 1.0625rem;
        margin-bottom: 1.25rem;
    }
}

.report-ready i {
    font-size: 1.375rem;
    min-width: 24px;
    text-align: center;
    line-height: 1;
}

/* iPad: Larger icon */
@media (min-width: 768px) {
    .report-ready i {
        font-size: var(--font-size-special);
        min-width: 26px;
    }
}

.report-buttons {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
}
.report-buttons .btn-report-action,
.report-buttons .btn-archived-reports {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    margin-top: 0 !important;
    padding: 0.625rem 0.5rem !important;
    min-height: 52px !important;
    height: auto !important;
    align-self: stretch !important;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    font-size: var(--font-size-tertiary) !important;
    line-height: 1.2 !important;
    white-space: normal;
    text-align: center;
    border-radius: 12px !important;
}
.report-buttons .btn-report-action i,
.report-buttons .btn-archived-reports i {
    font-size: 1rem !important;
    min-width: unset !important;
    flex-shrink: 0;
}
.report-buttons .btn-report-action .btn-label,
.report-buttons .btn-archived-reports .btn-label {
    font-size: var(--font-size-tertiary) !important;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}
.report-buttons .btn-archived-reports .archive-count {
    font-size: var(--font-size-tertiary) !important;
    color: inherit;
    opacity: 0.7;
}

/* ================================
   SECONDARY BUTTONS - Download PDF, Save to Archive, etc.
   ================================ */

/* Base Style for ALL Secondary Labor Buttons - Apple iOS Standard */
.btn-labor-secondary,
.btn-report-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1rem 1.75rem;
    min-height: 52px;
    border-radius: 14px;
    font-weight: var(--font-weight-semibold);
    font-size: 17px !important;
    line-height: 1.3;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

/* Mobile: Slightly adjust padding only */
@media (max-width: 480px) {
    .btn-labor-secondary,
    .btn-report-action {
        padding: 0.875rem 1.5rem;
    }
}

/* Hover state - secondary buttons */
@media (hover: hover) and (pointer: fine) {
.btn-labor-secondary:hover,
.btn-report-action:hover {
    transform: translateY(-2px);
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}
}


/* Active state - secondary buttons */
.btn-labor-secondary:active,
.btn-report-action:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Color variants for secondary buttons */
.btn-labor-secondary.blue,
.btn-report-action.blue {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-labor-secondary.red,
.btn-report-action.red {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.btn-labor-secondary.purple,
.btn-report-action.purple {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

/* Icon color for colored variants */
.btn-labor-secondary.blue i,
.btn-labor-secondary.red i,
.btn-labor-secondary.purple i,
.btn-report-action.blue i,
.btn-report-action.red i,
.btn-report-action.purple i {
    color: white;
}

/* Archived Reports Button - Apple iOS Standard */
.btn-archived-reports {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    padding: 1rem 1.75rem;
    min-height: 52px;
    border-radius: 14px;
    margin-top: 1rem;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-tertiary);
    line-height: 1.3;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

/* Mobile: Slightly adjust padding only */
@media (max-width: 480px) {
    .btn-archived-reports {
        padding: 0.875rem 1.5rem;
    }
}

body:not(.light-theme) .btn-archived-reports {
    background: var(--bg-tertiary);
}

@media (hover: hover) and (pointer: fine) {
.btn-archived-reports:hover {
    transform: translateY(-2px);
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}
}


.btn-archived-reports:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.archive-count {
    color: var(--text-muted);
    font-weight: var(--font-weight-semibold);
}

/* Archived Reports List */
.archived-reports-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

.archived-report-item {
    background: var(--surface-secondary);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    gap: 16px;
}

@media (hover: hover) and (pointer: fine) {
.archived-report-item:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
}
}


.report-info {
    flex: 1;
    min-width: 0;
}

.report-title {
    font-weight: var(--font-weight-semibold);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.report-title i {
    color: var(--accent-primary);
    margin-right: 8px;
}

.report-meta {
    display: flex;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.report-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.report-meta i {
    opacity: 0.7;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-report-download {
    padding: 10px 18px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
.btn-report-download:hover {
    background: var(--accent-primary-dark);
    transform: scale(1.05);
}
}


.btn-report-download:active {
    transform: scale(0.98);
}

.btn-report-delete {
    padding: 10px 14px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
.btn-report-delete:hover {
    background: #dc2626;
    transform: scale(1.05);
}
}


.btn-report-delete:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .archived-report-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .report-actions {
        width: 100%;
    }
    
    .btn-report-download,
    .btn-report-delete {
        flex: 1;
        justify-content: center;
    }
}

/* Input with Prefix (for hourly rate) */
/* Input with Prefix - iOS Style */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
    font-size: 0.9375rem;
    pointer-events: none;
    z-index: 1;
}

/* iPad: Better prefix positioning */
@media (min-width: 768px) {
    .input-prefix {
        left: 1.125rem;
        font-size: 1rem;
    }
}

.input-with-prefix input {
    padding-left: 2rem !important;
}

/* iPad: Enhanced padding */
@media (min-width: 768px) {
    .input-with-prefix input {
        padding-left: 2.25rem !important;
    }
}

/* Employee History Modal */
.history-summary {
    display: flex;
    justify-content: space-between;
    background: var(--bg-primary);
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    gap: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.summary-label {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    font-weight: var(--font-weight-semibold);
    text-align: center;
}

.summary-value {
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    text-align: center;
}

.history-section h4 {
    font-size: var(--font-size-default);
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: var(--font-weight-semibold);
}

.history-list {
    padding-right: 8px;
}

.history-entry {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 6px;
    border: 1px solid var(--border-color);
    gap: 12px;
}

.history-date {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    min-width: 85px;
    text-align: center;
}

.history-shift {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.shift-times {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.shift-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shift-hours {
    color: var(--text-secondary);
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-medium);
}

.shift-pay {
    color: var(--accent-green);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-action {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.event-time {
    font-size: var(--font-size-base);
    color: var(--text-muted);
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.history-empty i {
    color: var(--text-muted);
}

/* Mobile responsiveness for history modal */
@media (max-width: 768px) {
    .history-summary {
        flex-direction: column;
        gap: 12px;
    }
    
    .summary-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .history-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .history-date {
        min-width: auto;
        text-align: left;
        font-size: var(--font-size-base);
    }
    
    .history-shift {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .shift-summary {
        width: 100%;
        justify-content: flex-start;
    }
    
}

/* Desktop enhancements for labor tracker */
@media (min-width: 768px) {
    #laborView .content-panel {
        padding: 25px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    #laborView .view-title {
        margin-bottom: 25px;
    }
    
    .period-label {
        font-size: var(--font-size-base);
        margin-bottom: 10px;
    }
    
    .segmented-control {
        padding: 6px;
    }
    
    .segment-btn {
        padding: 14px 12px;
        font-size: var(--font-size-tertiary);
        min-height: 48px;
    }
    
    .labor-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .labor-stat-card {
        padding: 24px 20px;
    }
    
    .labor-stat-card .stat-value {
        font-size: var(--font-size-special);
    }
    
    .labor-stat-card .stat-label {
        font-size: var(--font-size-tertiary);
        margin-bottom: 14px;
    }
    
    /* Button styles now handled by standardized .btn-add-employee base class */
    
    /* Tablet: Slightly larger buttons and text */
    .btn-clock-main i {
        font-size: var(--font-size-special);
    }
    
    .btn-clock-main span {
        font-size: var(--font-size-tertiary);
    }
    
    /* Removed - handled by main styles */
    
    .report-buttons {
        flex-direction: row;
    }
    
    .btn-report-action {
        flex: 1;
    }
}

/* Extra small mobile (iPhone SE, etc) */
@media (max-width: 375px) {
    .labor-tab {
        padding: 12px 8px;
        font-size: var(--font-size-tertiary);
        min-height: 65px;
    }
    
    .labor-tab i {
        font-size: var(--font-size-default);
    }
    
    .labor-stat-card {
        padding: 16px 12px;
    }
    
    .labor-stat-card .stat-value {
        font-size: var(--font-size-special);
    }
    
    .labor-stat-card .stat-label {
        font-size: var(--font-size-tertiary);
        margin-bottom: 10px;
    }
    
    /* Button styles now handled by standardized .btn-add-employee base class */
    
    .segment-btn {
        padding: 10px 6px;
        font-size: var(--font-size-secondary);
        min-height: 42px;
    }
    
    /* Small mobile optimizations */
    .employee-name {
        font-size: var(--font-size-secondary);
    }
    
    .employee-details {
        font-size: var(--font-size-tertiary);
    }
    
    .employee-stats {
        gap: 6px;
    }
    
    .employee-hours,
    .employee-earnings {
        font-size: 0.75rem;
    }
    
    .employee-main-actions {
        min-width: 90px;
        padding: 6px;
    }
    
    .btn-clock-main {
        min-height: 70px;
        font-size: var(--font-size-tertiary);
    }
    
    .btn-clock-main i {
        font-size: 1.2rem;
    }
    
    .btn-clock-main span {
        font-size: var(--font-size-tertiary);
    }
    
    .btn-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }
    
    .employee-dropdown-menu {
        top: 44px;
        min-width: 160px;
    }
    
    .employee-dropdown-menu .menu-item {
        padding: 14px 18px;
        font-size: var(--font-size-secondary);
    }
    
    /* Removed - handled by main styles */
}

/* ========================================
   FLOATING BOTTOM MENU (NEW)
   ======================================== */

/* Floating Bottom Menu Container */
.floating-bottom-menu {
    position: fixed;
    bottom: calc(6px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, calc(100vw - 40px));
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    height: 56px;
    background: rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    z-index: 1000;
}

body.light-theme .floating-bottom-menu {
    background: rgba(148, 163, 184, 0.25);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

/* Morphing Background Shape - Performance Optimized */
.menu-background-shape {
    position: absolute;
    height: 44px;
    background: var(--accent-green);
    border-radius: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Optimized transitions - only animate essential properties */
    transition: 
        left 0.25s ease-out,
        width 0.25s ease-out;
    /* Enable hardware acceleration */
    will-change: left, width;
    /* Force GPU layer */
    transform: translateY(-50%) translateZ(0);
}

/* Sausage stretch state during transition - Performance Optimized */
.menu-background-shape.stretching {
    transition: 
        left 0.15s ease-out,
        width 0.15s ease-out;
    will-change: left, width;
}

body.light-theme .menu-background-shape {
    background: var(--accent-green);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Removed expensive hover effects for better performance */

/* Menu Buttons */
.floating-bottom-menu .menu-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.6, 1);
    position: relative;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    z-index: 1;
    opacity: 0.9;
}

.floating-bottom-menu .menu-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-bottom-menu .menu-btn:active {
    transform: none;
    transition: all 0.1s ease-out;
}

.floating-bottom-menu .menu-btn.active {
    color: #86efac;
    font-size: 18px;  /* Keep same size as inactive */
    transform: none;   /* Remove scale effect */
    opacity: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}

body.light-theme .floating-bottom-menu .menu-btn {
    color: #000000;
    opacity: 0.85;
}

body.light-theme .floating-bottom-menu .menu-btn.active {
    color: #059669;
    opacity: 1;
}

/* Center button (Dashboard/Plus) - smooth icon crossfade */
.floating-bottom-menu .menu-btn.center-btn {
    font-size: var(--font-size-special);
}

.floating-bottom-menu .center-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
}

.floating-bottom-menu .center-icon-wrap i {
    position: absolute;
    transition: opacity 0.25s ease;
}

.floating-bottom-menu .center-btn.plus-mode .center-icon-plus {
    opacity: 1;
}
.floating-bottom-menu .center-btn.plus-mode .center-icon-home {
    opacity: 0;
    pointer-events: none;
}
.floating-bottom-menu .center-btn:not(.plus-mode) .center-icon-plus {
    opacity: 0;
    pointer-events: none;
}
.floating-bottom-menu .center-btn:not(.plus-mode) .center-icon-home {
    opacity: 1;
}

/* Home icon - stays same size when active */
.floating-bottom-menu .menu-btn.center-btn.active .center-icon-home {
    font-size: var(--font-size-special);
}

/* Plus icon - gets smaller when active */
.floating-bottom-menu .menu-btn.center-btn.active .center-icon-plus {
    font-size: 18px;
}

.floating-bottom-menu .menu-btn.center-btn:active {
    transform: none;
    transition: all 0.1s ease-out;
}

.floating-bottom-menu .menu-btn.center-btn.active:active {
    transform: none;
    transition: all 0.1s ease-out;
}

.floating-bottom-menu .center-btn .center-icon-wrap i {
    transition: opacity 0.25s ease;
}

/* Notification badge */
.floating-bottom-menu .notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: none;
    pointer-events: none;
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.floating-bottom-menu .menu-btn.active .notification-badge {
    top: 2px;
    right: 2px;
    transform: none;  /* Remove scale effect */
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.6, 1);
}

/* User flow "New" badge on floating bottom menu */
.floating-bottom-menu .user-flow-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    margin-left: 0;
    padding: 0.15rem 0.35rem;
    font-size: 0.5625rem;
    border-radius: 4px;
}
.floating-bottom-menu .menu-btn.active .user-flow-badge.visible {
    background: rgba(255,255,255,0.35);
    color: #fff;
}

/* Remove scale effects for labor button only */
.floating-bottom-menu .menu-btn.labor-btn:active {
    transform: none;
    transition: all 0.1s ease-out;
}

.floating-bottom-menu .menu-btn.labor-btn.active {
    color: #86efac;
    font-size: 18px;  /* Same as inactive on mobile */
    transform: none;  /* Remove scale(1.1) */
    opacity: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Light theme - remove scale effects for labor button */
body.light-theme .floating-bottom-menu .menu-btn.labor-btn:active {
    transform: none;
}

body.light-theme .floating-bottom-menu .menu-btn.labor-btn.active {
    color: #059669;
    font-size: 18px;  /* Same as inactive on mobile */
    transform: none;  /* Remove scale(1.1) */
    opacity: 1;
}

/* Hide old floating button if it still exists */
.floating-add-btn {
    display: none !important;
}

/* iPad and larger screens - Make floating menu bigger */
@media (min-width: 769px) {
    .floating-bottom-menu .menu-btn {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    
    .floating-bottom-menu .menu-btn.center-btn {
        font-size: 28px;
    }
    
    .floating-bottom-menu .menu-btn.center-btn.active .center-icon-home {
        font-size: 28px;
    }
    
    .floating-bottom-menu .menu-btn.center-btn.active .center-icon-plus {
        font-size: 22px;
    }
    
    .floating-bottom-menu .menu-btn.active {
        font-size: 22px;
    }
    
    /* Labor button specific for iPad */
    .floating-bottom-menu .menu-btn.labor-btn {
        font-size: 22px;
    }
    
    .floating-bottom-menu .menu-btn.labor-btn.active {
        font-size: 22px;
    }
    
    body.light-theme .floating-bottom-menu .menu-btn.labor-btn.active {
        font-size: 22px;
    }
    
    .floating-bottom-menu {
        height: 64px;
        padding: 0 12px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Floating Bottom Menu - Reduce bottom distance on mobile */
    .floating-bottom-menu {
        bottom: 0px;
        margin-bottom: env(safe-area-inset-bottom);
    }
    
    /* Settings Cards Mobile */
    .settings-card-header {
        padding: 1rem;
        gap: 0.75rem;
        /* Keep flex-direction: row to keep toggles side-by-side */
    }
    
    .settings-card-info {
        flex: 1;
        min-width: 0; /* Allow text to wrap */
    }
    
    .settings-card-text h4 {
        font-size: var(--font-size-secondary);
    }
    
    .settings-card-text p {
        font-size: var(--font-size-secondary);
    }
    
    .setting-btn {
        padding: 0.75rem 1rem;
        font-size: var(--font-size-secondary);
    }
    
    .toggle-switch {
        flex-shrink: 0;
    }
    
    .settings-category-title {
        font-size: var(--font-size-secondary);
    }
    
    .settings-category-title i {
        font-size: var(--font-size-secondary);
    }
}

@media (max-width: 480px) {
    .settings-content {
        gap: 1.5rem;
    }
    
    .settings-card {
        border-radius: 12px;
    }
    
    .settings-card-header {
        padding: 1rem;
    }
    
    .settings-card-info {
        gap: 0.75rem;
    }
    
    .settings-card-info i {
        font-size: var(--font-size-secondary);
    }
}

/* Light theme - white text & icons on colored job site items */
body.light-theme .job-site-item.in-progress,
body.light-theme .job-site-item.upcoming,
body.light-theme .job-site-item.on-hold,
body.light-theme .job-site-item.completed {
    color: #ffffff !important;
}

body.light-theme .job-site-item.in-progress .job-site-name,
body.light-theme .job-site-item.in-progress .job-site-client,
body.light-theme .job-site-item.in-progress .job-site-address,
body.light-theme .job-site-item.in-progress .job-site-description,
body.light-theme .job-site-item.in-progress .status-badge,
body.light-theme .job-site-item.in-progress i,
body.light-theme .job-site-item.upcoming .job-site-name,
body.light-theme .job-site-item.upcoming .job-site-client,
body.light-theme .job-site-item.upcoming .job-site-address,
body.light-theme .job-site-item.upcoming .job-site-description,
body.light-theme .job-site-item.upcoming .status-badge,
body.light-theme .job-site-item.upcoming i,
body.light-theme .job-site-item.on-hold .job-site-name,
body.light-theme .job-site-item.on-hold .job-site-client,
body.light-theme .job-site-item.on-hold .job-site-address,
body.light-theme .job-site-item.on-hold .job-site-description,
body.light-theme .job-site-item.on-hold .status-badge,
body.light-theme .job-site-item.on-hold i,
body.light-theme .job-site-item.completed .job-site-name,
body.light-theme .job-site-item.completed .job-site-client,
body.light-theme .job-site-item.completed .job-site-address,
body.light-theme .job-site-item.completed .job-site-description,
body.light-theme .job-site-item.completed .status-badge,
body.light-theme .job-site-item.completed i {
    color: #ffffff !important;
}

/* Status cards white text (both themes) */
.status-card.upcoming,
.status-card.on-hold,
.status-card.completed {
    color: #ffffff !important;
}

.status-card.upcoming .status-count,
.status-card.upcoming .status-label,
.status-card.on-hold .status-count,
.status-card.on-hold .status-label,
.status-card.completed .status-count,
.status-card.completed .status-label {
    color: #ffffff !important;
}


/* ============================================
   SPLASH SCREEN
   ============================================ */

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Always white so launch matches native splash and looks same in light/dark theme */
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20000 !important; /* Higher than auth modal */
    opacity: 1;
    transition: opacity 0.5s ease-out;
    
    /* Make completely non-interactive */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Language Switching Overlay */
.language-switching-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.language-switching-overlay.active {
    display: flex;
    opacity: 1;
}

.language-switch-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    animation: scaleIn 0.3s ease-out;
}

.language-switch-icon {
    font-size: 4.5rem;
    color: #4ade80;
    animation: pulse 1.5s ease-in-out infinite;
}

.language-switch-text h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Loading circles for language switch - override default styles */
.language-switching-overlay .loading-circles {
    opacity: 1;
    animation: none;
    transform: translateY(0);
    margin-top: 0.5rem;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.splash-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
    
    /* Make non-interactive */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 1s ease-out 0.5s forwards;
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    
    /* Make non-interactive */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.splash-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1;
}

.splash-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.app-title {
    font-family: var(--font-family-sans);
    font-size: 2.2rem;
    font-weight: var(--font-weight-semibold);
    margin: 0;
    color: #4a5568;
    letter-spacing: -0.5px;
    text-align: left;
    line-height: 1.2;
    
    /* Make non-interactive */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.rotating-subtitle {
    font-family: var(--font-family-sans);
    font-size: 0.95rem;
    font-weight: var(--font-weight-regular);
    color: #718096;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    height: 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-top: 4px;
    
    /* Make non-interactive */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.subtitle-word {
    position: absolute;
    left: 0;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subtitle-word.active {
    opacity: 1;
    transform: translateY(0);
}

.loading-circles {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.8s ease-out 1.2s forwards;
    
    /* Make non-interactive */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.loading-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite both;
    
    /* Make non-interactive */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.circle-1 {
    background: #4ade80; /* Mint green */
    animation-delay: 0s;
}

.circle-2 {
    background: #f87171; /* Coral pink */
    animation-delay: 0.3s;
}

.circle-3 {
    background: #fb923c; /* Warm orange */
    animation-delay: 0.6s;
}

/* Dashboard Skeleton Loader */
.skeleton-job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    overflow: hidden;
    position: relative;
}

.skeleton-job-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: skeletonShimmer 1.5s infinite;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-line {
    height: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-line.title {
    width: 60%;
    height: 1.3rem;
}

.skeleton-line.subtitle {
    width: 45%;
    height: 0.9rem;
}

.skeleton-line.address {
    width: 70%;
    height: 0.9rem;
}

.skeleton-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.skeleton-badge {
    width: 80px;
    height: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-actions {
    display: flex;
    gap: 0.5rem;
}

.skeleton-action-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

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

/* Grid layout for skeleton on tablets and above */
@media (min-width: 768px) {
    .skeleton-job-item {
        margin-bottom: 0;
        flex-direction: column;
        align-items: flex-start;
        min-height: 200px;
        padding: 1.25rem;
        justify-content: space-between;
    }
    
    .skeleton-content {
        width: 100%;
    }
    
    .skeleton-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: auto;
    }
}

/* Job Card Skeleton Loader (financial view) */
.skeleton-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: skeletonShimmer 1.5s infinite;
}

.skeleton-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.625rem;
    gap: 0.75rem;
}

.skeleton-card-header .skeleton-line.title {
    width: 55%;
    height: 1.1rem;
    margin-bottom: 0.5rem;
}

.skeleton-card-header .skeleton-line.address {
    width: 75%;
    height: 0.85rem;
}

.skeleton-card-amount {
    width: 70px;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-card-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-card-stats {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.skeleton-card-stat {
    flex: 1;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@media (min-width: 768px) {
    .skeleton-card {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .skeleton-card {
        padding: 0.875rem;
        border-radius: 12px;
    }
}

/* Light theme: skeleton placeholders and shimmer visible on light background */
body.light-theme .skeleton-line,
body.light-theme .skeleton-badge,
body.light-theme .skeleton-action-btn {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .skeleton-job-item::before {
    background: transparent;
}

body.light-theme .skeleton-card {
    background: var(--bg-card);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .skeleton-card::before {
    background: transparent;
}

body.light-theme .skeleton-card-amount,
body.light-theme .skeleton-card-progress,
body.light-theme .skeleton-card-stat {
    background: rgba(0, 0, 0, 0.08);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .splash-icon {
        width: 70px;
        height: 70px;
    }
    
    .app-title {
        font-size: var(--font-size-special);
    }
    
    .rotating-subtitle {
        font-size: var(--font-size-tertiary);
    }
}

/* Save Photo Options Modal - Must be above canvas (z-index 20001) */
.save-photo-modal {
    z-index: 25000 !important;
    justify-content: center !important;
    align-items: center !important;
    background: rgba(0, 0, 0, 0.85) !important;
}

.save-photo-modal .modal-content {
    max-width: 480px;
    width: 90%;
    border-radius: 20px;
    height: auto;
    max-height: 85vh;
    background-color: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: none;
}

body.light-theme .save-photo-modal .modal-content {
    background-color: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.save-photo-modal .modal-body {
    padding: 1.5rem;
}

.save-photo-modal .modal-body p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.save-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.save-option {
    display: block;
    cursor: pointer;
    position: relative;
}

.save-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
.save-option:hover .option-content {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
}
}


.save-option input[type="radio"]:checked + .option-content {
    background: var(--accent-green);
    border-color: var(--accent-primary);
}

.option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: var(--font-size-default);
    color: var(--text-icons);
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
.save-option:hover .option-icon {
    transform: scale(1.1);
}
}


.save-option input[type="radio"]:checked + .option-content .option-icon {
    background: #1a202c;
    color: var(--accent-primary);
}

.option-text {
    flex: 1;
}

.option-title {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-default);
    color: var(--text-primary);
    margin-bottom: 6px;
}

.save-option input[type="radio"]:checked + .option-content .option-title {
    color: #1a202c;
}

.option-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

.save-option input[type="radio"]:checked + .option-content .option-description {
    color: #2d3748;
}

.option-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: var(--accent-success);
    color: #1a202c;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.option-check {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--border-color);
    transition: all 0.3s ease;
}

.save-option input[type="radio"]:checked + .option-content .option-check {
    color: #1a202c;
    transform: scale(1.2);
}

.save-photo-modal .modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    border-top: 1px solid var(--border-color);
}

.save-photo-modal .modal-footer .btn {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-semibold);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .save-photo-modal .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .option-content {
        padding: 1.25rem;
        gap: 0.875rem;
    }
    
    .option-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 1.2rem;
    }
    
    .option-title {
        font-size: var(--font-size-base);
    }
    
    .option-description {
        font-size: var(--font-size-secondary);
    }
    
    .save-photo-modal .modal-footer .btn {
        padding: 0.875rem 1rem;
    }
}



/* Quick Actions Menu - CSS transitions */
.quick-actions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    -webkit-transition: visibility 0s 0.35s;
    transition: visibility 0s 0.35s;
}

.quick-actions-overlay.active,
.quick-actions-overlay.quick-actions-closing {
    visibility: visible;
}

.quick-actions-overlay.active {
    background: rgba(0, 0, 0, 0.5);
    -webkit-transition: background 0.3s ease;
    transition: background 0.3s ease;
}

.quick-actions-overlay.quick-actions-closing {
    background: rgba(0, 0, 0, 0);
    -webkit-transition: background 0.3s ease, visibility 0s 0.35s;
    transition: background 0.3s ease, visibility 0s 0.35s;
}

.quick-actions-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Explicit sans stack: overlay was historically outside <body> on some builds */
.quick-actions-overlay {
    font-family: var(--font-family-sans);
}

.quick-actions-sheet {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
    padding: 0;
    -webkit-transform: translateY(100%);
    transform: translateY(100%);
    -webkit-transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 100001;
}

.quick-actions-overlay.active .quick-actions-sheet {
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

.quick-actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.quick-actions-header h3 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.quick-actions-header button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
}

@media (hover: hover) and (pointer: fine) {
.quick-actions-header button:hover {
    background: var(--bg-secondary);
    transform: scale(1.05);
}
}


.quick-actions-body {
    padding: 0.875rem 1rem 1.5rem 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

/* Quick Actions Trigger Button - reference layout (detail modal) */
#quickActionsBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.quick-action-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-normal);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 70px;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
.quick-action-btn:hover,
.quick-action-btn:active {
    background: var(--bg-tertiary);
    transform: scale(1.02);
}
}


.quick-action-btn i {
    font-size: var(--font-size-default);
    width: auto;
    flex-shrink: 0;
    color: var(--accent-green);
}

.quick-action-btn--spending i {
    color: var(--accent-red);
}

.quick-action-btn span {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-tertiary);
    line-height: 1.2;
    word-break: break-word;
    display: block;
    color: inherit;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .quick-actions-header {
        padding: 0.875rem 1rem;
    }
    
    .quick-actions-header h3 {
        font-size: var(--font-size-secondary);
    }
    
    .quick-actions-header button {
        width: 28px;
        height: 28px;
        font-size: var(--font-size-secondary);
        min-width: 28px;
        min-height: 28px;
    }
    
    .quick-actions-body {
        padding: 0.75rem 0.75rem 1.25rem 0.75rem;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .quick-action-btn {
        padding: 0.625rem 0.375rem;
        min-height: 65px;
        gap: 0.25rem;
    }
    
    .quick-action-btn i {
        font-size: var(--font-size-base);
    }
    
    .quick-action-btn span {
        font-size: var(--font-size-tertiary);
        line-height: 1.1;
    }
}

/* ================================================
   ANNOUNCEMENTS / NEWS & UPDATES VIEW
   ================================================ */

.announcements-container {
    padding: 0.5rem 0;
}

.announcements-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
    gap: 1rem;
}

.announcements-loading i {
    font-size: 1.5rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.announcements-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
}

.announcements-empty i {
    font-size: 2.5rem;
    color: var(--text-secondary);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.announcements-empty h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-default);
}

.announcements-empty p {
    color: var(--text-secondary);
    max-width: 260px;
    font-size: var(--font-size-secondary);
    opacity: 0.8;
}

.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Individual Announcement Card - Clean minimal style */
.announcement-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: none;
    transition: background 0.15s ease;
    position: relative;
}

.announcement-card:active {
    background: var(--bg-tertiary);
}

/* Type indicator - subtle left accent */
.announcement-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    border-radius: 0 3px 3px 0;
    opacity: 0.8;
}

.announcement-card.type-news::before {
    background: #3b82f6;
}

.announcement-card.type-update::before {
    background: #8b5cf6;
}

.announcement-card.type-alert::before {
    background: #f59e0b;
}

.announcement-card.type-maintenance::before {
    background: #6b7280;
}

.announcement-card.type-feature::before {
    background: #10b981;
}

.announcement-card-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Icon - smaller and cleaner */
.announcement-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.announcement-card.type-news .announcement-icon {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.announcement-card.type-update .announcement-icon {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.announcement-card.type-alert .announcement-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.announcement-card.type-maintenance .announcement-icon {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.announcement-card.type-feature .announcement-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.announcement-card-title {
    flex: 1;
    min-width: 0;
}

.announcement-card-title h4 {
    font-size: var(--font-size-secondary);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.announcement-card-title .announcement-date {
    font-size: var(--font-size-tertiary);
    color: var(--text-secondary);
    opacity: 0.7;
}

.announcement-card-body {
    padding-left: calc(36px + 0.875rem);
}

.announcement-card-body p {
    color: var(--text-secondary);
    font-size: var(--font-size-tertiary);
    line-height: 1.5;
    margin: 0 0 0.875rem 0;
}

.announcement-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.announcement-card-actions .btn-primary {
    padding: 0.5rem 0.875rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: opacity 0.15s ease;
}

.announcement-card-actions .btn-primary:active {
    opacity: 0.8;
}

.announcement-card-actions .btn-dismiss {
    padding: 0.5rem 0.875rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: color 0.15s ease;
}

.announcement-card-actions .btn-dismiss:active {
    color: var(--text-primary);
}

/* Priority - subtle indicators */
.announcement-card.priority-high::before {
    height: 32px;
}

.announcement-card.priority-urgent::before {
    height: 100%;
    top: 0;
    transform: none;
    border-radius: 0;
    background: #ef4444;
}

/* Announcements Actions Footer */
.announcements-actions {
    display: flex;
    justify-content: center;
    padding: 1.5rem 1rem;
    margin-top: 0.5rem;
}

.announcements-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-medium);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.announcements-actions .btn-secondary:active {
    background: var(--bg-tertiary);
}

/* Light theme */
body.light-theme .announcement-card {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .announcement-card:active {
    background: rgba(0, 0, 0, 0.06);
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .announcement-card {
        padding: 0.875rem 1rem;
    }
    
    .announcement-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.875rem;
    }
    
    .announcement-card-body {
        padding-left: calc(32px + 0.875rem);
    }
}

/* ============================================
   iOS GPU Performance Optimizations
   Keeps glass aesthetic while reducing GPU load
   ============================================ */
@supports (-webkit-touch-callout: none) {
    /* Reduce backdrop-filter blur on iOS (still visible, less GPU intensive) */
    .header,
    .bottom-nav {
        backdrop-filter: blur(8px) saturate(120%) !important;
        -webkit-backdrop-filter: blur(8px) saturate(120%) !important;
    }
    /* Side menu: no blur on iOS so slide runs at 60fps (blur kills frame rate during animation) */
    .side-menu {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(31, 41, 55, 0.97) !important;
    }
    body.light-theme .side-menu {
        background-color: #ffffff !important;
    }
    
    /* Lighter blur for dropdown and modals */
    .status-dropdown,
    .modal-content {
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
    
    /* Disable continuous animations on iOS */
    .pulse,
    [class*="pulse"] {
        animation: none !important;
    }
    /* Exception: task summary donut pulse is one-shot, not continuous */
    .task-summary-chart.donut-pulse {
        -webkit-animation: donut-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
        animation: donut-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }
    
    /* Reduce will-change usage (iOS handles these poorly) */
    * {
        will-change: auto !important;
    }
    
    /* Limit "transition: all" - only allow specific properties */
    *:not(.modal):not(.modal-content):not(.side-menu) {
        transition-property: opacity, transform, background-color !important;
        transition-duration: 0.15s !important;
    }
    /* Exception: side menu - GPU layer + full -webkit- prefix (Capacitor iOS guide) */
    .side-menu {
        -webkit-transform: translateX(-100%) translateZ(0) !important;
        transform: translateX(-100%) translateZ(0) !important;
        -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        will-change: transform !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
    }
    .side-menu.active {
        -webkit-transform: translateX(0) translateZ(0) !important;
        transform: translateX(0) translateZ(0) !important;
    }
    /* Exception: task summary donut segments animate arc length/position */
    .donut-segment {
        transition-property: stroke-dasharray, stroke-dashoffset !important;
        transition-duration: 0.6s !important;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    /* Exception: task checkbox and checklist checkbox animate on toggle */
    .task-checkbox,
    .task-checkbox::after,
    .checklist-checkbox {
        transition-property: opacity, transform, background-color, border-color !important;
        transition-duration: 0.2s !important;
        transition-timing-function: ease !important;
    }
    /* Exception: task-details expand/collapse animated via JS in toggleTaskDetails */
    .task-details-panel.active .task-list {
        -webkit-transition: none !important;
        transition: none !important;
    }
    .task-details-header {
        -webkit-transition: transform 0.2s ease !important;
        transition: transform 0.2s ease !important;
    }
    /* Exception: list-group expand/collapse animated via JS in toggleListGroup */
    .list-task-items {
        -webkit-transition: none !important;
        transition: none !important;
    }
    .list-group-header {
        -webkit-transition: background 0.2s ease, transform 0.2s ease !important;
        transition: background 0.2s ease, transform 0.2s ease !important;
    }
    /* Exception: photo viewer open/close fade + scale animation */
    .photo-viewer {
        -webkit-transition: opacity 0.3s ease, visibility 0s linear 0.3s, -webkit-transform 0.3s ease !important;
        transition: opacity 0.3s ease, visibility 0s linear 0.3s, transform 0.3s ease !important;
    }
    .photo-viewer.active {
        -webkit-transition: opacity 0.3s ease, visibility 0s linear 0s, -webkit-transform 0.3s ease !important;
        transition: opacity 0.3s ease, visibility 0s linear 0s, transform 0.3s ease !important;
    }
}

/* Task Summary Modal */
.task-summary-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--content-padding);
    width: 100%;
}

.task-summary-chart {
    position: relative;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
}

@-webkit-keyframes donut-pulse {
    0%, 100% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
    50% {
        -webkit-transform: scale(1.08);
        transform: scale(1.08);
        opacity: 0.92;
    }
}
@keyframes donut-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.92;
    }
}

.task-summary-chart.donut-pulse {
    -webkit-animation: donut-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: donut-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.donut-chart {
    width: 100%;
    height: auto;
    transform: rotate(-90deg);
}

.donut-segment {
    stroke-dasharray: 502.65;
    stroke-dashoffset: 502.65;
    transition: stroke-dasharray 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut-bg {
    stroke: var(--bg-tertiary);
    stroke-dashoffset: 0;
}

.donut-overdue {
    stroke: #fc8181;
}

.donut-due-soon {
    stroke: #f6ad55;
}

.donut-upcoming {
    stroke: var(--accent-green);
}

.donut-completed {
    stroke: #38a169;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.total-tasks-count {
    font-size: 44px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.total-tasks-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-secondary);
    margin-top: 2px;
}

.task-summary-legend {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
}

.legend-section {
    display: flex;
    flex-direction: column;
}

.task-summary-legend .legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--content-padding);
    background: var(--bg-tertiary);
    border-radius: var(--card-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
.legend-item:hover {
    transform: translateX(4px);
}
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.overdue-color {
    background: #fc8181;
}

.due-soon-color {
    background: #f6ad55;
}

.upcoming-color {
    background: var(--accent-green);
}

.completed-color {
    background: #38a169;
}

.legend-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: var(--spacing-sm);
}

.legend-label {
    font-size: var(--font-size-tertiary);
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    flex: 1;
}

.legend-count {
    font-size: var(--font-size-tertiary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 8px;
    min-width: 32px;
    text-align: center;
}

.legend-chevron {
    font-size: var(--font-size-secondaryallest);
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.legend-section:has(.legend-task-list.active) .legend-chevron {
    transform: rotate(180deg);
}

.legend-task-list {
    height: 0;
    overflow: hidden;
    opacity: 0;
}

.legend-task-list.active {
    height: auto;
    overflow: visible;
    opacity: 1;
    padding-top: var(--spacing-xs);
}

/* Light theme - Task Summary */
body.light-theme .task-summary-legend .legend-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

body.light-theme .legend-count {
    background: var(--border-color);
    color: var(--text-primary);
}

body.light-theme .donut-bg {
    stroke: var(--border-color);
}

/* Reduced motion preference - disable all animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .shape {
        display: none !important;
    }
}

/* Task rows: hide job-site chip on phones/small layouts.
   .task-item .list-task-job uses display:flex elsewhere; !important is required to override. */
@media (max-width: 768px) {
    .list-task-job {
        display: none !important;
    }
}
