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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-button {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: 600;
}

.nav-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-button.reports-button {
    margin-left: 1rem;
    padding: 0.5rem;
    width: 44px;
    height: 44px;
}

.report-icon {
    width: 28px;
    height: 28px;
    filter: brightness(0) saturate(100%);
}

.nav-button.reports-button:hover .report-icon {
    filter: brightness(0) saturate(100%) invert(100%);
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
}

.supervisor-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.supervisor-option {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text-primary);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.supervisor-option:last-child {
    border-bottom: none;
}

.supervisor-option:hover {
    background: var(--bg-color);
}

.supervisor-option.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.supervisor-option.logout {
    color: var(--danger-color);
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

.supervisor-option.logout:hover {
    background: #fee2e2;
}

.user-details h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-details p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.logout-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.logout-button:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.logout-button:active {
    transform: scale(0.98);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Projects Section */
.projects-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 250px;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    color: #4b5563;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    filter: grayscale(100%);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

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

/* Table */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.projects-table thead {
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
}

.projects-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.projects-table th:hover {
    background: var(--border-color);
}

.sort-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.5;
}

.sort-indicator.active {
    opacity: 1;
    color: var(--primary-color);
}

.projects-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

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

.projects-table td {
    padding: 1.25rem 1rem;
    font-size: 0.875rem;
}

.job-id {
    font-weight: 600;
    color: var(--primary-color);
    max-width: 90px;
    width: 90px;
}

.address {
    color: var(--text-primary);
    max-width: 300px;
}

.stage-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.projects-table td:has(.stage-badge) {
    max-width: 120px;
    width: 120px;
}

.stage-badge.slab {
    background: #dbeafe;
    color: #1e40af;
}

.stage-badge.frame {
    background: #fef3c7;
    color: #92400e;
}

.stage-badge.lockup {
    background: #e0e7ff;
    color: #3730a3;
}

.stage-badge.pho {
    background: #d1fae5;
    color: #065f46;
}

.claim-date {
    font-weight: 500;
    color: var(--text-primary);
    max-width: 100px;
    width: 100px;
    white-space: nowrap;
}

/* Slider Cell */
.slider-cell {
    min-width: 420px;
    max-width: 420px;
    width: 420px;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.slider-track {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    height: 10px;
    background: linear-gradient(to right, #10b981 0%, #fbbf24 50%, #ef4444 100%);
    border-radius: 5px;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    user-select: none;
    z-index: 2;
}

.slider-thumb:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.slider-thumb:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(0.95);
}

.slider-thumb.unconfirmed {
    background: white;
    border-color: #9ca3af;
    color: #9ca3af;
    cursor: pointer;
}

.slider-thumb.unconfirmed:hover {
    border-color: #6b7280;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.slider-thumb.confirmed {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    animation: confirmPulse 0.3s ease;
    cursor: pointer;
}

.slider-thumb.confirmed:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

@keyframes confirmPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.slider-label {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 100px;
    width: 100px;
    flex-shrink: 0;
    text-align: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
}

.slider-label.on-time {
    background: #d1fae5;
    color: #065f46;
}

.slider-label.delayed {
    background: #fee2e2;
    color: #991b1b;
}

.reason-input-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.reason-input {
    width: 100%;
    max-width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--bg-color);
    resize: none;
    overflow: hidden;
    min-height: 38px;
    line-height: 1.5;
    box-sizing: border-box;
}

.reason-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.reason-input::placeholder {
    color: var(--text-secondary);
}

.reason-input.required {
    border-color: var(--danger-color);
}

.reason-input.required:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.reason-input.required::placeholder {
    color: var(--danger-color);
    font-weight: 500;
}

.validation-text {
    font-size: 0.813rem;
    color: #991b1b;
    font-weight: 500;
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    word-wrap: break-word;
}

/* Login Screen */
.login-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 1.5rem;
background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.header {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.login-card {
background: white;
border-radius: 20px;
padding: 3rem 2rem;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
max-width: 400px;
width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 120px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group select {
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-button {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

/* Microsoft SSO Login Button */
.microsoft-login-button {
    width: 100%;
    padding: 0.875rem 1rem;
    background: white;
    color: #5e5e5e;
    border: 1px solid #8c8c8c;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.microsoft-login-button:hover {
    background: #f8f8f8;
    border-color: #5e5e5e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.microsoft-login-button:active {
    transform: translateY(0);
}

.microsoft-login-button svg {
    flex-shrink: 0;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    padding: 0 1rem;
}

/* Manual Login Toggle */
.manual-login-toggle {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Back to SSO Button */
.back-to-sso-button {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.back-to-sso-button:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Login Error Message */
.login-error {
    padding: 1rem;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

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

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

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Report Placeholder */
.report-placeholder {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.report-placeholder h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.report-placeholder p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.data-stats {
    margin: 2rem 0;
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.data-stats p {
    font-size: 1rem;
    color: var(--text-primary);
}

.data-stats strong {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

.data-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.action-button {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-button.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.action-button.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.action-button.danger {
    background: white;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

.action-button.danger:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.data-note {
    margin-top: 2rem;
    font-size: 0.875rem !important;
    color: var(--text-secondary) !important;
    font-style: italic;
}

/* Projection Chart Card */
.projection-chart-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.projection-chart-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.chart-container {
    width: 100%;
    overflow-x: auto;
}

.line-chart {
    width: 100%;
    height: auto;
    max-width: 800px;
    margin: 0 auto;
    display: block;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item-chart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.legend-item-chart span {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Forecast Dashboard */
.forecast-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

/* Forecast header styles removed - controls now in main header */

.header .forecast-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 2rem;
    background: white;
    max-width: 1400px;
    margin: 0 auto;
}

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

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-nav-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.month-nav-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.month-nav-button:active {
    transform: scale(0.95);
}

/* Filter Switch */
.filter-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.switch-label {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

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

.switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 28px;
    transition: 0.3s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-input:checked + .switch-slider {
    background-color: var(--danger-color);
}

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

.switch-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Search Input */
.search-input {
    flex: 1;
    max-width: 400px;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.date-picker-wrapper label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.date-picker {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-picker:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.forecast-table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

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

.forecast-table thead {
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
}

.forecast-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.forecast-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

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

.forecast-table td {
    padding: 1rem;
    font-size: 0.875rem;
}

.supervisor-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.expand-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    margin-right: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.expand-button:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.expand-button:active {
    transform: scale(0.95);
}

.expand-button-placeholder {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.expand-all-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
}

.expand-all-button:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.expand-all-button:active {
    transform: scale(0.95);
}

.job-detail-row {
    background: #f8fafc;
}

.job-detail-row:hover {
    background: #f1f5f9 !important;
}

.job-detail-cell {
    padding: 0 !important;
}

.job-detail-table-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 1rem 2rem;
    background: #f8fafc;
}

.job-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.813rem;
}

.job-detail-table thead {
    background: var(--bg-color);
    border-bottom: 2px solid var(--primary-color);
}

.job-detail-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.job-detail-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.job-detail-table th.sortable:hover {
    background: #e2e8f0;
}

.job-detail-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.job-detail-table tbody tr:hover {
    background: #f1f5f9;
}

.job-detail-table td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.job-status-cell {
    text-align: center;
}

.status-indicator {
    font-size: 1.5rem;
    flex-shrink: 0;
    font-weight: 700;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50%;
    background: var(--bg-color);
}

.status-indicator.doable {
    color: var(--success-color);
}

.status-indicator.overdue {
    color: var(--danger-color);
}

.kpi-cell {
    font-weight: 600;
    text-align: left;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.kpi-good {
    color: var(--success-color);
}

.kpi-warning {
    color: var(--warning-color);
}

.job-detail-table .job-number {
    font-weight: 600;
    color: var(--primary-color);
}

.job-detail-table .job-address {
    color: var(--text-secondary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-detail-table .job-stage {
    color: var(--text-primary);
    font-weight: 500;
}

.job-detail-table .job-amount {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.job-detail-table .job-date {
    color: var(--text-secondary);
    white-space: nowrap;
}

.job-detail-table .job-delay {
    color: var(--warning-color);
    font-weight: 600;
    text-align: center;
}

.amount-cell {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    text-align: left;
}

.percentage-cell {
    min-width: 200px;
}

.percentage-bar-wrapper {
    position: relative;
    width: 100%;
    height: 32px;
    background: var(--bg-color);
    border-radius: 6px;
    overflow: hidden;
}

.percentage-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(to right, var(--success-color), #34d399);
    transition: width 0.3s ease;
}

.percentage-bar.total {
    background: linear-gradient(to right, var(--primary-color), #60a5fa);
}

.percentage-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1;
}

.forecast-table tfoot {
    border-top: 3px solid var(--border-color);
}

.totals-row {
    background: var(--bg-color);
}

.totals-row td {
    padding: 1.25rem 1rem;
    font-size: 1rem;
}

.forecast-legend {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.forecast-legend h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.legend-list li {
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.legend-list li:last-child {
    border-bottom: none;
}

.data-management-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.data-management-section .data-actions {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .projects-table th,
    .projects-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .slider-cell {
        min-width: 300px;
    }

    .slider-track {
        height: 36px;
    }

    .slider-thumb {
        width: 28px;
        height: 28px;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .logo-text h1 {
        font-size: 1rem;
    }

    .user-details {
        display: none;
    }

    .slider-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

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

    .forecast-header {
        flex-direction: column;
        align-items: stretch;
    }

    .date-picker-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .percentage-cell {
        min-width: 150px;
    }

    .projection-chart-card {
        padding: 1rem;
    }

    .projection-chart-card h2 {
        font-size: 1.25rem;
    }

    .line-chart {
        min-width: 600px;
    }
}

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

.projects-table tbody tr {
    animation: fadeIn 0.3s ease;
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .projects-table th,
    .projects-table td {
        padding: 1rem;
    }

    .slider-track {
        height: 44px;
    }

    .slider-thumb {
        width: 36px;
        height: 36px;
    }

    .login-button,
    .form-group select {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Print Styles for PDF Export */
@media print {
    @page {
        size: portrait;
        margin: 10mm;
    }

    body {
        background: white;
    }

    .header,
    .data-management-section,
    .nav-button,
    .user-info {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .forecast-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: auto;
        margin-bottom: 0;
        padding: 10mm;
    }

    .forecast-table {
        page-break-inside: auto;
        width: 100%;
    }

    .forecast-table tbody tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .forecast-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #333;
        page-break-after: avoid;
    }

    .forecast-header h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
        color: #000;
    }

    .date-picker-wrapper {
        font-size: 0.75rem;
        color: #333;
    }

    .date-picker-wrapper label {
        color: #000;
    }

    .forecast-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #999 !important;
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .forecast-table td {
        border: 1px solid #ddd !important;
        color: #000 !important;
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .percentage-bar {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
        background: #4ade80 !important;
    }

    .percentage-bar.total {
        background: #3b82f6 !important;
    }

    .percentage-text {
        color: #000 !important;
        font-size: 0.7rem;
    }

    .forecast-legend {
        page-break-inside: avoid;
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
        margin-top: 1rem;
    }

    .forecast-legend h3 {
        color: #000 !important;
        font-size: 0.9rem;
    }

    .legend-list li {
        color: #000 !important;
        border-bottom: 1px solid #ddd !important;
        font-size: 0.75rem;
        padding: 0.3rem 0;
    }

    .totals-row {
        background: #e5e5e5 !important;
        font-weight: bold;
        page-break-inside: avoid;
    }

    .forecast-table tfoot {
        page-break-inside: avoid;
    }
}
