/* Global Styles - Modern Job Management System */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --accent-primary: #495057;
    --accent-secondary: #6c757d;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #0dcaf0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #212529;
    --bg-secondary: #343a40;
    --bg-tertiary: #495057;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-muted: #6c757d;
    --border-color: #495057;
    --accent-primary: #adb5bd;
    --accent-secondary: #868e96;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-secondary) var(--bg-tertiary);
}

/* Particles Background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: auto;
}

/* Ensure all main content has positive z-index above particles */
.main-layout {
    position: relative;
    z-index: 1;
}

.header {
    position: relative;
    z-index: 10;
}

.main-content {
    position: relative;
    z-index: 1;
}

/* Layout */
.container {
    max-width: 1660px; /* Increased from 1200px */
    margin: 0 auto;
    padding: 0 20px;
}

.main-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    box-shadow: 0 2px 4px var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

/* Navigation */
.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.user-dropdown-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-secondary);
}

.user-dropdown-toggle:focus,
.user-dropdown-toggle.active {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.2);
}

.user-icon {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.username {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.user-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1000;
    min-width: 220px;
    display: none;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.user-dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 8px 8px 0 0;
}

.user-dropdown-header .user-greeting {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
    font-weight: 500;
}

.user-dropdown-header .user-role {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-dropdown-greeting {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    text-decoration: none;
}

.user-dropdown-item:hover {
    background: var(--bg-secondary);
}

.user-dropdown-item:focus {
    background: var(--bg-secondary);
    outline: none;
}

.user-dropdown-item:first-of-type {
    border-radius: 0;
}

.user-dropdown-item:last-of-type {
    border-radius: 0 0 8px 8px;
}

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger:hover,
.user-dropdown-item.danger:focus {
    background: rgba(220, 53, 69, 0.1);
}

.user-dropdown-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.user-dropdown-item.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: auto;
}

.user-dropdown-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.user-dropdown-item:hover .user-dropdown-icon {
    opacity: 1;
}

.theme-toggle-dropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.theme-toggle-dropdown:hover {
    background: var(--bg-secondary);
}

.theme-toggle-switch {
    width: 40px;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    position: relative;
    transition: background-color 0.2s ease;
}

.theme-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

[data-theme="dark"] .theme-toggle-switch {
    background: var(--accent-primary);
}

[data-theme="dark"] .theme-toggle-switch::after {
    transform: translateX(20px);
}

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

/* Keyframe animations for user dropdown */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile navigation toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

.main-content {
    flex: 1;
    padding: 32px 0;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 8px var(--shadow-hover);
}

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

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 40px;
    min-width: 0;
}

input[type="date"],
input[type="time"],
input[type="number"] {
    min-width: 80px;
}

textarea {
    min-width: 120px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.1);
}

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

.form-row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Mobile Bootstrap form-control overrides */
.entry-row .form-control {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    text-align: center !important;
    margin: 0 !important;
}

/* Special padding for mobile select elements */
.entry-row select.form-control {
    padding: 7px 8px 9px 8px !important;
}

.entry-row select.form-control {
    font-weight: 500 !important;
    line-height: 18px !important;
    padding: 7px 8px 9px 8px !important;
}

.entry-row textarea.form-control {
    height: auto !important;
    min-height: 60px !important;
    max-height: none !important;
    line-height: 1.4 !important;
    text-align: left !important;
}

