@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* KTM Brand Signature Colors */
    --primary: #ff6600;
    --primary-hover: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #fff7ed;
    --primary-border: #fed7aa;
    
    /* Harmonious Multi-color Palette (Rich & Soft, Non-glaring) */
    --accent-blue: #0284c7;
    --accent-blue-light: #f0f9ff;
    --accent-green: #10b981;
    --accent-green-light: #f0fdf4;
    --accent-purple: #7c3aed;
    --accent-purple-light: #f5f3ff;
    --accent-amber: #d97706;
    --accent-amber-light: #fffbeb;
    --accent-rose: #e11d48;
    --accent-rose-light: #fff1f2;
    
    /* Functional Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    
    /* Warm Stone Neutral Surfaces & Typography */
    --bg-main: #fcfcfb;
    --bg-card: #ffffff;
    --text-main: #1c1917;
    --text-muted: #78716c;
    --border: #e7e5e4;
    --readonly-bg: #f5f5f4;
    --input-focus: #ff6600;
    --shadow: 0 4px 6px -1px rgba(28, 25, 23, 0.05), 0 2px 4px -2px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.04);
}

[data-theme="dark"] {
    --primary: #ff771a;
    --primary-hover: #ff6600;
    --primary-dark: #ea580c;
    --primary-light: #381a04;
    --primary-border: #7c2d12;
    
    --accent-blue: #38bdf8;
    --accent-blue-light: #082f49;
    --accent-green: #34d399;
    --accent-green-light: #064e3b;
    --accent-purple: #a78bfa;
    --accent-purple-light: #2e1065;
    --accent-amber: #fbbf24;
    --accent-amber-light: #451a03;
    --accent-rose: #fb7185;
    --accent-rose-light: #4c0519;
    
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;
    
    --bg-main: #141416;
    --bg-card: #1f1f23;
    --text-main: #fafaf9;
    --text-muted: #a8a29e;
    --border: #38383e;
    --readonly-bg: #26262b;
    --input-focus: #ff771a;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

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

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

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

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

.btn-secondary {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--readonly-bg);
}

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

.btn-danger:hover {
    opacity: 0.9;
}

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

.btn-success:hover {
    filter: brightness(0.92);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0.6rem auto;
    padding: 0 0.75rem;
    display: grid;
    grid-template-columns: 275px 1fr;
    gap: 0.75rem;
}

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

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 0.9rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

select.form-control {
    cursor: pointer;
}

