/* Stable report workspace. Last presentation layer, no changes to data semantics. */
body.report-shell {
    --surface: #f3f5f9;
    --line: #dfe5ee;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.report-shell > header {
    flex: 0 0 auto;
    z-index: 50;
    background: #132b45 !important;
    padding: 14px 24px !important;
    border-bottom: 3px solid #d6ad52;
}
.report-shell #page-main-title { font-size: 20px; letter-spacing: -.3px; }
.report-shell #page-sub-title { line-height: 1.5; font-size: 11px; color: #d2deeb; }
.report-shell .brand-tag { color: #d1ddeb; font-size: 10px; letter-spacing: 1.4px; }
.report-shell .app-workspace { flex: 1 1 0; min-height: 0; overflow: hidden !important; align-items: stretch; }
.report-shell aside {
    position: relative;
    top: auto;
    flex: 0 0 218px;
    width: 218px !important;
    min-height: 0;
    overflow: auto !important;
    overscroll-behavior: contain;
    padding: 20px 12px !important;
    background: #fff !important;
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
}
.report-shell aside h2 { color: #586b80; font-size: 10px !important; }
.report-shell aside > div > div:first-child { border-color: var(--line); padding: 0 8px 14px; }
.report-shell aside > div > div:first-child span { color: #7a8b9e; font-size: 10px; font-weight: 400; }
.report-shell aside nav { margin-top: 18px; }
.report-shell aside .sidebar-btn {
    color: #4a5e74;
    font-size: 12px;
    line-height: 1.5;
    min-height: 42px;
    padding: 10px 12px;
    margin: 4px 0;
    border-left: 3px solid transparent;
    border-radius: 6px;
}
.report-shell aside .sidebar-btn:hover { background: #f1f5fb; color: #1d4ed8; }
.report-shell aside .sidebar-btn.active { background: #eaf0fd; color: #1d4ed8; border-left-color: #2563eb; }
.report-shell .sidebar-note { color: #718397; border-color: var(--line); font-size: 11px; margin-inline: 8px; }
.report-shell main {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    overflow-anchor: none;
    scroll-padding-top: calc(var(--report-toolbar-height, 64px) + 16px);
    padding: 0 22px 32px !important;
}
.report-command-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    padding: 12px 0;
    min-height: 66px;
    border-bottom: 1px solid transparent;
}
.report-command-bar.is-scrolled { border-bottom-color: #ccd7e5; box-shadow: 0 8px 12px -12px #3d5675; }
.report-context { flex: 1; min-width: 0; }
.report-context-label { display: block; font-size: 9px; letter-spacing: 1.4px; color: #75849a; font-weight: 700; margin-bottom: 4px; }
#report-filter-summary { display: block; font-size: 12px; color: #314963; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-commands { display: flex; flex-shrink: 0; gap: 6px; }
.report-commands .ui-button { min-height: 34px; padding: 7px 11px; font-size: 11px; border-color: #cbd6e4; }
#report-toggle-filters { color: #1d4ed8; border-color: #bfd0f3; background: #fff; }
#report-toggle-filters[aria-expanded=true] { background: #eaf0fd; }
.report-shell .filter-panel { margin-top: 0 !important; border-radius: 8px; box-shadow: none; }
.report-shell .filter-panel[hidden] { display: none !important; }
.report-shell .filter-basic { grid-template-columns: minmax(170px,1.2fr) repeat(3,minmax(120px,1fr)); }
.report-shell .filter-basic > .ui-button { display: none; }
.report-shell .filter-panel select { min-height: 38px; }
.report-shell .filter-panel label { font-size: 11px !important; text-transform: none; }
.report-shell .filter-hint { color: #66788d; }
.report-shell .quality-bar { font-size: 11px; }
.report-shell .report-legend { margin-top: 12px !important; margin-bottom: -6px; }
.report-shell .kpi-grid { gap: 12px !important; }
.report-shell .pbi-kpi-card {
    background: #fff !important;
    box-shadow: 0 1px 3px #18324c08 !important;
    border-radius: 8px !important;
    min-height: 108px;
    padding: 16px !important;
}
.report-shell .pbi-kpi-card > div:first-child { color: #53667d !important; font-size: 11px !important; }
.report-shell .pbi-kpi-card > div:nth-child(2) { font-size: clamp(24px,2.1vw,32px) !important; font-variant-numeric: tabular-nums; }
.report-shell .pbi-kpi-card > div:last-child { font-size: 10px !important; line-height: 1.5; color: #708096 !important; }
.report-shell .insight-strip { border-left-color: #d97706; background: #fffdf8; font-size: 12px; line-height: 1.6; }
.report-shell .page-view .rounded-xl { border-radius: 8px !important; box-shadow: 0 1px 3px #18324c08 !important; border-color: var(--line) !important; }
.report-shell .page-view h3 { font-size: 14px !important; font-weight: 650; line-height: 1.5; }
.report-shell .page-view p { font-size: 11px !important; line-height: 1.6; color: #62748b; }
.report-shell .chart-toolbar { justify-content: flex-end; padding-bottom: 9px; border-bottom: 1px solid #edf0f5; }
.report-shell .chart-toolbar .ui-button { border-radius: 5px; }
.report-shell .pbi-table thead { position: sticky; top: 0; z-index: 3; }
.report-shell .pbi-table thead th { position: static; }
.report-shell .pbi-table td { border-bottom-color: #e9eef5; }
.report-shell .pbi-table th { font-size: 11px; }
.report-shell .table-viewport { scrollbar-width: thin; scrollbar-color: #b9c7d8 #f5f7fa; }
.report-shell .table-viewport:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.report-shell .table-tools input[type=search]:focus { outline: 2px solid #2563eb; outline-offset: 2px; }
.report-back-top { position: fixed; right: 30px; bottom: 20px; z-index: 40; box-shadow: 0 3px 14px #16365620; }
.report-back-top[hidden] { display: none; }
.report-skip { position: fixed; top: -80px; left: 16px; z-index: 10000; padding: 12px; background: white; color: #1d4ed8; }
.report-skip:focus { top: 8px; }
@media (min-width: 801px) {
    .report-shell.report-expanded aside { display: none; }
}
@media (max-width: 1200px) and (min-width: 801px) {
    .report-shell aside { width: 194px !important; flex-basis: 194px; }
    .report-shell main { padding-inline: 16px !important; }
    .report-shell .kpi-grid { grid-template-columns: repeat(5,minmax(0,1fr)) !important; gap: 8px !important; }
    .report-shell .pbi-kpi-card { padding: 12px 9px !important; }
    .report-shell .pbi-kpi-card > div:nth-child(2) { font-size: 23px !important; }
    .report-shell .filter-basic { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .report-shell .brand-tag { display: none; }
}
@media (max-width: 800px) {
    .report-shell > header { padding: 12px 14px !important; }
    .report-shell #page-main-title { font-size: 16px; }
    .report-shell #page-sub-title { font-size: 10px; }
    .report-shell .app-workspace { display: flex !important; flex-direction: column; }
    .report-shell .app-workspace aside { flex: 0 0 auto; width: 100% !important; padding: 4px 8px !important; overflow: hidden !important; border-right: 0; border-bottom: 1px solid var(--line); }
    .report-shell aside nav { margin: 0; gap: 4px; scrollbar-width: thin; }
    .report-shell aside .sidebar-btn { min-height: 44px; margin: 0; padding: 9px; font-size: 11px; }
    .report-shell main { padding: 0 12px 24px !important; }
    .report-command-bar { gap: 8px; padding: 8px 0; flex-wrap: wrap; }
    .report-context { flex: 1 1 100%; }
    .report-context-label { display: none; }
    #report-filter-summary { font-size: 11px; }
    .report-commands { width: 100%; }
    .report-commands .ui-button { flex: 1; min-height: 44px; font-size: 12px; }
    .report-commands .report-focus { display: none; }
    .report-shell .filter-basic, .report-shell .filter-advanced { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .report-shell .month-pair { grid-column: 1 / -1; }
    .report-shell .filter-panel select { min-height: 44px; font-size: 16px !important; }
    .report-shell .filter-panel summary { padding-block: 14px; }
    .report-shell .filter-basic > div:last-of-type { grid-column: 1 / -1; }
    .report-shell .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
    .report-shell .pbi-kpi-card { padding: 12px !important; min-height: 98px; }
    .report-shell .kpi-growth { grid-column: 1 / -1; }
    .report-shell .pbi-kpi-card > div:nth-child(2) { font-size: 25px !important; }
    .report-shell .chart-toolbar .ui-button { min-height: 40px; }
    .report-shell .table-viewport { max-height: none; }
    .report-shell .table-tools .ui-button { min-height: 44px; }
    .report-back-top { min-height: 44px; bottom: 14px; right: 16px; }
}
@media print {
    body.report-shell { display: block; height: auto; overflow: visible; }
    .report-shell .app-workspace, .report-shell main { display: block !important; overflow: visible !important; height: auto; }
    .report-shell aside, .report-command-bar, .report-back-top, .report-skip { display: none !important; }
    .report-shell .pbi-table thead { position: static; }
}

/* Trang 07: dùng KPI + kỳ riêng của trang */
.summary-active .kpi-grid, .summary-active #executive-insight, .summary-active .report-legend, .summary-active #page-sub-title { display: none !important; }
.sidebar-note { white-space: pre-line; }

/* Tháng chưa có số liệu: không bấm được */
.p7-month-pill.month-locked { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* Gọn giao diện: bỏ phần trùng lặp */
.report-shell #page-sub-title { display: none !important; }              /* trùng thanh phạm vi báo cáo */
.report-shell aside .sidebar-btn svg, .report-shell aside .sidebar-btn i { display: none !important; }
.report-shell aside > div > div:first-child span { display: none; }       /* "7 phân hệ báo cáo" */
.report-shell .filter-hint:empty { display: none; }
.report-shell .quality-bar summary { font-size: 11px; }
.pbi-table .inline-block { white-space: nowrap; }
@media (max-width: 800px) { #report-filter-summary { white-space: normal; } }