/* Additional override for form-select class that may have min-height: 40px */
.entry-row .form-select {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 5px 8px 11px 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

/* Work Entries Header Styling */
.work-entries-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.work-entries-header h2 {
    margin: 0;
}

.work-entries-header .btn {
    flex-shrink: 0;
}

/* Utility Classes */
.d-flex {
    display: flex;
}

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

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

.gap-2 {
    gap: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* Date input specific styling */
.date-input-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center; /* Center align the date content */
}

.date-picker {
    max-width: 100px;
    position: relative;
    z-index: 1;
    text-align: center; /* Center the date text */
}

/* Date text input styling */
.date-text-input {
    font-family: monospace;
    text-align: center;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.date-text-input:invalid {
    border-color: var(--danger) !important;
}

.date-text-input:valid {
    border-color: var(--success);
}

/* Hide date picker icon while maintaining functionality */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hidden date picker for popup functionality */
.hidden-date-picker {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

.date-display {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.8;
    font-weight: 500;
}

/* Time input 24-hour format styling - consolidated */
input[type="time"], .time-input {
    /* Sizing and alignment */
    max-width: 80px;
    text-align: center;
    font-family: monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    
    /* Force 24-hour format in WebKit browsers using English (UK) locale */
    -webkit-locale: "en-GB" !important;
      /* Ensure proper padding and styling */
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    
    /* Enable click anywhere to open picker */
    position: relative;
}

/* Hide only AM/PM selectors but keep the picker icon */
input[type="time"]::-webkit-datetime-edit-ampm-field,
input[type="time"]::-webkit-datetime-edit-meridiem-field {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide time picker icon while maintaining functionality */
input[type="time"]::-webkit-calendar-picker-indicator {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Style the individual time fields */
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

input[type="time"]::-webkit-datetime-edit-text {
    padding: 0 0.1em;
    color: var(--text-secondary);
}

input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
    background: transparent;
    border: none;
    padding: 0 0.1em;
    text-align: center;
    color: var(--text-primary);
}

/* Firefox specific 24-hour enforcement */
@-moz-document url-prefix() {
    input[type="time"] {
        appearance: textfield;
        -moz-appearance: textfield;
        text-align: center;
        font-family: monospace;
        /* Force Firefox to use 24-hour format */
        --moz-time-format: "24";
    }
}

/* Safari and WebKit specific fixes */
@supports (-webkit-appearance: none) {
    input[type="time"] {
        appearance: auto;
        -webkit-appearance: auto;
        -webkit-locale: "en-GB" !important;
    }
}

/* Enhanced WebKit 24-hour format enforcement */
input[type="time"]::-webkit-datetime-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Multiple layers of AM/PM hiding for maximum compatibility */
input[type="time"]::-webkit-datetime-edit-ampm-field,
input[type="time"]::-webkit-datetime-edit-meridiem-field {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Additional AM/PM removal methods */
input[type="time"]::-webkit-datetime-edit-ampm-field {
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Chrome/Edge specific enhancements */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input[type="time"] {
        -webkit-locale: "en-GB" !important;
    }
}

/* Hide only AM/PM selectors while keeping the time picker functional */
input[type="time"]::-webkit-datetime-edit-ampm-field,
input[type="time"]::-webkit-datetime-edit-meridiem-field {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

/* Force 24-hour format for data-format="24" inputs */
input[type="time"][data-format="24"] {
    -webkit-locale: "en-GB" !important;
}

/* Additional 24-hour enforcement for English (UK) locale */
input[type="time"] {
    /* Set English (UK) locale for all time inputs to force 24-hour format */
    -webkit-locale: "en-GB" !important;
}

/* Cross-browser 24-hour format enforcement */
@supports (-webkit-appearance: none) {
    input[type="time"] {
        appearance: auto;
        -webkit-appearance: auto;
        -webkit-locale: "sk-SK" !important;
    }
}

/* Focus states for time inputs */
input[type="time"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

/* ============================================
   CUSTOM DATE AND TIME PICKER STYLES
   ============================================ */

/* Custom Date Picker */
.custom-date-picker {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 120px;
}

.custom-date-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-date-input:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 4px var(--shadow);
}

.custom-date-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.2);
}

.custom-date-input.has-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Date Picker Popup */
.date-picker-popup {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 99999;
    padding: 16px;
    display: none;
    min-width: 280px;
    width: max-content;
}

.date-picker-popup.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

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

/* Date Picker Header */
.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.date-picker-header button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 19px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.date-picker-header button:hover {
    background: var(--bg-secondary);
}

.date-picker-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 0;
}

.calendar-day {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.calendar-day:hover {
    background: var(--bg-secondary);
}

.calendar-day.other-month {
    color: var(--text-muted);
}

.calendar-day.selected {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

.calendar-day.today {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.calendar-day.today.selected {
    background: var(--accent-primary);
}

/* Custom Time Picker */
.custom-time-picker {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 90px;
}

.custom-time-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.custom-time-input:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 4px var(--shadow);
}

.custom-time-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.2);
}

.custom-time-input.has-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Time input validation states */
.custom-time-input:invalid {
    border-color: var(--danger);
    background-color: rgba(220, 53, 69, 0.1);
}

/* Time Picker Popup */
.time-picker-popup {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 99999;
    padding: 16px;
    display: none;
    min-width: 220px;
    width: max-content;
}

.time-picker-popup.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

/* Time Picker Controls */
.time-picker-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.time-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.time-control-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.time-control-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-control-button {
    width: 32px;
    height: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-control-button:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.time-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-align: center;
    min-width: 80px;
}

/* Separator */
.time-separator {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Action Buttons */
.picker-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.picker-btn {
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow);
}

.picker-btn.primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    font-weight: 600;
}

.picker-btn.primary:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px var(--shadow);
}

/* Responsive Design - Date/Time Picker Mobile */
@media (max-width: 768px) {
    .date-picker-popup,
    .time-picker-popup {
        /* Fixed positioning is handled by JavaScript */
        width: 90% !important;
        max-width: 320px !important;
        min-width: auto !important;
        margin: 0 !important;
        z-index: 99999 !important;
    }
    
    .calendar-day {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .time-display {
        font-size: 22px;
        padding: 16px;
    }
    
    .time-control-button {
        width: 36px;
        height: 28px;
        font-size: 14px;
    }
      .picker-btn {
        font-size: 15px;
        padding: 14px 16px;
        min-height: 44px;
    }
}

/* Dark theme specific adjustments */
[data-theme="dark"] .date-picker-popup,
[data-theme="dark"] .time-picker-popup {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .calendar-day.today {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .time-display {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Animation for closing */
.date-picker-popup.closing,
.time-picker-popup.closing {
    animation: fadeOutDown 0.2s ease forwards;
}

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

/* Custom Date Range Picker */
.custom-date-range-picker {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-date-range-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-date-range-input:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 4px var(--shadow);
}

.custom-date-range-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.2);
}

.custom-date-range-input.has-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Date Range Picker Popup */
.date-range-picker-popup {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 99999;
    padding: 16px;
    display: none;
    min-width: 280px;
    width: max-content;
}

.date-range-picker-popup.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

/* Date Range Picker Header */
.date-range-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.date-range-picker-header button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 19px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.date-range-picker-header button:hover {
    background: var(--bg-secondary);
}

.date-range-picker-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

/* Date Range Instruction */
.date-range-instruction {
    text-align: center;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    max-width: 260px;
    word-wrap: break-word;
    white-space: normal;
}

.instruction-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.3;
}

/* Range Selection Styling */
.calendar-day.range-start {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
    border-radius: 4px 0 0 4px;
}

.calendar-day.range-end {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
    border-radius: 0 4px 4px 0;
}

.calendar-day.range-start.range-end {
    border-radius: 4px;
}

.calendar-day.in-range {
    background: rgba(73, 80, 87, 0.2);
    color: var(--text-primary);
}

/* Dark theme adjustments for date range picker */
[data-theme="dark"] .date-range-picker-popup {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .calendar-day.in-range {
    background: rgba(173, 181, 189, 0.2);
}

/* Animation for closing date range picker */
.date-range-picker-popup.closing {
    animation: fadeOutDown 0.2s ease forwards;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .date-range-picker-popup {
        width: 90% !important;
        max-width: 320px !important;
        min-width: auto !important;
        margin: 0 !important;
        z-index: 99999 !important;
    }
    
    .date-range-instruction {
        font-size: 12px;
        padding: 6px;
    }
}

/* ============================================
   MODAL STYLES
   ============================================ */

/* Modal backdrop */
.modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal content */
.modal-content {
    background-color: var(--bg-primary);
    margin: auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px var(--shadow);
    animation: slideInDown 0.3s ease;
    position: relative;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Modal close button */
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

/* Modal body */
.modal-body {
    padding: 0 24px 24px 24px;
}

/* Modal footer */
.modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-top: 20px;
}

/* Modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
}

.modal.closing .modal-content {
    animation: slideOutUp 0.2s ease;
}

.modal.closing {
    animation: fadeOut 0.2s ease;
}

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

/* Mobile modal responsiveness */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        padding: 16px 16px 0 16px;
        margin-bottom: 16px;
    }
    
    .modal-body {
        padding: 0 16px 16px 16px;
    }
    
    .modal-title {
        font-size: 18px;
    }
}

/* Dark theme modal support */
[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-color: var(--border-color);
}

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

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

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

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

.btn-success:hover {
    background: #146c43;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: var(--danger);
    color: white;
    font-size: 1.1em;
    font-weight: 700;
    font-family: Arial, sans-serif;
}

.btn-danger:hover {
    background: #bb2d3b;
}

.btn-info {
    background: #0dcaf0;
    color: white;
    font-size: 1.1em;
    font-weight: 700;
    font-family: Arial, sans-serif;
}

.btn-info:hover {
    background: #31d2f2;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

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

.btn-success,
.btn-primary {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    line-height: 1;
}

/* Better icon appearance in small buttons */
.entry-row .btn-sm,
.item-row .btn-sm {
    text-align: center;
    line-height: 1;
}

/* Icon styling for buttons */
.btn-success .checkmark,
.btn-primary .checkmark {
    font-weight: 700;
    font-size: 1.1em;
}

/* Print Button Styling */
.btn[onclick="printJob()"] {
    background: var(--accent-primary) !important;
    color: var(--bg-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    height: 34px !important;
    min-height: 34px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

.btn[onclick="printJob()"]:hover {
    background: var(--accent-secondary) !important;
    border-color: var(--accent-secondary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow);
}

/* Attachments Button Styling - matching print button */
#attachmentsBtn {
    background: var(--accent-primary) !important;
    color: var(--bg-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    height: 32px !important;
    min-height: 32px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

#attachmentsBtn:hover {
    background: var(--accent-secondary) !important;
    border-color: var(--accent-secondary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow);
}

/* Modern Print Icon */
.print-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    position: relative;
    margin-right: 0;
    flex-shrink: 0;
}

.print-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2px;
    width: 10px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-bottom: none;
    border-radius: 1px 1px 0 0;
}

.print-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 14px;
    height: 6px;
    border: 1.5px solid currentColor;
    border-top: none;
    border-radius: 0 0 2px 2px;
    background: currentColor;
    opacity: 0.2;
}

/* Print button specific icon styling */
.btn[onclick="printJob()"] .print-icon {
    vertical-align: middle;
}

/* Print Settings Modal Styling */
#printSettingsModal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

#printSettingsModal .form-group label[for="printLogo"],
#printSettingsModal .form-group label[for="printColors"],
#printSettingsModal .form-group label[for="printTwoColumn"] {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

#printSettingsModal .form-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Print Preview Styles */
@media print {
    /* Hide everything except print content */
    body > *:not(.print-container) {
        display: none !important;
    }
    
    .print-container {
        display: block !important;
    }
    
    /* Reset margins for print */
    @page {
        margin: 0.5in;
    }
    
    /* Ensure proper page breaks */
    .section {
        page-break-inside: avoid;
    }
    
    .print-table {
        page-break-inside: auto;
    }
    
    .print-table thead {
        display: table-header-group;
    }
    
    .print-table tbody {
        display: table-row-group;
    }
    
    .print-table tr {
        page-break-inside: avoid;
    }
}

/* Mobile print button adjustments */
@media (max-width: 768px) {
    .d-flex.align-center.gap-2.mb-3 {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .d-flex.align-center.gap-2.mb-3 > button,
    .d-flex.align-center.gap-2.mb-3 > a {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .d-flex.align-center.gap-2.mb-3 > div {
        order: 1;
        text-align: center;
    }
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

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

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

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions .btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 600;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* Job Status Colors */
.status-open {
    background-color: rgba(25, 135, 84, 0.2);
    color: #0a3622;
    border: 1px solid rgba(25, 135, 84, 0.4);
}

.status-in_progress {
    background-color: rgba(255, 193, 7, 0.2);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.status-completed {
    background-color: rgba(25, 135, 84, 0.2);
    color: #0a3622;
    border: 1px solid rgba(25, 135, 84, 0.4);
}

.status-closed {
    background-color: rgba(108, 117, 125, 0.2);
    color: #495057;
    border: 1px solid rgba(108, 117, 125, 0.4);
}

/* Invoice Status Colors */
.status-draft {
    background-color: rgba(255, 193, 7, 0.2);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.status-sent {
    background-color: rgba(13, 202, 240, 0.2);
    color: #055160;
    border: 1px solid rgba(13, 202, 240, 0.4);
}

.status-paid {
    background-color: rgba(25, 135, 84, 0.2);
    color: #0a3622;
    border: 1px solid rgba(25, 135, 84, 0.4);
}

.status-cancelled {
    background-color: rgba(220, 53, 69, 0.2);
    color: #58151c;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

/* Quote Status Colors */
.status-accepted {
    background-color: rgba(25, 135, 84, 0.2);
    color: #0a3622;
    border: 1px solid rgba(25, 135, 84, 0.4);
}

.status-rejected {
    background-color: rgba(220, 53, 69, 0.2);
    color: #58151c;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.status-expired {
    background-color: rgba(108, 117, 125, 0.2);
    color: #495057;
    border: 1px solid rgba(108, 117, 125, 0.4);
}

/* Dark theme adjustments for status badges */
[data-theme="dark"] .status-open {
    background-color: rgba(25, 135, 84, 0.25);
    color: #198754;
}

[data-theme="dark"] .status-in_progress {
    background-color: rgba(255, 193, 7, 0.25);
    color: #ffc107;
}

[data-theme="dark"] .status-completed {
    background-color: rgba(25, 135, 84, 0.25);
    color: #198754;
}

[data-theme="dark"] .status-closed {
    background-color: rgba(108, 117, 125, 0.25);
    color: #adb5bd;
}

[data-theme="dark"] .status-draft {
    background-color: rgba(255, 193, 7, 0.25);
    color: #ffc107;
}

[data-theme="dark"] .status-sent {
    background-color: rgba(13, 202, 240, 0.25);
    color: #0dcaf0;
}

[data-theme="dark"] .status-paid {
    background-color: rgba(25, 135, 84, 0.25);
    color: #198754;
}

[data-theme="dark"] .status-cancelled {
    background-color: rgba(220, 53, 69, 0.25);
    color: #dc3545;
}

[data-theme="dark"] .status-accepted {
    background-color: rgba(25, 135, 84, 0.25);
    color: #198754;
}

[data-theme="dark"] .status-rejected {
    background-color: rgba(220, 53, 69, 0.25);
    color: #dc3545;
}

[data-theme="dark"] .status-expired {
    background-color: rgba(108, 117, 125, 0.25);
    color: #adb5bd;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.hidden { display: none; }

/* Text overflow handling */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.word-break {
    word-break: break-word;
    word-wrap: break-word;
}

/* Loading states */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

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

/* Job specific styles */
.job-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 16px;
}

@media (min-width: 1400px) {
    .job-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.job-entries,
.job-items,
.job-tasks {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 24px;
    border: 1px solid var(--border-color);
    min-width: 0;
    overflow: visible; /* Changed from hidden */
}

.entries-container {
    max-height: 750px;
    overflow-x: auto;
    overflow-y: visible; /* Allow popups to escape vertically */
    margin-bottom: 16px;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 8px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.entry-header {
    display: grid;
    grid-template-columns: 100px 3fr 80px 80px 50px 80px; /* Reduced people column from 60px to 50px */
    gap: 12px;
    padding: 8px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 14px;
    min-width: 600px;
    background: var(--bg-tertiary);
    border-radius: 4px 4px 0 0;
    align-items: center; /* Better vertical alignment */
}

.entry-row {
    display: grid;
    grid-template-columns: 100px 3fr 80px 80px 50px 80px; /* Reduced people column from 60px to 50px */
    gap: 12px;
    align-items: start;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    min-width: 600px;
    background: var(--bg-primary);
}

/* Override Bootstrap form-control styles for entry rows */
.entry-row .form-control {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Special padding for select elements to center text vertically */
.entry-row select.form-control {
    padding: 5px 8px 11px 8px !important;
}

.entry-row .form-control:focus {
    border-color: var(--accent-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1) !important;
}

.entry-row select.form-control {
    font-weight: 500 !important;
    text-align: center !important;
    line-height: 1 !important;
    padding: 5px 8px 11px 8px !important;
}

.entry-row textarea.form-control {
    height: auto !important;
    min-height: 60px !important;
    max-height: none !important;
    resize: vertical !important;
    line-height: 1.4 !important;
}

.entry-row:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

.entry-row:hover {
    background: var(--bg-secondary);
}

.entry-row input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.entry-row textarea {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.entry-row select{
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    text-align: center;
    width: 100%;
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.entry-row input:focus,
.entry-row select:focus,
.entry-row textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

.entry-row textarea {
    resize: vertical;
    min-height: 60px;
    height: auto;
    font-family: inherit;
    line-height: 1.4;
    align-self: stretch; /* Allow textarea to stretch slightly down */
}

.entry-row input[type="date"],
.entry-row .date-picker {
    max-width: 100px;
    position: relative;
    z-index: 1;
    text-align: center;
    font-weight: 500;
}

.entry-row input[type="time"],
.entry-row .time-input {
    max-width: 80px;
    position: relative;
    z-index: 1;
    text-align: center;
    font-weight: 500;
}

.entry-row input[type="number"] {
    max-width: 50px; /* Reduced from 60px to 50px */
    text-align: center;
    font-weight: 500;
}

.entry-row .d-flex {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.entry-row .btn-sm {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 28px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    text-align: center;
    line-height: 1;
}

/* Custom picker integration in job entry rows */
.entry-row .custom-date-field,
.entry-row .custom-time-field {
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    font-family: inherit;
}

.entry-row .custom-date-picker {
    max-width: 100px;
}

.entry-row .custom-time-picker {
    max-width: 80px;
}

.entry-row .custom-date-input,
.entry-row .custom-time-input {
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
}

/* Ensure custom picker popups appear above other elements in entry rows */
.entry-row .date-picker-popup,
.entry-row .time-picker-popup {
    z-index: 10000;
}

/* Entry row specific adjustments for custom pickers */
.entry-row .custom-date-input.has-value,
.entry-row .custom-time-input.has-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Job items styles */
/* Default styles for job-detail page */
.item-header {
    display: grid;
    grid-template-columns: 1fr 55px 60px 80px;
    gap: 12px;
    padding: 8px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 14px;
    min-width: 450px;
    background: var(--bg-tertiary);
    border-radius: 4px 4px 0 0;
    align-items: center;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr 55px 60px 80px;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    min-width: 450px;
}

.item-row:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

.item-row:hover {
    background: var(--bg-secondary);
}

.item-row input,
.item-row select,
.item-row textarea {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 0;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    line-height: 1.2;
    box-sizing: border-box;
    resize: none;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

/* Quote-specific overrides */
.quote-detail-page .item-header {
    grid-template-columns: 1fr 80px 80px 100px 100px;
}

.quote-detail-page .item-header:has(> div:nth-child(6)) {
    grid-template-columns: 1fr 80px 80px 100px 100px 60px;
}

.quote-detail-page .item-row {
    grid-template-columns: 1fr 80px 80px 100px 100px;
    align-items: start;
}

.quote-detail-page .item-row:has(> div:nth-child(6)) {
    grid-template-columns: 1fr 80px 80px 100px 100px 60px;
}

.quote-detail-page .item-row > div {
    align-self: start;
}

.quote-detail-page .item-row input,
.quote-detail-page .item-row select,
.quote-detail-page .item-row textarea {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 0;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    line-height: 1.2;
    box-sizing: border-box;
    resize: none;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.quote-detail-page .item-row input:focus,
.quote-detail-page .item-row select:focus,
.quote-detail-page .item-row textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

.quote-detail-page .item-row .d-flex {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.quote-detail-page .item-row .btn-sm {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 28px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    text-align: center;
    line-height: 1;
}

/* Hide number input spinner arrows for item amount fields */
.quote-detail-page .item-row input[type="number"]::-webkit-outer-spin-button,
.quote-detail-page .item-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quote-detail-page .item-row input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Shared item-row styles for both job-detail and quote-detail */
.item-row input:focus,
.item-row select:focus,
.item-row textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

.item-row .d-flex {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.item-row .btn-sm {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 28px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    text-align: center;
    line-height: 1;
}

/* Hide number input spinner arrows for item amount fields */
.item-row input[type="number"]::-webkit-outer-spin-button,
.item-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.item-row input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.total-hours {
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 6px;
    margin-top: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    max-width: 200px;
    margin-left: auto;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Job action buttons */
.job-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.job-actions .btn {
    font-size: 13px;
    padding: 8px 12px;
    text-align: center;
    min-width: auto;
}

/* Mobile job actions - consolidated below */

/* Responsive Design */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    .job-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Mobile navigation and layout - consolidated below */

/* Mobile layout overrides - CONSOLIDATED */

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    .dashboard-grid {
        gap: 0.75rem; /* Reduced gap */
        margin-bottom: 1rem; /* Reduced margin */
    }
    
    .dashboard-content {
        gap: 1rem;
    }
    .card {
        margin-bottom: 0.75rem; /* Reduced margin */
        padding: 0;
        border-radius: 8px;
    }
    
    .card-body {
        padding: 1rem;
    }
    .card-header {
        margin-bottom: 0.75rem;
        padding: 0.75rem !important; /* Uniform padding */
        text-align: center !important; /* Center header content */
    }
    
    .card-title {
        font-size: 1.1rem;
        margin: 0 0 0.5rem 0 !important; /* Add bottom margin */
        text-align: center !important; /* Center text on mobile */
        padding: 0 !important; /* Remove padding since we're centering */
    }
    
    /* Mobile table improvements */
    .table-container {
        border-radius: 6px;
        margin: 0;
    }
    
    .table-container .table th,
    .table-container .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .table-container .table th {
        font-size: 0.75rem;
        padding: 0.75rem 0.25rem;
    }
    /* Quick action buttons mobile optimization */
    .quick-actions-buttons .btn {
        padding: 0.875rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .quick-actions-buttons .btn span {
        font-size: 1rem;
    }
    /* User dropdown mobile optimization */
    .user-dropdown-toggle {
        padding: 10px 12px;
        font-size: 16px; /* Prevent iOS zoom */
        min-height: 44px; /* Apple's minimum touch target */
        touch-action: manipulation; /* Prevent double-tap zoom */
    }
    
    .user-dropdown-toggle .username {
        max-width: 80px;
    }
    .user-dropdown-menu {
        min-width: 200px;
        right: 0px; /* Changed from -10px to keep it within bounds */
        z-index: 1001 !important; /* Above mobile nav */
        box-shadow: 0 8px 24px var(--shadow-hover); /* More prominent shadow on mobile */
    }
    
    .user-dropdown-item {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 44px; /* Touch-friendly size */
        touch-action: manipulation;
    }
    
    .user-dropdown-header {
        padding: 14px 16px;
    }
    
    .theme-toggle-dropdown {
        padding: 14px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }
    
    .header {
        padding: 12px 0;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .card {
        padding: 12px;
    }
    .btn {
        padding: 12px;
        font-size: 14px;
    }
      .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 28px;
    }
    
    /* Override for header-actions buttons to maintain larger size */
    .header-actions .btn-sm {
        padding: 6px 12px !important;
        font-size: 14px !important;
        min-width: auto !important;
    }
    /* Stack entry/item rows on very small screens */
    .entry-header,
    .item-header {
        display: none;
    }
    
    .entries-container {
        margin: 0;
        padding: 0;
        border: none;
        background: transparent;
    }
    /* Item rows use mobile-friendly layout - quantity, unit, and actions in same row */
    .item-row {
        display: grid !important;
        grid-template-columns: 80px 70px 1fr !important;
        grid-template-areas: 
            "name name name"
            "quantity unit actions" !important;
        gap: 8px !important;
        min-width: auto !important;
        padding: 16px;
        margin-bottom: 12px;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
    }
    
    /* Assign grid areas to each container */
    .item-row .item-name-container {
        grid-area: name;
    }
    
    .item-row .item-quantity-container {
        grid-area: quantity;
    }
    
    .item-row .item-unit-container {
        grid-area: unit;
    }
    .item-row .item-actions-container {
        grid-area: actions;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    /* Ensure all inputs and selects in item rows are properly sized */
    .item-row input,
    .item-row select {
        width: 100%;
        height: 32px !important;
        min-height: 32px !important;
        padding: 6px;
        font-size: 14px !important;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        box-sizing: border-box;
    }
    
    /* Button styling for mobile */
    .item-row .btn-sm {
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 8px;
        font-size: 12px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    /* Entry rows use custom mobile grid layout */
    .entry-row {
        display: grid !important;
        grid-template-columns: 90px 65px 65px 1fr;
        grid-template-areas: 
            "date time-from time-to people"
            "description description description description"
            "buttons buttons buttons buttons";
        gap: 8px;
        margin: 0 0 12px 0 !important; /* Keep bottom margin for spacing between entries */
        padding: 16px !important;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 6px !important; /* Ensure rounded corners override desktop rules */
        min-width: auto !important;
    }
    
    /* Override desktop pseudo-selector rules for mobile */
    .entry-row:first-child,
    .entry-row:last-child {
        border-radius: 6px !important; /* All corners rounded in mobile */
        border-bottom: 1px solid var(--border-color) !important; /* Restore border */
    }
    
    /* Grid item positioning */
    .entry-row .date-input-container {
        grid-area: date;
    }
    .entry-row textarea {
        grid-area: description;
        width: 100% !important;
        margin: 0 !important;
        padding: 8px;
        box-sizing: border-box;
        font-size: 14px !important;
        font-family: inherit !important;
        line-height: 1.4;
    }
    .entry-row input[data-time-field="time_from"] {
        grid-area: time-from;
        margin: 0;
        padding: 8px;
        box-sizing: border-box;
        font-size: 14px !important;
        font-family: inherit !important;
        text-align: center;
        height: 34px;
    }
    
    .entry-row input[data-time-field="time_to"] {
        grid-area: time-to;
        margin: 0;
        padding: 8px;
        box-sizing: border-box;
        font-size: 14px !important;
        font-family: inherit !important;
        text-align: center;
        height: 34px;
    }
    
    .entry-row select {
        grid-area: people;
        margin: 0;
        padding: 8px;
        box-sizing: border-box;
        font-size: 14px !important;
        font-family: inherit !important;
        text-align: center;
        height: 34px;
    }
    .entry-row .d-flex {
        grid-area: buttons;
        justify-content: flex-end;
        margin: 0;
        flex-wrap: wrap;
        gap: 8px;
    }
    /* Date input within container */
    .entry-row .date-input-container input {
        width: 100%;
        margin: 0;
        padding: 8px;
        box-sizing: border-box;
        font-size: 14px !important;
        font-family: inherit !important;
        text-align: center;
        height: 34px;
    }
    
    /* Apply width and margin rules only to specific entry row children */
    .entry-row > .date-time-people-row,
    .entry-row > textarea,
    .entry-row > .d-flex,
    .item-row > * {
        width: 100%;
        max-width: none !important;
    }
    
    .entry-row > .date-time-people-row:last-child,
    .entry-row > textarea:last-child,
    .entry-row > .d-flex:last-child,
    .item-row > *:last-child {
        margin-bottom: 0;
    }
    
    .entry-row .btn-sm,
    .item-row .btn-sm {
        margin: 0;
        flex: 0 0 auto;
    }
    
    /* Add labels for mobile stacked layout */
    .entry-row input[type="date"]::before {
        content: "Date: ";
        font-weight: 600;
        color: var(--text-secondary);
    }
    
    /* Mobile labels for item fields */
    .item-row input[type="text"]::before {
        content: "Item: ";
        font-weight: 600;
        color: var(--text-secondary);
        display: block;
        margin-bottom: 4px;
    }
    
    .item-row input[type="number"]::before {
        content: "Quantity: ";
        font-weight: 600;
        color: var(--text-secondary);
        display: block;
        margin-bottom: 4px;
    }
    .item-row select::before {
        content: "Unit: ";
        font-weight: 600;
        color: var(--text-secondary);
        display: block;
        margin-bottom: 4px;
    }
    
    /* Job Actions for medium-small screens */
    .job-actions {
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .job-actions .btn {
        height: 34px;
        padding: 8px 10px;
        font-size: 11px;
        min-width: auto;
        flex: 0 1 auto;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .table-container .table th,
    .table-container .table td {
        padding: 0.5rem 0.125rem;
        font-size: 0.8rem;
    }
    .quick-actions-buttons {
        gap: 0.5rem;
    }
    
    .quick-actions-buttons .btn {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Job Actions for very small screens */
    .job-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .job-actions .btn {
        width: 100%;
        text-align: center;
        font-size: 11px;
        padding: 10px 8px;
        height: auto;
        min-height: 40px;
        line-height: 1.2;
    }
}

/* Enhanced date centering */
.date-input-container input[type="date"] {
    text-align: center;
    font-weight: 500;
}

/* Mobile date/time input styles - consolidated below */

/* Add Entry and Add Item Sections */
.add-entry-section,
.add-item-section {
    text-align: right;
}

/* Simplified add button styling */
.add-entry-section .btn,
.add-item-section .btn {
    height: 32px;
    padding: 8px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Improved + icon styling in add buttons */

.add-entry-section .btn:hover,
.add-item-section .btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.add-entry-section .btn:active,
.add-item-section .btn:active {
    background: var(--bg-primary);
}

.add-entry-section .btn:focus,
.add-item-section .btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.2);
}

/* Work Entry Separator */
.work-entry-separator {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
    border-radius: 1px;
}

/* Mobile add sections - consolidated below */

/* Simplified entry and item action buttons */
.entry-row .btn-sm,
.item-row .btn-sm {
    height: 30px;
    min-width: 30px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.entry-row .btn-sm:hover,
.item-row .btn-sm:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

/* Save/Update button styling */
.entry-row .btn-success,
.item-row .btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.entry-row .btn-success:hover,
.item-row .btn-success:hover {
    background: #146c43;
}

.entry-row .btn-primary,
.item-row .btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.entry-row .btn-primary:hover,
.item-row .btn-primary:hover {
    background: var(--accent-secondary);
}

/* Delete button styling - unified for all contexts */
.entry-row .btn-danger,
.item-row .btn-danger,
.work-summary-row .btn-danger,
.delete-entry-btn,
.btn-danger.btn-sm {
    background: var(--danger) !important;
    color: white !important;
    border: 1px solid var(--danger) !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    min-width: 32px !important;
    height: auto !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    font-family: inherit !important;
}

.entry-row .btn-danger:hover,
.item-row .btn-danger:hover,
.work-summary-row .btn-danger:hover,
.delete-entry-btn:hover,
.btn-danger.btn-sm:hover {
    background: #bb2d3b !important;
    border-color: #bb2d3b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.entry-row .btn-danger:active,
.item-row .btn-danger:active,
.work-summary-row .btn-danger:active,
.delete-entry-btn:active,
.btn-danger.btn-sm:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* FontAwesome icons in delete buttons */
.entry-row .btn-danger i,
.item-row .btn-danger i,
.work-summary-row .btn-danger i,
.delete-entry-btn i,
.btn-danger.btn-sm i {
    font-size: 0.75rem !important;
    margin-right: 0 !important;
    width: auto !important;
    color: inherit !important;
}

/* When button contains only an icon (no text), center it properly */
.entry-row .btn-danger:has(i:only-child),
.item-row .btn-danger:has(i:only-child),
.work-summary-row .btn-danger:has(i:only-child),
.delete-entry-btn:has(i:only-child),
.btn-danger.btn-sm:has(i:only-child) {
    padding: 8px !important;
    min-width: 32px !important;
    gap: 0 !important;
}

/* Button active states */
.entry-row .btn-sm:active,
.item-row .btn-sm:active {
    background: var(--bg-primary);
}

/* Simplified job action buttons */
.job-actions .btn {
    height: 32px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.job-actions .btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.job-actions .btn-warning {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
    font-weight: 600;
}

.job-actions .btn-warning:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.job-actions .btn-success {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.job-actions .btn-success:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Button focus states for accessibility */
.entry-row .btn-sm:focus,
.item-row .btn-sm:focus,
.job-actions .btn:focus,
.add-entry-section .btn:focus,
.add-item-section .btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.3);
}

/* Responsive adjustments for buttons - consolidated below */

/* Dashboard Layout - Mobile First Design */

/* Dashboard Stats Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Dashboard Content Layout */
.dashboard-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Quick Actions */
.quick-actions-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0;
}

.quick-actions-buttons .btn {
    width: 100%;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-actions-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

/* Card Body Styles */
.card-body {
    padding: 1rem;
}

/* ========================================
   TASKS AND NOTES CONTAINER STYLES
   ======================================== */

/* Tasks and Notes Container Layout */
.tasks-notes-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.task-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Ensure consistent button heights in task and note headers */
.task-header-actions .btn,
.card-header .btn {
    height: 32px;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tasks Container */
.tasks-container {
    max-height: 240px; /* Approximately 3 items at ~80px each */
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-secondary) var(--bg-tertiary);
}

.tasks-container::-webkit-scrollbar {
    width: 6px;
}

.tasks-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.tasks-container::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}

.tasks-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    min-height: 70px; /* Ensure consistent height */
}

.task-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.task-priority {
    width: 8px;
    height: 100%;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 40px;
}

.task-priority.low {
    background: #28a745; /* Green for low priority */
}

.task-priority.normal {
    background: #ffc107; /* Yellow for normal priority */
}

.task-priority.high {
    background: #dc3545; /* Red for high priority */
}

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

.task-description {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.task-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.task-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* Task action buttons - matching entry/item row button style */
.task-complete-btn,
.task-convert-btn,
.task-delete-btn {
    height: 34px;
    min-width: 34px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    text-align: center;
}

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

.task-complete-btn:hover {
    background: #146c43;
}

.task-convert-btn {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.task-convert-btn:hover {
    background: var(--accent-secondary);
}

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

.task-delete-btn:hover {
    background: #bb2d3b;
}

.task-complete-btn:active,
.task-convert-btn:active,
.task-delete-btn:active {
    transform: scale(0.95);
}

.task-complete-btn:focus,
.task-convert-btn:focus,
.task-delete-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.3);
}

/* Job Tasks Specific Styles */
.job-task-item {
    margin-bottom: 0.75rem;
}

.job-task-item.completed-task {
    opacity: 0.7;
    background: var(--bg-tertiary);
}

.job-task-item.completed-task:hover {
    opacity: 0.9;
}

.job-task-item .task-description {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tasks-container {
    max-height: 300px; /* Allow space for more tasks */
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-secondary) var(--bg-tertiary);
}

.tasks-container::-webkit-scrollbar {
    width: 6px;
}

.tasks-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.tasks-container::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}

.tasks-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.add-task-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Notes Container */
.notes-container {
    max-height: 300px; /* Approximately 3 items at ~80px each */
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-secondary) var(--bg-tertiary);
}

.notes-container::-webkit-scrollbar {
    width: 6px;
}

.notes-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.notes-container::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}

.notes-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.note-item {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    position: relative;
    min-height: 70px; /* Ensure consistent height */
}

.note-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.note-content {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    padding-right: 5rem; /* Increased to accommodate both buttons */
}

.note-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.note-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.note-edit-btn,
.note-delete-btn {
    height: 34px;
    min-width: 34px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    text-align: center;
}

.note-edit-btn {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.note-edit-btn:hover {
    background: var(--accent-secondary);
}

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

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

.note-edit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.3);
}

.note-delete-btn:hover {
    background: #bb2d3b;
}

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

.note-delete-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

/* Task History Modal Styles */
.task-history-container {
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-secondary) var(--bg-tertiary);
}

.task-history-container::-webkit-scrollbar {
    width: 6px;
}

.task-history-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.task-history-container::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}

.task-history-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.history-task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    opacity: 0.8;
    min-height: 70px;
}

.history-task-item .task-description {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Modal Form Styling - Match Existing Theme */
.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal input,
.modal select,
.modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 40px;
    font-family: inherit;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

.modal textarea {
    resize: vertical;
    min-height: 80px;
}

.modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Modal Improvements */
.modal-large {
    max-width: 800px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show,
.modal[style*="flex"] {
    display: flex;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Smaller empty state icons for tasks and notes containers */
.tasks-container .empty-state,
.notes-container .empty-state {
    padding: 1.5rem 1rem;
}

.tasks-container .empty-state-icon,
.notes-container .empty-state-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* Even smaller on mobile */
@media (max-width: 768px) {
    .tasks-container .empty-state,
    .notes-container .empty-state {
        padding: 1rem 0.5rem;
    }
    
    .tasks-container .empty-state-icon,
    .notes-container .empty-state-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Loading Container */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Table Container - Mobile Optimized */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin: 0;
}

.table-container .table {
    min-width: 600px;
    margin: 0;
    border: none;
}

.table-container .table th,
.table-container .table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-container .table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

/* Dashboard Card Header Mobile */
.dashboard-content .card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem !important; /* Uniform padding */
    text-align: center !important; /* Center header content */
}

.dashboard-content .card-header .btn {
    width: 100%;
    justify-content: center;
}

.dashboard-content .card-title {
    text-align: center !important; /* Center text on mobile */
    margin-bottom: 0.5rem !important; /* Add bottom margin */
    padding: 0 !important; /* Remove padding since we're centering */
}

/* Dashboard Card Body - Match Header Spacing */
.dashboard-content .card-body {
    padding: 0.75rem !important; /* Match header padding for consistent spacing */
}

/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    /* Prevent horizontal page scroll */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    .main-layout, .container, .header-content, .main-content {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Container and Layout */
    .container {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    /* Mobile Navigation */
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-toggle {
        display: flex;
        order: 2;
    }
    .nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        gap: 6px; /* Reduced from 8px */
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        padding: 4px; /* Further reduced from 8px */
        box-shadow: 0 4px 8px var(--shadow);
        z-index: 1000;
        margin: 0;
    }
    
    .nav.active,
    #mobileNav[style*="flex"] {
        display: flex !important;
    }
    /* Ensure user dropdown appears above mobile nav */
    .user-dropdown-menu {
        z-index: 1001 !important;
    }
    /* Force dropdown visibility on mobile - high specificity */
    .user-dropdown .user-dropdown-menu.show {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        position: fixed !important; /* Changed to fixed positioning */
        top: 60px !important; /* Position below header */
        right: 10px !important; /* Position from right edge of screen */
        left: auto !important;
        bottom: auto !important;
        z-index: 9999 !important; /* Very high z-index */
        background: var(--bg-primary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        box-shadow: 0 8px 24px var(--shadow-hover) !important;
        min-width: 200px !important;
        max-width: calc(100vw - 20px) !important;
        margin-top: 0 !important;
    }
    
    /* Ensure dropdown stays within viewport on mobile */
    .user-dropdown-menu {
        max-width: calc(100vw - 20px); /* Ensure it doesn't exceed viewport width */
    }
    
    .nav-link {
        padding: 8px 12px; /* Reduced from 10px to 8px */
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        width: 100%;
        font-size: 0.9rem; /* Slightly smaller text */
        margin: 0; /* Remove any default margins */
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .user-info {
        order: 3;
    }
    
    .logo {
        order: 1;
    }
    /* Dashboard Layout - Force Single Column */
    .dashboard-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important; /* Even smaller gap for ultra-compact layout */
        margin-bottom: 0.75rem !important; /* Reduced bottom margin further */
    }
    /* Respect JavaScript display:none for permissions (overrides the grid display) */
    .dashboard-grid[style*="display: none"] {
        display: none !important;
    }
    
    /* Tasks and Notes Container - Mobile Layout */
    .tasks-notes-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .task-header-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .task-header-actions .btn,
    .card-header .btn {
        width: 100%;
        justify-content: center;
        height: 32px !important;
        min-height: 32px !important;
        line-height: 1.2 !important;
    }
    .tasks-container,
    .notes-container {
        max-height: 200px; /* Slightly shorter on mobile */
    }
    
    .task-item,
    .note-item {
        padding: 0.5rem;
        min-height: 60px; /* Smaller min-height on mobile */
    }
    .task-meta {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        flex-wrap: wrap;
        font-size: 0.7rem;
    }
    
    .modal-large {
        max-width: 95% !important;
    }
    
    .modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 20px !important;
    }
    
    .dashboard-content {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Quick Actions - Force Stacking */
    .quick-actions-buttons {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .quick-actions-buttons .btn {
        width: 100% !important;
        text-align: center !important;
        padding: 0.875rem !important;
        font-size: 0.85rem !important;
    }
    /* Card Layout */
    .card {
        margin-bottom: 1rem;
        padding: 0;
        border-radius: 8px;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .card-body {
        padding: 0.75rem !important; /* Reduced from 1rem to match header spacing */
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1rem;
        padding: 0.75rem !important; /* Uniform padding all around */
        text-align: center !important; /* Center all header content */
    }
    
    .card-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card-title {
        font-size: 1.1rem;
        margin: 0 0 0.5rem 0 !important; /* Add bottom margin */
        text-align: center !important; /* Center text on mobile */
        padding: 0 !important; /* Remove padding since we're centering */
    }
    /* Table Container - Horizontal and Vertical Scrolling */
    .table-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 6px !important;
        border: 1px solid var(--border-color) !important;
        margin: 0 !important;
        display: block !important;
        position: relative !important;
    }
    .table-container .table {
        min-width: 800px !important;
        width: 800px !important;
        margin: 0 !important;
        border: none !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }
    .table-container .table th,
    .table-container .table td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .table-container .table th {
        font-size: 0.75rem !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Buttons and Form Elements */
    .btn {
        font-size: 14px;
        padding: 12px 16px;
    }
      .btn-sm {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 28px;
    }
    
    /* Override for header-actions buttons to maintain larger size */
    .header-actions .btn-sm {
        padding: 6px 12px !important;
        font-size: 14px !important;
        min-width: auto !important;
    }
    /* Job Actions */
    .job-actions {
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .job-actions .btn {
        height: 36px;
        padding: 8px 12px;
        font-size: 12px;
        min-width: auto;
        flex: 0 1 auto;
        white-space: nowrap;
    }
    /* Entry and Item Buttons */
    .entry-row .btn-sm,
    .item-row .btn-sm {
        height: 32px;
        min-width: 32px;
        padding: 0 6px;
        font-size: 14px !important;
        line-height: 1 !important;
        font-weight: 600 !important;
    }    /* Task action buttons - mobile sizing */
    .task-complete-btn,
    .task-convert-btn,
    .task-delete-btn {
        height: 32px !important;
        min-width: 32px !important;
        padding: 0 6px !important;
        font-size: 14px !important;
        line-height: 1 !important;
        font-weight: 600 !important;
    }
    
    /* Note delete button - mobile sizing */
    .note-delete-btn {
        height: 32px !important;
        min-width: 32px !important;
        padding: 0 6px !important;
        font-size: 14px !important;
        line-height: 1 !important;
        font-weight: 600 !important;
    }
    
    /* Form Layout */
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Date and Time Inputs */
    input[type="date"], 
    input[type="time"] {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px; /* Touch-friendly size */
        touch-action: manipulation;
    }
    
    
    .date-display {
        font-size: 13px;
        margin-top: 4px;
    }
    
    /* Add Sections */
    .add-entry-section,
    .add-item-section {
        text-align: center;
    }
    
    .add-entry-section .btn,
    .add-item-section .btn {
        height: 32px;
        padding: 0 8px;
        font-size: 11px;
    }
    
    .work-entry-separator {
        margin: 16px 0;
    }
    
    /* Job Layout */
    .job-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .job-entries,
    .job-items {
        padding: 16px;
        overflow: visible;
    }
    
    /* Entry container - keep horizontal scroll */
    .entries-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .entry-header,
    .entry-row {
        min-width: 600px;
    }
    
    .item-row {
        min-width: 500px;
        overflow-x: auto;
    }
    
    .total-hours {
        text-align: center;
        margin-left: 0;
        max-width: none;
    }
    .table-actions {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
    }
    
    .table-actions .btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        align-self: center;
    }
    /* Dashboard Stats Responsive Text - Ultra Compact Mobile */
    .dashboard-grid .card {
        padding: 0.5rem !important; /* Even smaller padding */
    }
    
    .dashboard-grid .card div[style*="font-size: 2rem"] {
        font-size: 1.3rem !important; /* Smaller stats numbers */
        margin: 0.15rem 0 !important; /* Minimal margins */
    }
    
    .dashboard-grid .card h3 {
        font-size: 0.75rem !important; /* Smaller titles */
        margin-bottom: 0.3rem !important; /* Reduced margin */
    }
    
    .dashboard-grid .card .text-muted {
        font-size: 0.65rem !important; /* Smaller description text */
        margin-top: 0.15rem !important; /* Minimal margin */
        line-height: 1.1 !important; /* Tighter line height */
    }
}

/* Tablet Responsive Design */
@media (min-width: 576px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .quick-actions-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .card-body {
        padding: 1rem; /* Slightly increased from mobile for better tablet spacing */
    }
}

/* Desktop Responsive Design */
@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .dashboard-content {
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }
    
    .quick-actions-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quick-actions-buttons .btn {
        padding: 1.25rem;
        font-size: 1rem;
    }
    .card-body {
        padding: 1.25rem; /* Reduced from 1.5rem for better proportion */
    }
    .dashboard-content .card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1rem; /* Proportional increase from mobile 0.75rem */
    }
    
    .dashboard-content .card-header .btn {
        width: auto;
    }
    
    .table-container .table {
        min-width: auto;
    }
    
    .table-container .table th,
    .table-container .table td {
        padding: 1rem;
    }
}

/* Large Desktop Responsive Design */
@media (min-width: 1200px) {
    .dashboard-grid {
        gap: 2rem;
    }
    
    .dashboard-content {
        gap: 2.5rem;
    }
    .card-body {
        padding: 1.5rem; /* Reduced from 2rem for better proportion with headers */
    }
}

/* Mobile table row hover effects */
@media (hover: hover) {
    .table tbody tr {
        transition: background-color 0.2s ease;
    }
    
    .table tbody tr:hover {
        background-color: var(--bg-secondary);
        cursor: pointer;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .table tbody tr:active {
        background-color: var(--bg-secondary);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .quick-actions-buttons .btn:active {
        transform: scale(0.95);
    }
    /* User dropdown touch optimizations */
    .user-dropdown-toggle:active {
        background: var(--bg-tertiary);
        border-color: var(--accent-primary);
        transform: scale(0.98);
    }
    
    .user-dropdown-item:active {
        background: var(--bg-secondary);
        transform: scale(0.98);
    }
    
    /* Remove hover states on touch devices */
    .user-dropdown-toggle:hover {
        background: none;
        border-color: var(--border-color);
    }
    
    .user-dropdown-item:hover {
        background: none;
    }
    
    /* Enhanced mobile positioning for very small screens */
    @media (max-width: 400px) {
        .user-dropdown-menu {
            position: fixed !important;
            top: 60px !important;
            right: 5px !important;
            left: 5px !important;
            width: auto !important;
            min-width: auto !important;
            max-width: none !important;
            z-index: 1001 !important;
        }
    }
}

/* Dashboard Visual Improvements */
.dashboard-grid .card {
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-hover);
}

.dashboard-grid .card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.dashboard-grid .card .text-muted {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Responsive text sizes for stats */
@media (max-width: 576px) {
    .dashboard-grid .card div[style*="font-size: 2rem"] {
        font-size: 1.75rem !important;
    }
    
    .dashboard-grid .card h3 {
        font-size: 0.9rem;
    }
    
    .dashboard-grid .card .text-muted {
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .dashboard-grid .card {
        padding: 0.4rem !important; /* Ultra-compact padding for tiny screens */
    }
    
    .dashboard-grid .card div[style*="font-size: 2rem"] {
        font-size: 1.1rem !important; /* Even smaller stats for tiny screens */
        margin: 0.1rem 0 !important;
    }
    
    .dashboard-grid .card h3 {
        font-size: 0.65rem !important; /* Smaller titles */
        margin-bottom: 0.25rem !important;
    }
    
    .dashboard-grid .card .text-muted {
        font-size: 0.6rem !important; /* Smaller description */
        margin-top: 0.1rem !important;
        line-height: 1.05 !important;
    }
    
    /* User dropdown for very small screens */
    .user-dropdown-toggle {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .user-dropdown-toggle .username {
        max-width: 60px;
    }
    
    .user-icon {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .user-dropdown-menu {
        min-width: 180px;
        right: -20px;
    }
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px var(--shadow);
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-suggestion {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    min-height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.highlighted {
    background-color: var(--bg-secondary);
}

.autocomplete-suggestion.create-new {
    background-color: var(--bg-secondary);
    color: white;
    font-weight: 500;
}

.autocomplete-suggestion.create-new:hover {
    background-color: var(--bg-tertiary);
}

.suggestion-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.suggestion-details {
    font-size: 12px;
    color: var(--text-muted);
}

/* Modal for new customer confirmation */
.customer-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.customer-confirm-content {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.customer-confirm-content h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.customer-confirm-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.customer-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* User Management Modal Styles */
.tab-navigation {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-bottom-color: #007bff;
}

.tab-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-primary);
}

.tab-content:not(.active) {
    display: none;
}

.users-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.users-list-header h3 {
    color: var(--text-primary);
    margin: 0;
}

/* Dark theme specific adjustments */
[data-theme="dark"] .tab-navigation {
    background: var(--bg-secondary);
}

[data-theme="dark"] .tab-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .tab-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-bottom-color: #4a9eff;
}

[data-theme="dark"] .tab-content {
    background: var(--bg-primary);
}

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

.nested-modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.nested-modal .modal-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nested-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.nested-modal .modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.nested-modal .modal-body {
    padding: 20px 24px 24px;
}

/* Table Styles for User List */
.table-responsive {
    overflow-x: auto;
    margin: 0 -4px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

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

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

.table-striped tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.table-striped tbody tr:nth-child(even):hover {
    background: var(--bg-tertiary);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-info {
    background: var(--info);
    color: white;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted) !important;
}

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

/* Button Variants */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

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

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-info {
    background: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.2);
    color: #0066cc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-info i {
    font-size: 18px;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: var(--danger);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95% !important;
        margin: 20px;
    }
    
    .nested-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }
}

/* ============================================
   ITEMS MODULE STYLES
   ============================================ */

/* Items Page Layout - Two Column Design */
.items-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    margin-top: 16px;
    height: calc(100vh - 200px);
    min-height: 600px;
}

/* Categories Section - Left Column */
.categories-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.categories-section .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.categories-section .card-header {
    padding: 20px 20px 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.categories-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 20px 20px;
}

/* Items Section - Right Column */
.items-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.items-section .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible; /* Allow content to scroll */
}

.items-section .card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.items-section .table-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for categories */
.categories-container::-webkit-scrollbar {
    width: 6px;
}

.categories-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.categories-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.categories-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

.categories-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Tree Structure for Categories */
.tree-item {
    margin-bottom: 2px;
}

.tree-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 36px;
}

.tree-content:hover {
    background: var(--bg-tertiary);
}

.tree-item.active .tree-content {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.tree-item.active .tree-content .tree-count {
    color: rgba(255, 255, 255, 0.8);
}

/* Tree Toggle Button */
.tree-toggle {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.tree-toggle:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.tree-toggle.expanded {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.tree-spacer {
    width: 20px;
    margin-right: 8px;
}

/* Tree Icons and Labels */
.tree-icon {
    margin-right: 8px;
    font-size: 14px;
}

.tree-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.tree-item.active .tree-label {
    color: var(--bg-primary);
    font-weight: 600;
}

.tree-count {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: 8px;
}

/* Tree Children (Subcategories) */
.tree-children {
    margin-left: 28px;
    border-left: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.tree-children.collapsed {
    max-height: 0;
    opacity: 0;
}

.tree-children.expanded {
    max-height: 1000px;
    opacity: 1;
}

/* Tree Connectors */
.tree-connector {
    position: absolute;
    left: -2px;
    top: 0;
    width: 16px;
    height: 18px;
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tree-connector.last {
    border-left: 1px solid var(--border-color);
    background: linear-gradient(to bottom, 
        transparent 0%, 
        transparent 17px, 
        var(--bg-secondary) 17px, 
        var(--bg-secondary) 100%);
}

.tree-connector::before {
    content: '';
    position: absolute;
    left: 1px;
    top: 17px;
    width: 14px;
    height: 1px;
    background: var(--border-color);
}

/* Sub-category specific styling */
.sub-category .tree-content {
    padding-left: 24px;
    position: relative;
}

.sub-category .tree-icon {
    font-size: 12px;
}

.sub-category .tree-label {
    font-size: 14px;
    font-weight: 400;
}

/* All Items Special Styling */
.all-items .tree-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.all-items.active .tree-content {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Category Actions in Header */
#categoryActions {
    border-left: 1px solid var(--border-color);
    padding-left: 12px;
    margin-left: 8px;
}

#categoryActions .btn {
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#categoryActions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow);
}

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

.items-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.items-search {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.items-search input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.items-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

.items-table-container {
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

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

.items-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

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

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

.item-actions {
    display: flex;
    gap: 6px;
}

.item-actions .btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 600;
}

/* Item/Category Form Modals */
.modal-form-grid {
    display: grid;
    gap: 16px;
}

.modal-form-grid.two-column {
    grid-template-columns: 1fr 1fr;
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.unit-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.unit-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.unit-option input[type="radio"] {
    margin: 0;
}

.unit-option.selected {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.unit-option.selected input[type="radio"] {
    accent-color: var(--bg-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Loading State */
.items-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive Design for Items Module */
@media (max-width: 1024px) {
    .items-layout {
        grid-template-columns: 250px 1fr;
        gap: 16px;
    }
    
    .categories-section,
    .items-section {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .items-layout {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 8px;
        min-height: calc(100vh - 160px);
    }
    
    .categories-section {
        order: 1;
        max-height: 40vh;
    }
    .categories-section .card-header {
        padding: 16px;
        text-align: left !important; /* Override global mobile center alignment */
    }
    
    .categories-container {
        padding: 8px 16px 16px 16px;
    }
    .items-section {
        order: 2;
        flex: 1;
        min-height: 0; /* Allow flex item to shrink */
    }
    
    .items-section .card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .items-section .card-header {
        padding: 16px;
        flex-shrink: 0;
    }
    
    .items-section .table-container {
        flex: 1;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        min-height: 0; /* Important for flex scrolling */
    }
    .table-container {
        min-height: 300px;
        max-height: none;
    }
    
    .modal-form-grid.two-column {
        grid-template-columns: 1fr;
    }
    
    .price-inputs {
        grid-template-columns: 1fr;
    }
    
    .unit-type-grid {
        grid-template-columns: 1fr;
    }
    
    .items-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .card-header .d-flex.justify-between.align-center {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .card-header .d-flex.align-center.gap-3 {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Keep category title and action buttons horizontal in mobile */
    .category-title-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100%;
    }
    
    .category-title-container h2 {
        margin: 0;
        flex: 1;
    }
    
    .category-title-container #categoryActions {
        margin-left: 12px;
        flex-shrink: 0;
    }
    
    #itemsSearch {
        width: 100% !important;
        margin-bottom: 8px;
    }
    #categoryActions {
        justify-content: flex-end;
        margin-bottom: 8px;
        border: none !important;
        padding: 0 !important;
        margin-left: 0 !important;
    }
    
    /* Tree structure mobile adjustments */
    .tree-children {
        margin-left: 20px;
    }
    
    .tree-toggle {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .tree-content {
        padding: 10px 8px;
    }
    
    .sub-category .tree-content {
        padding-left: 20px;
    }
    
    .tree-connector {
        width: 12px;
    }
    
    .tree-connector::before {
        width: 12px;
    }
    
    .items-search {
        flex-direction: column;
    }
    
    .items-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .items-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .categories-section {
        max-height: 35vh;
    }
    
    .categories-section .card-header,
    .items-section .card-header {
        padding: 12px;
    }
    
    .categories-container {
        padding: 8px 12px 12px 12px;
    }
    
    .table-container {
        min-height: calc(50vh - 80px);
    }
    
    .category-link,
    .subcategory-link {
        padding: 10px 12px;
    }
    
    .category-actions .btn {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .items-table th,
    .items-table td {
        padding: 8px;
        font-size: 13px;
    }
    
    /* Mobile header button layout */
    .d-flex.justify-between.align-center.mb-3 {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .d-flex.justify-between.align-center.mb-3 h1 {
        text-align: center;
        margin: 0;
        order: 1;
    }
    
    .d-flex.justify-between.align-center.mb-3 .d-flex.gap-2 {
        order: 2;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ============================================
   ITEM AUTOCOMPLETE STYLES
   ============================================ */

.item-name-container {
    position: relative;
    width: 100%;
}

.item-name-input {
    width: 100%;
}

.item-suggestions {
    position: fixed; /* Use fixed positioning like date/time pickers */
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 99999; /* High z-index like date/time pickers */
    max-height: 200px;
    overflow-y: auto;
    display: none;
    min-width: 200px; /* Ensure minimum width */
}

.item-suggestions.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.item-suggestions .autocomplete-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.item-suggestions .autocomplete-suggestion:last-child {
    border-bottom: none;
}

.item-suggestions .autocomplete-suggestion:hover,
.item-suggestions .autocomplete-suggestion.highlighted {
    background: var(--bg-secondary);
}

.item-suggestion-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.item-suggestion-details .unit-type {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.item-suggestion-details .price {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Responsive adjustments for item autocomplete */
@media (max-width: 768px) {
    .item-suggestions {
        max-height: 150px;
        z-index: 99999 !important; /* Use same high z-index as date/time pickers */
        box-shadow: 0 4px 12px var(--shadow);
        border-radius: 6px;
    }
    
    .item-suggestion-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ============================================
   JOB ATTACHMENTS STYLES
   ============================================ */

/* Header Actions Layout */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Header Actions Button Styling - Ensure consistent sizing */
.header-actions .btn {
    padding: 6px 12px !important;
    font-size: 14px !important;
    height: 32px !important;
    min-height: 32px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

.header-actions .btn-primary {
    background: var(--accent-primary) !important;
    color: var(--bg-primary) !important;
    font-weight: 600 !important;
}

/* Attachment Badge */
.attachment-badge {
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
}

/* Upload Area */
.attachment-upload-section {
    margin-bottom: 24px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 36px;
    opacity: 0.6;
}

.upload-text {
    color: var(--text-secondary);
}

.upload-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.upload-text p {
    margin: 0;
    font-size: 13px;
}

/* Upload Progress */
.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Attachments Section */
.attachments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.attachments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.attachments-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.view-btn:hover {
    background: var(--bg-tertiary);
}

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

/* Attachments Grid View */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.attachment-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.attachment-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.attachment-preview {
    position: relative;
    width: 100%;
    height: 120px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview .file-icon {
    font-size: 48px;
    opacity: 0.6;
}

.attachment-info {
    padding: 12px;
}

.attachment-filename {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.3;
}

.attachment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.attachment-size {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
}

.attachment-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.attachment-item:hover .attachment-actions {
    opacity: 1;
}

.attachment-action-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.attachment-action-btn:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.attachment-action-btn.delete {
    background: rgba(220, 53, 69, 0.9);
}

.attachment-action-btn.delete:hover {
    background: rgba(220, 53, 69, 1);
}

/* Attachments List View */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachments-list .attachment-item {
    display: flex;
    align-items: center;
    padding: 12px;
    height: auto;
}

.attachments-list .attachment-item-list {
    display: flex;
    align-items: center;
    padding: 12px;
    height: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.attachments-list .attachment-item-list:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow);
}

.attachments-list .attachment-preview {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

.attachments-list .attachment-icon {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.attachments-list .attachment-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.attachments-list .file-icon-small {
    font-size: 24px;
    opacity: 0.6;
    color: var(--text-secondary);
}

.attachments-list .attachment-info {
    flex: 1;
    padding: 0;
}

.attachments-list .attachment-details {
    flex: 1;
    cursor: pointer;
}

.attachments-list .attachment-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.3;
}

.attachments-list .attachment-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.attachments-list .attachment-actions {
    position: static;
    opacity: 1;
    margin-left: 12px;
    gap: 8px;
}

/* Image Preview Modal */
.image-modal {
    background: rgba(0, 0, 0, 0.95);
    z-index: 100001;
}

.image-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 80px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 100002;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 100002;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.image-prev {
    left: 30px;
}

.image-next {
    right: 30px;
}

.image-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.image-nav-btn:disabled:hover {
    transform: translateY(-50%);
}

#previewImage {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.image-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    max-width: 90%;
    backdrop-filter: blur(10px);
}

.image-filename {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
}

.image-details {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.image-counter {
    font-size: 12px;
    opacity: 0.9;
    color: #ccc;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 4px;
    margin-top: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .attachment-preview {
        height: 100px;
    }
      .upload-area {
        padding: 16px 12px;
    }
    
    .upload-icon {
        font-size: 30px;
    }
      .header-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    /* Ensure header-actions buttons maintain consistent sizing on mobile */
    .header-actions .btn {
        padding: 6px 12px !important;
        font-size: 14px !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .image-modal-content {
        padding: 40px 20px;
    }
    
    .image-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .image-prev {
        left: 10px;
    }
    
    .image-next {
        right: 10px;
    }
    
    .image-modal-close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .view-toggle {
        flex-direction: column;
        gap: 2px;
    }
    
    .view-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Job Tasks Full Width Layout Styles */
.job-tasks-full-width {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0; /* Removed padding since card-header/card-body will handle it */
    border: 1px solid var(--border-color);
    margin-bottom: 32px; /* Space before other sections */
    width: 100%;
}

.job-tasks-full-width .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.job-tasks-full-width .card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.job-tasks-full-width .task-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.job-tasks-full-width .card-body {
    padding: 20px 24px 24px 24px;
}

/* Invoice Detail Edit Mode Styles */
.invoice-field-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.invoice-field-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

.editable-supplier-form,
.editable-customer-form {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.editable-supplier-form .form-group,
.editable-customer-form .form-group {
    margin-bottom: 8px;
}

.editable-supplier-form .form-group:last-child,
.editable-customer-form .form-group:last-child {
    margin-bottom: 0;
}

.editable-supplier-form .form-group label,
.editable-customer-form .form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 3px;
}

.editable-supplier-form .form-row,
.editable-customer-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.editable-supplier-form .form-row:last-child,
.editable-customer-form .form-row:last-child {
    margin-bottom: 0;
}

.supplier-field-input,
.customer-field-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.supplier-field-input:focus,
.customer-field-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    outline: none;
    box-shadow: 0 0 0 1px rgba(73, 80, 87, 0.1);
}

.customer-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.customer-select:focus {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    outline: none;
    box-shadow: 0 0 0 1px rgba(73, 80, 87, 0.1);
}

.custom-vat-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-vat-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.custom-vat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.custom-vat-input:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    padding: 10px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Work View Controls */
.work-view-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.work-view-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.work-view-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.work-view-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

/* Work summary styles */
.work-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    background: var(--bg-primary);
    font-size: 14px;
}

.work-summary-row:last-child {
    border-bottom: none;
}

.work-summary-row:hover {
    background: var(--bg-tertiary);
}

.work-summary-header {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--accent-primary);
    border-radius: 4px 4px 0 0;
    font-size: 14px;
}

.work-summary-date-range {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Add border-radius to last summary row */
.work-summary-row:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

/* Dark theme adjustments */
[data-theme="dark"] .work-view-select {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Responsive adjustments for edit forms */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .custom-vat-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Dark theme adjustments for invoice editing */
[data-theme="dark"] .invoice-field-input,
[data-theme="dark"] .supplier-field-input,
[data-theme="dark"] .customer-field-input,
[data-theme="dark"] .customer-select,
[data-theme="dark"] .custom-vat-input {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .invoice-field-input:focus,
[data-theme="dark"] .supplier-field-input:focus,
[data-theme="dark"] .customer-field-input:focus,
[data-theme="dark"] .customer-select:focus,
[data-theme="dark"] .custom-vat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(173, 181, 189, 0.1);
}

/* Desktop: Side-by-side task layout with height limit */
@media (min-width: 768px) {
    .job-tasks-full-width .tasks-container {
        max-height: 200px; /* Show approximately 2 tasks */
        overflow-y: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 0;
    }
    
    .job-tasks-full-width .task-item {
        margin-bottom: 0; /* Remove margin since grid handles spacing */
    }
}

/* Mobile: Vertical layout, move to top but keep existing task styling */
@media (max-width: 767px) {
    .job-tasks-full-width {
        margin-bottom: 24px; /* Slightly less margin on mobile */
    }
    
    .job-tasks-full-width .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 16px 20px;
        text-align: center;
    }
    
    .job-tasks-full-width .card-title {
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .job-tasks-full-width .task-header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .job-tasks-full-width .card-body {
        padding: 16px 20px 20px 20px;
    }
    
    .job-tasks-full-width .tasks-container {
        max-height: 300px; /* Allow more space on mobile */
        overflow-y: auto;
        display: block; /* Single column on mobile */
    }
    
    .job-tasks-full-width .task-item {
        margin-bottom: 0.75rem; /* Keep original spacing on mobile */
    }
}

/* Mobile Attachments Button Section */
.mobile-attachments-section {
    display: none; /* Hidden by default (desktop) */
    margin-bottom: 1.5rem;
    gap: 8px;
}

.mobile-attachments-section .btn {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile responsive behavior */
@media (max-width: 768px) {
    /* Show mobile attachments button */
    .mobile-attachments-section {
        display: flex;
    }
    
    /* Hide desktop calculator and attachments buttons in header-actions */
    .header-actions button[onclick="openCableCalculator()"],
    .header-actions #attachmentsBtn {
        display: none !important;
    }
    
    /* Adjust note button height for mobile */
    .note-edit-btn,
    .note-delete-btn {
        height: 32px;
        min-width: 32px;
    }
}

/* Cable Calculator & Form Section Styles */
.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cable-action-btn {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.proportion-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 0;
}

.proportion-row {
    display: contents;
}

.proportion-row .form-group {
    margin: 0;
}

.proportion-separator,
.proportion-equals {
    font-size: 24px;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    padding: 0 4px;
}

.proportion-equals {
    color: #0066cc;
    font-size: 28px;
}

/* Responsive adjustments for calculator */
@media (max-width: 768px) {
    .proportion-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .proportion-separator,
    .proportion-equals {
        display: none;
    }
    
    .proportion-row .form-group {
        margin-bottom: 12px;
    }
}
