body { background:#f5f6f8; color:#20242a; }
.app-topbar { min-height:56px; }
.sidebar { min-height:calc(100vh - 56px); background:#fff; border-right:1px solid #e6e8eb; position:sticky; top:56px; height:calc(100vh - 56px); overflow-y:auto; }
.sidebar .nav-link { color:#363b42; border-radius:8px; padding:.65rem .75rem; }
.sidebar .nav-link:hover { background:#f0f2f5; }
.sidebar .nav-link.active { background:#20242a; color:#fff; }
.sidebar-caption { font-size:.68rem; font-weight:700; letter-spacing:.08em; color:#9298a0; margin:.35rem .75rem .2rem; }
.disabled-link { cursor:default; }
.metric-card { background:#fff; border:1px solid #e6e8eb; border-radius:12px; padding:18px; height:100%; box-shadow:0 2px 8px rgba(20,30,40,.04); }
.metric-card.compact { padding:14px 16px; }
.metric-label { color:#6c757d; font-size:.82rem; min-height:2.4em; }
.metric-value { font-size:1.9rem; font-weight:700; margin-top:4px; }
.card { border:1px solid #e6e8eb; border-radius:12px; }
.login-wrap { min-height:75vh; display:flex; align-items:center; justify-content:center; }
.login-card { width:min(420px, 100%); }
.login-card input { display:block; width:100%; padding:.6rem .75rem; border:1px solid #ced4da; border-radius:.375rem; }
.module-tile { border:1px solid #e4e7eb; border-radius:10px; padding:16px; background:#fafbfc; }
.module-tile.muted { color:#8a9097; }
.tiny { font-size:.68rem; }
.muted-link { color:#8a9097 !important; }
.table thead th { font-size:.78rem; color:#6c757d; font-weight:600; background:#fafbfc; white-space:nowrap; }
code { color:#5c2d91; }
.sticky-save { position:sticky; bottom:12px; display:flex; justify-content:flex-end; pointer-events:none; }
.sticky-save .btn { pointer-events:auto; box-shadow:0 4px 16px rgba(0,0,0,.15); }
.app-breadcrumb { font-size:.82rem; }
.app-breadcrumb a { color:#6c757d; text-decoration:none; }
.project-tabs .nav-link { color:#5d636a; white-space:nowrap; }
.project-tabs .nav-link.active { color:#111; font-weight:600; }
.status-pill { display:inline-flex; align-items:center; border-radius:999px; padding:.3rem .6rem; font-size:.74rem; font-weight:600; background:#eef0f2; }
.status-active { background:#e9f7ef; color:#187341; }
.status-at_risk { background:#fff4d6; color:#8a6200; }
.status-delayed { background:#fdeaea; color:#9c2f2f; }
.status-completed { background:#e8f1ff; color:#285ea8; }
.status-on_hold, .status-archived, .status-cancelled { background:#eceff2; color:#5e646b; }
.status-draft, .status-planning { background:#f1edff; color:#5941a9; }
.detail-list { margin:0; }
.detail-list dt { color:#777e86; font-size:.78rem; font-weight:600; margin-top:.9rem; }
.detail-list dt:first-child { margin-top:0; }
.detail-list dd { margin-bottom:0; }
.mini-stat { border:1px solid #e6e8eb; border-radius:10px; text-align:center; padding:14px 8px; height:100%; }
.mini-stat strong { display:block; font-size:1.4rem; }
.mini-stat span { color:#777e86; font-size:.72rem; }
.empty-module { border-style:dashed; }
@media (max-width: 767.98px) { main { min-height:calc(100vh - 56px); } .metric-value { font-size:1.55rem; } }

/* STEP 6 — Task & Schedule / Công việc & tiến độ */
.task-metric-link { transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.task-metric-link:hover { transform:translateY(-1px); box-shadow:0 5px 16px rgba(20,30,40,.08); border-color:#cfd3d8; }
.metric-active { border-color:#20242a; box-shadow:inset 0 0 0 1px #20242a; }
.task-overdue-row > td { background:#fff7f7 !important; }
.task-status-completed, .task-status-approved { background:#e9f7ef; color:#187341; }
.task-status-in_progress { background:#e8f1ff; color:#285ea8; }
.task-status-waiting_review { background:#fff4d6; color:#8a6200; }
.task-status-revision_required { background:#fdeaea; color:#9c2f2f; }
.task-status-on_hold, .task-status-cancelled, .task-status-waiting { background:#eceff2; color:#5e646b; }
.task-status-not_started { background:#f1edff; color:#5941a9; }
.task-comments { display:flex; flex-direction:column; gap:.65rem; }
.task-comment { border-left:3px solid #d9dde2; background:#fafbfc; padding:.75rem .9rem; border-radius:0 8px 8px 0; }

.gantt-card { overflow:hidden; }
.gantt-wrap { min-width:900px; }
.gantt-header-row, .gantt-row { display:grid; grid-template-columns:280px 1fr; min-height:64px; border-bottom:1px solid #eceff2; }
.gantt-header-row { min-height:46px; background:#fafbfc; position:sticky; top:0; z-index:2; }
.gantt-task-col { padding:.7rem .85rem; border-right:1px solid #eceff2; overflow:hidden; }
.gantt-timeline { position:relative; min-height:100%; background-image:linear-gradient(to right, rgba(30,36,42,.055) 1px, transparent 1px); background-size:14.285% 100%; }
.gantt-ticks { position:absolute; inset:0; }
.gantt-ticks span { position:absolute; top:.75rem; transform:translateX(-50%); font-size:.68rem; color:#777e86; white-space:nowrap; }
.gantt-bar { position:absolute; top:20px; height:24px; min-width:8px; background:#20242a; border-radius:6px; color:#fff; text-decoration:none; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.18); }
.gantt-bar:hover { color:#fff; filter:brightness(1.15); }
.gantt-bar span { display:block; font-size:.68rem; line-height:24px; padding:0 6px; white-space:nowrap; }
.gantt-overdue { background:#a33a3a; }
.gantt-today { position:absolute; top:0; bottom:0; width:2px; background:#d94841; z-index:1; opacity:.75; }
@media (max-width: 767.98px) { .gantt-wrap { min-width:760px; } .gantt-header-row, .gantt-row { grid-template-columns:220px 1fr; } }


/* STEP 7 — Documents / Hồ sơ */
.doc-cde-working { background:#f1edff; color:#5941a9; }
.doc-cde-shared { background:#e8f1ff; color:#285ea8; }
.doc-cde-published { background:#e9f7ef; color:#187341; }
.doc-cde-archive { background:#eceff2; color:#5e646b; }
.doc-version-row { border-bottom:1px solid #eceff2; }
.doc-version-row:last-child { border-bottom:0; }
.doc-version-current { background:#fbfcfd; box-shadow:inset 3px 0 0 #20242a; }

/* STEP 7 v0.6 — Hybrid File & Document Management */
.file-health { display:inline-flex; border-radius:999px; padding:.25rem .55rem; font-size:.72rem; font-weight:600; background:#eef0f2; }
.file-health-up_to_date { background:#e9f7ef; color:#187341; }
.file-health-update_required { background:#fff4d6; color:#8a6200; }
.file-health-never_uploaded, .file-health-missing { background:#fdeaea; color:#9c2f2f; }
.file-health-unavailable { background:#eceff2; color:#5e646b; }
.storage-type-card { border:1px solid #e3e6ea; border-radius:10px; padding:14px; background:#fafbfc; }
.quarantine-box { border-left:4px solid #d69e00; background:#fff8df; padding:.8rem 1rem; border-radius:0 8px 8px 0; }
.path-box { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; background:#f3f4f6; border-radius:8px; padding:.55rem .7rem; word-break:break-all; }


/* STEP 9 — Commercial, Finance & Reports */
.report-options ul, .report-project-list ul, .report-section-list ul { list-style:none; padding-left:0; margin-bottom:0; }
.report-options li, .report-project-list li, .report-section-list li { padding:.45rem .55rem; border-bottom:1px solid #eceff2; }
.report-options li:last-child, .report-project-list li:last-child, .report-section-list li:last-child { border-bottom:0; }
.report-project-list, .report-section-list { max-height:360px; overflow:auto; border:1px solid #e6e8eb; border-radius:10px; background:#fff; }
.report-options { border:1px solid #e6e8eb; border-radius:10px; background:#fff; }
.report-options label, .report-project-list label, .report-section-list label { display:flex; align-items:flex-start; gap:.55rem; cursor:pointer; }
.report-options input, .report-project-list input, .report-section-list input { margin-top:.2rem; }
.finance-negative { color:#9c2f2f; }

/* STEP 11 — Executive Dashboard / Tổng quan điều hành */
.executive-panel { border-color:#d9dde2; background:linear-gradient(180deg,#fff,#fbfcfd); }
.dashboard-kpi { border:1px solid #e4e7eb; border-radius:10px; padding:13px 14px; background:#fff; height:100%; }
.dashboard-kpi span { display:block; color:#747b83; font-size:.72rem; min-height:2.2em; }
.dashboard-kpi strong { display:block; margin-top:.25rem; font-size:1rem; word-break:break-word; }
.dashboard-kpi-danger { border-color:#efc8c8; background:#fffafa; }
.dashboard-project-table td { vertical-align:middle; }
.dashboard-project-name { max-width:260px; white-space:normal; }
.dashboard-count { font-weight:700; }
.dashboard-status-list .progress { background:#eef0f2; }
@media (max-width: 1199.98px) { .dashboard-project-table { min-width:920px; } }

/* STEP 15 — Network & Storage Migration */
.migration-project-list ul { list-style:none; padding-left:0; margin:0; max-height:280px; overflow:auto; }
.migration-project-list li { padding:.3rem .25rem; }
.migration-project-list label { display:flex; gap:.5rem; align-items:flex-start; }

/* STEP 15 v2.2.4 - T+Manager theme selector / Chon giao dien */
html { color-scheme: light; }
html[data-bs-theme="dark"] { color-scheme: dark; }
body, .sidebar, .card, .metric-card, .module-tile, .mini-stat, .table, .form-control, .form-select, .input-group-text, .offcanvas, .dropdown-menu {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.theme-picker .dropdown-menu { min-width: 230px; }
.theme-picker .dropdown-item { gap: 1rem; }
.theme-check { min-width: 1rem; text-align: center; font-weight: 700; }

html[data-bs-theme="dark"] body { background:#15181c; color:#e6e9ed; }
html[data-bs-theme="dark"] .sidebar { background:#1d2126; border-right-color:#343a40; }
html[data-bs-theme="dark"] .sidebar .nav-link { color:#cfd4da; }
html[data-bs-theme="dark"] .sidebar .nav-link:hover { background:#2a2f35; color:#fff; }
html[data-bs-theme="dark"] .sidebar .nav-link.active { background:#f1f3f5; color:#17191c; }
html[data-bs-theme="dark"] .sidebar-caption { color:#858d96; }
html[data-bs-theme="dark"] .metric-card,
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .dashboard-kpi,
html[data-bs-theme="dark"] .mini-stat,
html[data-bs-theme="dark"] .module-tile,
html[data-bs-theme="dark"] .storage-type-card,
html[data-bs-theme="dark"] .report-options,
html[data-bs-theme="dark"] .report-project-list,
html[data-bs-theme="dark"] .report-section-list { background:#1f242a; border-color:#363c43; color:#e6e9ed; }
html[data-bs-theme="dark"] .executive-panel { background:linear-gradient(180deg,#20252b,#1b1f24); border-color:#363c43; }
html[data-bs-theme="dark"] .metric-label,
html[data-bs-theme="dark"] .mini-stat span,
html[data-bs-theme="dark"] .detail-list dt,
html[data-bs-theme="dark"] .dashboard-kpi span,
html[data-bs-theme="dark"] .app-breadcrumb a,
html[data-bs-theme="dark"] .project-tabs .nav-link,
html[data-bs-theme="dark"] .gantt-ticks span { color:#a9b0b8; }
html[data-bs-theme="dark"] .project-tabs .nav-link.active { color:#f4f6f8; }
html[data-bs-theme="dark"] .table { --bs-table-bg:#1f242a; --bs-table-color:#e6e9ed; --bs-table-border-color:#373d44; --bs-table-striped-bg:#242a30; --bs-table-striped-color:#e6e9ed; --bs-table-hover-bg:#2a3037; --bs-table-hover-color:#fff; }
html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .gantt-header-row { background:#242a30; color:#b7bec6; }
html[data-bs-theme="dark"] .task-comment,
html[data-bs-theme="dark"] .doc-version-current { background:#22282e; }
html[data-bs-theme="dark"] .task-overdue-row > td { background:#342428 !important; }
html[data-bs-theme="dark"] .gantt-header-row,
html[data-bs-theme="dark"] .gantt-row,
html[data-bs-theme="dark"] .gantt-task-col,
html[data-bs-theme="dark"] .doc-version-row,
html[data-bs-theme="dark"] .report-options li,
html[data-bs-theme="dark"] .report-project-list li,
html[data-bs-theme="dark"] .report-section-list li { border-color:#363c43; }
html[data-bs-theme="dark"] .gantt-timeline { background-image:linear-gradient(to right, rgba(235,240,245,.07) 1px, transparent 1px); }
html[data-bs-theme="dark"] .path-box { background:#262c32; color:#e6e9ed; }
html[data-bs-theme="dark"] .quarantine-box { background:#3a321c; color:#f1e5b9; }
html[data-bs-theme="dark"] .login-card input { background:#20262c; color:#eef1f4; border-color:#444b53; }
html[data-bs-theme="dark"] .login-card input::placeholder { color:#89919a; }
html[data-bs-theme="dark"] code { color:#d7a9ff; }
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] textarea,
html[data-bs-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-bs-theme="dark"] select { background-color:#20262c; color:#eef1f4; border-color:#444b53; }
html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus,
html[data-bs-theme="dark"] textarea:focus,
html[data-bs-theme="dark"] input:focus,
html[data-bs-theme="dark"] select:focus { background-color:#252b32; color:#fff; border-color:#6c757d; }
html[data-bs-theme="dark"] .input-group-text { background:#2a3036; color:#cbd1d7; border-color:#444b53; }
html[data-bs-theme="dark"] .text-muted { color:#a5adb5 !important; }
html[data-bs-theme="dark"] .border,
html[data-bs-theme="dark"] .border-top,
html[data-bs-theme="dark"] .border-bottom { border-color:#3a4047 !important; }
html[data-bs-theme="dark"] .bg-white { background-color:#1f242a !important; }
html[data-bs-theme="dark"] .bg-light { background-color:#242a30 !important; }

/* Keep semantic status chips readable in dark mode. */
html[data-bs-theme="dark"] .status-active,
html[data-bs-theme="dark"] .task-status-completed,
html[data-bs-theme="dark"] .task-status-approved,
html[data-bs-theme="dark"] .file-health-up_to_date { background:#173a2a; color:#8fe0b4; }
html[data-bs-theme="dark"] .status-at_risk,
html[data-bs-theme="dark"] .task-status-waiting_review,
html[data-bs-theme="dark"] .file-health-update_required { background:#3c3217; color:#efd477; }
html[data-bs-theme="dark"] .status-delayed,
html[data-bs-theme="dark"] .task-status-revision_required,
html[data-bs-theme="dark"] .file-health-never_uploaded,
html[data-bs-theme="dark"] .file-health-missing { background:#402426; color:#f0a1a6; }
html[data-bs-theme="dark"] .status-completed,
html[data-bs-theme="dark"] .task-status-in_progress { background:#1c304a; color:#9cc8ff; }
html[data-bs-theme="dark"] .status-draft,
html[data-bs-theme="dark"] .status-planning,
html[data-bs-theme="dark"] .task-status-not_started,
html[data-bs-theme="dark"] .doc-cde-working { background:#30274d; color:#cbbdff; }
html[data-bs-theme="dark"] .status-on_hold,
html[data-bs-theme="dark"] .status-archived,
html[data-bs-theme="dark"] .status-cancelled,
html[data-bs-theme="dark"] .task-status-on_hold,
html[data-bs-theme="dark"] .task-status-cancelled,
html[data-bs-theme="dark"] .task-status-waiting,
html[data-bs-theme="dark"] .file-health-unavailable { background:#30353b; color:#c7cdd3; }

@media (max-width: 575.98px) {
  .theme-picker .dropdown-menu { min-width: 210px; }
  .app-topbar .navbar-brand { font-size:1rem; }
}

/* Step 15 v2.2.5 — mobile/readability refinement */
.path-details > summary { cursor:pointer; color:var(--bs-link-color); font-weight:600; white-space:nowrap; }
.path-details[open] > summary { margin-bottom:.25rem; }
.assistant-ask-button { min-height:48px; padding:.7rem 1.1rem; box-shadow:0 .2rem .5rem rgba(13,110,253,.2); }
@media (max-width: 767.98px) {
  .assistant-ask-button { width:100%; font-size:1.05rem; }
}
html[data-bs-theme="dark"] .btn-outline-dark {
  color:#f4f6f8 !important;
  border-color:#8b949e !important;
  background-color:#242a30;
}
html[data-bs-theme="dark"] .btn-outline-dark:hover,
html[data-bs-theme="dark"] .btn-outline-dark:focus {
  color:#111418 !important;
  background-color:#e9ecef !important;
  border-color:#e9ecef !important;
}
html[data-bs-theme="dark"] .btn-dark {
  color:#111418 !important;
  background-color:#f1f3f5 !important;
  border-color:#f1f3f5 !important;
}
html[data-bs-theme="dark"] .btn-dark:hover,
html[data-bs-theme="dark"] .btn-dark:focus {
  color:#0b0d0f !important;
  background-color:#ffffff !important;
  border-color:#ffffff !important;
}
html[data-bs-theme="dark"] .btn-outline-secondary { color:#dfe3e7; border-color:#78818b; }
html[data-bs-theme="dark"] .btn-outline-secondary:hover { color:#111418; background:#cfd4da; border-color:#cfd4da; }
html[data-bs-theme="dark"] .card-header.bg-white { background-color:#242a30 !important; color:#eef1f4; }
html[data-bs-theme="dark"] .dropdown-menu { background-color:#242a30; border-color:#414850; }
html[data-bs-theme="dark"] .dropdown-item { color:#e6e9ed; }
html[data-bs-theme="dark"] .dropdown-item:hover { background-color:#30363d; color:#fff; }
html[data-bs-theme="dark"] .path-details > summary { color:#9ec5fe; }

/* Step 17.2 / Project UX refinement */
.min-w-0{min-width:0}
.project-side-nav-card{position:sticky;top:1rem}
.project-vertical-nav .list-group-item{border:0;border-radius:.55rem!important;margin-bottom:.25rem;padding:.7rem .8rem;font-size:.92rem}
.project-vertical-nav .list-group-item.active{background:var(--bs-dark);color:#fff}
.project-overview-stack .detail-list{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr);gap:.35rem 1rem}
.project-overview-stack .detail-list dt{color:var(--bs-secondary-color);font-weight:600}
.project-overview-stack .detail-list dd{margin-bottom:.25rem;min-width:0;overflow-wrap:anywhere}
.project-group-switcher .btn{min-width:130px}
@media (max-width:1199.98px){.project-side-nav-card{position:static}.project-vertical-nav{display:grid;grid-template-columns:1fr 1fr;gap:.25rem}.project-vertical-nav .list-group-item{margin-bottom:0}}
@media (max-width:575.98px){.project-vertical-nav{grid-template-columns:1fr}.project-group-switcher .btn{width:100%}.project-overview-stack .detail-list{grid-template-columns:1fr}.project-overview-stack .detail-list dt{margin-top:.4rem}}

/* Step 17.4 / v2.5.3 — executive project dashboard + calendar timeline */
.project-overview-grid .detail-list{display:grid;grid-template-columns:minmax(120px,42%) minmax(0,1fr);gap:.35rem .8rem}
.project-overview-grid .detail-list dt{color:var(--bs-secondary-color);font-weight:600}
.project-overview-grid .detail-list dd{margin-bottom:.25rem;min-width:0;overflow-wrap:anywhere}
.metric-accent-blue{border-top:3px solid #0d6efd}
.metric-accent-orange{border-top:3px solid #fd7e14}
.metric-accent-purple{border-top:3px solid #6f42c1}
.metric-accent-green{border-top:3px solid #198754}
.kpi-contract{border-left:3px solid #0d6efd}
.kpi-invoice{border-left:3px solid #6f42c1}
.kpi-received{border-left:3px solid #198754}
.kpi-receivable{border-left:3px solid #6c757d}
.kpi-cost{border-left:3px solid #fd7e14}
.kpi-profit{border-left:3px solid #20c997}
.finance-donut-card{text-align:center;padding:.7rem .35rem;border:1px solid var(--bs-border-color);border-radius:.75rem;background:var(--bs-body-bg)}
.finance-donut{--donut-track:#e9ecef;width:92px;height:92px;border-radius:50%;margin:0 auto;display:grid;place-items:center;background:conic-gradient(var(--donut-color) var(--donut-p),var(--donut-track) 0);position:relative;box-shadow:inset 0 0 0 1px rgba(0,0,0,.03)}
.finance-donut::before{content:"";position:absolute;inset:12px;border-radius:50%;background:var(--bs-body-bg);box-shadow:0 0 0 1px var(--bs-border-color)}
.finance-donut-center{position:relative;z-index:1;font-size:1rem;line-height:1}
.finance-donut-center strong{font-size:1.15rem}
.discipline-progress-tile{border:1px solid var(--bs-border-color);border-radius:.7rem;padding:.75rem;background:var(--bs-body-bg)}
.discipline-progress-bar{height:12px;background:rgba(127,127,127,.16)}
.project-time-track{height:24px;border-radius:999px;background:#e9ecef;position:relative;overflow:visible;border:1px solid var(--bs-border-color)}
.project-time-elapsed{height:100%;border-radius:999px 0 0 999px;background:linear-gradient(90deg,#0d6efd,#20c997);min-width:0;max-width:100%}
.project-time-track.is-danger .project-time-elapsed{background:linear-gradient(90deg,#fd7e14,#dc3545);border-radius:999px}
.project-time-track.is-complete .project-time-elapsed{background:linear-gradient(90deg,#198754,#20c997);border-radius:999px}
.project-today-marker{position:absolute;top:-6px;width:3px;height:36px;background:#212529;border-radius:2px;transform:translateX(-1px);box-shadow:0 0 0 2px rgba(255,255,255,.7)}
.project-today-marker::after{content:"Hôm nay";position:absolute;top:-22px;left:50%;transform:translateX(-50%);font-size:.66rem;white-space:nowrap;color:var(--bs-secondary-color)}
.timeline-stat{display:flex;justify-content:space-between;gap:.5rem;border:1px solid var(--bs-border-color);border-radius:.55rem;padding:.55rem .65rem;background:var(--bs-tertiary-bg)}
.timeline-health{border-radius:.55rem;padding:.6rem .7rem;font-weight:600}
.timeline-health-success{background:rgba(25,135,84,.12);color:#146c43}
.timeline-health-warning{background:rgba(255,193,7,.17);color:#8a6d00}
.timeline-health-danger{background:rgba(220,53,69,.12);color:#b02a37}
.timeline-health-info{background:rgba(13,110,253,.11);color:#0a58ca}
.timeline-health-neutral{background:var(--bs-tertiary-bg);color:var(--bs-secondary-color)}
html[data-bs-theme="dark"] .finance-donut{--donut-track:#343a40}
html[data-bs-theme="dark"] .project-time-track{background:#343a40}
html[data-bs-theme="dark"] .project-today-marker{background:#f8f9fa;box-shadow:0 0 0 2px rgba(0,0,0,.55)}
html[data-bs-theme="dark"] .timeline-health-success{color:#8fe0b4;background:#173a2a}
html[data-bs-theme="dark"] .timeline-health-warning{color:#efd477;background:#3c3217}
html[data-bs-theme="dark"] .timeline-health-danger{color:#f0a1a6;background:#402426}
html[data-bs-theme="dark"] .timeline-health-info{color:#9cc8ff;background:#1c304a}
@media (max-width:1199.98px){.project-overview-grid .detail-list{grid-template-columns:minmax(150px,220px) minmax(0,1fr)}}
@media (max-width:575.98px){.project-overview-grid .detail-list{grid-template-columns:1fr}.finance-donut{width:82px;height:82px}.project-today-marker::after{display:none}}


/* Step 18.1 / v2.5.4 — grouped management, executive dashboard, professional schedule */
.list-group-switcher{padding:.55rem .7rem;border:1px solid var(--bs-border-color);border-radius:.65rem;background:var(--bs-tertiary-bg)}
.table-group-row td{background:var(--bs-tertiary-bg)!important;border-top:2px solid var(--bs-border-color);padding:.55rem .75rem;color:var(--bs-body-color)}
.exec-mini-row{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding:.38rem 0;border-bottom:1px dashed var(--bs-border-color)}
.exec-mini-row:last-child{border-bottom:0}
.finance-project-picker{max-height:180px;overflow:auto;border:1px solid var(--bs-border-color);border-radius:.55rem;padding:.35rem .55rem;background:var(--bs-body-bg)}
.ratio-donut{--pct:0;--ratio-color:#198754;--ratio-track:#e9ecef;width:112px;height:112px;margin:.25rem auto;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--ratio-color) calc(var(--pct)*1%),var(--ratio-track) 0);position:relative}
.ratio-donut::before{content:"";position:absolute;inset:15px;border-radius:50%;background:var(--bs-body-bg);box-shadow:0 0 0 1px var(--bs-border-color)}
.ratio-donut>div{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;line-height:1.1}
.ratio-donut strong{font-size:1.15rem}.ratio-donut span{font-size:.68rem;color:var(--bs-secondary-color);margin-top:.25rem}
.ratio-donut.ratio-loss{--ratio-color:#dc3545}.ratio-donut.ratio-profit{--ratio-color:#198754}

.status-stack-wrap{display:flex;align-items:stretch;justify-content:center;gap:1rem;min-height:250px;padding:.5rem 0}
.status-stack-column{width:64px;height:230px;border:1px solid var(--bs-border-color);border-radius:.6rem;overflow:hidden;display:flex;flex-direction:column-reverse;background:var(--bs-tertiary-bg);box-shadow:inset 0 0 0 1px rgba(0,0,0,.03)}
.status-stack-segment{width:100%;min-height:2px}
.status-stack-legend{flex:1;display:flex;flex-direction:column;justify-content:center;gap:.45rem}
.status-stack-legend>div{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:.45rem;align-items:center;font-size:.82rem}
.status-dot{width:10px;height:10px;border-radius:50%;display:inline-block}
.status-seg-draft{background:#6f42c1}.status-seg-planning{background:#0d6efd}.status-seg-active{background:#20c997}.status-seg-on_hold{background:#6c757d}.status-seg-at_risk{background:#ffc107}.status-seg-delayed{background:#dc3545}.status-seg-completed{background:#198754}.status-seg-cancelled{background:#343a40}.status-seg-archived{background:#adb5bd}

.progress-smart{background:#0d6efd}
.progress-smart.progress-low{background:#dc3545!important}.progress-smart.progress-mid{background:#fd7e14!important}.progress-smart.progress-good{background:#0d6efd!important}.progress-smart.progress-high{background:#198754!important}

/* Shared Project Schedule / Gantt */
.schedule-pro-card{overflow:hidden}
.schedule-pro-scroll{overflow:auto;max-height:70vh}
.schedule-pro-grid{display:grid;grid-template-columns:105px minmax(260px,1.7fr) 110px 105px 130px 160px minmax(520px,2.4fr);min-width:1390px}
.schedule-pro-head{position:sticky;top:0;z-index:6;background:var(--bs-tertiary-bg);font-weight:700;border-bottom:2px solid var(--bs-border-color)}
.schedule-pro-head>div,.schedule-pro-row>div{padding:.55rem .6rem;border-right:1px solid var(--bs-border-color);border-bottom:1px solid var(--bs-border-color);min-width:0}
.schedule-pro-row{background:var(--bs-body-bg)}
.schedule-pro-row:hover{background:var(--bs-tertiary-bg)}
.schedule-row-overdue{box-shadow:inset 4px 0 0 #dc3545}
.sch-name{overflow-wrap:anywhere}.tree-elbow{color:var(--bs-secondary-color);margin-right:.25rem}
.sch-timeline{position:relative;min-height:40px;background-image:linear-gradient(to right,transparent 0,transparent calc(10% - 1px),rgba(127,127,127,.15) 10%);background-size:10% 100%;overflow:visible}
.gantt-ticks{position:absolute;inset:0;pointer-events:none}.gantt-ticks span{position:absolute;top:2px;transform:translateX(-50%);font-size:.62rem;color:var(--bs-secondary-color);white-space:nowrap}
.gantt-today{position:absolute;top:0;bottom:0;width:2px;background:#dc3545;z-index:3;opacity:.75}
.gantt-bar{position:absolute;top:12px;height:19px;border-radius:5px;background:#198754;color:#fff;text-decoration:none;display:flex;align-items:center;justify-content:center;font-size:.64rem;min-width:3px;z-index:2;box-shadow:0 1px 3px rgba(0,0,0,.2);overflow:hidden}
.gantt-bar:hover{filter:brightness(1.08);color:#fff}
.gantt-status-not_started{background:#6c757d}.gantt-status-in_progress{background:#0d6efd}.gantt-status-waiting{background:#fd7e14}.gantt-status-waiting_review{background:#6f42c1}.gantt-status-revision_required{background:#dc3545}.gantt-status-approved{background:#20c997}.gantt-status-completed{background:#198754}.gantt-status-on_hold{background:#ffc107;color:#212529}.gantt-status-cancelled{background:#343a40}.gantt-overdue{box-shadow:0 0 0 2px rgba(220,53,69,.45)}
html[data-bs-theme="dark"] .ratio-donut{--ratio-track:#343a40}
html[data-bs-theme="dark"] .schedule-pro-head{background:#242a30}
html[data-bs-theme="dark"] .schedule-pro-row:hover{background:#242a30}
@media(max-width:767.98px){.ratio-donut{width:96px;height:96px}.status-stack-wrap{min-height:210px}.status-stack-column{height:190px}}

/* Step 18.2: calendar zoom and frozen task identity while scrolling. */
.schedule-pro-grid{grid-template-columns:105px 280px 110px 105px 130px 160px var(--timeline-width,520px);width:max-content;min-width:100%}
.schedule-pro-grid>.sch-wbs{position:sticky;left:0;z-index:3;background:var(--bs-body-bg)}
.schedule-pro-grid>.sch-name{position:sticky;left:105px;z-index:3;background:var(--bs-body-bg);box-shadow:3px 0 4px #0001}
.schedule-pro-head>.sch-wbs,.schedule-pro-head>.sch-name{background:var(--bs-tertiary-bg)}

/* v2.5.6 — compact UI and solid pie sectors. */
html{font-size:77%}body{line-height:1.4}
.tiny,.sidebar-caption,.table thead th,.metric-label,.mini-stat span,.detail-list dt,.dashboard-kpi span{font-size:.9rem}
.small,small,.form-text{font-size:.92em}
.app-topbar{min-height:40px}.sidebar{top:40px;height:calc(100vh - 40px);min-height:calc(100vh - 40px)}
.sidebar .nav-link{padding:.5rem .6rem}.metric-card{padding:12px}.metric-card.compact{padding:10px 12px}
.dashboard-kpi{padding:9px 10px}.mini-stat{padding:9px 6px}.table>:not(caption)>*>*{padding:.4rem .5rem}.card-body{padding:1rem}
.exec-mini-row{gap:.6rem}.exec-mini-row strong{text-align:right;overflow-wrap:anywhere}.finance-project-picker{max-height:150px}
.financial-pies{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem}.financial-pies-single{grid-template-columns:minmax(0,1fr)}
.financial-pie-card{text-align:center;margin:0;min-width:0}.financial-pie{display:block;width:90px;height:90px;max-width:100%;margin:.5rem auto}
.pie-ratio{font-size:1.2rem;font-weight:750;margin-bottom:.5rem}.pie-legend{display:flex;flex-direction:column;gap:.35rem;text-align:left}
.pie-legend>div{display:grid;grid-template-columns:8px minmax(0,1fr);gap:.2rem .4rem;align-items:center}.pie-legend strong{grid-column:2;overflow-wrap:anywhere}
.pie-swatch{display:inline-block;width:8px;height:8px;border-radius:2px}.pie-note{color:var(--bs-secondary-color);font-size:.9rem;line-height:1.35;margin-top:.4rem}
.kpi-contract{border-left-color:#f4c542}.kpi-invoice{border-left-color:#2684ff}.kpi-received{border-left-color:#269c59}.kpi-cost{border-left-color:#8a50c7}.kpi-profit{border-left-color:#00a6a6}
.status-stack-wrap{min-height:210px;gap:.75rem}.status-stack-column{width:72px;height:210px;flex:none}.status-stack-segment{min-height:0;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.status-stack-segment span{padding:1px 3px;border-radius:3px;background:#ffffffde;color:#15181c;font-size:.9rem;font-weight:700}.status-stack-legend>div{font-size:.95rem;grid-template-columns:8px minmax(0,1fr) auto}.status-dot{width:8px;height:8px}
.finance-project-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1rem;background:var(--bs-tertiary-bg);border-bottom:1px solid var(--bs-border-color);border-radius:12px 12px 0 0}
.finance-ledger-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.finance-ledger-cell{min-width:0;padding:1rem;border-right:1px solid var(--bs-border-color);border-top:3px solid transparent}.finance-ledger-cell:last-child{border-right:0}
.finance-ledger-invoice{border-top-color:#2684ff}.finance-ledger-receipt{border-top-color:#269c59}.finance-ledger-vat{border-top-color:#8a50c7}.finance-ledger-no_vat{border-top-color:#ae83d8}
.finance-ledger-total{font-size:1.4rem;font-weight:700;margin:.4rem 0 .8rem;overflow-wrap:anywhere}.finance-ledger-total small{font-size:.85rem;font-weight:400}
.finance-record-details>summary{cursor:pointer;color:var(--bs-link-color);padding:.4rem 0}.finance-record-scroll{max-height:34rem;overflow:auto}.finance-record{padding:.7rem 0;border-top:1px solid var(--bs-border-color);overflow-wrap:anywhere}
@media(min-width:992px){.executive-finance-grid>.col-xl-3{width:25%}.project-overview-grid>.col-xl-4{width:33.333333%}}
@media(max-width:767.98px){.finance-ledger-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.finance-ledger-cell:nth-child(2){border-right:0}.financial-pies{grid-template-columns:repeat(2,minmax(0,1fr))}.financial-pies-single{grid-template-columns:minmax(0,1fr)}.finance-project-heading{flex-direction:column;align-items:flex-start;gap:.25rem}}
@media(max-width:399.98px){.finance-ledger-grid{grid-template-columns:minmax(0,1fr)}.finance-ledger-cell{border-right:0}}
@media print{html{font-size:100%}}
.financial-pie-card figcaption{min-height:2.8em;display:flex;align-items:center;justify-content:center}
.financial-pies-single .financial-pie-card figcaption{min-height:0}
.financial-pies-single .pie-legend>div{grid-template-columns:8px minmax(0,1fr) auto}
.financial-pies-single .pie-legend strong{grid-column:auto;text-align:right}