.contract-item-list {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.contract-item-card {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: var(--bg-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contract-item-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
}

.contract-item-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tabs-container {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.table-scroll-container {
    max-height: 60vh;
    overflow-y: auto;
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

th, td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    background-color: var(--readonly-bg);
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.76rem;
}

.table-inputs input.form-control {
    width: 55px !important;
    max-width: 60px !important;
    padding: 0.15rem 0.25rem !important;
    font-size: 0.75rem !important;
    height: 24px !important;
    line-height: 1;
    text-align: right;
    border-radius: 0.25rem;
}

/* Sticky Header cho Bảng GTTT */
.sticky-header-table thead th {
    position: sticky;
    background-color: var(--readonly-bg);
    box-shadow: inset 0 -1px 0 var(--border), inset 0 1px 0 var(--border);
    opacity: 1;
}
.sticky-header-table thead tr:nth-child(1) th {
    top: 0;
    z-index: 12;
}
.sticky-header-table thead tr:nth-child(2) th {
    top: 36px;
    z-index: 11;
}

/* Màu nền đặc 100% (không trong suốt) cho các nhóm cột khi scroll */
.sticky-header-table thead th.th-header-group-a {
    background-color: #e0f2fe;
    color: #0369a1;
}
.sticky-header-table thead th.th-header-sub-a {
    background-color: #f0f9ff;
    color: #0284c7;
}
.sticky-header-table thead th.th-header-group-b {
    background-color: #dcfce7;
    color: #15803d;
}
.sticky-header-table thead th.th-header-sub-b {
    background-color: #f0fdf4;
    color: #16a34a;
}
.sticky-header-table thead th.th-header-cum {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

[data-theme="dark"] .sticky-header-table thead th.th-header-group-a {
    background-color: #0c4a6e;
    color: #7dd3fc;
}
[data-theme="dark"] .sticky-header-table thead th.th-header-sub-a {
    background-color: #075985;
    color: #bae6fd;
}
[data-theme="dark"] .sticky-header-table thead th.th-header-group-b {
    background-color: #064e3b;
    color: #86efac;
}
[data-theme="dark"] .sticky-header-table thead th.th-header-sub-b {
    background-color: #065f46;
    color: #bbf7d0;
}
[data-theme="dark"] .sticky-header-table thead th.th-header-cum {
    background-color: var(--primary-light);
    color: var(--primary);
}

.table-inputs td input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    text-align: right;
    font-size: 0.85rem;
}

.table-inputs td input[readonly] {
    background-color: var(--readonly-bg);
    cursor: not-allowed;
    border-color: transparent;
}

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

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

/* ======================================================= */
/* BẢNG MẪU 03.a/TT CHUẨN BÁO CÁO NHÀ NƯỚC */
/* ======================================================= */
.m03-report-sheet {
    background-color: var(--card-bg, #ffffff);
    color: var(--text-main, #1e293b);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    font-family: 'Times New Roman', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

.m03-header-left {
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    line-height: 1.3;
    max-width: 65%;
}

.m03-header-right {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: right;
    white-space: nowrap;
}

.m03-main-title {
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
    margin: 0.85rem 0 1rem 0;
    color: var(--text-main, #0f172a);
    letter-spacing: 0.5px;
}

.m03-meta-info {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
}

.m03-meta-info p {
    margin: 0.15rem 0;
}

.m03-meta-info .meta-val {
    font-weight: 600;
    color: var(--text-main);
}

.m03-unit {
    text-align: right;
    font-style: italic;
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

/* Bảng 10 Cột Mẫu 03.a/TT */
.m03-table-10col {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    border: 1px solid #1e293b;
}

.m03-table-10col th,
.m03-table-10col td {
    border: 1px solid #334155;
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

.m03-table-10col th {
    background-color: var(--readonly-bg, #f8fafc);
    font-weight: 700;
    text-align: center;
}

.m03-table-10col tr.num-header td {
    text-align: center;
    font-weight: 600;
    font-size: 0.78rem;
    background-color: var(--readonly-bg, #f1f5f9);
}

/* Danh mục Dòng tiền Mẫu 03.a/TT (Mục 1 đến 6) */
.m03-cashflow-section {
    font-size: 0.92rem;
    line-height: 1.6;
}

.m03-cashflow-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.m03-cashflow-table td {
    padding: 0.3rem 0.25rem;
    border: none;
    vertical-align: top;
}

.m03-cashflow-table tr.cf-bold td {
    font-weight: 700;
}

.m03-cashflow-table .cf-label {
    text-align: left;
}

.m03-cashflow-table .cf-value {
    text-align: right;
    white-space: nowrap;
    width: 200px;
    font-variant-numeric: tabular-nums;
}

.m03-cashflow-table .cf-indent-1 {
    padding-left: 1.5rem;
}

.m03-cashflow-table .cf-indent-2 {
    padding-left: 3rem;
}

.m03-words-line {
    font-style: italic;
    font-weight: 600;
    color: var(--primary, #0d9488);
    margin: 0.35rem 0 0.5rem 0;
    padding-left: 0;
    font-size: 0.9rem;
}

/* Toggle Switch & Tiện ích */
.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 2.5rem;
    height: 1.25rem;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 0.875rem;
    width: 0.875rem;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

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

input:checked + .slider:before {
    transform: translateX(1.1rem);
}

.text-number-words {
    font-style: italic;
    color: var(--primary);
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-left: 3px solid var(--primary);
    background-color: var(--primary-light);
    border-radius: 0 0.25rem 0.25rem 0;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

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

.badge-neutral {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.badge-success {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

[data-theme="dark"] .badge-neutral {
    background-color: #1e293b;
    color: #94a3b8;
    border-color: #475569;
}

[data-theme="dark"] .badge-success {
    background-color: #064e3b;
    color: #34d399;
    border-color: #059669;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

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

.mt-3 {
    margin-top: 1.5rem;
}

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

.hidden {
    display: none !important;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
    stroke: currentColor;
}

/* --- Cấu hình hiển thị theo thiết bị (Responsive) --- */
.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

/* Responsive trên mobile/tablet */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.75rem;
    }
    
    .header-actions select {
        width: 100% !important;
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    .tabs-container {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .tab-btn {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        border-bottom: 2px solid transparent;
        border-left: 2px solid transparent;
    }
    
    .tab-btn.active {
        border-bottom-color: transparent;
        border-left-color: var(--primary);
        background-color: var(--readonly-bg);
    }
    
    /* Mobile cards style */
    .mobile-card {
        background-color: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 0.5rem;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow);
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        border-bottom: 1px solid var(--border);
        padding-bottom: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-card-title {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-main);
    }
    
    .mobile-card-grid {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 0.35rem 0.5rem;
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-card-label {
        color: var(--text-muted);
        font-weight: 500;
    }
    
    .mobile-card-value {
        text-align: right;
        font-weight: 600;
        color: var(--text-main);
    }
    
    .mobile-card-inputs {
        border-top: 1px dashed var(--border);
        padding-top: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .mobile-input-group {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .mobile-input-group label {
        font-size: 0.8rem;
        font-weight: 500;
        color: var(--text-muted);
    }
    
    .mobile-input-group input {
        width: 120px;
        text-align: right;
    }
    
    /* Mẫu 03.a responsive */
    .cashflow-table th, .cashflow-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    #cf-line4-input {
        width: 130px !important;
    }
}

/* Modal Popup Styles for Cloud Sync */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: 0.85rem;
    width: 90%;
    max-width: 520px;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-15px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

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

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
    border-radius: 0.25rem;
    transition: color 0.15s;
}

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

/* Footer Styling */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-card);
}

/* Financial Summary & Contractor Recovery Bar */
.financial-summary-container {
    background: var(--readonly-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.financial-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kpi-card.highlight {
    border: 2px solid var(--primary);
    background: var(--primary-light);
}

.kpi-card.closed {
    border: 2px solid var(--success);
    background: rgba(16, 185, 129, 0.08);
}

.kpi-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.kpi-card.highlight .kpi-value {
    color: var(--primary-hover);
    font-size: 1.25rem;
}

.kpi-subtext {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Contract Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.78rem;
    font-weight: 600;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    word-break: break-word;
    box-sizing: border-radius;
    line-height: 1.25;
}

.badge-status-in-progress {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid #f59e0b;
}

.badge-status-settlement-pending {
    background: rgba(14, 165, 233, 0.15);
    color: #0369a1;
    border: 1px solid #0ea5e9;
}

.badge-status-closed {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border: 1px solid #10b981;
}

/* Trash / Delete Icon Button in Table */
.btn-remove-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-remove-icon:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* Edit Icon Button in Table */
.btn-edit-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-edit-icon:hover {
    background-color: rgba(13, 148, 136, 0.1);
    border-color: var(--primary);
}

/* ==========================================================================
   PROJECT MANAGEMENT & TRACKING SYSTEM (MODULE 1 & 2 STYLES)
   ========================================================================== */

/* Top Module Switcher Bar */
.module-switcher-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.25rem;
}

.module-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    background: var(--readonly-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-bottom: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.module-btn:hover {
    background: var(--bg-card);
    color: var(--primary);
}

.module-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

/* Dashboard KPI Grid */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.success::before { background: var(--success); }

.kpi-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Progress bar inside card */
.kpi-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--readonly-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.kpi-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.kpi-progress-fill.warning {
    background: linear-gradient(90deg, var(--warning), #f97316);
}

.kpi-progress-fill.danger {
    background: linear-gradient(90deg, var(--danger), #dc2626);
}

/* Kanban Board Layout */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 1100px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-column {
    background: var(--readonly-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-main);
}

.kanban-col-count {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.kanban-task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    user-select: none;
    cursor: grab;
}

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

.kanban-card-stt-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(13, 148, 136, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    display: inline-block;
    align-self: flex-start;
}

.kanban-card-title-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
}

.kanban-task-card.dragging {
    opacity: 0.4;
    transform: scale(0.97);
    border: 2px dashed var(--primary) !important;
}

.kanban-column {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kanban-column.drag-over {
    background: rgba(13, 148, 136, 0.08) !important;
    border: 2px dashed var(--primary) !important;
    box-shadow: inset 0 0 10px rgba(13, 148, 136, 0.15);
}

.kanban-task-stt {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

.kanban-task-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.kanban-task-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* PM Status Badges */
.badge-pm-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    word-break: break-word;
    box-sizing: border-box;
    line-height: 1.2;
}

.badge-chua_dat_hang { background: rgba(148, 163, 184, 0.15); color: #64748b; border: 1px solid #cbd5e1; }
.badge-da_dat_hang { background: rgba(139, 92, 246, 0.15); color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-nghiem_thu_ky_thuat { background: rgba(14, 165, 233, 0.15); color: #0284c7; border: 1px solid #bae6fd; }
.badge-dang_thi_cong { background: rgba(245, 158, 11, 0.15); color: #d97706; border: 1px solid #fde68a; }
.badge-cho_nghiem_thu { background: rgba(59, 130, 246, 0.15); color: #2563eb; border: 1px solid #bfdbfe; }
.badge-hoan_thanh { background: rgba(16, 185, 129, 0.15); color: #059669; border: 1px solid #a7f3d0; }
.badge-overdue { background: rgba(239, 68, 68, 0.15); color: #dc2626; border: 1px solid #fecaca; }


/* Visual Gantt Chart V2 UI Styles */
.gantt-v2-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.85rem;
    background: var(--bg-card);
    border-radius: 0.85rem;
}

.gantt-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--border);
}

.gantt-v2-stats {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.gantt-v2-stat-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--readonly-bg);
    border: 1px solid var(--border);
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
}

.gantt-v2-stat-chip .chip-num {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--primary);
}

.gantt-v2-stat-chip.text-amber .chip-num { color: #d97706; }
.gantt-v2-stat-chip.text-sky .chip-num { color: #0284c7; }
.gantt-v2-stat-chip.text-emerald .chip-num { color: #059669; }

.gantt-v2-legend {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.73rem;
    color: var(--text-muted);
}

.gantt-legend-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.gantt-legend-tag .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.bg-chua_dat_hang { background: #64748b; }
.dot.bg-da_dat_hang { background: #7c3aed; }
.dot.bg-nghiem_thu_ky_thuat { background: #0284c7; }
.dot.bg-dang_thi_cong { background: #d97706; }
.dot.bg-cho_nghiem_thu { background: #2563eb; }
.dot.bg-hoan_thanh { background: #059669; }

/* Timeline Axis Header */
.gantt-v2-timeline-header {
    display: flex;
    align-items: center;
    background: var(--readonly-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.gantt-v2-timeline-label {
    width: 310px;
    flex-shrink: 0;
}

.gantt-v2-timeline-axis {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
}

/* Rows & Bars */
.gantt-v2-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gantt-v2-row {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    gap: 0.85rem;
    transition: all 0.2s ease;
}

.gantt-v2-row:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.08);
    transform: translateY(-1px);
}

.gantt-v2-left {
    width: 310px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gantt-v2-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.gantt-v2-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.gantt-v2-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.gantt-v2-dates {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.gantt-v2-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gantt-v2-track {
    position: relative;
    flex: 1;
    height: 28px;
    background: var(--readonly-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.gantt-v2-bar {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.4rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Gradients theo trạng thái */
.gantt-bar-chua_dat_hang { background: linear-gradient(90deg, #94a3b8, #64748b); }
.gantt-bar-da_dat_hang { background: linear-gradient(90deg, #c084fc, #7c3aed); }
.gantt-bar-nghiem_thu_ky_thuat { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.gantt-bar-dang_thi_cong { background: linear-gradient(90deg, #fbbf24, #d97706); }
.gantt-bar-cho_nghiem_thu { background: linear-gradient(90deg, #60a5fa, #1d4ed8); }
.gantt-bar-hoan_thanh { background: linear-gradient(90deg, #34d399, #059669); }

.gantt-v2-bar-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.gantt-v2-bar-label {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    white-space: nowrap;
}

.gantt-empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .gantt-v2-left, .gantt-v2-timeline-label {
        width: 100%;
    }
    .gantt-v2-row {
        flex-direction: column;
        align-items: stretch;
    }
    .gantt-v2-right {
        width: 100%;
    }
}


/* Site Logs / Journal Feed */
.site-log-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.site-log-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.site-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.4rem;
}

.site-log-content {
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: pre-line;
    line-height: 1.4;
}

.site-log-issues {
    margin-top: 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: #b45309;
}

.site-log-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.site-log-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    user-select: none;
}

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

.site-log-btn.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Flatpickr Datepicker Custom Theming */
.flatpickr-calendar {
    font-family: inherit;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.endRange.nextMonthDay {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.flatpickr-day:hover {
    background: var(--primary-light) !important;
}
[data-theme="dark"] .flatpickr-calendar {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .flatpickr-months .flatpickr-month,
[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
[data-theme="dark"] .flatpickr-current-month input.cur-year {
    color: var(--text-main);
    fill: var(--text-main);
}
[data-theme="dark"] .flatpickr-weekday {
    color: var(--text-muted);
}
[data-theme="dark"] .flatpickr-day {
    color: var(--text-main);
}
[data-theme="dark"] .flatpickr-day.flatpickr-disabled,
[data-theme="dark"] .flatpickr-day.prevMonthDay,
[data-theme="dark"] .flatpickr-day.nextMonthDay {
    color: var(--text-muted);
    opacity: 0.4;
}
[data-theme="dark"] .flatpickr-months .flatpickr-prev-month svg,
[data-theme="dark"] .flatpickr-months .flatpickr-next-month svg {
    fill: var(--text-main);
}

/* ======================================================== */
/* ACCORDION / COLLAPSIBLE SIDEBAR SECTIONS                 */
/* ======================================================== */
.accordion-card {
    background: var(--readonly-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    user-select: none;
    background: var(--readonly-bg);
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: rgba(13, 148, 136, 0.08);
}

.accordion-arrow {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.accordion-arrow.expanded {
    transform: rotate(90deg);
}

.badge-summary {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.accordion-content {
    padding: 0.65rem 0.75rem;
    border-top: 1px dashed var(--border);
    background: var(--bg-card);
}

/* ======================================================== */
/* SMART ALERT CARDS                                        */
/* ======================================================== */
.alert-card-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all 0.2s ease;
}

.alert-card-item:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow);
}

.alert-card-item.danger {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.04);
}

.alert-card-item.warning {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.04);
}

.alert-card-item.info {
    border-left: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.04);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1;
}

.alert-body {
    flex: 1;
}

.alert-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.alert-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* ======================================================== */
/* SUBCONTRACTS & SUPPLIERS CARDS                           */
/* ======================================================== */
.subcontract-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.subcontract-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

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

.subcontract-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.subcontract-supplier-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.subcontract-package {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.subcontract-finance-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: var(--readonly-bg);
    padding: 0.5rem 0.65rem;
    border-radius: 0.4rem;
    margin-bottom: 0.75rem;
    font-size: 0.76rem;
}

.countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.countdown-pill.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.countdown-pill.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.countdown-pill.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ======================================================== */
/* VIEW MODE TOGGLE & GANTT TODAY LINE                      */
/* ======================================================== */
.btn-toggle {
    background: transparent;
    border: none;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle.active {
    background: var(--primary);
    color: #ffffff;
}

.gantt-today-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--danger);
    z-index: 10;
    pointer-events: none;
}

.gantt-today-badge {
    position: absolute;
    top: -18px;
    transform: translateX(-50%);
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.05rem 0.35rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

/* ======================================================== */
/* GLASSMORPHISM & MODERN POLISH                            */
/* ======================================================== */
header {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] header {
    background: rgba(30, 41, 59, 0.88);
}

/* Sidebar Collapse (Full-Width Mode) */
.container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.sidebar-collapsed {
    grid-template-columns: 1fr !important;
}

.container.sidebar-collapsed .sidebar {
    display: none !important;
}

/* Enhanced KPI Cards */
.kpi-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    opacity: 0.8;
}

.kpi-card.danger::after {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

.kpi-card.warning::after {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.kpi-card.success::after {
    background: linear-gradient(90deg, #34d399, #10b981);
}

/* ======================================================== */
/* SMART WIDGET 1: PROJECT HEALTH SCORE GAUGE               */
/* ======================================================== */
.health-score-card {
    background: linear-gradient(145deg, var(--bg-card), var(--readonly-bg));
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.health-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.health-score-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.health-score-body {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.health-gauge-svg {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.health-gauge-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.health-gauge-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.health-gauge-text {
    font-size: 1.5rem;
    font-weight: 800;
    fill: var(--text-main);
    text-anchor: middle;
    dominant-baseline: central;
}

.health-score-meta {
    flex: 1;
}

.health-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 1rem;
    margin-bottom: 0.4rem;
}

.health-status-badge.excellent {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.health-status-badge.good {
    background: rgba(13, 148, 136, 0.15);
    color: var(--primary);
    border: 1px solid rgba(13, 148, 136, 0.3);
}

.health-status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.health-status-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.health-submetrics {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ======================================================== */
/* SMART WIDGET 2: SMART AI INSIGHTS & RECOMMENDATIONS      */
/* ======================================================== */
.smart-insights-card {
    background: linear-gradient(145deg, var(--bg-card), var(--readonly-bg));
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.smart-insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.smart-insights-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.smart-insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.insight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.insight-item:hover {
    border-color: var(--primary);
    transform: translateX(2px);
}

.insight-item-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-main);
}

.insight-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.insight-action-btn {
    background: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid rgba(13, 148, 136, 0.25);
    padding: 0.25rem 0.65rem;
    border-radius: 0.375rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.insight-action-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

/* ======================================================== */
/* QUICK FILTER PILLS                                       */
/* ======================================================== */
.quick-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.quick-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.quick-pill.danger.active {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.quick-pill.warning.active {
    background: var(--warning);
    border-color: var(--warning);
    color: #ffffff;
}

.quick-pill.info.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.quick-pill.success.active {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

/* ======================================================== */
/* FLOATING QUICK ACTIONS BAR (FAB)                         */
/* ======================================================== */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.75rem;
}

.fab-main-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-main-btn:hover {
    transform: scale(1.08) rotate(45deg);
    box-shadow: 0 12px 28px rgba(13, 148, 136, 0.5);
}

.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-container.open .fab-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.fab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.5rem 0.85rem;
    border-radius: 2rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fab-item:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
    border-color: var(--primary);
    transform: translateX(-4px);
}

.fab-icon {
    font-size: 1rem;
}

/* ======================================================== */
/* ======================================================== */
/* TOAST NOTIFICATION STYLING (MINIMAL COMPACT PILL)        */
/* ======================================================== */
.toast {
    position: fixed !important;
    bottom: 5.5rem !important;
    right: 2rem !important;
    top: auto !important;
    left: auto !important;
    z-index: 999999 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    color: #f8fafc !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 2rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(8px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(8px) scale(0.95) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    max-width: fit-content !important;
    width: auto !important;
    min-width: 0 !important;
}

.toast.show {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
}

.toast-success {
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #34d399 !important;
}

.toast-danger {
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #f87171 !important;
}

.toast-warning {
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: #fbbf24 !important;
}

.toast-info {
    border-color: rgba(45, 212, 191, 0.5) !important;
    color: #2dd4bf !important;
}

.toast-icon {
    font-size: 0.85rem !important;
    flex-shrink: 0 !important;
}

.toast-text {
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* ============================================================
   GOOGLE SIGN-IN & DRIVE CLOUD SYNC STYLES
   ============================================================ */
.btn-google-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: #ffffff;
    color: #3c4043;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border: 1px solid #dadce0;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 320px;
}

.btn-google-login:hover {
    background-color: #f8fafd;
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.2), 0 1px 2px rgba(60, 64, 67, 0.24);
    border-color: #d2e3fc;
    transform: translateY(-1px);
}

.btn-google-login:active {
    background-color: #eeeeee;
    transform: translateY(0);
}

.dark .btn-google-login {
    background-color: #202124;
    color: #e8eaed;
    border-color: #5f6368;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .btn-google-login:hover {
    background-color: #303134;
    border-color: #8ab4f8;
}

.gdrive-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: var(--readonly-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.gdrive-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.gdrive-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 118, 110, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
}

/* ============================================================
   BULK WORK ITEM PROGRESS & STATUS ACTION TOOLBAR
   ============================================================ */
.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.08) 0%, rgba(2, 132, 199, 0.08) 100%);
    border: 1px solid var(--primary-border);
    border-radius: 0.6rem;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    transition: all 0.25s ease;
    animation: fadeIn 0.2s ease-in-out;
}

[data-theme="dark"] .bulk-action-bar {
    background: linear-gradient(135deg, rgba(255, 119, 26, 0.15) 0%, rgba(56, 189, 248, 0.12) 100%);
    border-color: rgba(255, 119, 26, 0.35);
}

.table-row-selected {
    background-color: rgba(255, 102, 0, 0.08) !important;
}

[data-theme="dark"] .table-row-selected {
    background-color: rgba(255, 119, 26, 0.18) !important;
}

.bulk-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
    vertical-align: middle;
}







