* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Open Sans', sans-serif; background: #FFFFFF; color: #40404C; display: flex; width: 100%; overflow-x: hidden; }
body.dark-mode { background: #1A1A1F; color: #E0E0E0; }

.sidebar { width: 260px; background: #FFFFFF; border-right: 1px solid #DADAE5; padding: 24px 16px; position: fixed; height: 100vh; overflow-y: auto; left: 0; transition: left 0.3s ease; z-index: 1001; }
.sidebar.dark-mode { background: #25252C; border-right-color: #404048; }
.sidebar.open { left: -260px; }
.logo-container { position: relative; height: 50px; margin-bottom: 32px; padding: 0 8px; display: flex; align-items: center; }
.logo-container svg { height: 100%; width: auto; max-width: 180px; }
.hub-title { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 11px; color: #F15D22; letter-spacing: 0.5px; transition: all 0.3s; position: absolute; bottom: -18px; right: 48px; margin: 0; }
.hamburger-btn { display: block; cursor: pointer; font-size: 24px; color: #40404C; background: none; border: none; padding: 8px; margin-right: 16px; transition: all 0.3s; }
.topbar.dark-mode .hamburger-btn { color: #A0A0A0; }
.hamburger-btn:hover { color: #F15D22; }

@media (max-width: 768px) {
  .main-wrapper { margin-left: 0 !important; }
  .main-wrapper.sidebar-closed { margin-left: 0 !important; }
  .sidebar { z-index: 1000; }
}

.sidebar.dark-mode .hub-title { color: #F37721; }
.nav-menu { display: flex; flex-direction: column; gap: 4px; position: relative; }
.nav-item { padding: 12px 16px; cursor: pointer; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 600; color: #40404C; border-left: 3px solid transparent; border-radius: 8px; transition: all 0.3s; }
.nav-item:hover { background: #F0F0F5; color: #F15D22; }
.nav-item.active { color: #F15D22; border-left-color: #F15D22; background: rgba(241, 93, 34, 0.08); }
.sidebar.dark-mode .nav-item { color: #A0A0A0; }
.sidebar.dark-mode .nav-item:hover { background: #40404C; }
.sidebar.dark-mode .nav-item.active { color: #F15D22; background: rgba(241, 93, 34, 0.15); }

.main-wrapper { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left 0.3s ease; overflow: hidden; }
.main-wrapper.sidebar-closed { margin-left: 0 !important; }
.topbar { background: #FFFFFF; border-bottom: 1px solid #DADAE5; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 100; }
.topbar.dark-mode { background: #25252C; border-bottom-color: #404048; }
.settings-icon { cursor: pointer; font-size: 20px; color: #40404C; transition: all 0.3s; }
.topbar.dark-mode .settings-icon { color: #A0A0A0; }
.settings-icon:hover { color: #F15D22; }

/* TIME PERIOD SLICER */
.topbar-slicer-container { display: flex; align-items: center; gap: 16px; flex: 1; max-width: 800px; margin: 0 24px; }
.topbar-preset-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar-preset-btn { padding: 6px 12px; font-size: 12px; font-weight: 600; background: #F0F0F5; color: #40404C; border: 1px solid #DADAE5; border-radius: 4px; cursor: pointer; transition: all 0.2s; font-family: 'Open Sans', sans-serif; }
.topbar-preset-btn:hover { background: #E8E8F0; border-color: #F15D22; color: #F15D22; }
.topbar-preset-btn.active { background: #F15D22; color: #FFFFFF; border-color: #F15D22; }
.topbar.dark-mode .topbar-preset-btn { background: #40404C; border-color: #505060; color: #C0C0D0; }
.topbar.dark-mode .topbar-preset-btn:hover { background: #505060; border-color: #F15D22; color: #F15D22; }
.topbar.dark-mode .topbar-preset-btn.active { background: #F15D22; color: #FFFFFF; border-color: #F15D22; }
.topbar-slicer-dropdowns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Multi-select slicer dropdowns */
.slicer-ms { position: relative; display: inline-block; }
.slicer-ms-btn { display: flex; align-items: center; gap: 5px; padding: 6px 9px; font-size: 12px; font-weight: 600; font-family: 'Open Sans', sans-serif; background: #FFFFFF; color: #40404C; border: 1px solid #DADAE5; border-radius: 4px; cursor: pointer; transition: all 0.2s; white-space: nowrap; max-width: 140px; }
.slicer-ms-btn:hover { border-color: #F15D22; color: #F15D22; }
.slicer-ms-label { overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; min-width: 0; }
.slicer-ms-arrow { font-size: 9px; flex-shrink: 0; opacity: 0.6; }
.slicer-ms-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 1200; background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.13); min-width: 165px; padding: 5px 0; }
.slicer-ms-option { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 12px; color: #40404C; cursor: pointer; transition: background 0.12s; white-space: nowrap; }
.slicer-ms-option:hover { background: #FFF5F0; color: #F15D22; }
.slicer-ms-option input[type=checkbox] { accent-color: #F15D22; margin: 0; flex-shrink: 0; }
.slicer-ms-disabled .slicer-ms-btn { opacity: 0.42; pointer-events: none; }
/* Dark mode */
.topbar.dark-mode .slicer-ms-btn { background: #40404C; border-color: #505060; color: #C0C0D0; }
.topbar.dark-mode .slicer-ms-btn:hover { border-color: #F15D22; color: #F15D22; }
.topbar.dark-mode .slicer-ms-panel { background: #35353F; border-color: #505060; }
.topbar.dark-mode .slicer-ms-option { color: #C0C0D0; }
.topbar.dark-mode .slicer-ms-option:hover { background: rgba(241,93,34,0.15); color: #F15D22; }

/* Preset select — hidden at wide viewports, shown below 1400px in place of the button row */
.topbar-preset-select { display: none; }

@media (max-width: 1400px) {
  .topbar { padding: 10px 20px; }
  .topbar-slicer-container { gap: 10px; max-width: none; margin: 0 12px; }
  .topbar-preset-buttons { display: none; }
  .topbar-preset-select { display: block; padding: 5px 8px; font-size: 12px; font-weight: 600; font-family: 'Open Sans', sans-serif; background: #F0F0F5; color: #40404C; border: 1px solid #DADAE5; border-radius: 4px; cursor: pointer; height: 32px; }
  .topbar-slicer-dropdowns { flex-wrap: nowrap; gap: 6px; }
  .slicer-ms-btn { padding: 5px 7px; font-size: 11px; }
}
@media (max-width: 1024px) {
  .topbar-slicer-container { flex-direction: column; gap: 8px; align-items: flex-start; margin: 0 16px; }
  .topbar-preset-buttons { gap: 4px; }
  .topbar-preset-btn { padding: 5px 10px; font-size: 11px; }
  .topbar-slicer-select { padding: 5px 6px; font-size: 11px; }
}

@media (max-width: 768px) {
  .topbar-slicer-container { display: none; }
}

.content { padding: 32px 48px; background: #FAFAFA; min-height: 100vh; }
.content.dark-mode { background: #1A1A1F; }
.page { display: none; }
.page.active { display: block; }
h1 { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 32px; color: #25252C; margin-bottom: 4px; }
h1.dark-mode { color: #E0E0E0; }
.page-header { margin-bottom: 32px; }
.breadcrumb { font-size: 13px; color: #A4A4B2; margin-bottom: 8px; }
.breadcrumb.dark-mode { color: #8080A0; }
h2 { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 18px; color: #25252C; margin: 32px 0 20px 0; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 40px; }
.metric-card { background: #FFFFFF; border-radius: 12px; padding: 24px; border: 1px solid #DADAE5; box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: all 0.3s; }
.metric-card.dark-mode { background: #40404C; border-color: #505060; }
.metric-card:hover { border-color: #F15D22; box-shadow: 0 2px 8px rgba(241, 93, 34, 0.1); }
.metric-label { font-size: 12px; color: #A4A4B2; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.metric-value { font-family: 'Montserrat', sans-serif; font-size: 32px; font-weight: 600; color: #25252C; margin-bottom: 4px; }
.metric-trend { font-size: 12px; color: #F15D22; font-weight: 600; }
.metric-trend.negative { color: #F37721; }
.metric-trend.neutral { color: #A4A4B2; }
.chart-container { background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 12px; padding: 28px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.chart-container.dark-mode { background: #40404C; border-color: #505060; }
.chart-wrapper { position: relative; height: 320px; margin-bottom: 16px; }
.chart-wrapper--tall { height: 420px; }
.chart-wrapper--doughnut { height: 300px; }
.chart-scroll-outer { overflow-y: auto; max-height: 450px; border-radius: 4px; margin-bottom: 8px; }
.chart-scroll-outer .chart-wrapper { margin-bottom: 0; }
.scroll-chart-axis { display: block; height: 50px; width: 100%; max-height: 50px; overflow: hidden; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.charts-row .chart-container { margin-bottom: 0; }
@media (max-width: 768px) { .charts-row { grid-template-columns: 1fr; } }
.charts-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .charts-row--3 { grid-template-columns: 1fr; } }
.metrics-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .metrics-grid--3 { grid-template-columns: 1fr; } }
.metric-subtitle { font-size: 12px; color: #A4A4B2; margin-top: 4px; }
.metric-card.dark-mode .metric-subtitle { color: #808090; }
.data-notice { background: #FFF8E1; border: 1px solid #FCC54C; border-radius: 8px; padding: 10px 16px; font-size: 13px; color: #40404C; margin-bottom: 16px; }
.section-subtitle { font-size: 13px; color: #A4A4B2; margin: -12px 0 16px; }
/* Page tabs (Security/M&A/Telephony etc) */
.page-tabs { display: flex; gap: 0; margin-bottom: 28px; border-bottom: 2px solid #DADAE5; }
.page-tab { padding: 10px 22px; font-size: 14px; font-weight: 500; border: none; background: none; cursor: pointer; color: #A4A4B2; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color 0.2s, border-color 0.2s; }
.page-tab:hover { color: #40404C; }
.page-tab.active { color: #F15D22; border-bottom-color: #F15D22; }
.tab-panel { display: block; }

/* Placeholder panels */
.placeholder-panel { background: #F8F8FC; border: 2px dashed #DADAE5; border-radius: 12px; padding: 48px; text-align: center; color: #A4A4B2; font-size: 14px; margin-top: 16px; }

/* Projects summary table */
.projects-summary-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 8px; }
.projects-summary-table th { background: #F8F8FC; padding: 10px 16px; text-align: left; font-weight: 600; color: #40404C; border-bottom: 2px solid #DADAE5; }
.projects-summary-table td { padding: 10px 16px; border-bottom: 1px solid #DADAE5; color: #40404C; }
.projects-summary-table tr:hover td { background: #F8F8FC; }
.proj-grand-total td { font-weight: 700; background: #F0F0F5; border-top: 2px solid #DADAE5; }
.proj-total { font-weight: 700; }
.proj-status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.proj-backlog  { background: #EDE9FE; color: #6D28D9; }
.proj-inflight { background: #D1FAE5; color: #065F46; }
.proj-tbs      { background: #FEF3C7; color: #92400E; }
.proj-pending  { background: #FEE2E2; color: #991B1B; }

.qualys-trs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qualys-trs-icon { flex-shrink: 0; opacity: 0.9; }
.qualys-delta { font-size: 13px; font-weight: 600; margin-top: 3px; letter-spacing: 0.01em; }
.qualys-delta--neutral { color: #6B6B7B; font-weight: 500; }
.qualys-subhead { font-size: 18px; font-weight: 600; color: #25252C; margin: 8px 0 4px; }
.qualys-kpi-key { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 10px 16px; background: #F8F8FC; border: 1px solid #DADAE5; border-radius: 8px; margin-bottom: 24px; font-size: 12px; color: #40404C; }
.qualys-key-item { display: flex; align-items: center; gap: 6px; }
.qualys-key-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.loading-indicator { text-align: center; padding: 24px; font-size: 14px; color: #A4A4B2; }
.error-message { background: #FFF0F0; border: 1px solid #F15D22; border-radius: 8px; padding: 10px 16px; font-size: 13px; color: #C0392B; margin-bottom: 16px; }
.chart-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.sla-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.sla-item { background: #FFFFFF; border-radius: 12px; padding: 20px; border: 1px solid #DADAE5; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #F15D22; }
.sla-item.dark-mode { background: #40404C; border-color: #505060; }
.sla-name { font-size: 13px; color: #A4A4B2; font-weight: 600; margin-bottom: 6px; }
.sla-value { font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: 600; color: #25252C; margin-bottom: 6px; }
.sla-bar { background: #DADAE5; height: 6px; border-radius: 3px; overflow: hidden; }
.sla-bar.dark-mode { background: #505060; }
.sla-fill { background: #F15D22; height: 100%; border-radius: 3px; }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.status-good { background: rgba(241, 93, 34, 0.1); color: #E23F13; }
.status-warn { background: rgba(243, 119, 33, 0.1); color: #F37721; }
.status-alert { background: rgba(252, 197, 76, 0.1); color: #FCC54C; }
.status-badge.dark-mode.status-good { background: rgba(241, 93, 34, 0.2); color: #FF8C5A; }
.status-badge.dark-mode.status-warn { background: rgba(243, 119, 33, 0.2); color: #FF9D4A; }
.status-badge.dark-mode.status-alert { background: rgba(252, 197, 76, 0.2); color: #FFD580; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 16px; margin-bottom: 24px; }
.area-card { background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 12px; padding: 24px; cursor: pointer; transition: all 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.area-card.dark-mode { background: #40404C; border-color: #505060; }
.area-card:hover { border-color: #F15D22; box-shadow: 0 4px 12px rgba(241, 93, 34, 0.15); transform: translateY(-2px); }
.area-title { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 17px; color: #25252C; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.area-icon { font-size: 22px; }
.area-stat { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.area-stat-label { font-size: 13px; color: #A4A4B2; font-weight: 500; }
.area-stat-value { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 15px; color: #25252C; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-top: 16px; margin-bottom: 24px; }
.team-card { background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.team-card.dark-mode { background: #40404C; border-color: #505060; }
h2.dark-mode { color: #E0E0E0; }
.metric-label.dark-mode { color: #8080A0; }
.metric-value.dark-mode { color: #E0E0E0; }
.sla-name.dark-mode { color: #8080A0; }
.sla-value.dark-mode { color: #E0E0E0; }
.area-title.dark-mode { color: #E0E0E0; }
.area-stat-label.dark-mode { color: #8080A0; }
.area-stat-value.dark-mode { color: #E0E0E0; }
.team-leader.dark-mode { color: #E0E0E0; }
.team-details.dark-mode { color: #8080A0; }
.btn.dark-mode { background: #505060; border-color: #606070; color: #E0E0E0; }
.btn.dark-mode:hover { background: #606070; border-color: #F15D22; color: #F15D22; }
.team-leader { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 15px; color: #25252C; margin-bottom: 12px; }
.team-details { font-size: 13px; color: #A4A4B2; margin-bottom: 12px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid #DADAE5; background: #FFFFFF; cursor: pointer; transition: all 0.3s; color: #40404C; text-decoration: none; }
.btn:hover { border-color: #F15D22; color: #F15D22; background: #FFF5F0; }
.btn-primary { background: #2D4FB2; color: #FFFFFF; border-color: #2D4FB2; }
.btn-primary:hover { background: #1a3489; border-color: #1a3489; }
.section { margin-bottom: 40px; }
.drilldown-link { color: #2D4FB2; text-decoration: none; cursor: pointer; font-weight: 600; }
.drilldown-link:hover { text-decoration: underline; }
.drilldown-link.dark-mode { color: #6B9EFF; }
.welcome-section { background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F5 100%); border-radius: 12px; padding: 32px; margin-bottom: 32px; border: 1px solid #DADAE5; }
.welcome-section.dark-mode { background: linear-gradient(135deg, #40404C 0%, #25252C 100%); border-color: #404048; }
.welcome-title { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 28px; color: #25252C; margin-bottom: 8px; }
.welcome-section.dark-mode .welcome-title { color: #E0E0E0; }
.welcome-subtitle { font-size: 14px; color: #A4A4B2; }
.welcome-section.dark-mode .welcome-subtitle { color: #8080A0; }
.quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 20px; }
.quick-stat { background: #FFFFFF; padding: 16px; border-radius: 8px; border: 1px solid #DADAE5; }
.quick-stat-value { font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 600; color: #F15D22; }
.quick-stat-label { font-size: 12px; color: #A4A4B2; margin-top: 4px; }
p { color: #40404C; }
p.dark-mode { color: #C0C0D0; }
.quick-stat.dark-mode { background: #40404C; border-color: #505060; }
.quick-stat-label.dark-mode { color: #8080A0; }
#kpi-submenu.dark-mode { background: #40404C !important; border-color: #505060 !important; }
#kpi-submenu.dark-mode > div { color: #C0C0D0 !important; background: #40404C !important; }
#kpi-submenu.dark-mode > div:hover { background: #505060 !important; }

/* Power BI auth bar */
.pbi-auth-bar { display: flex; align-items: center; gap: 10px; margin-left: auto; margin-right: 8px; }
.pbi-user-name { font-size: 12px; color: #A4A4B2; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-signout-btn { font-size: 11px; font-weight: 600; font-family: 'Montserrat', sans-serif; color: #A4A4B2; text-decoration: none; border: 1px solid #DDDDE8; border-radius: 6px; padding: 4px 10px; white-space: nowrap; transition: color .15s, border-color .15s; }
.topbar-signout-btn:hover { color: #F15D22; border-color: #F15D22; }

/* Home / landing page */
.home-hero { background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F5 100%); border: 1px solid #DADAE5; border-radius: 16px; padding: 48px 40px 40px; margin-bottom: 32px; }
.home-greeting { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 40px; color: #25252C; line-height: 1.1; margin-bottom: 8px; }
.home-date { font-size: 15px; color: #A4A4B2; margin-bottom: 12px; }
.home-subtitle { font-size: 14px; color: #A4A4B2; }
body.dark-mode .home-hero { background: linear-gradient(135deg, #40404C 0%, #25252C 100%); border-color: #404048; }
body.dark-mode .home-greeting { color: #E0E0E0; }

/* Live data loading state */
.pbi-loading { color: #DADAE5 !important; animation: pbi-pulse 1.2s ease-in-out infinite; }
@keyframes pbi-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Admin tabs */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 0; border-bottom: 2px solid #DADAE5; }
.admin-tab { padding: 10px 20px; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 600; color: #A4A4B2; background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.admin-tab:hover { color: #F15D22; }
.admin-tab.active { color: #F15D22; border-bottom-color: #F15D22; }
.admin-panel { padding-top: 24px; }

/* Admin form row */
.admin-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px; background: #F8F8FC; border-radius: 10px; border: 1px solid #DADAE5; margin-bottom: 20px; }
.admin-input { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid #DADAE5; border-radius: 6px; font-size: 13px; font-family: inherit; color: #25252C; background: #fff; }
.admin-input:focus { outline: none; border-color: #F15D22; }
.admin-select { padding: 8px 12px; border: 1px solid #DADAE5; border-radius: 6px; font-size: 13px; font-family: inherit; color: #25252C; background: #fff; cursor: pointer; }
.admin-select:focus { outline: none; border-color: #F15D22; }
.admin-checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #60607A; white-space: nowrap; cursor: pointer; }

/* Admin user/group table */
.admin-user-row { display: grid; grid-template-columns: 1fr 200px 80px 90px 80px; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #F0F0F8; }
.admin-user-row:hover { background: #F8F8FC; }
.admin-user-row.header { background: #F0F0F8; border-radius: 8px 8px 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #80808C; border-bottom: none; margin-bottom: 2px; }
.admin-user-name { font-weight: 600; font-size: 14px; color: #25252C; }
.admin-user-email { font-size: 12px; color: #A4A4B2; margin-top: 2px; }
.admin-status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.admin-status-badge.active { background: #D1FAE5; color: #065F46; }
.admin-status-badge.pending { background: #FEF3C7; color: #92400E; }
.admin-remove-btn { padding: 4px 10px; font-size: 12px; background: none; border: 1px solid #DADAE5; border-radius: 5px; color: #EF4444; cursor: pointer; font-weight: 600; }
.admin-remove-btn:hover { background: #FEF2F2; border-color: #EF4444; }

/* Groups matrix (legacy — kept for fallback) */
.admin-matrix-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-matrix-table th { padding: 10px 12px; text-align: left; background: #F0F0F8; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #80808C; }
.admin-matrix-table td { padding: 10px 12px; border-bottom: 1px solid #F0F0F8; color: #25252C; }
.admin-matrix-table tr:hover td { background: #F8F8FC; }
.admin-matrix-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #F15D22; }

/* Group editor — area tabs */
.admin-area-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid #EEEEF5; margin-bottom: 16px; }
.admin-area-tab { padding: 8px 16px; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 600; color: #A4A4B2; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.admin-area-tab:hover { color: #F15D22; }
.admin-area-tab.active { color: #F15D22; border-bottom-color: #F15D22; }

/* Group editor — page rows */
.admin-page-row { display: flex; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid #EEEEF5; }
.admin-page-row:last-child { border-bottom: none; }
.admin-page-row span { flex: 1; font-size: 14px; font-weight: 500; color: #25252C; }
.admin-rw-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; min-width: 72px; padding: 6px 12px; border-radius: 6px; background: #F8F8FC; border: 1px solid #EEEEF5; transition: background .15s; }
.admin-rw-label:hover { background: #EEEEF5; }
.admin-rw-label input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: #F15D22; }
/* Bulk action buttons */
.admin-bulk-btn { font-size: 12px; padding: 5px 14px; background: transparent; border: 1.5px solid; border-radius: 8px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.admin-bulk-btn:hover { opacity: .75; }

.dark-mode .admin-add-row { background: #2E2E38; border-color: #40404C; }
.dark-mode .admin-input, .dark-mode .admin-select { background: #25252C; border-color: #40404C; color: #E0E0E0; }
.dark-mode .admin-user-row:hover { background: #2E2E38; }
.dark-mode .admin-user-row.header { background: #2E2E38; }
.dark-mode .admin-matrix-table th { background: #2E2E38; }
.dark-mode .admin-matrix-table tr:hover td { background: #2E2E38; }
.dark-mode .admin-area-tabs { border-bottom-color: #40404C; }
.dark-mode .admin-page-row { border-bottom-color: #40404C; }
.dark-mode .admin-page-row span { color: #E0E0E0; }

/* == QBR Actions grid == */
.qbr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 8px; }
@media (max-width: 1100px) { .qbr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .qbr-grid { grid-template-columns: 1fr; } }

.qbr-card { background: #fff; border: 1px solid #DADAE5; border-radius: 14px; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); transition: box-shadow .2s, transform .2s; }
.qbr-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.10); transform: translateY(-2px); }
.qbr-card-icon { font-size: 2rem; line-height: 1; }
.qbr-card-title { font-size: 1.1rem; font-weight: 700; color: #25252C; margin: 0; line-height: 1.3; }
.qbr-card-body { font-size: 0.9rem; color: #60607A; line-height: 1.6; flex: 1; margin: 0; }
.qbr-card-footer { border-top: 1px solid #EBEBF5; padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.qbr-owner-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #A4A4B2; }
.qbr-owners { font-size: 0.9rem; font-weight: 600; color: #F15D22; }
.qbr-via { font-weight: 400; color: #80808C; font-size: 0.82rem; margin-left: 4px; }

.dark-mode .qbr-card { background: #2E2E38; border-color: #40404C; }
.dark-mode .qbr-card-title { color: #E0E0E0; }
.dark-mode .qbr-card-body { color: #9090A8; }
.dark-mode .qbr-card-footer { border-color: #40404C; }

/* == Power BI embed == */
.pbi-embed-wrapper { border: 1px solid #DADAE5; border-radius: 12px; overflow: hidden; margin-top: 8px; }
.pbi-embed-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #F8F8FC; border-bottom: 1px solid #DADAE5; flex-wrap: wrap; gap: 8px; }
.pbi-embed-label { font-weight: 600; font-size: 0.95rem; color: #25252C; }
.pbi-embed-note { font-size: 0.78rem; color: #A4A4B2; }
.pbi-embed-container { width: 100%; height: calc(100vh - 220px); min-height: 540px; }
.pbi-embed-container iframe { display: block; width: 100%; height: 100%; border: 0; }
.dark-mode .pbi-embed-wrapper { border-color: #40404C; }
.dark-mode .pbi-embed-header { background: #2E2E38; border-color: #40404C; }
.dark-mode .pbi-embed-label { color: #E0E0E0; }

/* == Area card star / favourites == */
.area-card { position: relative; }
.area-card-star {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; line-height: 1; color: #C8C8D8;
  padding: 2px 4px; border-radius: 4px;
  transition: color .15s, transform .15s;
  z-index: 1;
}
.area-card-star:hover { color: #F15D22; transform: scale(1.2); }
.area-card-star.starred { color: #F15D22; }
.dark-mode .area-card-star { color: #60607A; }
.dark-mode .area-card-star:hover,
.dark-mode .area-card-star.starred { color: #F15D22; }

/* == Starrable widget sections (metric cards, charts, tables) == */
.starrable { position: relative; }
.widget-star {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 1rem; line-height: 1; color: #C8C8D8;
  padding: 2px 4px; border-radius: 4px;
  transition: color .15s, transform .15s;
  z-index: 2; opacity: 0;
}
.starrable:hover .widget-star { opacity: 1; }
.widget-star:hover { color: #F15D22; transform: scale(1.2); }
.widget-star.starred { color: #F15D22; opacity: 1; }
.dark-mode .widget-star { color: #60607A; }
.dark-mode .widget-star:hover,
.dark-mode .widget-star.starred { color: #F15D22; }

/* == Pinned widget cards (home screen) == */
.pinned-widgets-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.fav-widget-card {
  background: #FFFFFF;
  border: 1px solid #DADAE5;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.fav-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid #DADAE5;
  gap: 6px;
}

.fav-widget-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6B6B80;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-widget-actions { display: flex; gap: 3px; flex-shrink: 0; }

.fav-widget-view {
  background: none;
  border: none;
  cursor: pointer;
  color: #F15D22;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background .15s;
}
.fav-widget-view:hover { background: rgba(241,93,34,0.1); }

.fav-widget-unpin {
  background: none;
  border: none;
  cursor: pointer;
  color: #A4A4B2;
  font-size: 0.85rem;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s, background .15s;
}
.fav-widget-unpin:hover { color: #EF4444; background: rgba(239,68,68,0.1); }

.fav-widget-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

.fav-metric-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #1A1A2E;
}
.fav-metric-delta { font-size: 0.78rem; margin-top: 3px; font-weight: 500; }
.fav-metric-subtitle { font-size: 0.72rem; color: #6B6B80; margin-top: 6px; }

.fav-chart-info {
  font-size: 0.78rem;
  color: #6B6B80;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* Widget size classes (S=1col, M=2col, W=full) */
.fav-widget-card--s { grid-column: span 3; }   /* 4 columns */
.fav-widget-card--t { grid-column: span 4; }   /* 3 columns */
.fav-widget-card--m { grid-column: span 6; }   /* 2 columns */
.fav-widget-card--l { grid-column: 1 / -1; }   /* full width */
.fav-widget-card--wide { grid-column: 1 / -1; } /* legacy alias */

.fav-widget-card--l .fav-widget-body,
.fav-widget-card--wide .fav-widget-body {
  padding: 12px 16px 16px;
  min-height: 0;
}

/* Mirrored page elements ("pin anything"): a read-only live copy inside the widget card */
.fav-mirror { width: 100%; max-height: 480px; overflow: auto; }
.fav-mirror * { pointer-events: none; }
.fav-mirror > * { width: 100%; margin: 0 !important; box-shadow: none !important; border: none !important; background: transparent !important; }

/* Design Authority / Investment Committee decisions */
.bl-decision { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; }
.bl-decision--none    { background: #E4E4EE; color: #60607A; }
.bl-decision--approve { background: #1E8E3E; }
.bl-decision--reject  { background: #C5221F; }
.bl-decision--defer   { background: #B06000; }
.bl-approve-btn { margin-left: 8px; background: #F15D22; color: #fff; border: none; border-radius: 6px; padding: 3px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.bl-approve-btn:hover { background: #E23F13; }
.bl-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.bl-filter-field { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #A4A4B2; }
.bl-section-note { margin: -8px 0 12px; font-size: 12px; color: #A4A4B2; }
.bl-small { display: block; font-size: 11px; color: #A4A4B2; }
.bl-muted { color: #A4A4B2; font-size: 12px; }
.apv-note { background: #F8F8FB; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; color: #60607A; }
td.bl-action-cell { text-align: right; white-space: nowrap; }
td.bl-action-cell .bl-approve-btn { margin-left: 0; }
.apv-choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.apv-choice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #DADAE5; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.apv-choice:hover { border-color: #F15D22; }
.apv-choice small { display: block; color: #A4A4B2; font-size: 12px; margin-top: 2px; }

/* Classify page (Priority & Size, Change Risk Triage) */
.cls-label { display: block; font-size: 12px; font-weight: 700; color: #40404C; margin: 0 0 6px; }
.cls-in { width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 9px; border: 1px solid #DADAE5; background: #F8F8FB; color: #25252C; font-size: 14px; margin-bottom: 14px; }
.cls-note { font-size: 12px; color: #A4A4B2; margin: -8px 0 14px; }
.cls-now { font-size: 13px; color: #60607A; margin-bottom: 14px; }
.cls-banner { background: #FFF5F0; border: 1px solid #FBD5C4; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #40404C; margin: 0 0 18px; }
.cls-warn { font-size: 12px; background: #FFF8E1; border: 1px solid #FCC54C; border-radius: 8px; padding: 9px 10px; margin-bottom: 14px; color: #40404C; }
.cls-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.cls-grid2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .cls-grid3, .cls-grid2 { grid-template-columns: 1fr; } }
.cls-card { background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 14px; padding: 20px; }
.cls-card h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: #25252C; }
.cls-card h3 span { color: #F15D22; margin-right: 6px; }
.cls-card .sub { color: #A4A4B2; font-size: 13px; margin: 6px 0 16px; }
.cls-radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cls-radio { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid #DADAE5; border-radius: 10px; background: #F8F8FB; cursor: pointer; }
.cls-radio:has(input:checked) { border-color: #F15D22; background: #FFF5F0; }
.cls-radio .t { font-weight: 700; font-size: 13px; } .cls-radio .d { font-size: 12px; color: #A4A4B2; margin-top: 1px; }
.cls-line { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 1px dashed #DADAE5; }
.cls-line .k { font-size: 12px; color: #A4A4B2; text-transform: uppercase; letter-spacing: .05em; }
.cls-line .v { font-size: 20px; font-weight: 800; color: #25252C; }
.cls-badge { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: 13px; font-weight: 800; color: #fff; background: #A4A4B2; }
.cls-badge.p1 { background: #E23F13; } .cls-badge.p2 { background: #F15D22; } .cls-badge.p3 { background: #F6911E; } .cls-badge.p4 { background: #A4A4B2; }
.cls-badge.s-s { background: #616173; } .cls-badge.s-m { background: #2D4FB2; } .cls-badge.s-l { background: #F37721; } .cls-badge.s-xl { background: #F15D22; }
.cls-check { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 8px; cursor: pointer; font-size: 13px; }
.cls-check input { margin-top: 3px; }
.cls-check small { display: block; color: #A4A4B2; font-size: 12px; font-weight: 400; }
.cls-box { display: block; margin: 8px 0 14px; padding: 12px; border-radius: 10px; background: #F8F8FB; border: 1px solid #DADAE5; }
.cls-req { color: #E23F13; font-weight: 700; font-size: 11px; text-transform: uppercase; margin-left: 6px; }
.bl-briefing { background: #FFF5F0; border: 1px solid #FBD5C4; border-left: 4px solid #F15D22; border-radius: 10px; padding: 12px 14px; margin: 14px 0; }
.bl-briefing-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #E23F13; margin-bottom: 6px; }
.bl-briefing-text { white-space: pre-wrap; font-size: 14px; color: #25252C; margin-bottom: 6px; }
.cls-seg { display: flex; gap: 6px; margin-bottom: 12px; }
.cls-segbtn { flex: 1; border: 1px solid #DADAE5; background: #F8F8FB; color: #25252C; padding: 8px 6px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; }
.cls-segbtn.active, .cls-segbtn.sel { background: #F15D22; border-color: #F15D22; color: #fff; }
.cls-segbtn .num { opacity: .6; margin-right: 4px; }
.cls-comp { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 13px; }
.cls-comp th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #A4A4B2; padding-bottom: 6px; }
.cls-comp td { padding: 3px 4px 3px 0; }
.cls-compsize { font-weight: 700; font-size: 12px; color: #A4A4B2; white-space: nowrap; }
.cls-x { background: none; border: none; color: #A4A4B2; cursor: pointer; font-size: 16px; } .cls-x:hover { color: #E23F13; }
.cls-add { background: none; border: 1px dashed #DADAE5; color: #E23F13; border-radius: 8px; padding: 7px 10px; font-weight: 700; font-size: 12px; cursor: pointer; width: 100%; margin-bottom: 12px; }
.cls-title { display: block; word-break: break-all; font-family: Consolas, monospace; font-size: 13px; background: #F8F8FB; border: 1px solid #DADAE5; border-radius: 8px; padding: 10px; color: #25252C; }
.cls-btn { background: #F15D22; color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: 13px; cursor: pointer; }
.cls-btn:hover:not(:disabled) { background: #E23F13; } .cls-btn:disabled { opacity: .5; cursor: not-allowed; }
.cls-btn.secondary { background: #25252C; }
.cls-msg { font-size: 13px; margin-top: 10px; word-break: break-word; } .cls-msg.ok { color: #1E8E3E; } .cls-msg.bad { color: #C5221F; }
.cls-guide, .cls-more { margin-top: 14px; border-top: 1px solid #EEEEF5; padding-top: 10px; }
.cls-guide summary, .cls-more summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: #2D4FB2; }
.cls-kv { width: 100%; font-size: 12px; border-collapse: collapse; margin-top: 8px; }
.cls-kv td { padding: 4px 6px; border-bottom: 1px solid #EEEEF5; vertical-align: top; } .cls-kv td:first-child { color: #A4A4B2; width: 34%; }
.cls-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; }
.cls-fact.wide { grid-column: 1 / -1; } .cls-fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #A4A4B2; } .cls-fact .v { font-size: 13px; word-break: break-word; }
.cls-act { padding: 8px 0; border-bottom: 1px solid #EEEEF5; font-size: 13px; }
.cls-tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.cls-tab { background: #fff; border: 1px solid #DADAE5; border-radius: 10px 10px 0 0; padding: 10px 18px; font-weight: 700; font-size: 13px; cursor: pointer; color: #60607A; }
.cls-tab.active { background: #F15D22; border-color: #F15D22; color: #fff; }
.cls-factor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #EEEEF5; flex-wrap: wrap; }
.cls-factor .fname { font-weight: 700; font-size: 13px; flex: 1 1 200px; } .cls-factor .fname small { display: block; font-weight: 400; color: #A4A4B2; font-size: 11.5px; }
.cls-seg3 { display: flex; gap: 4px; flex: 1 1 320px; } .cls-seg3 .cls-segbtn { padding: 6px 4px; font-size: 11px; }
.cls-bigscore { font-size: 34px; font-weight: 800; color: #25252C; }
.cls-bar { height: 8px; border-radius: 99px; background: #F0F0F5; overflow: hidden; margin: 6px 0 14px; } .cls-bar div { height: 100%; width: 0; transition: width .2s; }
.cls-verdict { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.cls-triggers { font-size: 12.5px; background: #F8F8FB; border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.cls-keys { display: flex; gap: 10px; font-size: 11px; color: #A4A4B2; flex-wrap: wrap; } .cls-keys i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
body.dark-mode .cls-card, body.dark-mode .cls-tab { background: #1E1E2E; border-color: #2D2D3F; }
body.dark-mode .cls-in, body.dark-mode .cls-radio, body.dark-mode .cls-segbtn, body.dark-mode .cls-title, body.dark-mode .cls-box, body.dark-mode .cls-triggers { background: #262636; border-color: #3A3A50; color: #D9D7DB; }
body.dark-mode .cls-card h3, body.dark-mode .cls-line .v, body.dark-mode .cls-bigscore { color: #F5F3F1; }

/* Collapsible "Your Areas" heading on Home */
.home-areas-title { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.home-areas-title:hover { color: #F15D22; }
.home-areas-chevron { display: inline-block; font-size: 0.9em; transition: transform .15s; }
.home-areas-title.collapsed .home-areas-chevron { transform: rotate(-90deg); }

/* Admin "View as" preview */
.topbar-viewas-btn { background: #FFFFFF; color: #40404C; border: 1px solid #DADAE5; border-radius: 6px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.topbar-viewas-btn:hover { border-color: #F15D22; color: #F15D22; }
.viewas-banner { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3000; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #25252C; color: #FFFFFF; border: 2px solid #F15D22; border-radius: 10px; padding: 10px 16px; font-size: 13px; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.viewas-banner button { background: #F15D22; color: #FFFFFF; border: none; border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.viewas-banner button:hover { background: #E23F13; }

/* Drag handle */
.fav-drag-handle {
  cursor: grab;
  color: #C0C0D0;
  font-size: 1rem;
  padding: 0 6px 0 2px;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
  transition: color .15s;
}
.fav-drag-handle:hover { color: #6B6B80; }
.fav-drag-handle:active { cursor: grabbing; }
.fav-drag-ghost { opacity: 0.35; background: #F5F5FF; border: 2px dashed #A4A4B2; }

/* ============================================================
   REPORT SCHEDULER — topbar button + modal
   ============================================================ */

/* Topbar report button */
.topbar-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #F15D22;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.topbar-report-btn:hover { background: #E23F13; }
.topbar-report-btn:active { transform: scale(.97); }

/* Modal overlay */
.rm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Modal box */
.rm-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.rm-header {
  background: #F15D22;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.rm-title {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.rm-page-badge {
  color: rgba(255,255,255,.85);
  font-size: 12px;
  margin-top: 2px;
}
.rm-close {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: background .15s;
}
.rm-close:hover { background: rgba(255,255,255,.35); }

/* Tabs */
.rm-tabs {
  display: flex;
  border-bottom: 2px solid #EBEBF5;
  background: #FAFAFE;
}
.rm-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #A4A4B2;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.rm-tab.active {
  color: #F15D22;
  border-bottom-color: #F15D22;
  font-weight: 600;
}

/* Body scroll area */
.rm-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Form pieces */
.rm-field { display: flex; flex-direction: column; gap: 5px; }
.rm-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #60607A;
}
.rm-input {
  border: 1px solid #DADAE5;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  color: #25252C;
  background: #FAFAFE;
  outline: none;
  transition: border-color .15s;
}
.rm-input:focus { border-color: #F15D22; }
.rm-input-accent { border-color: #F8C9B5; background: #FFF4EF; }

.rm-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Toggle button row */
.rm-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rm-toggle {
  padding: 5px 11px;
  border: 1px solid #DADAE5;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #60607A;
  cursor: pointer;
  transition: all .12s;
}
.rm-toggle:hover { border-color: #F15D22; color: #F15D22; }
.rm-toggle.active {
  background: #FFF4EF;
  border-color: #F15D22;
  color: #E23F13;
  font-weight: 600;
}

/* Divider label */
.rm-divider {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #A4A4B2;
  padding-top: 6px;
  border-top: 1px solid #F3F4F6;
}

/* Checkbox row */
.rm-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #40404C;
  cursor: pointer;
}
.rm-check-row input[type="checkbox"] { accent-color: #F15D22; width: 15px; height: 15px; cursor: pointer; }

/* Error */
.rm-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #B91C1C;
}

/* Footer */
.rm-footer {
  padding: 14px 20px;
  border-top: 1px solid #EBEBF5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FAFAFE;
}

/* Buttons */
.rm-btn {
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .12s;
}
.rm-btn:disabled { opacity: .5; cursor: not-allowed; }
.rm-btn-primary  { background: #F15D22; color: #fff; }
.rm-btn-primary:hover:not(:disabled) { background: #E23F13; }
.rm-btn-secondary { background: #F3F4F6; color: #40404C; }
.rm-btn-secondary:hover { background: #E5E7EB; }
.rm-btn-ghost { background: transparent; color: #F15D22; border: 1px solid #F8C9B5; }
.rm-btn-ghost:hover { background: #FFF4EF; }
.rm-btn-danger { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; padding: 6px 12px; font-size: 12px; }
.rm-btn-danger:hover { background: #FEE2E2; }

/* Schedule cards in manage panel */
.rm-sched-card {
  background: #FAFAFE;
  border: 1px solid #EBEBF5;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.rm-sched-page  { font-size: 13px; font-weight: 600; color: #25252C; margin-bottom: 3px; }
.rm-sched-meta  { font-size: 12px; color: #60607A; margin-bottom: 2px; }
.rm-sched-next  { font-size: 11px; color: #A4A4B2; }
.rm-empty { color: #A4A4B2; text-align: center; padding: 24px; margin: 0; font-size: 13px; }

/* Dark mode */
body.dark-mode .rm-modal { background: #2A2A3A; }
body.dark-mode .rm-header { background: #E23F13; }
body.dark-mode .rm-tabs  { background: #222230; border-color: #3A3A50; }
body.dark-mode .rm-tab   { color: #A4A4B2; }
body.dark-mode .rm-tab.active { color: #F15D22; border-bottom-color: #F15D22; }
body.dark-mode .rm-body  { background: #2A2A3A; }
body.dark-mode .rm-input { background: #1E1E2E; border-color: #3A3A50; color: #E0E0F0; }
body.dark-mode .rm-input-accent { background: #2E1A14; border-color: #6B3020; }
body.dark-mode .rm-toggle { background: #1E1E2E; border-color: #3A3A50; color: #A4A4B2; }
body.dark-mode .rm-toggle.active { background: #3A1A0A; border-color: #F15D22; color: #F8A07A; }
body.dark-mode .rm-sched-card { background: #1E1E2E; border-color: #3A3A50; }
body.dark-mode .rm-footer { background: #222230; border-color: #3A3A50; }
body.dark-mode .rm-divider { border-color: #3A3A50; }

/* Width picker: 1 / 2 / 3 / 4 columns */
.fav-size-picker { display: inline-flex; gap: 2px; margin-right: 4px; }
.fav-widget-szbtn.active { border-color: #F15D22; color: #FFFFFF; background: #F15D22; }
.fav-widget-szbtn {
  background: none;
  border: 1px solid #DADAE5;
  cursor: pointer;
  color: #6B6B80;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  min-width: 20px;
  text-align: center;
  line-height: 1.3;
  transition: border-color .15s, color .15s, background .15s;
}
.fav-widget-szbtn:hover { border-color: #F15D22; color: #F15D22; background: rgba(241,93,34,0.06); }

/* Chart canvas wrapper */
.fav-chart-canvas-wrap {
  position: relative;
  height: 320px;
  width: 100%;
}
.fav-chart-canvas-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
}

.fav-loading { font-size: 0.8rem; color: #A4A4B2; }
.fav-error   { font-size: 0.78rem; color: #EF4444; }
.fav-placeholder { font-size: 0.82rem; color: #A4A4B2; font-style: italic; padding: 8px 4px; line-height: 1.5; }

/* ============================================================
   PAGE COMMENTS PANEL
   ============================================================ */
.comments-panel {
  margin: 32px 0 0 0;
  border: 1px solid #E0E0EC;
  border-radius: 10px;
  background: #FAFAFA;
  overflow: hidden;
}
.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #F4F4F8;
  border-bottom: 1px solid #E0E0EC;
}
.comments-title {
  font-size: 13px;
  font-weight: 600;
  color: #2A2A3A;
}
.comments-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.comments-add-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: #F15D22;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.comments-add-btn:hover { background: #E23F13; }
.comments-toggle-btn {
  background: none;
  border: none;
  color: #777;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 6px;
}
.comments-toggle-btn:hover { color: #F15D22; }

/* Add / Edit form */
.comments-add-form,
.comments-inline-edit {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #E0E0EC;
  background: #fff;
}
.comments-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.comments-form-label {
  font-size: 12px;
  color: #555;
  white-space: nowrap;
}
.comments-date-input {
  border: 1px solid #D0D0E0;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 13px;
  color: #2A2A3A;
  background: #FAFAFA;
}
.comments-textarea {
  width: 100%;
  border: 1px solid #D0D0E0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: #2A2A3A;
  background: #FAFAFA;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}
.comments-textarea:focus,
.comments-date-input:focus {
  outline: none;
  border-color: #F15D22;
  box-shadow: 0 0 0 2px rgba(241,93,34,.12);
}
.comments-form-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.comments-btn-primary {
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: #F15D22;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.comments-btn-primary:hover { background: #E23F13; }
.comments-btn-secondary {
  padding: 5px 14px;
  border: 1px solid #D0D0E0;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
}
.comments-btn-secondary:hover { background: #F4F4F8; }
.comments-error {
  font-size: 12px;
  color: #EF4444;
  flex: 1;
}

/* Comment list */
.comments-list {
  padding: 4px 0;
}
.comments-loading,
.comments-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: #A4A4B2;
}
.comments-error-msg {
  padding: 14px 16px;
  font-size: 12px;
  color: #EF4444;
}
.comments-item {
  padding: 12px 16px;
  border-bottom: 1px solid #F0F0F8;
}
.comments-item:last-child { border-bottom: none; }
.comments-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.comments-date-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: #F15D22;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}
.comments-author {
  font-size: 12px;
  font-weight: 600;
  color: #2A2A3A;
}
.comments-posted-at {
  font-size: 11px;
  color: #A4A4B2;
  margin-left: auto;
}
.comments-edited {
  font-size: 11px;
  color: #A4A4B2;
  font-style: italic;
}
.comments-actions {
  display: inline-flex;
  gap: 6px;
}
.comments-action-btn {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid #D0D0E0;
  background: #fff;
  color: #555;
  font-size: 11px;
  cursor: pointer;
}
.comments-action-btn:hover { background: #F4F4F8; border-color: #aaa; }
.comments-action-delete { color: #EF4444; }
.comments-action-delete:hover { background: #FFF1F0; border-color: #EF4444; }
.comments-text {
  font-size: 13px;
  color: #3A3A4A;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Dark mode */
body.dark-mode .comments-panel { background: #1E1E2E; border-color: #3A3A50; }
body.dark-mode .comments-header { background: #262636; border-color: #3A3A50; }
body.dark-mode .comments-title { color: #E0E0F0; }
body.dark-mode .comments-item { border-color: #2E2E40; }
body.dark-mode .comments-item-header { color: #C0C0D8; }
body.dark-mode .comments-author { color: #E0E0F0; }
body.dark-mode .comments-text { color: #C8C8DC; }
body.dark-mode .comments-add-form,
body.dark-mode .comments-inline-edit { background: #1A1A2C; border-color: #3A3A50; }
body.dark-mode .comments-textarea,
body.dark-mode .comments-date-input { background: #262636; color: #E0E0F0; border-color: #4A4A60; }
body.dark-mode .comments-btn-secondary { background: #262636; border-color: #4A4A60; color: #C0C0D8; }
body.dark-mode .comments-btn-secondary:hover { background: #2E2E42; }
body.dark-mode .comments-action-btn { background: #262636; border-color: #3A3A50; color: #A0A0C0; }
body.dark-mode .comments-action-btn:hover { background: #2E2E42; }
body.dark-mode .comments-empty,
body.dark-mode .comments-loading { color: #6A6A88; }
.fav-info-text { font-size: 0.85rem; color: #40404C; line-height: 1.5; padding: 4px 0; }
.fav-sla-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.fav-sla-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; padding: 4px 0; border-bottom: 1px solid #F0F0F5; }
.fav-sla-row:last-child { border-bottom: none; }
.fav-sla-ok   { color: #10B981; font-weight: 600; }
.fav-sla-warn { color: #FCC54C; font-weight: 600; }
.fav-sla-bad  { color: #EF4444; font-weight: 600; }

/* Office Occupancy */
.occ-office-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.occ-office-card { background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
body.dark-mode .occ-office-card { background: #25252C; border-color: #404048; }
.occ-office-name { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px; color: #40404C; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.dark-mode .occ-office-name { color: #E0E0E0; }
.occ-country { font-size: 10px; font-weight: 400; color: #A4A4B2; background: #F0F0F5; padding: 2px 6px; border-radius: 10px; }
body.dark-mode .occ-country { background: #35353E; color: #A4A4B2; }
.occ-office-avg { font-size: 1.6rem; font-weight: 700; color: #40404C; line-height: 1.1; }
body.dark-mode .occ-office-avg { color: #E0E0E0; }
.occ-office-avg-label { font-size: 11px; font-weight: 400; color: #A4A4B2; margin-left: 6px; }
.occ-office-range { font-size: 11px; color: #A4A4B2; }
.occ-util-bar-wrap { background: #F0F0F5; border-radius: 4px; height: 6px; overflow: hidden; margin-top: 4px; }
body.dark-mode .occ-util-bar-wrap { background: #35353E; }
.occ-util-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.occ-util-label { font-size: 11px; font-weight: 600; margin-top: 2px; }

/* ITAM ROI table */
.itam-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.itam-table th { background: #F5F5FA; color: #40404C; font-weight: 600; padding: 10px 14px; border-bottom: 2px solid #DADAE5; text-align: left; white-space: nowrap; }
.itam-table td { padding: 9px 14px; border-bottom: 1px solid #F0F0F5; vertical-align: middle; }
.itam-table tbody tr:hover { background: #FAFAFA; }
body.dark-mode .itam-table th { background: #2A2A32; color: #E0E0E0; border-bottom-color: #404048; }
body.dark-mode .itam-table td { border-bottom-color: #35353E; }
body.dark-mode .itam-table tbody tr:hover { background: #2A2A32; }

/* Dark mode */
.dark-mode .fav-widget-card { background: #1E1E2E; border-color: #2D2D3F; box-shadow: none; }
.dark-mode .fav-widget-header { background: rgba(255,255,255,0.04); border-bottom-color: #2D2D3F; }
.dark-mode .fav-widget-title { color: #A4A4B2; }
.dark-mode .fav-metric-value { color: #E4E4F0; }
.dark-mode .fav-metric-subtitle { color: #A4A4B2; }
.dark-mode .fav-chart-info { color: #A4A4B2; }
.dark-mode .fav-drag-handle { color: #505060; }
.dark-mode .fav-drag-handle:hover { color: #A4A4B2; }
.dark-mode .fav-drag-ghost { background: #1A1A2E; border-color: #505060; }
.dark-mode .fav-widget-szbtn { border-color: #3A3A50; color: #A4A4B2; }
.dark-mode .fav-widget-szbtn:hover { border-color: #F15D22; color: #F15D22; }

/* Responsive */
@media (max-width: 1100px) {
  .fav-widget-card--s,
  .fav-widget-card--t { grid-column: span 6; }   /* 3 and 4 columns fall back to 2 */
}
@media (max-width: 600px) {
  .fav-widget-card--s,
  .fav-widget-card--t,
  .fav-widget-card--m,
  .fav-widget-card--l { grid-column: 1 / -1; }
}

/* ============================================================
   QBR ACTION SUB-PAGES
   ============================================================ */

/* Overview card enhancements */
.qbr-card-link { cursor: pointer; }
.qbr-card-link:hover { box-shadow: 0 8px 24px rgba(241,93,34,.18); border-color: rgba(241,93,34,.3); }
.qbr-card-rag { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

/* RAG badge */
.rag-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}
.rag-grey   { background: #E8E8F0; color: #60607A; }
.rag-green  { background: #D1FAE5; color: #065F46; }
.rag-amber  { background: #FEF3C7; color: #92400E; }
.rag-red    { background: #FEE2E2; color: #991B1B; }

/* ============================================================
   INFRASTRUCTURE KPI HOMEPAGE (v1.53.0)
   Computed RAG status (getRagStatus()) drives a left-border accent on
   each KPI card, using the same colour family as .rag-badge above.
   ============================================================ */
.kpi-theme-group { margin-bottom: 32px; }
.kpi-theme-group .metrics-grid {
  /* Bounded width, not 1fr — a theme group with only 1-2 KPIs (e.g. Server
     Lifecycle today) would otherwise have its lone card stretch across the
     full page width under auto-fit+1fr. auto-fill leaves the extra track
     empty instead of stretching existing cards. */
  grid-template-columns: repeat(auto-fill, minmax(240px, 300px));
  margin-bottom: 0; /* .kpi-theme-group already provides the gap below */
}
.kpi-theme-heading { display: flex; align-items: center; gap: 8px; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 15px; color: #40404C; margin-bottom: 14px; }
.kpi-theme-icon { font-size: 18px; }
.kpi-card { border-left: 4px solid #DADAE5; cursor: pointer; min-height: 148px; }
.kpi-card:hover { box-shadow: 0 4px 12px rgba(37,37,44,0.12); transform: translateY(-2px); }
.kpi-card--green  { border-left-color: #10B981; }
.kpi-card--amber  { border-left-color: #FCC54C; }
.kpi-card--red    { border-left-color: #E23F13; }
.kpi-card--neutral{ border-left-color: #DADAE5; }
.kpi-card--static { cursor: default; }
.kpi-card--static:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.08); transform: none; }
.kpi-card .metric-value.kpi-placeholder { color: #A4A4B2; }
.kpi-target-line { font-size: 12px; color: #A4A4B2; margin: -2px 0 8px; }
.kpi-placeholder-caption { font-size: 11px; color: #A4A4B2; font-style: italic; margin: -2px 0 8px; }
.kpi-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 10px 16px; background: #F8F8FC; border: 1px solid #DADAE5; border-radius: 8px; margin-bottom: 24px; font-size: 12px; color: #40404C; }
.kpi-legend-item { display: flex; align-items: center; gap: 6px; }
.kpi-legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Status chip */
.qbr-status-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.status-grey  { background: #E8E8F0; color: #60607A; }
.status-blue  { background: #DBEAFE; color: #1E40AF; }
.status-green { background: #D1FAE5; color: #065F46; }
.status-red   { background: #FEE2E2; color: #991B1B; }

/* Meta card */
.qbr-meta-card {
  background: #fff;
  border: 1px solid #E0E0EC;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.qbr-meta-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.qbr-meta-row:last-child { margin-bottom: 0; }
.qbr-dates-row { margin-top: 4px; }
.qbr-meta-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 140px;
}
.qbr-meta-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #A4A4B2;
}
.qbr-meta-select,
.qbr-meta-date {
  border: 1px solid #D0D0E0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: #2A2A3A;
  background: #FAFAFA;
}
.qbr-meta-select:focus,
.qbr-meta-date:focus {
  outline: none;
  border-color: #F15D22;
  box-shadow: 0 0 0 2px rgba(241,93,34,.12);
}
.qbr-meta-select:disabled,
.qbr-meta-date:disabled { opacity: .6; cursor: default; }

/* RAG select colour coding */
.qbr-rag-green { background: #D1FAE5; border-color: #6EE7B7; }
.qbr-rag-amber { background: #FEF3C7; border-color: #FCD34D; }
.qbr-rag-red   { background: #FEE2E2; border-color: #FCA5A5; }

.qbr-meta-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #F0F0F8;
}
.qbr-save-btn {
  padding: 6px 18px;
  border: none;
  border-radius: 7px;
  background: #F15D22;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.qbr-save-btn:hover { background: #E23F13; }
.qbr-save-msg { font-size: 13px; }
.qbr-save-ok  { color: #10B981; }
.qbr-save-err { color: #EF4444; }
.qbr-last-updated { font-size: 11px; color: #A4A4B2; }

/* ============================================================
   DYNAMIC MODAL OVERLAY — used by RAG edit, metric edit,
   KPI definition edit, ValueFlow detail/edit
   ============================================================ */
.new-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.new-action-modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  box-sizing: border-box;
  width: 100%;
}

/* Inputs and selects inside the modal */
.new-action-modal .qbr-meta-date,
.new-action-modal .admin-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #D0D0E0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #25252C;
  background: #FAFAFA;
}

.new-action-modal .qbr-meta-date:focus,
.new-action-modal .admin-select:focus {
  outline: none;
  border-color: #F15D22;
  box-shadow: 0 0 0 2px rgba(241,93,34,.12);
}

.new-action-modal .qbr-upd-textarea {
  width: 100%;
  box-sizing: border-box;
}

/* Space between stacked fields */
.new-action-modal .qbr-meta-field {
  margin-bottom: 14px;
}

/* Footer button row */
.new-action-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #F0F0F8;
}

/* Dark mode */
body.dark-mode .new-action-modal {
  background: #1E1E2C;
  color: #E0E0F0;
}
body.dark-mode .new-action-modal .qbr-meta-date,
body.dark-mode .new-action-modal .admin-select {
  background: #262636;
  border-color: #4A4A60;
  color: #E0E0F0;
}
body.dark-mode .new-action-modal .qbr-upd-textarea {
  background: #262636;
  border-color: #4A4A60;
  color: #E0E0F0;
}
body.dark-mode .new-action-modal .modal-footer {
  border-color: #2E2E40;
}

/* KPI Definition modal layout */
.kpi-def-modal {
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
}

.kpi-def-modal__title {
  margin: 0 0 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #25252C;
}

.kpi-def-modal__grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.kpi-def-modal__grid--2 { grid-template-columns: 1fr 1fr; }
.kpi-def-modal__grid--3 { grid-template-columns: 1fr 1fr 1fr; }

/* The Active checkbox row needs to centre-align */
.kpi-def-modal__bottom-row { align-items: end; }
.kpi-def-modal__checkbox-field {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding-bottom: 9px;
}
.kpi-def-modal__checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.kpi-def-modal__checkbox-field .qbr-meta-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  cursor: pointer;
}

/* Collapse bottom margin on the last grid row so footer border isn't too far */
.kpi-def-modal__bottom-row { margin-bottom: 0; }

@media (max-width: 560px) {
  .kpi-def-modal__grid--2,
  .kpi-def-modal__grid--3 { grid-template-columns: 1fr; }
}

body.dark-mode .kpi-def-modal__title { color: #E0E0F0; }

/* Timeline bar */
.qbr-timeline-bar {
  margin: 16px 0 8px;
}
.qbr-tl {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 4px;
}
.qbr-tl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 80px;
}
.qbr-tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid #D0D0E0;
  background: #fff;
}
.tl-start    .qbr-tl-dot { border-color: #60A5FA; background: #60A5FA; }
.tl-target   .qbr-tl-dot { border-color: #F59E0B; background: #FEF3C7; }
.tl-complete .qbr-tl-dot { border-color: #10B981; background: #10B981; }
.qbr-tl-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #A4A4B2;
}
.qbr-tl-date { font-size: 12px; color: #2A2A3A; font-weight: 600; }
.qbr-tl-line {
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, #D0D0E0, #D0D0E0);
  min-width: 40px;
  margin-bottom: 24px;
}
.qbr-tl-overdue {
  font-size: 12px;
  color: #EF4444;
  font-weight: 600;
  margin-left: 12px;
  flex-shrink: 0;
}

/* Loading state */
.qbr-action-loading {
  padding: 40px;
  text-align: center;
  color: #A4A4B2;
  font-size: 14px;
}

/* Dark mode */
body.dark-mode .qbr-meta-card { background: #1E1E2E; border-color: #3A3A50; }
body.dark-mode .qbr-meta-select,
body.dark-mode .qbr-meta-date  { background: #262636; color: #E0E0F0; border-color: #4A4A60; }
body.dark-mode .qbr-meta-label { color: #6A6A88; }
body.dark-mode .qbr-tl-date   { color: #E0E0F0; }
body.dark-mode .qbr-meta-footer { border-color: #3A3A50; }
body.dark-mode .rag-grey   { background: #2A2A3A; color: #A4A4B2; }
body.dark-mode .status-grey { background: #2A2A3A; color: #A4A4B2; }

/* ============================================================
   QBR PROGRESS UPDATES FEED
   ============================================================ */
.qbr-updates-section {
  background: #fff;
  border: 1px solid #E0E0EC;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 4px;
}
.qbr-updates-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #F4F4F8;
  border-bottom: 1px solid #E0E0EC;
}
.qbr-updates-title {
  font-size: 14px;
  font-weight: 700;
  color: #2A2A3A;
  flex: 1;
}
.qbr-updates-count {
  font-size: 12px;
  color: #A4A4B2;
  background: #E8E8F0;
  padding: 2px 9px;
  border-radius: 10px;
}
.qbr-add-update-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 7px;
  background: #F15D22;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.qbr-add-update-btn:hover { background: #E23F13; }

/* Add / edit form */
.qbr-add-form {
  padding: 16px 20px;
  border-bottom: 1px solid #E0E0EC;
  background: #FAFAFA;
}
.qbr-add-form-row {
  margin-bottom: 10px;
}
.qbr-upd-textarea {
  width: 100%;
  border: 1px solid #D0D0E0;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  color: #2A2A3A;
  background: #fff;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}
.qbr-upd-textarea:focus {
  outline: none;
  border-color: #F15D22;
  box-shadow: 0 0 0 2px rgba(241,93,34,.12);
}
.qbr-add-form-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Feed */
.qbr-feed {
  padding: 8px 0;
}
.qbr-feed-empty {
  padding: 24px 20px;
  color: #A4A4B2;
  font-size: 13px;
  text-align: center;
}
.qbr-feed-item {
  display: flex;
  gap: 0;
  padding: 0 20px;
}
.qbr-feed-item.qbr-feed-latest {
  background: #FFFBF8;
}
.qbr-feed-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24px;
  flex-shrink: 0;
  padding-top: 3px;
}
.qbr-feed-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #D0D0E0;
  background: #fff;
  flex-shrink: 0;
  margin-top: 4px;
}
.qbr-feed-dot-latest {
  border-color: #F15D22;
  background: #F15D22;
  width: 14px;
  height: 14px;
  margin-top: 3px;
}
.qbr-feed-connector {
  width: 2px;
  flex: 1;
  background: #E0E0EC;
  min-height: 20px;
  margin: 4px 0;
}
.qbr-feed-body {
  flex: 1;
  padding: 10px 0 14px 12px;
  border-bottom: 1px solid #F0F0F8;
}
.qbr-feed-item:last-child .qbr-feed-body { border-bottom: none; }
.qbr-feed-latest-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: #FFF0E8;
  color: #F15D22;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.qbr-feed-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.qbr-feed-date-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  background: #2A2A3A;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.qbr-feed-latest .qbr-feed-date-badge { background: #F15D22; }
.qbr-feed-author {
  font-size: 12px;
  font-weight: 600;
  color: #2A2A3A;
}
.qbr-feed-posted {
  font-size: 11px;
  color: #A4A4B2;
  margin-left: auto;
}
.qbr-feed-edited { font-size: 11px; color: #A4A4B2; font-style: italic; }
.qbr-feed-actions {
  display: inline-flex;
  gap: 4px;
}
.qbr-feed-action-btn {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid #D0D0E0;
  background: #fff;
  color: #555;
  font-size: 11px;
  cursor: pointer;
}
.qbr-feed-action-btn:hover { background: #F4F4F8; }
.qbr-feed-delete { color: #EF4444; }
.qbr-feed-delete:hover { background: #FFF1F0; border-color: #EF4444; }
.qbr-feed-text {
  font-size: 13px;
  color: #3A3A4A;
  line-height: 1.6;
  white-space: pre-wrap;
}
.qbr-feed-edit-form {
  margin-top: 8px;
}

/* Dark mode */
body.dark-mode .qbr-updates-section { background: #1E1E2E; border-color: #3A3A50; }
body.dark-mode .qbr-updates-header  { background: #262636; border-color: #3A3A50; }
body.dark-mode .qbr-updates-title   { color: #E0E0F0; }
body.dark-mode .qbr-updates-count   { background: #2E2E42; color: #8080A0; }
body.dark-mode .qbr-feed-item.qbr-feed-latest { background: #221A14; }
body.dark-mode .qbr-add-form        { background: #1A1A2C; border-color: #3A3A50; }
body.dark-mode .qbr-upd-textarea    { background: #262636; color: #E0E0F0; border-color: #4A4A60; }
body.dark-mode .qbr-feed-body       { border-color: #2E2E40; }
body.dark-mode .qbr-feed-author     { color: #E0E0F0; }
body.dark-mode .qbr-feed-text       { color: #C8C8DC; }
body.dark-mode .qbr-feed-connector  { background: #3A3A50; }
body.dark-mode .qbr-feed-dot        { border-color: #4A4A60; background: #262636; }
body.dark-mode .qbr-feed-action-btn { background: #262636; border-color: #3A3A50; color: #A0A0C0; }
body.dark-mode .qbr-feed-action-btn:hover { background: #2E2E42; }
body.dark-mode .qbr-feed-empty      { color: #6A6A88; }
body.dark-mode .qbr-feed-latest-badge { background: #3A1A0A; color: #F15D22; }

/* ============================================================
   PROJECT BACKLOG PAGE
   ============================================================ */

/* Chart grid — 3 cols on wide, 2 on medium, 1 on narrow */
.backlog-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .backlog-chart-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .backlog-chart-grid { grid-template-columns: 1fr; } }

.backlog-chart-card {
  background: #FFFFFF;
  border: 1px solid #DADAE5;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.backlog-chart-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: #40404C;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.backlog-chart-canvas-wrap {
  position: relative;
  height: 200px;
  flex: 1;
}
.backlog-chart-canvas-wrap canvas {
  max-height: 200px;
}

/* Placeholder card (Growth Pillar) */
.backlog-placeholder-card {
  background: #F8F8FC;
  border: 2px dashed #DADAE5;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 232px;
  color: #A4A4B2;
  font-size: 13px;
  text-align: center;
}
.backlog-placeholder-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: #A4A4B2;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.backlog-placeholder-icon { font-size: 28px; margin-bottom: 8px; }

/* Active filter chips */
.backlog-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 24px;
}
.backlog-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF5F0;
  border: 1px solid #F15D22;
  border-radius: 12px;
  padding: 3px 10px 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #F15D22;
  cursor: default;
}
.backlog-filter-chip button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #F15D22;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Search bar */
/* ── CBS view toggle bar ── */
.bl-cbs-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #F8F8FC;
  border: 1px solid #DADAE5;
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 18px;
  transition: background 0.2s, border-color 0.2s;
}
.bl-cbs-bar.cbs-active {
  background: #FFF5F2;
  border-color: #F15D22;
}
.bl-cbs-bar-label {
  font-size: 12px;
  color: #A4A4B2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bl-cbs-bar-mode {
  font-size: 13px;
  font-weight: 600;
  color: #40404C;
  min-width: 80px;
}
.bl-cbs-bar.cbs-active .bl-cbs-bar-mode { color: #F15D22; }

/* Toggle switch */
.bl-toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.bl-toggle-switch input { opacity: 0; width: 0; height: 0; }
.bl-toggle-slider {
  position: absolute;
  inset: 0;
  background: #DADAE5;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.bl-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.bl-toggle-switch input:checked + .bl-toggle-slider { background: #F15D22; }
.bl-toggle-switch input:checked + .bl-toggle-slider::before { transform: translateX(18px); }

body.dark-mode .bl-cbs-bar { background: #1E1E2E; border-color: #3A3A50; }
body.dark-mode .bl-cbs-bar.cbs-active { background: #2A1A10; border-color: #F15D22; }
body.dark-mode .bl-cbs-bar-mode { color: #C8C8DC; }
body.dark-mode .bl-toggle-slider { background: #3A3A50; }

.backlog-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.backlog-search-input {
  flex: 1;
  max-width: 340px;
  border: 1px solid #DADAE5;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  color: #40404C;
  outline: none;
}
.backlog-search-input:focus { border-color: #F15D22; }
.backlog-clear-btn {
  background: none;
  border: 1px solid #DADAE5;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  color: #A4A4B2;
  cursor: pointer;
}
.backlog-clear-btn:hover { border-color: #F15D22; color: #F15D22; }
.backlog-sprint-select {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #40404C;
  background: #FFFFFF;
  border: 1px solid #DADAE5;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.backlog-sprint-select:focus,
.backlog-sprint-select:hover { border-color: #F15D22; }
body.dark-mode .backlog-sprint-select { background: #262636; border-color: #3A3A50; color: #E0E0F0; }

/* Backlog table */
.backlog-table-wrap { overflow-x: auto; }
.backlog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #40404C;
}
.backlog-table th {
  background: #F5F5FA;
  border-bottom: 2px solid #DADAE5;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #A4A4B2;
  white-space: nowrap;
}
.backlog-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #EBEBF5;
  vertical-align: top;
  max-width: 300px;
}
.backlog-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.backlog-table tbody tr:hover { background: #FFF5F0; }
.backlog-table tbody tr.selected { background: #FFF0E8; border-left: 3px solid #F15D22; }
.backlog-table tbody tr.selected td:first-child { padding-left: 9px; }
.backlog-desc-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.backlog-count { font-size: 12px; color: #A4A4B2; margin-left: 8px; }

/* Priority badges */
.bl-priority {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.bl-priority-p1 { background: #E23F13; color: #FFFFFF; }
.bl-priority-p2 { background: #F15D22; color: #FFFFFF; }
.bl-priority-p3 { background: #FCC54C; color: #25252C; }
.bl-priority-p4 { background: #F0F0F5; color: #40404C; }
.bl-priority-unknown { background: #DADAE5; color: #A4A4B2; }

/* Size badges — OneAdvanced brand colours */
.bl-size {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
}
.bl-size-s  { background: #FFDB9B; color: #25252C; }
.bl-size-m  { background: #FCC54C; color: #25252C; }
.bl-size-l  { background: #F37721; color: #FFFFFF; }
.bl-size-xl { background: #F15D22; color: #FFFFFF; }
.bl-size-unknown { background: #F0F0F5; color: #A4A4B2; }

/* Ticket drilldown panel */
.backlog-detail-panel {
  background: #FFFFFF;
  border: 1px solid #DADAE5;
  border-radius: 8px;
  margin-top: 20px;
  overflow: hidden;
}
.backlog-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #F8F8FC;
  border-bottom: 1px solid #DADAE5;
}
.backlog-detail-title {
  font-size: 15px;
  font-weight: 700;
  color: #40404C;
}
.backlog-detail-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #A4A4B2;
  line-height: 1;
  padding: 0;
}
.backlog-detail-close:hover { color: #F15D22; }
.backlog-detail-body { padding: 20px; }
.backlog-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.backlog-detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.backlog-detail-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #A4A4B2;
}
.backlog-detail-meta-value { font-size: 13px; color: #40404C; font-weight: 500; }
.backlog-detail-desc {
  font-size: 13px;
  color: #40404C;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px;
  background: #F8F8FC;
  border-radius: 6px;
  border: 1px solid #EBEBF5;
}

/* Activity feed */
.backlog-activity-feed { margin-top: 4px; }
.backlog-activity-feed-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #A4A4B2;
  margin-bottom: 12px;
}
.backlog-feed-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.backlog-feed-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.backlog-feed-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #F15D22;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #DADAE5;
  flex-shrink: 0;
  margin-top: 3px;
}
.backlog-feed-connector {
  width: 2px;
  flex: 1;
  background: #EBEBF5;
  margin: 4px 0;
}
.backlog-feed-body { flex: 1; }
.backlog-feed-meta {
  font-size: 11px;
  color: #A4A4B2;
  margin-bottom: 4px;
}
.backlog-feed-meta strong { color: #40404C; }
.backlog-feed-notes {
  font-size: 13px;
  color: #40404C;
  line-height: 1.5;
  background: #F8F8FC;
  border: 1px solid #EBEBF5;
  border-radius: 6px;
  padding: 8px 12px;
  white-space: pre-wrap;
}
.backlog-feed-loading { color: #A4A4B2; font-size: 13px; padding: 12px 0; }
.backlog-feed-empty { color: #A4A4B2; font-size: 13px; font-style: italic; }

/* Dark mode */
body.dark-mode .backlog-chart-card { background: #1E1E2E; border-color: #3A3A50; }
body.dark-mode .backlog-chart-card h3 { color: #C8C8DC; }
body.dark-mode .backlog-placeholder-card { background: #1A1A2C; border-color: #3A3A50; }
body.dark-mode .backlog-placeholder-card h3 { color: #6A6A88; }
body.dark-mode .backlog-table { color: #C8C8DC; }
body.dark-mode .backlog-table th { background: #262636; border-color: #3A3A50; color: #8080A0; }
body.dark-mode .backlog-table td { border-color: #2E2E40; }
body.dark-mode .backlog-table tbody tr:hover { background: #2A1A10; }
body.dark-mode .backlog-table tbody tr.selected { background: #2A1A10; }
body.dark-mode .backlog-search-input { background: #262636; border-color: #3A3A50; color: #E0E0F0; }
body.dark-mode .backlog-detail-panel { background: #1E1E2E; border-color: #3A3A50; }
body.dark-mode .backlog-detail-header { background: #262636; border-color: #3A3A50; }
body.dark-mode .backlog-detail-title { color: #E0E0F0; }
body.dark-mode .backlog-detail-meta-value { color: #E0E0F0; }
body.dark-mode .backlog-detail-desc { background: #262636; border-color: #3A3A50; color: #C8C8DC; }
body.dark-mode .backlog-feed-notes { background: #262636; border-color: #3A3A50; color: #C8C8DC; }
body.dark-mode .backlog-feed-meta strong { color: #E0E0F0; }
body.dark-mode .backlog-feed-connector { background: #3A3A50; }

/* ---- Ticket detail MODAL ---- */
.bl-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bl-modal-overlay.active { display: flex; }
.bl-modal {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #F15D22;
  flex-shrink: 0;
}
.bl-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  flex: 1;
  margin-right: 12px;
}
.bl-modal-close {
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  color: #FFFFFF;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.bl-modal-close:hover { background: rgba(255,255,255,.35); }
.bl-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
body.dark-mode .bl-modal { background: #1E1E2E; }
body.dark-mode .bl-modal-body { color: #C8C8DC; }
body.dark-mode .bl-modal-body .backlog-detail-meta-value { color: #E0E0F0; }
body.dark-mode .bl-modal-body .backlog-detail-desc { background: #262636; border-color: #3A3A50; color: #C8C8DC; }
body.dark-mode .bl-modal-body .backlog-feed-notes { background: #262636; border-color: #3A3A50; color: #C8C8DC; }
body.dark-mode .bl-modal-body .backlog-feed-meta strong { color: #E0E0F0; }
body.dark-mode .bl-modal-body .backlog-feed-connector { background: #3A3A50; }

/* ---- Facilities day selector ---- */
.fac-day-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.fac-day-selector-label {
  font-size: 12px;
  font-weight: 600;
  color: #A4A4B2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.fac-day-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fac-day-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid #DADAE5;
  background: #FFFFFF;
  color: #616173;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.fac-day-btn:hover {
  border-color: #F15D22;
  color: #F15D22;
}
.fac-day-btn.active {
  background: #F15D22;
  border-color: #F15D22;
  color: #FFFFFF;
}
.fac-day-reset {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid #DADAE5;
  background: transparent;
  color: #A4A4B2;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.fac-day-reset:hover {
  border-color: #A4A4B2;
  color: #616173;
}
body.dark-mode .fac-day-btn {
  background: #262636;
  border-color: #3A3A50;
  color: #8080A0;
}
body.dark-mode .fac-day-btn:hover {
  border-color: #F15D22;
  color: #F15D22;
}
body.dark-mode .fac-day-btn.active {
  background: #F15D22;
  border-color: #F15D22;
  color: #FFFFFF;
}
body.dark-mode .fac-day-reset {
  border-color: #3A3A50;
  color: #616173;
}
body.dark-mode .fac-day-reset:hover {
  border-color: #616173;
  color: #8080A0;
}

/* ---- Facilities: clickable office cards ---- */
.fac-card-clickable[onclick] {
  transition: box-shadow 0.15s, transform 0.1s;
}
.fac-card-clickable[onclick]:hover {
  box-shadow: 0 4px 16px rgba(241,93,34,0.18);
  transform: translateY(-2px);
}

/* ---- Facilities: DoW chart controls ---- */
.fac-chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fac-toggle-group {
  display: flex;
  border: 1.5px solid #DADAE5;
  border-radius: 20px;
  overflow: hidden;
}
.fac-toggle-btn {
  padding: 5px 14px;
  border: none;
  background: #FFFFFF;
  color: #616173;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.fac-toggle-group .fac-toggle-btn + .fac-toggle-btn {
  border-left: 1.5px solid #DADAE5;
}
.fac-toggle-btn.active {
  background: #F15D22;
  color: #FFFFFF;
}
.fac-toggle-btn:not(.active):hover {
  background: #FFF4F0;
  color: #F15D22;
}
/* Standalone toggle (Show Values) */
.fac-chart-controls > .fac-toggle-btn {
  border: 1.5px solid #DADAE5;
  border-radius: 20px;
}
body.dark-mode .fac-toggle-group {
  border-color: #3A3A50;
}
body.dark-mode .fac-toggle-btn {
  background: #262636;
  color: #8080A0;
}
body.dark-mode .fac-toggle-group .fac-toggle-btn + .fac-toggle-btn {
  border-color: #3A3A50;
}
body.dark-mode .fac-toggle-btn.active {
  background: #F15D22;
  color: #FFFFFF;
}
body.dark-mode .fac-toggle-btn:not(.active):hover {
  background: #3A1A10;
  color: #F15D22;
}
body.dark-mode .fac-chart-controls > .fac-toggle-btn {
  border-color: #3A3A50;
}

/* ---- Facilities: office modal meta grid ---- */
.fac-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 16px;
  background: #F8F8FC;
  border-radius: 8px;
  border: 1px solid #EBEBF5;
  margin-bottom: 4px;
}
body.dark-mode .fac-modal-meta {
  background: #262636;
  border-color: #3A3A50;
}

/* ---- Facilities: data note banner ---- */
.fac-data-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  background: #FFF8F0;
  border: 1px solid #F6911E;
  border-radius: 6px;
  font-size: 12px;
  color: #856404;
}
body.dark-mode .fac-data-note {
  background: #2A1E0A;
  border-color: #F6911E;
  color: #F6C56E;
}

/* Disabled slicer preset button (facilities page suppresses Last Week) */
.topbar-preset-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Modal header toggle (sits on orange background) */
.bl-modal-header .fac-toggle-group {
  border-color: rgba(255,255,255,0.4);
}
.bl-modal-header .fac-toggle-btn {
  background: transparent;
  color: rgba(255,255,255,0.75);
  border: none;
  font-size: 11px;
}
.bl-modal-header .fac-toggle-btn.active {
  background: rgba(255,255,255,0.25);
  color: #FFFFFF;
}
.bl-modal-header .fac-toggle-btn:not(.active):hover {
  background: rgba(255,255,255,0.15);
  color: #FFFFFF;
}
.bl-modal-header .fac-toggle-group .fac-toggle-btn + .fac-toggle-btn {
  border-left: 1px solid rgba(255,255,255,0.4);
}

/* ============================================================
   SPRINT BOARD
   ============================================================ */
.sprint-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.sprint-select {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #40404C;
  background: #FFFFFF;
  border: 1px solid #DADAE5;
  border-radius: 6px;
  padding: 7px 12px;
  min-width: 280px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.sprint-select:hover,
.sprint-select:focus { border-color: #F15D22; outline: none; }

.sprint-panel {
  background: #FFFFFF;
  border: 1px solid #DADAE5;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.sprint-panel-prev { border-left: 4px solid #A4A4B2; }

.sprint-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.sprint-panel-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #25252C;
  margin-right: 10px;
}
.sprint-panel-dates {
  font-size: 12px;
  color: #A4A4B2;
  font-weight: 500;
}

/* Sprint status chips */
.sprint-status-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 9px;
  border-radius: 12px;
  vertical-align: middle;
}
.sprint-chip-current { background: #FFF0EA; color: #F15D22; border: 1px solid #F15D22; }
.sprint-chip-future  { background: #EEF6FF; color: #2980B9; border: 1px solid #2980B9; }
.sprint-chip-past    { background: #F5F5F8; color: #7F7F8C; border: 1px solid #DADAE5; }

/* Metrics row */
.sprint-metrics {
  display: flex;
  gap: 24px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sprint-metric { text-align: center; min-width: 48px; }
.sprint-metric-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #25252C;
  line-height: 1.1;
}
.sprint-metric-lbl {
  font-size: 11px;
  color: #A4A4B2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Progress bar */
.sprint-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.sprint-progress-track {
  flex: 1;
  height: 8px;
  background: #F0F0F5;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
.sprint-progress-seg {
  height: 100%;
  transition: width 0.4s ease;
}
.seg-done    { background: #27AE60; }
.seg-inprog  { background: #F15D22; }
.seg-blocked { background: #E74C3C; }
.sprint-progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: #27AE60;
  white-space: nowrap;
}

/* Sprint badge (status in table) */
.sprint-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.sprint-badge-done    { background: #E8F8EF; color: #27AE60; }
.sprint-badge-inprog  { background: #FFF0EA; color: #F15D22; }
.sprint-badge-blocked { background: #FDEDEC; color: #E74C3C; }
.sprint-badge-new     { background: #F5F5F8; color: #7F7F8C; }
.sprint-badge-blocked { background: #FDECEA; color: #C0392B; }

/* Sprint table */
.sprint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sprint-table thead tr {
  border-bottom: 2px solid #DADAE5;
}
.sprint-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #A4A4B2;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.sprint-table tbody tr {
  border-bottom: 1px solid #F0F0F5;
  transition: background 0.15s;
}
.sprint-table tbody tr:hover { background: #FFF5F0; }
.sprint-table td { padding: 8px 10px; color: #40404C; vertical-align: middle; }
.sprint-table .backlog-desc-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.sprint-empty {
  padding: 32px;
  text-align: center;
  color: #A4A4B2;
  font-size: 14px;
}

/* Dark mode overrides */
body.dark-mode .sprint-select {
  background: #2D2D35;
  color: #E0E0E0;
  border-color: #404048;
}
body.dark-mode .sprint-panel {
  background: #25252C;
  border-color: #404048;
}
body.dark-mode .sprint-panel-title { color: #E0E0E0; }
body.dark-mode .sprint-progress-track { background: #35353D; }
body.dark-mode .sprint-table thead tr { border-bottom-color: #404048; }
body.dark-mode .sprint-table tbody tr { border-bottom-color: #35353D; }
body.dark-mode .sprint-table tbody tr:hover { background: #2D2D35; }
body.dark-mode .sprint-table td { color: #C8C8D0; }
body.dark-mode .sprint-chip-current { background: #3A2010; }
body.dark-mode .sprint-chip-future  { background: #0D2035; }
body.dark-mode .sprint-chip-past    { background: #2D2D35; }

/* ============================================================
   RAG REPORTING + VALUEFLOW
   ============================================================ */

/* Home — management reporting strip */
#home-management-reporting { margin-bottom: 32px; }
.home-section-label { font-size: 0.75rem; font-weight: 600; color: #A4A4B2; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
.home-reporting-panels { display: flex; gap: 16px; flex-wrap: wrap; }
.home-reporting-panel { flex: 1; min-width: 240px; background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 12px; padding: 20px 24px; cursor: pointer; transition: all 0.2s; user-select: none; }
.home-reporting-panel:hover { border-color: #F15D22; box-shadow: 0 2px 8px rgba(241,93,34,0.1); }
.home-panel-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #A4A4B2; margin-bottom: 12px; }
.home-rag-loading { color: #A4A4B2; font-size: 13px; padding: 8px 0; }
.home-rag-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; margin-bottom: 6px; border-left: 6px solid transparent; }
.home-rag-row:last-child { margin-bottom: 0; }
.home-rag-row--green { background: #ECFDF5; border-left-color: #10B981; }
.home-rag-row--amber { background: #FFFBEB; border-left-color: #FCC54C; }
.home-rag-row--red   { background: #FEF2F2; border-left-color: #E23F13; }
.home-rag-row--grey  { background: #F8F8FB; border-left-color: #DADAE5; }
.home-rag-lens { flex: 1; font-size: 14px; color: #25252C; font-weight: 600; }
/* ValueFlow home panel — neutral tiles, NO traffic light colours */
.home-vf-tiles { display: flex; flex-direction: column; gap: 8px; }
.home-vf-tile { display: flex; align-items: baseline; gap: 8px; }
.home-vf-value { font-size: 20px; font-weight: 700; color: #25252C; }
.home-vf-label { font-size: 12px; color: #A4A4B2; }

/* Executive RAG page */
.exec-rag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.exec-rag-grid--3col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .exec-rag-grid--3col { grid-template-columns: 1fr; } }
.exec-rag-card { background: #FFFFFF; border: 1px solid #DADAE5; border-radius: 12px; padding: 0; cursor: pointer; transition: all 0.2s; overflow: hidden; }
.exec-rag-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-2px); }
.exec-rag-card--green  { border-color: #10B981; }
.exec-rag-card--amber  { border-color: #FCC54C; }
.exec-rag-card--red    { border-color: #E23F13; }
.exec-rag-card--grey   { border-color: #DADAE5; }
.exec-rag-card-banner  { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; }
.exec-rag-card--green  .exec-rag-card-banner { background: #10B981; }
.exec-rag-card--amber  .exec-rag-card-banner { background: #FCC54C; }
.exec-rag-card--red    .exec-rag-card-banner { background: #E23F13; }
.exec-rag-card--grey   .exec-rag-card-banner { background: #DADAE5; }
.exec-rag-card-banner-lens { font-size: 1.05rem; font-weight: 700; color: #FFFFFF; }
.exec-rag-card--amber  .exec-rag-card-banner-lens { color: #25252C; }
.exec-rag-card--grey   .exec-rag-card-banner-lens { color: #40404C; }
.exec-rag-card-banner-right { display: flex; align-items: center; gap: 8px; }
.exec-rag-card-body    { padding: 16px 24px 20px; }
.exec-rag-card-banner .exec-card-edit-btn { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); color: #fff; font-size: 12px; padding: 3px 10px; }
.exec-rag-card--amber .exec-rag-card-banner .exec-card-edit-btn { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.2); color: #25252C; }
.exec-rag-card-banner .exec-card-edit-btn:hover { background: rgba(255,255,255,0.4); }
.exec-rag-card-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.exec-rag-card-lens    { font-size: 1rem; font-weight: 600; color: #25252C; }
.exec-rag-card-arrow   { font-size: 12px; color: #A4A4B2; margin-top: 12px; }
.exec-rag-commentary   { font-size: 14px; color: #40404C; line-height: 1.5; margin-bottom: 8px; }
.exec-rag-meta         { font-size: 12px; color: #A4A4B2; }
.exec-override-note    { font-size: 12px; color: #92400E; background: #FEF3C7; border-radius: 4px; padding: 4px 8px; margin-bottom: 8px; }
.exec-override-note .override-dates { opacity: 0.75; font-style: italic; }
.rag-period-label { font-size: 12px; color: #A4A4B2; min-height: 18px; }
/* "RAG calculated 06:00 - Refresh now" line under the RAG views */
.rag-asat { font-size: 12px; color: #A4A4B2; display: flex; align-items: center; gap: 12px; min-height: 18px; }
.rag-asat:empty { display: none; }
.rag-asat .btn-link { font-size: 12px; }
.rag-asat .btn-link:disabled { color: #A4A4B2; text-decoration: none; cursor: default; }
.dir-rag-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.exec-rag-loading      { color: #A4A4B2; padding: 32px 0; text-align: center; }
.exec-section-header   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.exec-section-title    { margin: 0; font-size: 1rem; font-weight: 600; color: #25252C; }
/* Executive ValueFlow tiles — neutral, no RAG colours */
.exec-vf-grid  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .exec-vf-grid { grid-template-columns: repeat(2, 1fr); } }
.exec-vf-tile  { background: #F5F5FA; border-radius: 10px; padding: 16px 20px; }
.exec-vf-value { font-size: 1.4rem; font-weight: 700; color: #25252C; }
.exec-vf-label { font-size: 12px; color: #A4A4B2; margin-top: 4px; }
/* Redirect — potential capacity by department */
.exec-section-subheader { margin-bottom: 12px; }
.exec-section-subtitle  { font-size: 13px; font-weight: 600; color: #A4A4B2; text-transform: uppercase; letter-spacing: 0.04em; }
.exec-redirect-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 900px) { .exec-redirect-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .exec-redirect-grid { grid-template-columns: 1fr 1fr; } }
.exec-redirect-card { background: #F5F5FA; border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: background 0.15s; border-left: 3px solid #F15D22; }
.exec-redirect-card:hover { background: #EEEEF5; }
.exec-redirect-card--empty { border-left-color: #E0E0E8; }
.exec-redirect-area  { font-size: 12px; font-weight: 600; color: #40404C; margin-bottom: 6px; }
.exec-redirect-hours { font-size: 1.25rem; font-weight: 700; color: #25252C; }
.exec-redirect-meta  { font-size: 11px; color: #A4A4B2; margin-top: 3px; }
/* ValueFlow director matrix */
.vf-matrix-cell { font-size: 14px; color: #25252C; text-align: center; }
.exec-rag-row          { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.exec-rag-lens         { flex: 1; font-size: 14px; color: #40404C; font-weight: 500; }
.rag-override-note     { color: #92400E; font-size: 14px; cursor: help; }
.exec-card-edit-btn    { font-size: 12px; padding: 3px 10px; }

/* Director RAG matrix */
.dir-rag-summary { display: block; padding: 12px 0 20px; }
.dir-summary-item { font-size: 13px; color: #40404C; }
.dir-summary-counts { font-size: 13px; margin-top: 8px; color: #40404C; }
.dir-count-green { color: #065F46; font-weight: 600; }
.dir-count-amber { color: #92400E; font-weight: 600; }
.dir-count-red   { color: #991B1B; font-weight: 600; }
.dr-rag-matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.dr-rag-matrix th { text-align: center; padding: 8px 12px; background: #3D3D50; border-bottom: 2px solid #3D3D50; border-right: 1px solid rgba(255,255,255,0.15); font-weight: 700; color: #FFFFFF; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.dr-rag-matrix th:first-child { text-align: left; border-right: 2px solid rgba(255,255,255,0.2); }
.dr-rag-matrix th:last-child { border-right: none; }
.dr-rag-matrix td { padding: 7px 12px; border-bottom: 1px solid #EBEBF5; vertical-align: middle; }
.dr-area-name { font-weight: 500; color: #25252C; width: 30%; border-right: 2px solid #DADAE5; }
.rag-cell { cursor: pointer; transition: filter 0.15s; text-align: center; width: 140px; border-right: 2px solid rgba(255,255,255,0.35); }
.rag-cell:last-child { border-right: none; }
.rag-cell:hover { filter: brightness(0.9); }
.rag-cell--green { background: #10B981; color: #fff; }
.rag-cell--amber { background: #FCC54C; color: #25252C; }
.rag-cell--red   { background: #E23F13; color: #fff; }
.rag-cell--grey  { background: #DADAE5; color: #60607A; }
.rag-cell .rag-badge { display: none; }
.rag-cell-label { display: none; }
.rag-cell { vertical-align: middle; }
.matrix-cell-inner { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.matrix-rag-letter { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: transparent; border: 2px solid rgba(255,255,255,0.85); font-size: 13px; font-weight: 800; line-height: 28px; color: #ffffff; }
.rag-cell--amber .matrix-rag-letter { border-color: rgba(0,0,0,0.35); color: rgba(0,0,0,0.75); }
.rag-cell--grey  .matrix-rag-letter { border-color: rgba(100,100,120,0.5); color: #60607A; }
.matrix-trend-arrow { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 28px; flex-shrink: 0; font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.9); line-height: 1; }
.rag-cell--amber .matrix-trend-arrow { color: rgba(0,0,0,0.55); }
.rag-cell--grey  .matrix-trend-arrow { color: rgba(100,100,120,0.6); }

/* Trend icons */
.trend-icon { font-size: 14px; font-weight: 700; }
.trend-improving     { color: #10B981; }
.trend-stable        { color: #A4A4B2; }
.trend-deteriorating { color: #E23F13; }
.trend-unknown       { color: #DADAE5; }

/* DR area overview tab */
.dr-area-lens-summary { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.dr-area-lens-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; border-left: 6px solid transparent; }
.dr-area-lens-row--green { background: #ECFDF5; border-left-color: #10B981; }
.dr-area-lens-row--amber { background: #FFFBEB; border-left-color: #FCC54C; }
.dr-area-lens-row--red   { background: #FEF2F2; border-left-color: #E23F13; }
.dr-area-lens-row--grey  { background: #F8F8FB; border-left-color: #DADAE5; }
.dr-area-lens-name { flex: 0 0 180px; font-weight: 600; font-size: 14px; color: #25252C; }
.dr-area-commentary { font-size: 13px; color: #60607A; flex: 1; }
.dr-area-metric-section { margin-bottom: 28px; }
.dr-area-metric-lens { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #A4A4B2; margin: 0 0 10px; }
/* Overview metrics tab strip */
.ov-tabs-wrap { margin-top: 8px; }
.ov-tab-bar { display: flex; gap: 4px; border-bottom: 2px solid #DADAE5; margin-bottom: 16px; }
.ov-tab { background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 8px 18px; font-size: 14px; font-weight: 500; color: #60607A; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.ov-tab:hover { color: #F15D22; }
.ov-tab--active { color: #F15D22; border-bottom-color: #F15D22; font-weight: 600; }

/* KPI metric table */
.metric-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.metric-table th { text-align: left; padding: 8px 10px; background: #F5F5FA; border-bottom: 2px solid #DADAE5; font-weight: 600; color: #60607A; font-size: 13px; }
.metric-table td { padding: 10px; border-bottom: 1px solid #EBEBF5; vertical-align: middle; }
.metric-table-value { font-weight: 600; }
.metric-table-ts { font-size: 12px; }
.metric-row--clickable { cursor: pointer; }
.metric-row--green  { background: #D1FAE5; }
.metric-row--green  td { border-bottom-color: #A7F3D0; color: #065F46; }
.metric-row--green.metric-row--clickable:hover  { background: #A7F3D0; }
.metric-row--amber  { background: #FEF3C7; }
.metric-row--amber  td { border-bottom-color: #FDE68A; color: #78350F; }
.metric-row--amber.metric-row--clickable:hover  { background: #FDE68A; }
.metric-row--red    { background: #FEE2E2; }
.metric-row--red    td { border-bottom-color: #FECACA; color: #7F1D1D; }
.metric-row--red.metric-row--clickable:hover    { background: #FECACA; }
.metric-row--grey   td { color: #60607A; }
.metric-row-actions { text-align: right; white-space: nowrap; }
.metric-row-edit { opacity: 0.6; }
.metric-row--clickable:hover .metric-row-edit { opacity: 1; }
.kpi-detail-table td { vertical-align: top; font-size: 13px; }
.kpi-detail-table th { white-space: nowrap; }
.collection-badge { font-size: 11px; padding: 2px 6px; border-radius: 3px; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.collection-badge--manual      { background: #FEF3C7; color: #92400E; }
.collection-badge--partial     { background: #EDE9FE; color: #5B21B6; }
.collection-badge--placeholder { background: #F3F4F6; color: #6B7280; }
.collection-badge--future      { background: #EFF6FF; color: #1D4ED8; }
.btn-link { background: none; border: none; color: #F15D22; font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; }
.btn-link:hover { color: #C44D1A; }

/* ValueFlow Scorecard page */
.vf-period-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.vf-period-btn { padding: 6px 16px; border: 1px solid #DADAE5; border-radius: 20px; background: #FFFFFF; font-size: 13px; font-weight: 500; cursor: pointer; color: #60607A; transition: all 0.15s; }
.vf-period-btn:hover  { border-color: #F15D22; color: #F15D22; }
.vf-period-btn.active { background: #F15D22; border-color: #F15D22; color: #FFFFFF; }
.vf-stage-note { font-size: 12px; color: #A4A4B2; }
.vf-forecast-line { font-size: 12px; color: #A4A4B2; margin-top: 2px; }
.vf-tile { position: relative; }
.vf-status--complete   .metric-value { color: #065F46; }
.vf-status--inprogress .metric-value { color: #1D4ED8; }
.vf-status--blocked    .metric-value { color: #991B1B; }
.vf-by-area-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-bottom: 1px solid #EBEBF5; border-radius: 4px; transition: background 0.15s; }
.vf-by-area-row:last-child { border-bottom: none; }
.vf-by-area-row:hover { background: #F4F4FB; }
.vf-by-area-row--active { background: #EEF2FF !important; }
.vf-by-area-row--active .vf-by-area-label { color: #4338CA; font-weight: 600; }
.vf-by-area-row--active .vf-by-area-count { color: #4338CA; }
.vf-by-area-label { flex: 1; font-size: 14px; color: #40404C; }
.vf-by-area-count { font-size: 13px; color: #60607A; }
/* ValueFlow intervention list */
.vf-intervention-table { cursor: default; }
.vf-iv-row { cursor: pointer; }
.vf-iv-row:hover td { background: #FFF5F0; }
.vf-status-badge { font-size: 12px; padding: 2px 8px; border-radius: 12px; font-weight: 600; background: #F3F4F6; color: #60607A; }
.vf-status--complete   .vf-status-badge, .vf-status-badge.vf-status--complete   { background: #D1FAE5; color: #065F46; }
.vf-status--inprogress .vf-status-badge, .vf-status-badge.vf-status--inprogress { background: #DBEAFE; color: #1D4ED8; }
.vf-status--blocked    .vf-status-badge, .vf-status-badge.vf-status--blocked    { background: #FEE2E2; color: #991B1B; }
.vf-driver-badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #F0F0F8; color: #60607A; margin-right: 4px; white-space: nowrap; display: inline-block; text-transform: capitalize; }
/* ValueFlow detail modal */
.vf-detail-meta { font-size: 13px; color: #60607A; margin-bottom: 12px; }
.vf-detail-drivers { margin-bottom: 14px; }
.vf-detail-section { margin-bottom: 18px; }
.vf-detail-h3 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #A4A4B2; margin: 0 0 6px; }
.vf-stage-badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.vf-stage--forecast  { background: #FEF3C7; color: #92400E; }
.vf-stage--realised  { background: #D1FAE5; color: #065F46; }
.vf-stage--validated { background: #DBEAFE; color: #1D4ED8; }
.vf-outcome-table { margin-top: 0; }
/* ValueFlow form checkboxes */
.vf-driver-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; }
.vf-driver-checkboxes label { font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Taxonomy section headings inside edit form */
.vf-taxonomy-section { background: #FAFAFA; border: 1px solid #EBEBF5; border-radius: 6px; padding: 12px 14px; }
.vf-taxonomy-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #25252C; margin-bottom: 10px; }
.vf-taxonomy-heading--driver    { color: #C0490A; }
.vf-taxonomy-heading--principle { color: #065F46; }
.vf-taxonomy-sub { font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; color: #A4A4B2; margin-left: 4px; }

/* Taxonomy badges */
.vf-capability-badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #DBEAFE; color: #1D4ED8; margin-right: 4px; white-space: nowrap; display: inline-block; }
.vf-principle-badge  { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #D1FAE5; color: #065F46; margin-right: 4px; white-space: nowrap; display: inline-block; }
.vf-pattern-badge    { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #EDE9FE; color: #5B21B6; margin-right: 4px; white-space: nowrap; display: inline-block; font-style: italic; }

/* ---- ValueFlow View Toggle ---- */
.vf-view-toggle { display: flex; border: 1px solid #DADAE5; border-radius: 6px; overflow: hidden; }
.vf-view-btn { background: #FFFFFF; border: none; border-right: 1px solid #DADAE5; padding: 6px 14px; font-size: 13px; font-weight: 500; color: #60607A; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.vf-view-btn:last-child { border-right: none; }
.vf-view-btn:hover { background: #FFF5F0; color: #F15D22; }
.vf-view-btn.active { background: #F15D22; color: #FFFFFF; }

/* ---- ValueFlow Card View Page ---- */
.vf-card-page { width: 100%; }

.vf-card-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 20px; gap: 16px; }
.vf-card-nav-btn { background: #FFFFFF; border: 1.5px solid #DADAE5; border-radius: 6px; padding: 8px 20px; font-size: 14px; font-weight: 600; color: #40404C; cursor: pointer; transition: all 0.15s; }
.vf-card-nav-btn:hover:not(:disabled) { border-color: #F15D22; color: #F15D22; }
.vf-card-nav-btn:disabled { opacity: 0.35; cursor: default; }
.vf-card-nav-centre { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vf-card-nav-count { font-size: 13px; font-weight: 600; color: #60607A; }
.vf-card-nav-dots { display: flex; gap: 6px; }
.vf-card-dot { width: 8px; height: 8px; border-radius: 50%; background: #DADAE5; cursor: pointer; transition: background 0.15s; }
.vf-card-dot.active { background: #F15D22; transform: scale(1.25); }
.vf-card-dot:hover:not(.active) { background: #A4A4B2; }

/* Card header strip (above the navy bar) */
.vf-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.vf-card-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vf-card-header-area { font-size: 13px; font-weight: 600; color: #60607A; }
.vf-card-header-period { font-size: 12px; color: #A4A4B2; }
.vf-card-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vf-card-title { font-size: 1.4rem; font-weight: 800; color: #25252C; margin: 0 0 12px; line-height: 1.2; }

/* Placeholder card topbar */
.vf-card-topbar--placeholder { opacity: 0.45; }
.vf-card-placeholder-val { color: #A4A4B2 !important; font-size: 28px !important; }
.vf-card-placeholder-cta { background: #F9F9FC; border: 2px dashed #DADAE5; border-radius: 8px; padding: 32px; text-align: center; margin-top: 24px; }
.vf-card-placeholder-icon { font-size: 32px; color: #DADAE5; margin-bottom: 12px; }
.vf-card-placeholder-cta p { font-size: 14px; color: #60607A; margin: 0 0 16px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ---- ValueFlow Detail Tabs ---- */
.vf-detail-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #EBEBF5; }
.vf-detail-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 6px 16px; font-size: 13px; font-weight: 600; color: #60607A; cursor: pointer; transition: all 0.15s; }
.vf-detail-tab:hover { color: #F15D22; }
.vf-detail-tab.active { color: #F15D22; border-bottom-color: #F15D22; }
.vf-detail-tab--empty { color: #A4A4B2; font-weight: 400; }

/* ---- ValueFlow Case Card Builder Form ---- */
.vf-case-modal { padding: 24px; }
.vf-case-section { background: #FAFAFA; border: 1px solid #EBEBF5; border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.vf-case-section-heading { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #60607A; margin-bottom: 12px; }
.vf-fn-row { border-bottom: 1px solid #EBEBF5; padding-bottom: 12px; margin-bottom: 12px; }
.vf-fn-row:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

/* ---- ValueFlow Case Card View ---- */
.vf-card { background: #FFFFFF; border: 1px solid #EBEBF5; border-radius: 8px; overflow: hidden; }

.vf-card-topbar { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; background: #12243A; padding: 0; }
.vf-card-kpi { padding: 14px 18px; }
.vf-card-kpi--highlight .vf-card-kpi-label { color: #F15D22; }
.vf-card-kpi-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #A4A4B2; margin-bottom: 4px; }
.vf-card-kpi-value { font-size: 22px; font-weight: 800; color: #FFFFFF; line-height: 1; margin-bottom: 3px; }
.vf-card-kpi-sub { font-size: 11px; color: #7a8fa6; }
.vf-card-kpi-divider { width: 1px; background: rgba(255,255,255,0.12); margin: 10px 0; }

.vf-card-body { display: grid; grid-template-columns: 1fr 400px; gap: 0; border-top: 1px solid #EBEBF5; }
@media (max-width: 900px) { .vf-card-body { grid-template-columns: 1fr; } }

.vf-card-left { padding: 16px; border-right: 1px solid #EBEBF5; }
.vf-card-right { padding: 16px; background: #FAFAFA; }
.vf-card-body-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #25252C; margin: 0 0 4px; }
.vf-card-body-sub { font-size: 12px; color: #60607A; margin: 0 0 12px; }

.vf-fn-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.vf-fn-table th { background: #25252C; color: #FFFFFF; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; text-align: left; }
.vf-fn-table th:last-child { color: #F15D22; }
.vf-fn-table td { padding: 6px 8px; border-bottom: 1px solid #EBEBF5; vertical-align: top; }
.vf-fn-table tr:nth-child(even) td { background: #FAFAFA; }
.vf-fn-table tr:last-child td { border-bottom: none; }

.vf-card-formula-box { background: #FFF5F0; border: 1.5px solid #F15D22; border-radius: 8px; padding: 14px; margin-bottom: 14px; text-align: center; }
.vf-card-formula-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #F15D22; margin-bottom: 6px; }
.vf-card-formula-expr { font-size: 12px; color: #40404C; margin-bottom: 6px; }
.vf-card-formula-result { font-size: 20px; font-weight: 800; color: #F15D22; margin-bottom: 4px; }
.vf-card-formula-note { font-size: 10px; color: #A4A4B2; }

.vf-card-compare-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vf-card-compare-th--itil { background: #2D4FB2; color: #FFFFFF; padding: 6px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; width: 50%; }
.vf-card-compare-th--vf   { background: #25252C; color: #FFFFFF; padding: 6px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.vf-card-compare-table td { padding: 8px 10px; vertical-align: top; border: 1px solid #EBEBF5; }
.vf-card-compare-list { margin: 0; padding-left: 16px; }
.vf-card-compare-list li { font-size: 12px; color: #40404C; margin-bottom: 4px; }

.vf-card-bottombar { background: #12243A; padding: 12px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.vf-card-bottombar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #F15D22; white-space: nowrap; }
.vf-card-bottombar-tagline { font-size: 15px; font-weight: 700; color: #FFFFFF; }

/* error banner */
.error-banner { background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #991B1B; }


/* ---- Delivery list views (Projects, Design Authority, Investment Committee, Triage) ---- */
.bl-state {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
}
.bl-view-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.bl-state-chip {
  background: #FFFFFF;
  border: 1px solid #DADAE5;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #40404C;
  cursor: pointer;
  font-family: inherit;
}
.bl-state-chip:hover { border-color: #F15D22; }
.bl-state-chip.active { background: #F15D22; border-color: #F15D22; color: #FFFFFF; }
.bl-view-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #60607A; white-space: nowrap; }
body.dark-mode .bl-state-chip { background: #262636; border-color: #3A3A50; color: #C8C8DC; }
body.dark-mode .bl-state-chip.active { background: #F15D22; border-color: #F15D22; color: #FFFFFF; }

/* Change Delivery Roadmap: the app's own palette (orange #F15D22, greys #DADAE5 / #A4A4B2 / #40404C / #25252C) */
.rm-controls { flex-wrap:wrap; gap:10px 12px; }
.rm-lbl { font-weight:600; font-size:14px; color:#40404C; white-space:nowrap; }
.rm-spacer { flex:1; }
.rm-chart { padding:16px 20px; overflow:hidden; }
.rm-row { display:flex; align-items:center; min-height:26px; }
.rm-label { flex:0 0 240px; font-size:12px; color:#40404C; padding-right:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rm-label b { color:#25252C; }
.rm-name { display:block; max-width:100%; margin:0; padding:0; border:0; background:none; font:inherit; color:inherit; text-align:left; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rm-name:hover, .rm-name:focus-visible { color:#2D4FB2; text-decoration:underline; outline:none; }
.rm-chip-btn { font-family:inherit; cursor:pointer; }
.rm-chip-btn:hover, .rm-chip-btn:focus-visible { border-color:#2D4FB2; color:#2D4FB2; outline:none; }
body.dark-mode .rm-name:hover, body.dark-mode .rm-name:focus-visible, body.dark-mode .rm-chip-btn:hover { color:#8FA8F0; }
.rm-label small { color:#A4A4B2; font-size:10px; text-transform:uppercase; letter-spacing:.04em; }
.rm-track { position:relative; flex:1; height:24px; }
.rm-head .rm-track { height:22px; }
.rm-col { position:absolute; top:0; bottom:0; border-left:1px solid #EEEEF5; font-size:11px; font-weight:600; color:#A4A4B2; padding-left:4px; }
.rm-today { position:absolute; top:-2px; bottom:-2px; width:2px; background:#F15D22; z-index:3; }
.rm-sprintrow { border-bottom:1px solid #EEEEF5; padding-bottom:6px; margin-bottom:4px; }
.rm-sprintrow .rm-track { height:28px; }
.rm-sprint { position:absolute; top:2px; bottom:2px; background:#F5F5F8; border:1px solid #DADAE5; border-radius:4px; font-size:10px; color:#616173; display:flex; gap:4px; align-items:center; justify-content:center; overflow:hidden; box-sizing:border-box; }
.rm-sprint.rm-cur { background:#FFF0EA; border-color:#F15D22; color:#F15D22; font-weight:700; }
.rm-sprint em { font-style:normal; font-weight:700; color:#25252C; }
.rm-group { margin-top:12px; padding:4px 0; font-family:'Montserrat',sans-serif; font-weight:700; font-size:13px; color:#25252C; border-bottom:1px solid #DADAE5; }
.rm-group small { color:#A4A4B2; font-weight:400; font-family:inherit; }
.rm-bar { position:absolute; top:6px; height:12px; border-radius:6px; background:var(--rm-col,#2D4FB2); z-index:2; }
.rm-bar.rm-flight { background:repeating-linear-gradient(45deg,var(--rm-col),var(--rm-col) 6px,rgba(255,255,255,.45) 6px,rgba(255,255,255,.45) 10px); }
.rm-bar.rm-sched { background:transparent; border:2px solid var(--rm-col); box-sizing:border-box; }
.rm-bar.rm-late { box-shadow:0 0 0 2px #E23F13; }
.rm-plan { position:absolute; top:3px; height:18px; border:1px dashed #A4A4B2; border-radius:9px; background:rgba(164,164,178,.12); z-index:1; box-sizing:border-box; }
.rm-demand { margin-top:14px; border-top:1px solid #EEEEF5; padding-top:8px; }
.rm-demand .rm-track { height:70px; }
.rm-dcol { position:absolute; bottom:0; top:0; border-left:1px solid #EEEEF5; }
.rm-dbar { position:absolute; bottom:14px; left:18%; right:18%; background:#F15D22; border-radius:3px 3px 0 0; max-height:calc(100% - 14px); overflow:hidden; }
.rm-dap { position:absolute; left:0; right:0; top:0; display:block; background:repeating-linear-gradient(45deg,#FBC2AB,#FBC2AB 4px,#FFF0EA 4px,#FFF0EA 8px); }
.rm-dcol span { position:absolute; bottom:0; left:0; right:0; text-align:center; font-size:10px; color:#616173; }
.rm-key { display:flex; flex-wrap:wrap; gap:6px 16px; font-size:11px; color:#616173; margin:12px 0; }
.rm-k { display:inline-block; width:14px; height:8px; border-radius:4px; background:var(--rm-col,#2D4FB2); margin-right:5px; vertical-align:middle; }
.rm-k.rm-flight { background:repeating-linear-gradient(45deg,var(--rm-col),var(--rm-col) 3px,rgba(255,255,255,.45) 3px,rgba(255,255,255,.45) 6px); }
.rm-k.rm-sched { background:transparent; border:2px solid var(--rm-col); box-sizing:border-box; }
.rm-k.rm-late { box-shadow:0 0 0 2px #E23F13; background:#A4A4B2; }
.rm-k.rm-plan { background:none; border:1px dashed #A4A4B2; }
.rm-note { margin:10px 0; padding:10px 14px; border-radius:8px; background:#F5F5F8; border:1px solid #DADAE5; font-size:13px; color:#40404C; }
.rm-warn { background:#FFF8E6; border-color:#FCC54C; } .rm-bad { background:#FDECEA; border-color:#E23F13; color:#E23F13; }
.rm-unsched h2, .rm-heat h2 { margin:0 0 10px; } .rm-heat h2 small { font-family:inherit; font-weight:400; font-size:12px; color:#A4A4B2; }
.rm-chip { display:inline-block; margin:2px 6px 2px 0; padding:3px 10px; border-radius:12px; background:#F5F5F8; border:1px solid #DADAE5; font-size:12px; color:#40404C; }
.rm-hmt { border-collapse:collapse; font-size:12px; width:100%; }
.rm-hmt th { font-weight:600; padding:5px 8px; text-align:left; white-space:nowrap; color:#40404C; }
.rm-hmt thead th { color:#A4A4B2; font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.rm-hm { text-align:center; padding:6px 8px; border:2px solid #FFFFFF; border-radius:4px; }
.rm-hm-ok { background:#E8F8EF; color:#27AE60; } .rm-hm-warn { background:#FFF3D6; color:#9A6A00; } .rm-hm-over { background:#FDECEA; color:#E23F13; font-weight:700; } .rm-hm-none { background:#F5F5F8; color:#A4A4B2; }
body.dark-mode .rm-label, body.dark-mode .rm-hmt th, body.dark-mode .rm-lbl, body.dark-mode .rm-chip, body.dark-mode .rm-note { color:#C8C8DC; }
body.dark-mode .rm-label b, body.dark-mode .rm-group, body.dark-mode .rm-sprint em { color:#E0E0E0; }
body.dark-mode .rm-sprint { background:#35353D; border-color:#404048; color:#C8C8DC; }
body.dark-mode .rm-sprint.rm-cur { background:#2A1A10; border-color:#F15D22; color:#F15D22; }
body.dark-mode .rm-note, body.dark-mode .rm-chip { background:#2A2A32; border-color:#404048; }
body.dark-mode .rm-col, body.dark-mode .rm-dcol, body.dark-mode .rm-group, body.dark-mode .rm-sprintrow, body.dark-mode .rm-demand { border-color:#404048; }
body.dark-mode .rm-hm-none { background:#2A2A32; } body.dark-mode .rm-hm { border-color:#25252C; }
body.dark-mode .rm-hm-ok { background:#173626; } body.dark-mode .rm-hm-warn { background:#3A3015; color:#FCC54C; } body.dark-mode .rm-hm-over { background:#3F1C16; }

.cap-table { border-collapse:collapse; } .cap-in { width:62px; padding:3px 4px; box-sizing:border-box; border:1px solid #DADAE5; border-radius:4px; }
.bl-ovr { margin:0 0 20px; padding:14px 16px; background:#F8F8FC; border:1px solid #EBEBF5; border-left:3px solid #F15D22; border-radius:6px; }
.bl-ovr-head { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.bl-ovr-title { font-size:13px; font-weight:700; color:#25252C; }
.bl-ovr-badge { font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#F15D22; background:#FFF0EA; border-radius:10px; padding:2px 8px; }
.bl-ovr-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; }
.bl-ovr-field { display:flex; flex-direction:column; gap:5px; min-width:180px; }
.bl-ovr-grow { flex:1; min-width:220px; }
.bl-ovr .admin-select { min-width:200px; }
.bl-ovr-in { border:1px solid #DADAE5; border-radius:6px; padding:8px 12px; font-size:13px; font-family:inherit; color:#25252C; background:#FFFFFF; outline:none; }
.bl-ovr-in:focus { border-color:#F15D22; }
.bl-ovr-in::placeholder { color:#A4A4B2; }
.bl-ovr-save { padding:8px 22px; }
.bl-ovr-note { margin-top:10px; font-size:12px; color:#7F7F8C; line-height:1.5; }
.bl-ovr-msg { font-size:12px; font-weight:600; margin-right:8px; }
body.dark-mode .bl-ovr { background:#262636; border-color:#3A3A50; border-left-color:#F15D22; }
body.dark-mode .bl-ovr-title { color:#E0E0F0; }
body.dark-mode .bl-ovr-badge { background:#3A2A22; }
body.dark-mode .bl-ovr .admin-select, body.dark-mode .bl-ovr-in { background:#1E1E2E; border-color:#4A4A60; color:#E0E0F0; }
body.dark-mode .bl-ovr-note { color:#A4A4B2; }
.cls-longtext { white-space:pre-wrap; max-height:260px; overflow:auto; padding:8px 10px; background:#F8F8FB; border:1px solid #DADAE5; border-radius:8px; }
.bl-detail-long { margin-top:10px; } .bl-detail-long-title { font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#A4A4B2; margin-bottom:4px; }

/* ============================================================
   POP-OUT PANELS — every popup in the app slides in from the right and covers two thirds of the screen.
   Three families share this: .bl-modal (ticket detail, office, manifest), .rm-modal (View as, approvals, Schedule Report)
   and .new-action-modal (edit and create forms, including the static New Action one). !important beats the
   per-popup inline widths. Change --drawer-width to resize them all.
   ============================================================ */
:root { --drawer-width: 66.667vw; }
.bl-modal-overlay, .rm-overlay, .new-action-overlay, #new-action-modal-overlay {
  align-items: stretch !important;
  justify-content: flex-end !important;
  padding: 0 !important;
  animation: drawerFade .2s ease-out;
}
.bl-modal, .rm-modal, .new-action-modal, #new-action-modal-overlay > div {
  width: var(--drawer-width) !important;
  min-width: min(520px, 100vw);
  max-width: none !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  box-shadow: -12px 0 40px rgba(0,0,0,.28) !important;
  animation: drawerIn .28s cubic-bezier(.22,.8,.3,1);
}
.new-action-modal, #new-action-modal-overlay > div { overflow-y: auto !important; box-sizing: border-box; }
@keyframes drawerIn   { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes drawerFade { from { background-color: rgba(0,0,0,0); } }
.drawer-closing { animation: drawerFadeOut .22s ease-in forwards !important; pointer-events: none; }
.drawer-closing > * { animation: drawerOut .22s cubic-bezier(.5,0,.8,.4) forwards !important; }
@keyframes drawerOut     { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes drawerFadeOut { to { background-color: rgba(0,0,0,0); } }
@media (max-width: 900px) { :root { --drawer-width: 100vw; } }
@media (prefers-reduced-motion: reduce) {
  .bl-modal, .rm-modal, .new-action-modal, #new-action-modal-overlay > div, .bl-modal-overlay, .rm-overlay, .new-action-overlay, #new-action-modal-overlay { animation: none; }
}

/* ---- Attachments in the ticket pop-out, and the viewer ---- */
.bl-clip { font-size:11px; font-weight:600; color:#7F7F8C; white-space:nowrap; }
.bl-attach { margin:14px 0; }
.bl-attach-row { display:flex; align-items:center; gap:10px; width:100%; text-align:left; margin-top:6px; padding:9px 12px; border:1px solid #DADAE5; border-radius:8px; background:#FFFFFF; cursor:pointer; font:inherit; color:#25252C; }
.bl-attach-row:hover { border-color:#F15D22; background:#FFF6F2; }
.bl-attach-icon { font-size:18px; }
.bl-attach-name { flex:1; font-weight:600; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bl-attach-meta { font-size:12px; color:#7F7F8C; white-space:nowrap; }
.bl-att-overlay .bl-modal { width: min(82vw, 1200px) !important; }
.bl-att-download { margin-right:10px; padding:5px 12px; border-radius:6px; background:#FFFFFF; color:#F15D22; font-size:13px; font-weight:700; text-decoration:none; white-space:nowrap; }
.bl-att-download:hover { background:#FFF0EA; }
.bl-att-body { padding:0 !important; background:#F5F5F8; display:flex; flex-direction:column; }
.bl-att-frame { flex:1; width:100%; min-height:70vh; border:0; background:#FFFFFF; }
.bl-att-img { max-width:100%; margin:16px auto; display:block; }
.bl-att-text { margin:0; padding:16px 20px; white-space:pre-wrap; font:12px/1.5 Consolas, monospace; color:#25252C; background:#FFFFFF; flex:1; }
.bl-att-docx { padding:16px; overflow:auto; }
.bl-att-note { margin:32px auto; max-width:480px; padding:20px; text-align:center; color:#40404C; font-size:14px; }
body.dark-mode .bl-attach-row { background:#262636; border-color:#3A3A50; color:#E0E0F0; }
body.dark-mode .bl-attach-row:hover { background:#2E2E42; border-color:#F15D22; }
body.dark-mode .bl-att-body { background:#1E1E2E; }
body.dark-mode .bl-att-note { color:#C8C8DC; }

/* ---- Category chips on the Change Delivery pages (replaces the CBS-only switch) ---- */
.bl-cat-bar { flex-wrap: wrap; gap: 8px; }
.bl-cat-chip { padding: 5px 14px; border: 1px solid #DADAE5; border-radius: 16px; background: #FFFFFF; color: #616173; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .03em; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.bl-cat-chip:hover { border-color: #F15D22; color: #F15D22; }
.bl-cat-chip.on { background: #F15D22; border-color: #F15D22; color: #FFFFFF; }
.bl-cat-chip.on:hover { background: #E23F13; border-color: #E23F13; color: #FFFFFF; }
.bl-cat-all { padding: 5px 10px; border: none; background: none; color: #F15D22; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; }
.bl-cat-all:disabled { color: #A4A4B2; cursor: default; text-decoration: none; }
body.dark-mode .bl-cat-chip { background: #262636; border-color: #4A4A60; color: #C0C0D8; }
body.dark-mode .bl-cat-chip.on { background: #F15D22; border-color: #F15D22; color: #FFFFFF; }

/* ---- Overview: Active / Completed tabs ---- */
.bl-tabs { display: inline-flex; gap: 4px; border-bottom: 2px solid #EBEBF5; }
.bl-tab { padding: 8px 16px; margin-bottom: -2px; border: none; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 15px; font-weight: 700; color: #7F7F8C; cursor: pointer; }
.bl-tab:hover { color: #F15D22; }
.bl-tab.on { color: #25252C; border-bottom-color: #F15D22; }
.bl-tab-n { display: inline-block; min-width: 22px; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #F0F0F5; color: #616173; font-size: 12px; font-weight: 700; text-align: center; }
.bl-tab.on .bl-tab-n { background: #F15D22; color: #FFFFFF; }
.bl-tab-note { min-height: 0; margin: -4px 0 10px; font-size: 12px; color: #7F7F8C; }
.bl-tab-note:empty { display: none; }
body.dark-mode .bl-tabs { border-bottom-color: #3A3A50; }
body.dark-mode .bl-tab { color: #A4A4B2; }
body.dark-mode .bl-tab.on { color: #E0E0F0; }
body.dark-mode .bl-tab-n { background: #2E2E42; color: #C0C0D8; }
body.dark-mode .bl-tab.on .bl-tab-n { background: #F15D22; color: #FFFFFF; }
body.dark-mode .bl-tab-note { color: #A4A4B2; }

/* ---- Attachment viewer: spreadsheets and emails ---- */
.bl-xl { display: flex; flex-direction: column; flex: 1; min-height: 70vh; background: #FFFFFF; }
.bl-xl-grid { flex: 1; overflow: auto; }
.bl-xl-table { border-collapse: collapse; font-size: 12px; color: #25252C; }
.bl-xl-table th, .bl-xl-table td { border: 1px solid #E4E4EE; padding: 4px 8px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.bl-xl-table thead th { position: sticky; top: 0; background: #F0F0F5; color: #616173; font-weight: 700; text-align: center; z-index: 1; }
.bl-xl-table tbody th { background: #F0F0F5; color: #616173; font-weight: 600; text-align: right; position: sticky; left: 0; }
.bl-xl-corner { left: 0; z-index: 2 !important; }
.bl-xl-tabs { display: flex; gap: 2px; padding: 6px 10px 0; background: #F5F5F8; border-top: 1px solid #DADAE5; overflow-x: auto; }
.bl-xl-tab { padding: 6px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: #616173; cursor: pointer; white-space: nowrap; }
.bl-xl-tab:hover { color: #F15D22; }
.bl-xl-tab.on { background: #FFFFFF; border-color: #DADAE5; color: #25252C; }
.bl-eml { display: flex; flex-direction: column; flex: 1; background: #FFFFFF; }
.bl-eml-head { padding: 16px 20px 10px; border-bottom: 1px solid #EBEBF5; }
.bl-eml-subject { font-size: 17px; font-weight: 700; color: #25252C; margin-bottom: 8px; }
.bl-eml-row { display: flex; gap: 10px; font-size: 13px; margin-top: 3px; }
.bl-eml-k { flex: 0 0 auto; min-width: 54px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #A4A4B2; padding-top: 2px; }
.bl-eml-v { color: #40404C; word-break: break-word; }
.bl-eml-atts { padding: 10px 20px; border-bottom: 1px solid #EBEBF5; background: #F8F8FC; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bl-eml-att { font-size: 13px; padding: 3px 10px; border: 1px solid #DADAE5; border-radius: 14px; background: #FFFFFF; }
.bl-eml-body { flex: 1; display: flex; flex-direction: column; }
.bl-eml-frame { flex: 1; width: 100%; min-height: 55vh; border: 0; background: #FFFFFF; }
.bl-eml-text { margin: 0; padding: 16px 20px; white-space: pre-wrap; word-break: break-word; font: 13px/1.55 Consolas, monospace; color: #25252C; }
body.dark-mode .bl-eml, body.dark-mode .bl-xl { background: #1E1E2E; }
body.dark-mode .bl-eml-subject { color: #E0E0F0; } body.dark-mode .bl-eml-v { color: #C8C8DC; }
body.dark-mode .bl-eml-head, body.dark-mode .bl-eml-atts { border-color: #3A3A50; } body.dark-mode .bl-eml-atts { background: #262636; }
body.dark-mode .bl-eml-att { background: #1E1E2E; border-color: #4A4A60; color: #E0E0F0; }
body.dark-mode .bl-eml-text { color: #E0E0F0; }
body.dark-mode .bl-xl-table { color: #E0E0F0; } body.dark-mode .bl-xl-table th, body.dark-mode .bl-xl-table td { border-color: #3A3A50; }
body.dark-mode .bl-xl-table thead th, body.dark-mode .bl-xl-table tbody th { background: #2A2A3C; color: #A4A4B2; }
body.dark-mode .bl-xl-tabs { background: #262636; border-color: #3A3A50; } body.dark-mode .bl-xl-tab.on { background: #1E1E2E; border-color: #3A3A50; color: #E0E0F0; }

/* Change workflow diagram (Change Delivery overview) */
.wf-diagram { overflow-x: auto; }
.wf-diagram svg { display: block; min-width: 1300px; }
.wf-tip { position: fixed; z-index: 3000; max-width: 340px; background: #25252C; color: #EDEDF2; padding: 12px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); pointer-events: none; font-size: 13px; line-height: 1.45; }
.wf-tip-title { font-family: 'Montserrat', sans-serif; font-weight: 600; color: #FCC54C; margin-bottom: 4px; }
.wf-tip-text { white-space: pre-line; }
.wf-admin-row { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #EDEDF2; }
.wf-admin-row textarea { width: 100%; box-sizing: border-box; margin-top: 6px; }
.wf-admin-edited { font-size: 11px; color: #F15D22; margin-left: 8px; }
