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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.btn-primary, .btn-secondary, .btn-link {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 8px 12px;
    text-decoration: underline;
}

.main-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.insights-panel, .priorities-panel {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.insights-panel h2, .priorities-panel h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.insights-content, .priorities-list {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.placeholder {
    font-style: italic;
    color: #9ca3af;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.home-status-filter {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    flex-wrap: wrap;
}
.home-status-filter .status-filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.home-status-filter .status-cb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}
.home-status-filter .status-cb input[type="checkbox"] {
    cursor: pointer;
}

.search-input, .filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    min-width: 180px;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Projects Table */
.projects-table-container {
    background: var(--card-bg);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.projects-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.projects-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.projects-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.projects-table th.sorted-asc,
.projects-table th.sorted-desc {
    background: rgba(255, 255, 255, 0.15);
}

.sort-indicator {
    margin-left: 5px;
    font-size: 0.8rem;
}

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

.projects-table tbody tr:hover {
    background: #f3f4f6;
}

.projects-table td {
    padding: 16px 20px;
    font-size: 0.95rem;
}

.project-name {
    font-weight: 600;
    color: var(--text-primary);
}

.project-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.status-planning { background: #dbeafe; color: #1e40af; }
.status-active { background: #d1fae5; color: #065f46; }
.status-active-hot { background: #fde68a; color: #92400e; border: 1px solid #f59e0b; }
.status-on-hold { background: #fef3c7; color: #92400e; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.priority-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.priority-critical { background: #fee2e2; color: #991b1b; }
.priority-high { background: #fed7aa; color: #9a3412; }
.priority-medium { background: #fef3c7; color: #92400e; }
.priority-low { background: #d1fae5; color: #065f46; }

.budget-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.actions-cell {
    white-space: nowrap;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin-right: 5px;
}

.btn-notes {
    background: #ede9fe;
}

.btn-notes:hover {
    background: #ddd6fe;
    transform: scale(1.1);
}

.btn-implementation {
    background: #dbeafe;
}

.btn-implementation:hover {
    background: #bfdbfe;
    transform: scale(1.1);
}

.btn-edit {
    background: #d1fae5;
}

.btn-edit:hover {
    background: #a7f3d0;
    transform: scale(1.1);
}

.no-projects {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Total Row */
.projects-table tfoot {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-top: 3px solid var(--primary-color);
}

.total-row td {
    padding: 16px 20px;
    font-weight: 700;
}

.total-label {
    text-align: right;
    color: var(--text-primary);
    font-size: 1rem;
}

.total-value {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Legacy Grid Styles - Keep for backward compatibility */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

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

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

.project-customer {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.project-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-planning { background: #dbeafe; color: #1e40af; }
.status-active { background: #d1fae5; color: #065f46; }
.status-active-hot { background: #fde68a; color: #92400e; border: 1px solid #f59e0b; }
.status-on-hold { background: #e0e7ff; color: #3730a3; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.project-details {
    margin: 15px 0;
    font-size: 0.9rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

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

.project-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-notes {
    background: #ede9fe;
    color: #5b21b6;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-notes:hover, .btn-edit:hover {
    transform: scale(1.05);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

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

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

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

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--danger-color);
}

/* Form Styles */
#projectForm, .notes-content {
    padding: 30px;
}

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* Notes Styles */
.add-note {
    margin-bottom: 20px;
}

.add-note h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.add-note .form-group {
    margin-bottom: 12px;
}

.add-note .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.add-note input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.add-note input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-note textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.add-note textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-note .btn-primary {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 0.95rem;
}

.note-options {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

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

.notes-list {
    max-height: 400px;
    overflow-y: auto;
}

.note-item {
    padding: 10px 12px;
    background: var(--light-bg);
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    border-left: 3px solid transparent;
}

.note-item.note-important .note-content-inline {
    color: #dc2626 !important;
    font-weight: 700 !important;
}

.note-item.note-important {
    border-left-color: #dc2626;
}

.note-item.note-hidden {
    opacity: 0.6;
}

.note-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.note-date-short {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: help;
    white-space: nowrap;
    min-width: 50px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.note-content-inline {
    flex: 1;
    min-width: 200px;
    line-height: 1.5;
}

.note-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.eye-icon {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #dc2626;
    margin-right: 2px;
}

.edit-note-btn,
.delete-note-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.edit-note-btn:hover,
.delete-note-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

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

.important-badge {
    display: inline-block;
    background: #dc2626;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 6px;
}

.note-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.note-content {
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Priority Badge */
.priority-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.priority-low { background: #e0e7ff; color: #3730a3; }
.priority-medium { background: #fef3c7; color: #92400e; }
.priority-high { background: #fed7aa; color: #9a3412; }
.priority-critical { background: #fee2e2; color: #991b1b; }

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}


/* ===== RESOURCES MODULE ===== */

.resources-content {
    max-height: 70vh;
    overflow-y: auto;
}

.resources-list {
    display: grid;
    gap: 15px;
}

.resource-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

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

.resource-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.resource-card p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.resource-form {
    margin-top: 20px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
}


/* ===== IMPLEMENTATION MODULE ===== */

.implementation-content {
    max-height: 70vh;
    overflow-y: auto;
}

.implementation-details {
    padding: 10px;
}

.plan-summary, .plan-insights, .plan-risks {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.plan-summary h3, .plan-insights h3, .plan-risks h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.plan-phases {
    margin-bottom: 20px;
}

.phase-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid var(--secondary-color);
}

.phase-card h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.phase-steps {
    margin-top: 15px;
}

.step-card {
    background: var(--light-bg);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 2px solid var(--primary-color);
}

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

.step-days {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 5px 0;
}

.risk-card {
    background: #fef3c7;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid var(--warning-color);
}

.risk-source {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.plan-actions {
    margin-top: 20px;
    text-align: center;
}

.no-plan {
    text-align: center;
    padding: 40px 20px;
}

.no-plan p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}


/* ===== ADDITIONAL UI IMPROVEMENTS ===== */

.loading-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.error {
    color: var(--danger-color);
    text-align: center;
    padding: 20px;
}

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

.btn-implementation:hover {
    background: #7c3aed;
}

.placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}


/* ===== DELETE PROJECT MODAL ===== */

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}
.btn-delete:hover {
    background: #fca5a5;
    transform: scale(1.1);
}

.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--danger-color);
    color: white;
    transition: all 0.2s;
}
.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.4);
}
.btn-danger:disabled {
    background: #fca5a5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal-content--narrow {
    max-width: 460px;
}

.modal-header--danger {
    background: #fff1f2;
    border-bottom-color: #fecdd3;
    border-radius: 16px 16px 0 0;
}
.modal-header--danger h2 {
    color: #991b1b;
}

.delete-confirm-body {
    padding: 28px 30px 30px;
}
.delete-confirm-body p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.delete-project-name {
    font-size: 1.1rem !important;
    font-weight: 700;
    color: var(--text-primary) !important;
    background: #f3f4f6;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 4px solid var(--danger-color);
    margin: 12px 0 16px !important;
}
.delete-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 10px 14px;
    color: #92400e !important;
    font-size: 0.88rem !important;
    margin-bottom: 20px !important;
}
.delete-confirm-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.delete-confirm-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: monospace;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 24px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.delete-confirm-input:focus {
    outline: none;
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

/* ===== PROJECT VIEW PAGE ===== */

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

.back-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 6px;
    background: #eef2ff;
    transition: background 0.2s;
    white-space: nowrap;
}

.back-link:hover {
    background: #e0e7ff;
}

.project-view-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.project-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.project-section h2 {
    margin: 0 0 1.2rem 0;
    font-size: 1.2rem;
    color: #111827;
}

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

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 1rem;
    color: #111827;
    font-weight: 500;
}

/* Completion progress bar */
.completion-cell {
    min-width: 110px;
}

.completion-bar-wrap {
    position: relative;
    background: #e5e7eb;
    border-radius: 6px;
    height: 20px;
    min-width: 90px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.completion-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.completion-label {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1f2937;
    padding: 0 6px;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
}

/* View button */
.btn-view {
    background: #eef2ff !important;
}

.btn-view:hover {
    background: #c7d2fe !important;
}

/* Notes section in project view */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.add-note-inline {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.note-form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.note-input-datetime {
    padding: 8px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 200px;
}

.note-input-text {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}

.note-form-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-sm {
    padding: 6px 16px !important;
    font-size: 0.85rem !important;
}

.notes-list-view {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.note-item-view {
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
    background: #fafafa;
    transition: background 0.15s;
}

.note-item-view:hover {
    background: #f3f4f6;
}

.note-item-view.note-important {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.note-item-view.note-important:hover {
    background: #fee2e2;
}

.note-item-view.note-hidden {
    opacity: 0.55;
}

.note-item-view .note-header-inline {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.note-item-view .note-date-short {
    font-weight: 600;
    color: #6366f1;
    white-space: nowrap;
    min-width: 40px;
    font-size: 0.85rem;
    padding-top: 1px;
}

.note-item-view .note-content-inline {
    flex: 1;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.note-item-view .note-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.note-item-view:hover .note-actions {
    opacity: 1;
}

@media (max-width: 768px) {
    .note-form-row {
        flex-direction: column;
    }
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Project name link in table */
.project-name-link {
    color: #4338ca;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.project-name-link:hover {
    color: #6366f1;
    text-decoration: underline;
}


/* Summary block header with last-updated */
.summary-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.summary-block-header h3 {
    margin: 0;
}
.summary-last-updated {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

/* Last Updated column on homepage */
.last-updated-cell {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
}

/* ── Project view indicators strip ──────────────────────────── */
.indicators-section {
    padding: 0 !important;
}
.project-indicators-strip .prow-indicators {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-height: 68px;
}
.project-indicators-strip .ind-col {
    padding: 12px 18px;
}

/* ── Shared indicator styles (used in parskats + project view) ─── */

.prow-indicators {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
}

.ind-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 14px;
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid #f0f1f4;
}
.ind-col:last-child { border-right: none; }

.ind-col-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
    gap: 4px;
    min-width: 0;
}
.ind-col-label {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}
.ind-col-pct {
    font-size: 0.67rem;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
    flex-shrink: 0;
}

.ind-bar-track {
    height: 8px;
    background: #e9ecf0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.ind-bar-fill {
    height: 100%;
    border-radius: 4px;
    max-width: 100%;
    min-width: 0;
    transition: width 0.4s ease;
}
.ind-bar-track.over {
    box-shadow: inset 0 0 0 2px rgba(239,68,68,0.6);
}

.ind-col-text {
    font-size: 0.64rem;
    color: #9ca3af;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.ind-col-text.nodata { font-style: italic; }

.ind-green  { background: linear-gradient(90deg, #059669, #10b981); }
.ind-yellow { background: linear-gradient(90deg, #d97706, #f59e0b); }
.ind-red    { background: linear-gradient(90deg, #dc2626, #ef4444); }
.ind-grey   { background: #d1d5db; }

/* ── Collapsible sections in project view ────────────────────── */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}
.collapsible-header:hover {
    opacity: 0.75;
}
.collapse-icon {
    display: inline-block;
    font-size: 0.7em;
    transition: transform 0.2s ease;
    width: 1em;
    text-align: center;
}
.collapsed .collapse-icon {
    transform: rotate(-90deg);
}
.collapsible-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 5000px;
    opacity: 1;
}
.collapsed .collapsible-body {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* === Header Three-Dot Menu === */
.header-menu-wrapper {
    position: relative;
    display: inline-block;
}
.btn-icon {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.btn-icon:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}
.header-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 200px;
    z-index: 1000;
    padding: 4px 0;
}
.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.12s;
    text-align: left;
}
.header-dropdown-item:hover {
    background: rgba(255,255,255,0.08);
}

/* === Tasks Section === */
.task-form-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.task-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 0.7fr 0.7fr 1fr;
    gap: 12px;
    align-items: end;
}
.task-fg-title { grid-column: 1 / 2; }
.task-form-grid .form-group label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 4px;
}
.task-form-grid .form-group input,
.task-form-grid .form-group select {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.25);
    color: #e2e8f0;
    font-size: 0.9rem;
}
.task-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}
.task-form-options {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

/* Tasks list table */
.tasks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.tasks-table th {
    text-align: left;
    padding: 8px 10px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.tasks-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
.tasks-table tr:hover td {
    background: rgba(255,255,255,0.03);
}
.tasks-table tr.task-done td {
    opacity: 0.5;
    text-decoration: line-through;
}
.tasks-table tr.task-priority td {
    background: rgba(242, 128, 118, 0.15);
}
.tasks-table tr.task-priority:hover td {
    background: rgba(242, 128, 118, 0.22);
}
.tasks-table tr.task-done td:last-child,
.tasks-table tr.task-done td .task-check {
    text-decoration: none;
    opacity: 1;
}

.task-check {
    cursor: pointer;
    font-size: 1.2rem;
    user-select: none;
}
.task-check:hover { opacity: 0.7; }
.task-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 4px;
}
.task-actions-cell button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px 4px;
    border-radius: 4px;
}
.task-actions-cell button:hover {
    background: rgba(255,255,255,0.1);
}
.task-deadline-overdue {
    color: #f87171;
    font-weight: 600;
}
.tasks-summary {
    display: flex;
    gap: 18px;
    padding: 10px 10px 4px;
    font-size: 0.85rem;
    color: #94a3b8;
}
.tasks-summary strong { color: #e2e8f0; }
@media (max-width: 900px) {
    .task-form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .task-fg-title { grid-column: 1 / -1; }
}

/* === Financial disabled message === */
.fin-disabled-msg {
    text-align: center;
    padding: 24px 16px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
}

/* === Financial disabled message spanning 3 KPI columns === */
.ind-fin-disabled-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 3;
    min-height: 48px;
    color: #9ca3af;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    padding: 0 12px;
}


/* === Customer Tasks Table Styles === */
#customerTasksTable {
    min-width: 700px;
}
#customerTasksTable tr.task-done td {
    opacity: 0.5;
    text-decoration: line-through;
}
#customerTasksTable tr.task-done td:last-child,
#customerTasksTable tr.task-done td:first-child {
    text-decoration: none;
    opacity: 1;
}
#customerTasksTable tr.task-priority td {
    background: rgba(242, 128, 118, 0.12);
}
#customerTasksTable tr.task-priority:hover td {
    background: rgba(242, 128, 118, 0.2);
}
#customerTasksTable .task-check {
    cursor: pointer;
    font-size: 1.1rem;
    user-select: none;
}
#customerTasksTable .task-check:hover { opacity: 0.7; }
#customerTasksTable .task-deadline-overdue {
    color: #ef4444;
    font-weight: 600;
}
