/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --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);
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

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

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

.logo-main i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

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

.logo-tagline {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 2.5rem;
    opacity: 0.8;
}

/* Responsive: Hide tagline on mobile */
@media (max-width: 768px) {
    .logo-tagline {
        display: none;
    }
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

/* User Menu */
.user-menu {
    position: relative;
    margin-left: 1rem;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.user-menu-btn:hover {
    background: var(--bg-secondary);
}

.user-menu-btn i {
    font-size: 1.25rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 240px;
    display: none;
    z-index: 1000;
    animation: slideDown 0.2s ease;
}

.user-dropdown.active {
    display: block;
}

.user-info {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-secondary);
}

.user-info div:first-child {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-info div:last-child {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.dropdown-divider {
    height: 1px;
    background: var(--bg-secondary);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 1.25rem;
    text-align: center;
}

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

/* ===== Main Content ===== */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

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

.view-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
}

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

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.stat-icon.red {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

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

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

/* ===== Section Card ===== */
.section-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

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

.project-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

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

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.project-address {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.project-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.project-status.active {
    background: #d1fae5;
    color: #065f46;
}

.project-status.on-hold {
    background: #fef3c7;
    color: #92400e;
}

.project-status.completed {
    background: #dbeafe;
    color: #1e40af;
}

.project-status.archived {
    background: #f1f5f9;
    color: #475569;
}

.project-details {
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.project-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.project-detail-row:last-child {
    margin-bottom: 0;
}

.project-detail-row .label {
    color: var(--text-secondary);
}

.project-detail-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.5rem;
}

/* ===== Filters Bar ===== */
.filters-bar {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

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

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

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

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

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

/* ===== Snag List ===== */
.snag-list {
    padding: 1.5rem;
}

.snag-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.snag-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

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

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

.snag-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.snag-item-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.snag-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.snag-item-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ===== Snag Table ===== */
.snags-table {
    width: 100%;
    border-collapse: collapse;
}

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

.snags-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.snags-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.snags-table tbody tr {
    transition: var(--transition);
}

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

.snag-id {
    font-family: monospace;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.snag-title-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

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

.snag-actions button {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-status {
    text-transform: capitalize;
}

.badge-status.open {
    background: #fef3c7;
    color: #92400e;
}

.badge-status.in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.badge-status.resolved {
    background: #d1fae5;
    color: #065f46;
}

.badge-status.verified {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-status.closed {
    background: #f1f5f9;
    color: #475569;
}

.badge-priority {
    text-transform: capitalize;
}

.badge-priority.critical {
    background: #fee2e2;
    color: #991b1b;
}

.badge-priority.high {
    background: #fed7aa;
    color: #9a3412;
}

.badge-priority.medium {
    background: #fef3c7;
    color: #92400e;
}

.badge-priority.low {
    background: #dbeafe;
    color: #1e40af;
}

.badge-category {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Workflow Badge Styles (Phase 1.6) */
.badge-workflow {
    text-transform: capitalize;
}

.badge-workflow.reported {
    background: #e0f2fe;
    color: #075985;
}

.badge-workflow.assigned-to-contractor {
    background: #fef3c7;
    color: #92400e;
}

.badge-workflow.work-completed {
    background: #dbeafe;
    color: #1e40af;
}

.badge-workflow.failed-verification {
    background: #fee2e2;
    color: #991b1b;
}

.badge-workflow.verified {
    background: #d1fae5;
    color: #065f46;
}

.badge-workflow.closed {
    background: #f1f5f9;
    color: #475569;
}

/* Milestone Badge Styles (Phase 1.6) */
.badge-pre-construction {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-during-construction {
    background: #dbeafe;
    color: #1e40af;
}

.badge-post-construction {
    background: #fef3c7;
    color: #92400e;
}

.badge-handover-inspection {
    background: #fce7f3;
    color: #831843;
}

.badge-warranty-period {
    background: #fee2e2;
    color: #991b1b;
}

.badge-default {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

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

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

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

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

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

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

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

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

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

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
}

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

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

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

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

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

.empty-state i {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

.empty-state-row {
    text-align: center;
    padding: 2rem;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

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

.toast.show {
    display: flex;
}

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

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

.toast.warning {
    background: var(--warning-color);
}

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

/* ===== Snag Detail View ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* ===== Phase 1.5 Styles ===== */

/* Team Members List */
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.team-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.team-member-item input,
.team-member-item select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
}

.team-member-item .remove-btn {
    padding: 0.5rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.team-member-item .remove-btn:hover {
    background: #dc2626;
}

/* Audio Recording Controls */
.audio-recording-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.recording-timer {
    font-weight: 600;
    color: var(--danger-color);
    font-size: 1.1rem;
    animation: pulse 1.5s infinite;
}

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

#audio-player-container {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

#transcription-container {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

/* Sign-Off Cards */
.signoff-card {
    padding: 15px;
    margin-bottom: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

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

.signoff-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.signoff-header h4 i {
    color: var(--primary-color);
}

.signoff-display {
    padding: 10px;
    background: var(--bg-primary);
    border-left: 3px solid var(--success-color);
    border-radius: 4px;
    margin-top: 10px;
}

.signoff-display-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.875rem;
}

.signoff-display-item strong {
    color: var(--text-primary);
}

.signoff-display-item span {
    color: var(--text-secondary);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 5px;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

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

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

/* Dual Direction Layout */
.form-row .direction-compass {
    margin-bottom: 0;
}

/* Enhanced Compass for Wall Orientation */
.compass-btn.active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* View Direction Select Enhancement */
#snag-view-direction {
    font-weight: 500;
}

#snag-view-direction option {
    padding: 10px;
}

/* Responsive adjustments for Phase 1.5 */
@media (max-width: 768px) {
    .team-member-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .audio-recording-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .signoff-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ===== Phase 1.6 Styles ===== */

/* Workflow Progress Indicator */
.workflow-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    position: relative;
}

.workflow-step .step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.workflow-step.active .step-icon {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
}

.workflow-step.completed .step-icon {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.workflow-step.rejected .step-icon {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.workflow-step .step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.workflow-step.active .step-label {
    color: var(--primary-color);
}

.workflow-step.completed .step-label {
    color: var(--success-color);
}

.workflow-line {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    margin: 0 10px;
    position: relative;
}

.workflow-line.completed {
    background: var(--success-color);
}

/* Workflow Cards */
.workflow-card {
    padding: 20px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.workflow-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.1);
}

.workflow-card.completed {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.workflow-card.rejected {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

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

.workflow-card-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.workflow-card-header h4 i {
    color: var(--primary-color);
}

.workflow-instruction {
    padding: 12px;
    background: var(--info-color);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-left: 3px solid var(--info-color);
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.workflow-instruction i {
    color: var(--info-color);
    margin-right: 8px;
}

/* Info Banners */
.info-banner {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-banner i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.info-banner.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning-color);
    color: var(--text-primary);
}

.info-banner.warning i {
    color: var(--warning-color);
}

.info-banner.danger {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger-color);
    color: var(--text-primary);
}

.info-banner.danger i {
    color: var(--danger-color);
}

.info-banner.success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success-color);
    color: var(--text-primary);
}

.info-banner.success i {
    color: var(--success-color);
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button-group button {
    flex: 1;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--bg-tertiary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Workflow State Badge Enhancements */
#workflow-state-badge {
    font-size: 0.85rem;
    padding: 5px 12px;
    margin-left: 10px;
}

#workflow-state-badge.reported {
    background: var(--info-color);
}

#workflow-state-badge.assigned {
    background: var(--warning-color);
}

#workflow-state-badge.work-completed {
    background: var(--primary-color);
}

#workflow-state-badge.failed-verification {
    background: var(--danger-color);
}

#workflow-state-badge.verified {
    background: var(--success-color);
}

#workflow-state-badge.closed {
    background: var(--secondary-color);
}

/* Responsive adjustments for Phase 1.6 */
@media (max-width: 768px) {
    .workflow-progress {
        flex-direction: column;
        gap: 15px;
    }
    
    .workflow-line {
        width: 3px;
        height: 20px;
        margin: 0;
    }
    
    .workflow-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
}



.detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-description {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.detail-photo {
    text-align: center;
    margin-top: 1.5rem;
}

.detail-photo img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        width: 100%;
        justify-content: space-between;
    }

    .nav-btn {
        flex: 1;
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .view-header {
        flex-direction: column;
    }

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

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

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .snags-table {
        display: block;
        overflow-x: auto;
    }

    .modal {
        padding: 1rem;
    }

    .modal-content {
        max-height: 95vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo span {
        display: none;
    }

    .view-header h1 {
        font-size: 1.5rem;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }
}

/* ===== Phase 1: New Features ===== */

/* Context Bar (Sticky Building Context) */
.context-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 65px;
    z-index: 90;
    animation: slideDown 0.3s ease;
}

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

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

.context-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.context-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.context-separator {
    color: rgba(255, 255, 255, 0.6);
}

.context-bar strong {
    font-weight: 600;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Context Display in Modal */
.context-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

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

.context-display-content i {
    font-size: 1.25rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-link {
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.breadcrumb-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb i.fa-chevron-right {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

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

.building-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.building-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.building-photo {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.building-photo-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.building-photo-placeholder i {
    font-size: 3rem;
    color: var(--text-tertiary);
}

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

.building-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.building-code {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: monospace;
}

.building-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.building-details {
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.building-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.building-detail-row:last-child {
    margin-bottom: 0;
}

.building-detail-row .label {
    color: var(--text-secondary);
}

.building-detail-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

.building-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.building-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.5rem;
}

/* Direction Compass */
.direction-compass {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.compass-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.compass-btn {
    width: 80px;
    height: 80px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-secondary);
}

.compass-btn i {
    font-size: 1.5rem;
}

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

.compass-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.compass-center {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-tertiary);
}

#direction-hint {
    text-align: center;
    margin-top: 0.5rem;
}

#direction-hint.selected {
    color: var(--success-color);
    font-weight: 500;
}

/* Stat Card Purple Variant */
.stat-icon.purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Additional Badge Styles */
.badge-direction {
    background: var(--info-color);
    color: white;
}

.badge-element {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 500;
}

/* Element Progress Indicators (for future use) */
.element-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.element-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color) 0%, var(--info-color) 100%);
    transition: width 0.3s ease;
}

/* Building Floor Plan Preview */
.floor-plan-preview {
    width: 100%;
    max-width: 400px;
    margin: 1rem auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.floor-plan-preview img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* Enhanced Table for New Columns */
.snags-table th:nth-child(6),
.snags-table td:nth-child(6) {
    text-align: center;
}

/* Mobile Responsiveness for New Features */
@media (max-width: 768px) {
    .context-bar {
        top: 110px;
    }
    
    .context-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .context-info {
        font-size: 0.8rem;
    }
    
    .buildings-grid {
        grid-template-columns: 1fr;
    }
    
    .compass-btn {
        width: 60px;
        height: 60px;
        font-size: 0.875rem;
    }
    
    .compass-btn i {
        font-size: 1.25rem;
    }
    
    .compass-center {
        width: 30px;
        height: 30px;
        font-size: 1.5rem;
    }
    
    .breadcrumb {
        font-size: 0.75rem;
    }
}
