/* Enhanced Squire Enterprises CSS with Optimized UX Design */

:root {
    /* Distinct gradients for action variations */
    --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%); /* Vibrant blue */

    /* Complementary gradients */
    --secondary-gradient: linear-gradient(135deg, #8b4513 0%, #a0522d 100%); /* Warm brown */
    --success-gradient: linear-gradient(135deg, #198754 0%, #157347 100%); /* Classic green */
    --warning-gradient: linear-gradient(135deg, #daa520 0%, #ffd700 100%); /* Golden yellow */
    --info-gradient: linear-gradient(135deg, #0dcaf0 0%, #31d2f2 100%); /* Bright teal */
    --danger-gradient: linear-gradient(135deg, #8b4513 0%, #cd853f 100%); /* Rustic brown */

    /* Core colors */
    --primary-color: #0d6efd; /* Vibrant blue */
    --secondary-color: #3cb371; /* Medium sea green */
    --accent-color: #32cd32; /* Emerald accent */
    --warm-accent: #daa520; /* Golden accent */
    
    /* Background and surfaces */
    --background-color: #f8faf6; /* Very light sage */
    --card-background: #ffffff;
    --surface-light: #f1f5ec; /* Light sage */
    --surface-medium: #e8f0de; /* Medium sage */
    
    /* Text colors */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-on-primary: #ffffff;
    
    /* Border and shadows */
    --border-color: #d4d4aa; /* Sage border */
    --border-light: #e6e6c7; /* Lighter sage border */
    --shadow-sm: 0 1px 3px rgba(50, 205, 50, 0.1);
    --shadow-md: 0 4px 6px rgba(50, 205, 50, 0.1);
    --shadow-lg: 0 10px 25px rgba(50, 205, 50, 0.1);
    --shadow-xl: 0 20px 25px rgba(50, 205, 50, 0.15);
    
    /* Radius values */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Status colors */
    --success-color: #198754;
    --warning-color: #daa520;
    --danger-color: #8b4513;
    --info-color: #0dcaf0;
}

/* Base Styles */
body {
    background: var(--background-color);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

.contractor-logo {
    max-height: 160px;
    max-width: 100%;
    width: auto;
    height: auto;
}

/* Enhanced Admin Styles */
#header {
    background: var(--card-background) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#branding h1,
#branding h1 a {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 1.5rem;
}

#user-tools {
    background: var(--primary-gradient);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    margin: 8px;
}

#user-tools a,
#user-tools a:visited {
    color: white !important;
    font-weight: 500;
    text-decoration: none;
}

#user-tools a:hover {
    opacity: 0.8;
}

.module {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.module h2 {
    background: var(--primary-gradient);
    color: white;
    padding: 16px 20px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.module table {
    background: var(--card-background);
    border: none;
}

.module table th {
    background: var(--surface-light);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

.module table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.module table tbody tr:hover {
    background: var(--surface-light);
}

/* Modern Form Styles - FIXED VERSION */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
.form-select,
textarea {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff !important;  /* Force white background */
    color: #212529 !important;       /* Force dark text */
}

.form-control:focus,
input:focus,
select:focus,
.form-select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 42, 0.1);
    transform: translateY(-1px);
    background: #ffffff !important;  /* Maintain white background on focus */
    color: #212529 !important;       /* Maintain dark text on focus */
}

/* Small form controls */
.form-control-sm, 
.form-select-sm {
    font-size: 0.875rem;
    background-color: #ffffff !important;  /* Force white background */
    color: #212529 !important;             /* Force dark text */
    padding: 8px 12px;
}

.form-control-sm:focus,
.form-select-sm:focus {
    background-color: #ffffff !important;  /* Maintain white background on focus */
    color: #212529 !important;             /* Maintain dark text on focus */
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Modern Button Styles */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-warning {
    background: var(--warning-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-info {
    background: var(--info-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

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

/* Modern Card Design */
.card {
    background: var(--card-background);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

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

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Summary Cards with Gradients */
.summary-card {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.summary-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(74, 124, 42, 0.3);
}

.summary-card .card-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.summary-card .card-text {
    color: white;
    font-size: 32px;
    font-weight: 800;
}

/* Modern Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border: none;
    box-shadow: var(--shadow-lg);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contractor-name {
    font-weight: 700;
    background: var(--success-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--primary-gradient);
    color: white !important;
    transform: translateY(-1px);
}

/* Sidebar Navigation Styles */
.sidebar {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 25px 0;
    height: fit-content;
    position: sticky;
    top: 100px;
}

/* Estimate edit sidebar */
.estimate-sidebar {
    position: sticky;
    top: 80px;
    z-index: 900;
}

.sidebar-item {
    padding: 12px 25px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: #f8f9fa;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-item.active {
    background: var(--primary-gradient);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-item i {
    width: 20px;
    margin-right: 15px;
}

/* Top Navigation */
.top-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.search-bar {
    background: white;
    border-radius: 25px;
    padding: 8px 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    max-width: 400px;
}

.search-bar input {
    border: none;
    outline: none;
    flex: 1;
    padding: 5px 10px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quick Action Cards */
.quick-action-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
}

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

.quick-action-card.primary {
    background: var(--primary-gradient);
    color: white;
}

.quick-action-card.success {
    background: var(--success-gradient);
    color: white;
}

.quick-action-card.warning {
    background: var(--warning-gradient);
    color: white;
}

.quick-action-card.info {
    background: var(--info-gradient);
    color: white;
}

.quick-action-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* Modern Table Design */
.table {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: none;
    margin-bottom: 24px;
}

.table thead th {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody td {
    padding: 16px 12px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 14px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: var(--surface-light);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.table tbody tr:nth-child(even) {
    background: var(--surface-light);
}

.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

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

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

.alert-warning {
    background: var(--warning-gradient);
    color: white;
}

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

/* Dashboard Specific Styles */
.dashboard-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Action Button Groups */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.action-buttons .btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Input group styling */
.input-group-text {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 500;
}

/* Status colors for text elements */
.text-success {
    color: var(--success-color) !important;
}

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

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

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

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

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

/* Background colors for badges and other elements */
.bg-success {
    background: var(--success-gradient) !important;
    color: white !important;
}

.bg-warning {
    background: var(--warning-gradient) !important;
    color: white !important;
}

.bg-danger {
    background: var(--danger-gradient) !important;
    color: white !important;
}

.bg-info {
    background: var(--info-gradient) !important;
    color: white !important;
}

.bg-primary {
    background: var(--primary-gradient) !important;
    color: white !important;
}

.bg-secondary {
    background: var(--secondary-gradient) !important;
    color: white !important;
}

/* Progress bars */
.progress-bar {
    background: var(--success-gradient) !important;
}

.progress-bar.bg-warning {
    background: var(--warning-gradient) !important;
}

.progress-bar.bg-danger {
    background: var(--danger-gradient) !important;
}

.progress-bar.bg-info {
    background: var(--info-gradient) !important;
}

/* Badge styling */
.badge {
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge.bg-light {
    background: var(--surface-medium) !important;
    color: var(--text-primary) !important;
}

/* Job entry tag spacing */
.job-entry-tags .badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.job-entry-tags .badge:last-child {
    margin-right: 0;
}

/* Floating Action Buttons */

.floating-add {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(74, 124, 42, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-add:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(74, 124, 42, 0.4);
}

.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.floating-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 28px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.floating-btn.primary {
    background: var(--primary-gradient);
}

.floating-btn.success {
    background: var(--success-gradient);
}

.floating-btn.warning {
    background: var(--warning-gradient);
}

.floating-btn.info {
    background: var(--info-gradient);
}

/* Job entry action buttons spacing */
.job-entry-actions .btn {
    margin-right: 5px;
}

.job-entry-actions .btn:last-child {
    margin-right: 0;
}

/* Stats and Metrics */
.stats-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: none;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.metric-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    text-align: center;
    height: 100%;
    border: none;
    transition: all 0.3s ease;
}

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

.metric-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.metric-label {
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.metric-trend {
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Project and Activity Cards */
.project-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: none;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

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

.recent-activity {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.activity-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 14px;
}

.activity-icon.success {
    background: #d4edda;
    color: #155724;
}

.activity-icon.info {
    background: #cce5ff;
    color: #004085;
}

.activity-icon.warning {
    background: #fff3cd;
    color: #856404;
}

/* Timeline Styles */
.timeline-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 25px;
    margin-bottom: 20px;
}

.timeline-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #f1f3f5;
}

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

.timeline-date {
    width: 120px;
    flex-shrink: 0;
    text-align: center;
    color: #6c757d;
    font-weight: 600;
}

.timeline-content {
    flex-grow: 1;
    padding-left: 20px;
    border-left: 3px solid #e9ecef;
    margin-left: 10px;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
}

@media (max-width: 576px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-date {
        width: 100%;
        text-align: left;
        margin-bottom: 10px;
    }
    .timeline-content {
        border-left: none;
        margin-left: 0;
        padding-left: 0;
    }
    .timeline-content::before {
        display: none;
    }
}

/* Entry and Form Styles */
.entry-row {
    background: white;
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.entry-row:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.entry-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 16px;
    flex-shrink: 0;
}

.entry-type-labor {
    background: #e3f2fd;
    color: #1976d2;
}

.entry-type-material {
    background: #f3e5f5;
    color: #7b1fa2;
}

.entry-type-equipment {
    background: #fff3e0;
    color: #f57c00;
}

@media (max-width: 576px) {
    .entry-row .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    .entry-row .entry-type-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    .entry-row .text-end {
        width: 100%;
        text-align: left !important;
        margin-top: 10px;
    }
}

/* Enhanced Job Entry Form Styles */
.quick-add-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
}

.quick-add-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex: 0 0 30px;
}

.step-indicator.active {
    background: var(--primary-color);
    color: white;
}

.step-indicator.completed {
    background: var(--success-color);
    color: white;
}

#progress-steps {
    flex-wrap: wrap;
    gap: 0.5rem;
}

#progress-steps > div {
    display: flex;
    align-items: center;
}

@media (max-width: 576px) {
    #progress-steps {
        justify-content: center;
    }

    #progress-steps > div {
        flex: 1 1 45%;
        flex-direction: column;
        text-align: center;
    }

    #progress-steps .step-indicator {
        margin-right: 0 !important;
        margin-bottom: 0.25rem;
    }

    #progress-steps > div span {
        font-size: 0.8rem;
    }
}

.material-total {
    color: var(--success-color);
    font-size: 1.1rem;
}

.materials-table {
    background: white;
    border-radius: var(--radius-md);
}

.materials-table th {
    background: #f8f9fa;
    border: none;
    padding: 15px 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.materials-table td {
    border: none;
    padding: 12px;
    border-bottom: 1px solid #f1f3f5;
}

/* Progress and Status Elements */
.progress-section {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.progress-bar-custom {
    height: 12px;
    border-radius: 6px;
    background: #e9ecef;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 6px;
    transition: width 1s ease;
    position: relative;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #cce5ff;
    color: #004085;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.project-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Navigation and Layout Helpers */
.breadcrumb-nav {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-custom {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-custom .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.breadcrumb-custom .breadcrumb-item.active {
    color: white;
}

/* Weather and Widgets */
.weather-widget {
    background: linear-gradient(135deg, #87CEEB 0%, #4682B4 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.summary-widget {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Filter and Toolbar Elements */
.action-toolbar {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.filter-bar {
    background: white;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

/* Tab Styles */
.nav-tabs-custom {
    border: none;
    margin-bottom: 25px;
}

.nav-tabs-custom .nav-link {
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: var(--radius-md);
    margin-right: 10px;
    padding: 12px 20px;
    font-weight: 600;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary-color) !important;
}

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

@media (max-width: 576px) {
    .nav-tabs-custom {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .nav-tabs-custom .nav-item {
        flex: 0 0 50%;
    }

    .nav-tabs-custom .nav-link {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

.tab-content-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 25px;
}

@media (max-width: 576px) {
    .tab-content-card {
        background: transparent;
        box-shadow: none;
        padding: 10px 0;
    }

    .materials-table {
        background: transparent;
        border-radius: 0;
    }

    .materials-table th,
    .materials-table td {
        padding: 8px 6px;
    }
}

.entry-tabs {
    border: none;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    border: none;
    background: #f8f9fa;
    color: var(--text-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-right: 5px;
    font-weight: 600;
    padding: 15px 25px;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: #fff !important;
}

.nav-tabs .nav-link.active i {
    color: #fff !important;
}

.tab-content {
    background: white;
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    padding: 25px;
    border: 1px solid #e2e8f0;
}

/* Project Header Styles */
.project-header {
    background: var(--primary-gradient);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Form Enhancements */
.form-floating {
    position: relative;
    margin-bottom: 20px;
}

/* Placeholder styling */
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder {
    color: #6c757d !important;
    opacity: 0.7;
}

/* Prevent placeholder text from overlapping floating labels */
.form-floating > .form-control::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

/* Adjust padding when using floating labels */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* Form text/help text */
.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Ensure readability in all states */
.form-control:disabled,
.form-select:disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    opacity: 1;
}

/* Fix for Bootstrap select styling */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
}

/* Textarea specific styling */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* PDF-Specific Styles */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    @page {
        size: landscape;
        margin: 0.5in 0.3in;
    }
    
    body {
        font-family: Arial, sans-serif;
        font-size: 9px;
        line-height: 1.2;
        color: #000;
        background: white;
    }
    
    .pdf-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        margin-bottom: 12px;
        page-break-inside: avoid;
    }
    
    .pdf-table th,
    .pdf-table td {
        border: 0.5px solid #333;
        padding: 3px 2px;
        vertical-align: top;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        font-size: 8px;
        line-height: 1.1;
    }
    
    .pdf-table th {
        background-color: #e8f0de !important; /* Light sage for print */
        font-weight: bold;
        font-size: 8px;
        text-align: center;
        padding: 4px 2px;
    }
    
    /* Contractor Job Report Column Widths */
    .contractor-report-table .col-date { width: 7%; }
    .contractor-report-table .col-description { width: 20%; }
    .contractor-report-table .col-asset { width: 12%; }
    .contractor-report-table .col-employee { width: 12%; }
    .contractor-report-table .col-material { width: 16%; }
    .contractor-report-table .col-hours { width: 7%; }
    .contractor-report-table .col-cost { width: 8%; }
    .contractor-report-table .col-billable { width: 8%; }
    .contractor-report-table .col-profit { width: 7%; }
    .contractor-report-table .col-margin { width: 3%; }
    
    /* Customer Report Column Widths */
    .customer-report-table .col-date { width: 10%; }
    .customer-report-table .col-description { width: 28%; }
    .customer-report-table .col-asset { width: 14%; }
    .customer-report-table .col-employee { width: 14%; }
    .customer-report-table .col-material { width: 18%; }
    .customer-report-table .col-hours { width: 8%; }
    .customer-report-table .col-billable { width: 8%; }
    
    /* Payment Table */
    .payment-table { width: 50%; }
    .payment-table .col-date { width: 70%; }
    .payment-table .col-amount { width: 30%; }
    
    .text-left { text-align: left !important; }
    .text-right { text-align: right !important; }
    .text-center { text-align: center !important; }
    
    .report-header {
        text-align: center;
        margin-bottom: 15px;
        page-break-inside: avoid;
    }
    
    .report-header img {
        max-height: 35px;
        margin-bottom: 6px;
    }
    
    .report-header h1 {
        font-size: 14px;
        margin: 6px 0 3px 0;
        font-weight: bold;
        color: #000;
    }
    
    .report-header h2 {
        font-size: 11px;
        margin: 3px 0;
        color: #333;
    }
    
    .totals-row {
        background-color: #e9ecef !important;
        font-weight: bold;
        border-top: 1px solid #000 !important;
    }
    
    .totals-row td {
        font-size: 8px !important;
        font-weight: bold;
        background-color: #e9ecef !important;
    }
    
    .summary-section {
        margin: 12px 0;
        font-size: 10px;
        page-break-inside: avoid;
    }
    
    .d-print-none,
    .btn,
    .navbar,
    .no-print,
    .action-buttons,
    .alert,
    .floating-add,
    .floating-actions {
        display: none !important;
    }
    
    tr {
        page-break-inside: avoid;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        position: relative;
        top: auto;
        margin-bottom: 20px;
    }
    
    .floating-actions {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .summary-card .card-text {
        font-size: 24px;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        flex: none;
        min-width: auto;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .sidebar {
        display: none;
    }
    
    .table:not(.no-stack) thead {
        display: none;
    }

    .table:not(.no-stack) tbody,
    .table:not(.no-stack) tr,
    .table:not(.no-stack) td {
        display: block;
        width: 100%;
    }

    .table:not(.no-stack) tr {
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }

    .table:not(.no-stack) td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }

    .table:not(.no-stack) td:last-child {
        border-bottom: none;
    }

    .table:not(.no-stack) td:empty {
        display: none;
    }

    .table:not(.no-stack) td::before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .search-bar {
        max-width: 250px;
    }
    
    .metric-number {
        font-size: 2rem;
    }
    
    .floating-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin-left: 8px;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 24px;
        margin: 16px;
    }
    
    .dashboard-header {
        padding: 24px 16px;
    }
    
    .project-header {
        padding: 30px 0;
    }
    
    .summary-card {
        padding: 20px 15px;
    }
    
    .card-body {
        padding: 15px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        margin-bottom: 5px;
        border-radius: var(--radius-md) !important;
    }

    .floating-actions {
        display: none;
    }
}

/* Fix for dark mode - override if needed */
@media (prefers-color-scheme: dark) {
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        background: #ffffff !important;  /* Keep forms white even in dark mode */
        color: #212529 !important;       /* Keep text dark even in dark mode */
        border-color: var(--border-color);
    }
    
    .form-control:focus,
    .form-select:focus,
    input:focus,
    select:focus,
    textarea:focus {
        background: #ffffff !important;  /* Keep focused forms white */
        color: #212529 !important;       /* Keep focused text dark */
    }
}

/* Additional fixes for specific form elements */
.btn-close {
    background-color: transparent;
    opacity: 0.8;
}

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

/* Alert form text should remain readable */
.alert .form-control,
.alert .form-select {
    background: #ffffff !important;
    color: #212529 !important;
    border-color: rgba(0,0,0,0.2);
}

/* Card form backgrounds */
.card .form-control,
.card .form-select,
.card input,
.card select,
.card textarea {
    background: #ffffff !important;
    color: #212529 !important;
}

/* Table form controls */
.table .form-control,
.table .form-select,
.table input,
.table select {
    background: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
    font-size: 0.875rem;
    padding: 6px 10px;
}

.table .form-control:focus,
.table .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 124, 42, 0.1);
}

/* Ensure consistent styling across all form containers */
.modal .form-control,
.modal .form-select,
.offcanvas .form-control,
.offcanvas .form-select,
.dropdown-menu .form-control,
.dropdown-menu .form-select {
    background: #ffffff !important;
    color: #212529 !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

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

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

/* Minimal utilities for PDF rendering when Bootstrap is unavailable */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

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

.img-fluid {
    max-width: 100%;
    height: auto;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-light th {
    background-color: var(--surface-light);
}

/* Loading States and Interactions */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    .card,
    .form-control,
    .form-select {
        border-width: 2px;
    }
    
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .btn:hover,
    .card:hover,
    .summary-card:hover {
        transform: none;
    }
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .btn-group .btn:last-child {
        margin-bottom: 0;
    }

    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
