/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* Header */
.app-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
}

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

.app-header h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-header h1 i {
    color: var(--primary-color);
}

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

.user-email {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Navigation */
.main-nav {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    color: var(--gray-600);
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

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

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-header h2 {
    font-size: 1.75rem;
    color: var(--gray-900);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-block {
    width: 100%;
    justify-content: center;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.project-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

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

.project-card h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

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

.icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.project-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.project-link {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.project-link-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.link-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.link-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.btn-copy {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-copy:hover {
    background: var(--primary-dark);
}

/* Reports List */
.reports-list {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.report-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

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

.report-item:hover {
    background: var(--gray-50);
}

.report-info h4 {
    font-size: 1rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.report-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

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

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-select, input[type="search"] {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

input[type="search"] {
    min-width: 250px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    transition: border-color 0.2s;
    background: white;
}

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

.form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

/* Workflow Builder */
.builder-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.step-templates {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.step-templates h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.step-template {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: move;
    transition: all 0.2s;
}

.step-template:hover {
    background: white;
    border-color: var(--primary-color);
}

.step-template i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.workflow-canvas {
    background: white;
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 500px;
}

.workflow-step {
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.workflow-step-content {
    flex: 1;
}

.workflow-step h5 {
    font-size: 1rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.workflow-step p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

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

/* Mobile Form Styles */
body.mobile-form {
    background: white;
}

.form-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.form-header-content h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.form-header-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.form-progress {
    margin-top: 1rem;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    background: white;
    height: 100%;
    transition: width 0.3s;
}

#progressText {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Engineer Info */
.engineer-info {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.engineer-info h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

/* Workflow Steps */
.workflow-steps {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.workflow-step-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: none;
}

.workflow-step-item.active {
    display: block;
    animation: slideIn 0.3s;
}

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

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step-header h3 {
    font-size: 1.1rem;
    color: var(--gray-900);
}

.step-description {
    color: var(--gray-600);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* Form Controls */
.form-controls {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.form-controls button {
    flex: 1;
}

/* Success/Error States */
.loading-state, .success-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
    text-align: center;
}

.success-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.success-icon {
    color: var(--success-color);
}

.error-icon {
    color: var(--danger-color);
}

.success-state h2, .error-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.success-state p, .error-state p {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.submission-id {
    font-family: monospace;
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.spinner {
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* Notifications */
.notifications {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    max-width: 400px;
}

.notification {
    background: white;
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

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

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

    .main-nav {
        padding: 0 1rem;
    }

    .main-content {
        padding: 0 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .filter-controls {
        flex-direction: column;
    }

    input[type="search"] {
        min-width: 100%;
    }

    .builder-container {
        grid-template-columns: 1fr;
    }
}

/* Admin Styles */
.admin-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.admin-section-header h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-section-content {
    padding: 1.5rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    background: var(--gray-50);
}

.user-info h4 {
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.user-info p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

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

/* PDF Template Styles */
.template-option {
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.template-option:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.template-option.selected {
    border-color: var(--primary-color);
    background: var(--gray-50);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.template-preview {
    width: 100%;
    height: 180px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.template-info h4 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.template-info p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* PDF Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.preview-modal.hidden {
    display: none;
}

.preview-container {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.preview-header h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
}

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

.preview-body {
    flex: 1;
    overflow: auto;
    padding: 2rem;
    background: var(--gray-100);
}

.preview-content {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 800px;
}

@media print {
    .preview-header,
    .preview-actions {
        display: none !important;
    }

    .preview-body {
        padding: 0;
        background: white;
    }

    .preview-container {
        max-height: none;
        box-shadow: none;
    }
}

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.image-lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: var(--gray-800);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: var(--gray-100);
    transform: scale(1.1);
}

.pdf-image-clickable {
    cursor: zoom-in;
    transition: opacity 0.2s;
    position: relative;
}

.pdf-image-clickable:hover {
    opacity: 0.9;
}

.pdf-image-clickable::after {
    content: '\f00e';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.pdf-image-clickable:hover::after {
    opacity: 1;
}

/* =================================================
   Live Progress Tracking Styles
   ================================================= */

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.live-text {
    color: #22c55e;
    font-weight: 600;
    font-size: 0.9rem;
}

.live-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.engineer-progress-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.engineer-progress-card.active {
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.engineer-progress-card.disconnected {
    border-color: #f59e0b;
    opacity: 0.8;
}

.engineer-progress-card.incomplete {
    border-color: #fbbf24;
    background: #fffbeb;
    opacity: 0.9;
}

.engineer-progress-card.offline {
    border-color: #ef4444;
    background: #fef2f2;
    opacity: 0.85;
}

.engineer-progress-card.working {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.engineer-progress-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.engineer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.engineer-info {
    flex: 1;
}

.engineer-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.engineer-name i {
    color: var(--primary-color);
}

.engineer-company {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: 0;
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

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

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

.status-badge.status-incomplete {
    background: rgba(251, 191, 36, 0.15);
    color: #ca8a04;
}

.status-badge.status-offline {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-badge.status-working {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.status-badge .fa-circle {
    font-size: 0.5rem;
}

.project-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.project-info-row i {
    color: var(--primary-color);
}

.location-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.location-info-row i {
    color: #22c55e;
    font-size: 0.9rem;
}

.location-info-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.elapsed-time-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.elapsed-time-row i {
    color: #3b82f6;
    font-size: 0.9rem;
}

.current-step-container {
    margin-bottom: 1rem;
}

.step-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.step-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.time-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.step-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-900);
    margin: 0;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
}

.progress-bar-container {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-percentage {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.alert-warning-box {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #d97706;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .live-progress-grid {
        grid-template-columns: 1fr;
    }

    .engineer-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .status-badge {
        align-self: flex-start;
    }
}

/* Warning Banner for Engineers */
.warning-banner {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

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

.warning-banner i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.warning-content strong {
    font-weight: 700;
}

@media (max-width: 768px) {
    .warning-banner {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .warning-banner i {
        font-size: 1.25rem;
    }
}

/* Live Progress Tabs */
.live-progress-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 12px;
}

.live-progress-tabs .tab-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.live-progress-tabs .tab-btn:hover {
    background: white;
    color: var(--gray-900);
}

.live-progress-tabs .tab-btn.active {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.live-progress-tabs .tab-btn i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .live-progress-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .live-progress-tabs .tab-btn {
        width: 100%;
    }
}

/* Search and Filter Bar */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i.fa-search {
    position: absolute;
    left: 1rem;
    color: var(--gray-500);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

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

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .filter-controls {
        flex-direction: column;
        width: 100%;
    }

    .filter-controls select,
    .filter-controls button {
        width: 100%;
    }
}
