:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --line: #dfe5ef;
  --text: #162033;
  --muted: #677085;
  --accent: #2563eb;
  --green: #168a5b;
  --amber: #b7791f;
  --red: #c24132;
  --sidebar: #111827;
  --shadow: 0 10px 28px rgba(22, 32, 51, .08);
}

/* Direct-only workspace */
.direct-shell { min-height: 100vh; background: #f4f5f7; color: #17181a; }
.direct-sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 24px 16px; background: #171817; color: #fff; display: flex; flex-direction: column; z-index: 40; }
.direct-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; margin: 0 8px 28px; }
.direct-brand span { width: 36px; height: 36px; display: grid; place-items: center; background: #ffcc00; color: #171817; border-radius: 6px; font-weight: 800; }
.direct-brand strong { font-size: 18px; }
.direct-sidebar nav { display: grid; gap: 5px; }
.direct-sidebar nav a { color: #b9b9b4; text-decoration: none; padding: 11px 12px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 650; }
.direct-sidebar nav a:hover, .direct-sidebar nav a.active { color: #fff; background: #30302f; }
.direct-sidebar nav a span { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 11px; background: #ffcc00; color: #171817; font-size: 11px; }
.direct-safety-note { margin-top: auto; padding: 14px 12px; border: 1px solid #3c3c3a; border-radius: 6px; display: grid; gap: 5px; }
.direct-safety-note strong { color: #ffcc00; font-size: 12px; }
.direct-safety-note span { color: #9c9c96; font-size: 11px; line-height: 1.45; }
.direct-link-button { border: 0; background: none; color: #9c9c96; padding: 16px 12px 0; cursor: pointer; }
.direct-main { margin-left: 232px; min-height: 100vh; padding: 0 28px 60px; }
.direct-context-bar { position: sticky; top: 0; z-index: 30; min-height: 76px; margin: 0 -28px; padding: 12px 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid #e3e4e6; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.direct-selector { display: flex; gap: 12px; flex: 1; }
.direct-selector label, .direct-form-panel label, .approval-form label, .report-create-bar label { display: grid; gap: 5px; color: #74777c; font-size: 11px; font-weight: 700; }
.direct-selector select { min-width: 220px; }
.direct-selector select, .direct-form-panel input, .direct-form-panel textarea, .direct-form-panel select, .approval-form input, .report-create-bar input, .report-create-bar select { width: 100%; border: 1px solid #d8dade; border-radius: 6px; background: #fff; color: #202124; padding: 10px 11px; font: inherit; }
.direct-context-meta { display: flex; align-items: center; gap: 20px; }
.direct-context-meta span { display: grid; gap: 2px; font-size: 12px; font-weight: 700; }
.direct-context-meta small { color: #8d9095; font-size: 10px; font-weight: 600; }
.direct-context-meta .ok { color: #16834a; }.direct-context-meta .warn { color: #a86100; }
.morning-global-context { display: grid; gap: 2px; }.morning-global-context strong { font-size: 14px; }.morning-global-context small { color: #85888d; font-size: 10px; }
.direct-page-header { padding: 34px 0 24px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.direct-page-header h1 { font-size: 32px; margin: 3px 0 6px; letter-spacing: 0; }
.direct-page-header p { margin: 0; color: #6e7176; }
.direct-page-header .eyebrow { color: #a86100; font-weight: 800; font-size: 11px; text-transform: uppercase; }
.direct-notice { margin-top: 18px; padding: 12px 14px; border: 1px solid #b8dfc7; background: #ecf8f0; color: #176b3c; border-radius: 6px; }
.direct-notice.warning { border-color: #f0d08e; background: #fff8e8; color: #845300; }
.direct-workflow-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #dedfe2; border: 1px solid #dedfe2; margin-bottom: 28px; }
.direct-workflow-strip.compact { grid-template-columns: repeat(5, 1fr); }
.direct-workflow-strip.business-workflow { grid-template-columns: repeat(6, 1fr); }
.direct-workflow-strip div { background: #fff; padding: 16px; display: flex; align-items: center; gap: 10px; }
.direct-workflow-strip b { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: #ffcc00; font-size: 12px; }
.direct-workflow-strip span { font-size: 13px; font-weight: 700; }
.direct-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.direct-section-head h2, .direct-section-head h3 { margin: 0; font-size: 19px; letter-spacing: 0; }
.direct-section-head p { margin: 4px 0 0; color: #73767b; font-size: 13px; }
.direct-client-list, .direct-stack { display: grid; gap: 10px; }
.direct-client-create { margin-top: 24px; }
.direct-client-form { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; align-items: end; }
.direct-client-form label { display: grid; gap: 5px; color: #74777c; font-size: 11px; font-weight: 700; }
.direct-client-form input, .direct-client-form textarea { width: 100%; border: 1px solid #d8dade; border-radius: 6px; background: #fff; color: #202124; padding: 10px 11px; font: inherit; }
.direct-client-row { min-height: 76px; display: grid; grid-template-columns: 44px minmax(180px,1.5fr) minmax(130px,1fr) 110px auto; align-items: center; gap: 16px; padding: 12px 16px; background: #fff; border: 1px solid #e1e2e5; color: inherit; text-decoration: none; }
.direct-client-row:hover, .direct-client-row.selected { border-color: #ffcc00; box-shadow: inset 3px 0 #ffcc00; }
.direct-client-row > span:not(.direct-client-avatar) { display: grid; gap: 3px; }
.direct-client-row small { color: #85888d; font-size: 11px; }
.direct-client-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 5px; background: #f1edff; color: #6246b5; font-weight: 800; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; width: fit-content; padding: 4px 9px; border-radius: 12px; font-size: 10px; font-style: normal; font-weight: 800; }
.status-pill.ready { background: #dff5e8; color: #167443; }.status-pill.pending { background: #fff1c4; color: #795300; }
.direct-two-column { display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(360px, .95fr); gap: 18px; align-items: start; }
.direct-form-panel, .direct-panel, .change-set, .direct-report-card { background: #fff; border: 1px solid #e0e2e5; padding: 20px; }
.direct-form-panel { display: grid; gap: 14px; }
.business-scope-panel { margin-bottom: 18px; display: grid; gap: 16px; }
.business-scope-run { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid #e5e7ea; background: #fafbfc; }
.business-scope-run label { display: grid; gap: 5px; color: #74777c; font-size: 11px; font-weight: 700; }
.business-scope-run select { width: 100%; padding: 10px 11px; border: 1px solid #d8dade; border-radius: 6px; background: #fff; font: inherit; }
.business-scope-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.business-scope-kpis article { padding: 13px; border: 1px solid #e2e4e7; background: #fff; display: grid; gap: 5px; }
.business-scope-kpis small { color: #797c81; font-size: 10px; }.business-scope-kpis strong { font-size: 22px; }
.business-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.business-scope-grid article { min-width: 0; padding: 14px; border: 1px solid #e5e7ea; background: #fafbfc; }
.business-scope-grid h3 { margin: 0 0 8px; font-size: 13px; }.business-scope-grid small { color: #777b80; }
.keyword-cloud.danger span { background: #fce8e6; color: #9b2c24; }.keyword-cloud.protected span { background: #e8f1ff; color: #265ca8; }.keyword-cloud.review span { background: #fff1c4; color: #795300; }
.business-scope-questions { padding: 14px; border-left: 3px solid #ffcc00; background: #fff9df; }
.business-scope-questions strong { font-size: 13px; }.business-scope-questions ul { margin-bottom: 0; }
.business-scope-pages td:first-child { max-width: 420px; }.business-scope-pages td:first-child small { display: block; margin-top: 3px; color: #7b7e83; word-break: break-all; }
.scope-status { display: inline-flex; padding: 4px 8px; border-radius: 12px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.scope-status.core { background: #dff5e8; color: #167443; }.scope-status.supporting { background: #fff1c4; color: #795300; }.scope-status.information { background: #e8f1ff; color: #265ca8; }.scope-status.excluded { background: #fce8e6; color: #9b2c24; }
.business-scope-confirm { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 14px; border-top: 1px solid #e5e7ea; }
.business-scope-confirm p { margin: 0; color: #676b70; font-size: 12px; }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.form-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.direct-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #ececef; }
.direct-item:last-child { border-bottom: 0; }.direct-item.vertical { align-items: stretch; flex-direction: column; }
.direct-item > div { display: grid; gap: 3px; }.direct-item small { color: #7b7e83; }
.direct-item form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.semantic-inline-form { display: grid; grid-template-columns: 1.2fr .8fr auto; gap: 10px; align-items: end; }
.semantic-inline-form label { display: grid; gap: 5px; color: #74777c; font-size: 11px; font-weight: 700; }
.semantic-inline-form input, .semantic-inline-form textarea { width: 100%; border: 1px solid #d8dade; border-radius: 6px; padding: 10px 11px; font: inherit; }
.keyword-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }.keyword-cloud span { padding: 5px 8px; background: #f0f1f3; font-size: 11px; }.keyword-cloud small { color: #7b7e83; }
.check-inline { display: inline-flex !important; align-items: center; gap: 5px !important; font-size: 11px !important; }.check-inline input { width: auto; }
.direct-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 26px; }
.direct-kpis article { min-height: 116px; padding: 17px; background: #fff; border: 1px solid #e1e2e5; display: grid; align-content: space-between; }
.direct-kpis article.accent { border-top: 3px solid #ffcc00; }.direct-kpis span, .direct-kpis small { color: #777a7f; font-size: 11px; }.direct-kpis strong { font-size: 25px; }
.direct-data-source { margin: -14px 0 26px; padding: 10px 13px; border: 1px solid #dfe1e4; background: #f7f8f9; color: #666a70; font-size: 11px; }.direct-data-source strong { color: #2f3236; }
.direct-source-empty { display: grid; gap: 5px; padding: 18px; border: 1px dashed #d7d9dd; background: #fafbfc; }.direct-source-empty strong { color: #3b3e43; font-size: 12px; }.direct-source-empty span { color: #74777c; font-size: 10px; line-height: 1.5; }
.direct-period-workspace { display: grid; gap: 16px; margin-bottom: 14px; padding: 18px; border: 1px solid #dfe1e4; background: #fff; }
.direct-period-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.direct-period-status h2 { margin: 2px 0 4px; font-size: 21px; }
.direct-period-status p { margin: 0; color: #73767b; font-size: 12px; }
.direct-period-form { display: grid; grid-template-columns: auto minmax(150px, .7fr) minmax(150px, .7fr) auto; align-items: end; gap: 10px; padding-top: 14px; border-top: 1px solid #eceef0; }
.direct-period-form label { display: grid; gap: 5px; color: #74777c; font-size: 11px; font-weight: 700; }
.direct-period-form input { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #d8dade; border-radius: 6px; background: #fff; }
.direct-period-presets { display: flex; align-items: stretch; }
.direct-period-presets button { min-height: 40px; padding: 8px 11px; border: 1px solid #d8dade; border-right: 0; background: #fff; color: #55595f; cursor: pointer; }
.direct-period-presets button:first-child { border-radius: 6px 0 0 6px; }.direct-period-presets button:last-child { border-right: 1px solid #d8dade; border-radius: 0 6px 6px 0; }
.direct-period-presets button:hover, .direct-period-presets button.active { border-color: #ffcc00; background: #fff8db; color: #171817; }
.direct-cycle-head, .direct-cycle-result-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.direct-cycle-head { margin: 4px 0 14px; }
.direct-cycle-head h2, .direct-cycle-result-head h2 { margin: 2px 0 4px; font-size: 20px; }
.direct-cycle-head p { margin: 0; color: #73767b; font-size: 12px; }
.direct-cycle-period { align-self: center; padding: 7px 10px; border: 1px solid #e3d183; background: #fff8db; color: #695300; font-size: 11px; font-weight: 800; }
.direct-action-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-bottom: 24px; }
.direct-action-tools form button { width: 100%; min-height: 112px; text-align: left; padding: 14px; border: 1px solid #dfe1e4; background: #fff; cursor: pointer; display: grid; align-content: start; gap: 7px; }
.direct-action-tools form button:hover { border-color: #ffcc00; }.direct-action-tools small { color: #73767b; line-height: 1.4; }
.direct-cycle-tools form button { grid-template-rows: auto 1fr auto; min-height: 150px; }
.direct-cycle-tools form button > span { color: #8a6500; font-size: 11px; font-weight: 800; }
.direct-cycle-tools form button:disabled { border-color: #e5e7ea; background: #f5f6f7; color: #9a9da2; cursor: not-allowed; }
.direct-cycle-tools form button:disabled small, .direct-cycle-tools form button:disabled span { color: #a5a8ad; }
.direct-cycle-result { display: grid; gap: 14px; margin: 0 0 28px; padding: 20px; border: 1px solid #dfe1e4; border-left: 4px solid #ffcc00; background: #fff; scroll-margin-top: 96px; }
.cycle-result-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: #74777c; font-size: 11px; }
.cycle-result-summary { margin: 0; padding: 12px 14px; background: #f7f8f9; font-size: 14px; font-weight: 700; }
.cycle-finding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid #e3e4e6; background: #e3e4e6; }
.cycle-finding-grid > div { min-width: 0; padding: 13px; background: #fff; }
.cycle-finding-grid small { display: block; margin-bottom: 5px; color: #777a7f; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.cycle-finding-grid p { margin: 0; color: #34363a; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.cycle-result-footer { display: flex; justify-content: space-between; gap: 14px; padding-top: 12px; border-top: 1px solid #eceef0; color: #73767b; font-size: 11px; }
.cycle-result-footer strong { color: #167443; }
.cycle-run-history { display: flex; flex-wrap: wrap; gap: 7px; }
.cycle-run-history a { display: grid; gap: 2px; min-width: 150px; padding: 8px 10px; border: 1px solid #dfe1e4; color: #36383c; text-decoration: none; font-size: 11px; }
.cycle-run-history a.active { border-color: #ffcc00; background: #fff8db; }.cycle-run-history small { color: #85888d; font-size: 9px; }
.direct-detail-heading { margin-top: 0; }
.direct-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }.direct-data-grid > :first-child { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }.direct-panel table { width: 100%; border-collapse: collapse; font-size: 12px; }.direct-panel th, .direct-panel td { padding: 10px 8px; border-bottom: 1px solid #e8e9eb; text-align: left; }
.metric-row { min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ececef; }
.metric-row > span { display: grid; gap: 3px; }.metric-row small, .metric-row time { color: #808389; font-size: 10px; }
.change-set { padding: 0; overflow: hidden; }.change-set > header { padding: 18px 20px; display: flex; justify-content: space-between; border-bottom: 1px solid #e7e8ea; }.change-set h3 { margin: 8px 0 3px; }.change-set p { margin: 0; color: #777a7f; font-size: 12px; }
.change-items { padding: 8px 20px; }.change-items > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #eeeeef; }.change-items span { display: grid; gap: 2px; }.change-items small { color: #83868b; }.change-items em { font-size: 11px; color: #777a7f; }
.approval-form { padding: 16px 20px 20px; background: #fafafa; display: grid; grid-template-columns: 1.4fr .6fr auto; gap: 10px; align-items: end; }
.action-row { padding: 16px 20px; display: flex; gap: 10px; }.safety-inline { margin: 0 20px 20px !important; padding: 10px 12px; background: #fff7df; color: #795300 !important; }
.btn.danger { background: #b42318; color: #fff; border-color: #b42318; }
.report-create-bar { background: #fff; border: 1px solid #e0e2e5; padding: 16px; display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.direct-report-list { display: grid; gap: 14px; }.direct-report-card header { display: flex; justify-content: space-between; align-items: center; }.direct-report-card time { color: #74777c; font-size: 12px; }
.report-kpis { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid #e4e5e7; margin: 16px 0; }.report-kpis span { display: grid; gap: 4px; padding: 14px; border-right: 1px solid #e4e5e7; }.report-kpis span:last-child { border: 0; }.report-kpis small { color: #777a7f; }.report-kpis strong { font-size: 19px; }
.report-finding { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; padding: 14px; background: #f7f8f9; font-size: 13px; }.report-finding b { color: #6c6f74; }
.report-export-row { display: flex; gap: 8px; margin-top: 16px; }
.timeline-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ebeced; }.timeline-row i { width: 8px; height: 8px; margin-top: 5px; border-radius: 4px; background: #ffcc00; }.timeline-row span { display: grid; gap: 3px; }.timeline-row small { color: #7e8186; }
.direct-empty { padding: 42px; text-align: center; background: #fff; border: 1px dashed #cfd1d5; }.direct-empty h2 { margin-top: 0; }.compact-list { margin: 0; padding-left: 18px; }.error-list { color: #a33a2e; }

.morning-command-bar { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: end; gap: 16px; padding: 18px; border: 1px solid #dfe1e4; background: #fff; }
.morning-command-bar h2 { margin: 2px 0 4px; font-size: 24px; }.morning-command-bar p { margin: 0; color: #73767b; font-size: 12px; }
.morning-command-bar form { display: flex; align-items: end; gap: 8px; }.morning-command-bar label { display: grid; gap: 5px; color: #74777c; font-size: 11px; font-weight: 700; }
.morning-command-bar input { min-height: 40px; padding: 8px 10px; border: 1px solid #d8dade; border-radius: 6px; background: #fff; }
.morning-refresh-form { display: grid !important; justify-items: end; }.morning-refresh-form small { color: #85888d; font-size: 9px; }
.morning-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin: 12px 0; }
.morning-kpis article { min-height: 104px; display: grid; align-content: space-between; padding: 15px; border: 1px solid #e1e2e5; background: #fff; }
.morning-kpis article.good { border-top: 3px solid #22a06b; }.morning-kpis article.warn { border-top: 3px solid #e0a400; }.morning-kpis article.danger { border-top: 3px solid #d14836; }
.morning-kpis span, .morning-kpis small { color: #777a7f; font-size: 10px; }.morning-kpis strong { font-size: 25px; }
.morning-analytics-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: 12px; margin-bottom: 26px; }
.morning-chart-panel, .morning-priority-panel { min-width: 0; padding: 18px; border: 1px solid #e0e2e5; background: #fff; }
.morning-chart-panel > header, .morning-priority-panel > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.morning-chart-panel h2, .morning-priority-panel h2 { margin: 0; font-size: 18px; }.morning-chart-panel p { margin: 4px 0 0; color: #73767b; font-size: 11px; }
.morning-chart { width: 100%; height: 300px; }.morning-chart-empty { min-height: 260px; display: grid; place-content: center; gap: 7px; padding: 30px; text-align: center; color: #73767b; }
.morning-chart-empty strong { color: #34363a; }.morning-chart-empty span { max-width: 560px; font-size: 12px; }
.morning-priority-panel > header > span { color: #a33a2e; font-size: 11px; font-weight: 800; }.morning-priority-panel ol { display: grid; gap: 0; margin: 12px 0 0; padding: 0; list-style: none; }
.morning-priority-panel li { display: grid; grid-template-columns: 26px 1fr; gap: 9px; padding: 11px 0; border-top: 1px solid #eceef0; }
.morning-priority-panel li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #eceef1; font-size: 10px; font-weight: 800; }
.morning-priority-panel li.high > span { background: #fde8e5; color: #a33a2e; }.morning-priority-panel li.medium > span { background: #fff2cb; color: #765800; }.morning-priority-panel li.low > span { background: #dff5e8; color: #167443; }
.morning-priority-panel li div { min-width: 0; }.morning-priority-panel li p { margin: 2px 0; font-size: 12px; }.morning-priority-panel li small { color: #777a7f; font-size: 10px; }
.morning-section-head { margin-bottom: 12px; }.morning-section-head h2 { margin: 0; font-size: 21px; }.morning-section-head p { margin: 4px 0 0; color: #73767b; font-size: 12px; }
.morning-client-list { display: grid; gap: 10px; }.morning-client-row { border: 1px solid #e0e2e5; border-left: 4px solid #9da1a8; background: #fff; }
.morning-client-row.high { border-left-color: #d14836; }.morning-client-row.medium { border-left-color: #e0a400; }.morning-client-row.low { border-left-color: #22a06b; }
.morning-client-row > header { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #eceef0; }
.morning-client-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #eceef1; font-size: 11px; font-weight: 800; }
.morning-client-row h3 { margin: 0; color: #222427; font-size: 16px; }.morning-client-row header p { margin: 3px 0 0; color: #7b7e83; font-size: 10px; }
.morning-client-body { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(280px, 1.15fr) minmax(300px, 1.1fr); gap: 1px; background: #eceef0; }
.morning-client-body > div { min-width: 0; padding: 14px 16px; background: #fff; }
.morning-client-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.morning-client-numbers > span { display: grid; gap: 3px; }.morning-client-numbers small, .morning-client-diagnosis > small, .morning-client-plan > small { color: #777a7f; font-size: 9px; font-weight: 800; text-transform: uppercase; }.morning-client-numbers strong { font-size: 18px; }
.morning-client-numbers em { color: #777a7f; font-size: 10px; font-style: normal; }
.latest-known { grid-column: 1 / -1; display: grid; gap: 5px; padding: 11px; background: #f7f8f9; }.latest-known strong { font-size: 14px; }.latest-known span { color: #666a70; font-size: 11px; }
.morning-client-diagnosis h4 { margin: 5px 0; font-size: 14px; }.morning-client-diagnosis p { margin: 0 0 6px; color: #34363a; font-size: 11px; }.morning-client-diagnosis span { color: #74777c; font-size: 10px; }
.morning-client-plan ol, .generated-report-plan { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }.morning-client-plan li, .generated-report-plan li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 11px; }.morning-client-plan li b, .generated-report-plan li b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #fff2c4; color: #765800; font-size: 9px; }.morning-client-plan li span { display: grid; }.morning-client-plan li small, .generated-report-plan li small { color: #85888d; font-size: 9px; }
.morning-client-row > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #fafbfc; color: #74777c; font-size: 10px; }
.morning-breakdown { border-top: 1px solid #eceef0; background: #fff; }.morning-breakdown summary { padding: 10px 16px; color: #4e5258; font-size: 11px; font-weight: 800; cursor: pointer; }.morning-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 16px 14px; }.morning-breakdown-grid h4 { margin: 0 0 7px; font-size: 12px; }.morning-breakdown-grid p { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 0; border-bottom: 1px solid #eceef0; font-size: 11px; }.morning-breakdown-grid p span { overflow-wrap: anywhere; }.morning-breakdown-grid > div > small { color: #7d8085; font-size: 9px; }
.morning-report-actions { display: flex; flex-wrap: wrap; gap: 6px; }.morning-report-actions button { padding: 6px 9px; border: 1px solid #d8dade; border-radius: 5px; background: #fff; color: #33363a; font-size: 10px; font-weight: 700; cursor: pointer; }.morning-report-actions button:hover { border-color: #ffcc00; background: #fff8db; }
.generated-analytics-report { display: grid; gap: 16px; margin-top: 26px; padding: 20px; border: 1px solid #dfe1e4; border-top: 4px solid #ffcc00; background: #fff; scroll-margin-top: 90px; }
.generated-analytics-report > header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }.generated-analytics-report h2 { margin: 0; font-size: 22px; }.generated-analytics-report header p { margin: 4px 0 0; color: #73767b; font-size: 11px; }
.generated-report-kpis { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid #e3e4e6; }.generated-report-kpis span { display: grid; gap: 4px; padding: 13px; border-right: 1px solid #e3e4e6; }.generated-report-kpis span:last-child { border-right: 0; }.generated-report-kpis small { color: #777a7f; font-size: 9px; text-transform: uppercase; }.generated-report-kpis strong { font-size: 20px; }
.generated-report-source { margin: 0; padding: 10px 12px; background: #f7f8f9; color: #62666c; font-size: 11px; }
.generated-report-analysis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid #e3e4e6; background: #e3e4e6; }.generated-report-analysis div { padding: 13px; background: #fff; }.generated-report-analysis small { color: #777a7f; font-size: 9px; font-weight: 800; text-transform: uppercase; }.generated-report-analysis p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; }

.connection-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 18px; border: 1px solid #dedfe2; background: #dedfe2; }
.connection-progress article { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 14px; background: #fff; }
.connection-progress b, .connection-step { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; background: #eceef1; color: #60646b; font-size: 12px; font-style: normal; }
.connection-progress article.done b, .connection-card .connection-step { background: #dff5e8; color: #167443; }
.connection-progress article.current b { background: #ffcc00; color: #171817; }
.connection-progress span { display: grid; gap: 2px; }
.connection-progress small { color: #7d8085; font-size: 11px; }
.connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.connection-card { min-width: 0; display: grid; align-content: start; gap: 16px; }
.connection-wide { grid-column: 1 / -1; }
.connection-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.connection-card-head h2 { margin: 2px 0 4px; font-size: 18px; }
.connection-card-head p { margin: 0; color: #73767b; font-size: 12px; line-height: 1.5; }
.connection-main-action { justify-self: start; }
.connection-callback { display: grid; gap: 5px; padding: 11px 12px; border: 1px solid #dfe1e4; background: #f7f8f9; }
.connection-callback span { color: #5f6368; font-size: 11px; font-weight: 700; }
.connection-callback code { padding: 8px 9px; overflow-wrap: anywhere; background: #fff; border: 1px solid #e2e4e7; color: #202124; font-size: 12px; }
.connection-callback small { color: #7d8085; font-size: 10px; line-height: 1.45; }
.connection-form { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(220px, 1.3fr); align-items: end; gap: 10px; }
.verification-code-form { margin-top: 2px; padding-top: 12px; border-top: 1px solid #eceef0; }
.connection-form > .btn { grid-column: 1 / -1; justify-self: start; }
.connection-form label, .connection-bind-form > label, .connection-sync-actions label { display: grid; gap: 5px; color: #74777c; font-size: 11px; font-weight: 700; }
.connection-form input, .connection-bind-form input, .connection-bind-form select, .connection-sync-actions input { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #d8dade; border-radius: 6px; background: #fff; color: #202124; }
.connection-form label small, .connection-bind-form label small { color: #85888d; font-weight: 500; line-height: 1.35; }
.connection-list { display: grid; gap: 8px; }
.connection-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #ececef; }
.connection-row > span { min-width: 0; display: grid; gap: 3px; }
.connection-row small { color: #7d8085; font-size: 10px; overflow-wrap: anywhere; }
.connection-row .connection-error { color: #a33a2e; }
.connection-empty { margin: 0; padding: 12px; background: #f7f8f9; color: #73767b; font-size: 12px; }
.connection-help { display: grid; gap: 3px; padding: 11px 12px; border-left: 3px solid #ffcc00; background: #fff8e1; color: #674d00; }
.connection-help strong { font-size: 12px; }
.connection-help span { font-size: 11px; line-height: 1.5; }
.connection-inline-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid #ececef; font-size: 12px; }
.connection-bind-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.connection-goals { grid-column: 1 / -1; margin: 0; padding: 13px; border: 1px solid #e1e2e5; }
.connection-goals legend { padding: 0 6px; font-size: 12px; font-weight: 800; }
.connection-goals > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 12px; max-height: 220px; overflow: auto; }
.connection-goals label { display: flex; align-items: start; gap: 8px; padding: 7px; background: #f7f8f9; font-size: 11px; }
.connection-goals input { width: auto; margin-top: 2px; }
.connection-goals label span { display: grid; gap: 2px; }
.connection-goals small { color: #85888d; }
.connection-goals p { margin: 0; color: #73767b; font-size: 12px; }
.connection-bind-form > .btn { justify-self: start; }
.connection-sync-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.connection-sync-actions form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; padding: 12px; border: 1px solid #e1e2e5; background: #f8f9fa; }
.connection-sync-actions form .btn { grid-column: 1 / -1; width: 100%; min-height: 42px; }
.connection-history { max-height: 340px; }
.connection-history table { min-width: 760px; table-layout: fixed; }
.connection-history th:nth-child(1) { width: 170px; }.connection-history th:nth-child(2) { width: 125px; }.connection-history th:nth-child(3) { width: 90px; }.connection-history th:nth-child(4) { width: 60px; }
.connection-history td { vertical-align: top; overflow-wrap: anywhere; }.connection-history td small { display: block; margin-top: 4px; color: #7d8085; }.connection-history .connection-error { color: #a33a2e; }
.connection-log-path { display: block; padding: 10px 12px; overflow-wrap: anywhere; border: 1px solid #e1e2e5; background: #f7f8f9; font-size: 11px; }
.connection-event-list { display: grid; max-height: 360px; overflow: auto; }
.connection-event-list article { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #ececef; }
.connection-event-list time { color: #7d8085; font-size: 10px; }
.connection-event-list span { display: grid; gap: 3px; }.connection-event-list small { color: #73767b; font-size: 11px; overflow-wrap: anywhere; }

@media (max-width: 1050px) {
  .direct-sidebar { width: 190px; }.direct-main { margin-left: 190px; }.direct-context-meta { display: none; }
  .direct-kpis, .direct-action-tools { grid-template-columns: repeat(3,1fr); }.direct-client-row { grid-template-columns: 40px 1fr 1fr auto; }.direct-client-row > span:nth-child(4) { display: none; }
  .connection-grid { grid-template-columns: 1fr; }.connection-wide { grid-column: auto; }.connection-progress { grid-template-columns: repeat(2, 1fr); }
  .connection-form, .connection-bind-form { grid-template-columns: 1fr; }.connection-goals { grid-column: auto; }.connection-goals > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connection-sync-actions { grid-template-columns: 1fr; }
  .direct-period-form { grid-template-columns: 1fr 1fr; }.direct-period-presets { grid-column: 1 / -1; }.direct-period-form > .btn { align-self: stretch; }
  .morning-command-bar { grid-template-columns: 1fr 1fr; }.morning-command-bar > div { grid-column: 1 / -1; }.morning-kpis { grid-template-columns: repeat(3, 1fr); }.morning-analytics-grid { grid-template-columns: 1fr; }.morning-client-body { grid-template-columns: 1fr 1fr; }.morning-client-plan { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .direct-sidebar { position: static; width: auto; padding: 12px; }.direct-sidebar nav { grid-template-columns: repeat(3,1fr); }.direct-safety-note, .direct-sidebar form { display: none; }
  .direct-brand { margin: 0 0 12px; }.direct-main { margin-left: 0; padding: 0 14px 36px; }.direct-context-bar { position: static; margin: 0 -14px; padding: 12px 14px; }
  .direct-selector { display: grid; grid-template-columns: 1fr; }.direct-selector select { min-width: 0; }.direct-page-header { align-items: start; flex-direction: column; }
  .direct-workflow-strip, .direct-workflow-strip.compact, .direct-workflow-strip.business-workflow, .direct-kpis, .direct-action-tools, .business-scope-kpis { grid-template-columns: 1fr 1fr; }
  .direct-data-grid, .direct-two-column, .form-grid.two, .report-kpis, .business-scope-grid { grid-template-columns: 1fr; }
  .direct-two-column > *, .business-scope-grid > * { min-width: 0; }
  .direct-client-row { grid-template-columns: 40px 1fr; }.direct-client-row > span:nth-child(n+3) { display: none; }.direct-data-grid > :first-child { grid-column: auto; }
  .approval-form, .report-create-bar, .direct-client-form, .semantic-inline-form, .business-scope-run { grid-template-columns: 1fr; }
  .business-scope-confirm { align-items: stretch; flex-direction: column; }
  .connection-progress, .connection-goals > div { grid-template-columns: 1fr; }.connection-sync-actions form { grid-template-columns: 1fr; }
  .connection-card-head { grid-template-columns: auto 1fr; }.connection-card-head .status-pill { grid-column: 2; }
  .connection-row { grid-template-columns: 1fr auto; }.connection-row form { grid-column: 1 / -1; }
  .connection-event-list article { grid-template-columns: 1fr; gap: 4px; }
  .direct-period-status, .direct-cycle-head, .direct-cycle-result-head { grid-template-columns: auto 1fr; }.direct-period-status .status-pill, .direct-cycle-head .direct-cycle-period, .direct-cycle-result-head .status-pill { grid-column: 2; }
  .direct-period-form, .cycle-finding-grid { grid-template-columns: 1fr; }.direct-period-presets { width: 100%; overflow-x: auto; }.direct-period-presets button { flex: 1 0 auto; }
  .cycle-result-footer { flex-direction: column; }
  .morning-command-bar, .morning-kpis, .morning-client-body, .generated-report-kpis, .generated-report-analysis, .morning-breakdown-grid { grid-template-columns: 1fr; }.morning-command-bar > div { grid-column: auto; }.morning-command-bar form { display: grid; }.morning-refresh-form { justify-items: stretch; }
  .morning-client-row > header { grid-template-columns: auto 1fr; }.morning-client-row > header .status-pill, .morning-client-row > header .btn { grid-column: 2; justify-self: start; }.morning-client-plan { grid-column: auto; }.morning-client-row > footer { align-items: flex-start; flex-direction: column; }.generated-report-kpis span { border-right: 0; border-bottom: 1px solid #e3e4e6; }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, Segoe UI, Arial, sans-serif; line-height: 1.45; }
button, input, select, textarea { font: inherit; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: var(--shadow); }
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-row.compact { margin-bottom: 28px; color: #fff; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, var(--green), var(--accent)); color: #fff; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; letter-spacing: 0; margin-bottom: 6px; }
h2 { font-size: 18px; margin-bottom: 0; }
h3 { font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 6px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; background: var(--sidebar); color: #d7dde8; }
.sidebar nav { display: grid; gap: 4px; margin-bottom: 26px; }
.sidebar a { color: #aeb8c8; text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.sidebar a.active, .sidebar a:hover { background: #1f2937; color: #fff; }
.main { padding: 24px 28px 52px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.status-cluster { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 520px; }
.status-pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: var(--panel); color: var(--muted); font-size: 13px; }
.status-pill.ok { color: var(--green); border-color: #b7e3cd; background: #f0faf5; }
.status-pill.warn { color: var(--amber); border-color: #f0d79c; background: #fff8e8; }
.notice { margin-bottom: 14px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.notice-success { border-color: #b7e3cd; background: #f0faf5; color: var(--green); }
.notice-warning { border-color: #f0d79c; background: #fff8e8; color: var(--amber); }
.notice-error { border-color: #ffc8c2; background: #fff1f0; color: var(--red); }

.workspace-sticky { position: sticky; top: 0; z-index: 20; display: grid; gap: 12px; margin-bottom: 16px; padding: 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 12px 30px rgba(22, 32, 51, .12); backdrop-filter: blur(14px); }
.workspace-sticky-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.workspace-sticky-head strong { display: block; font-size: 18px; }
.workspace-sticky-head span { color: var(--muted); }
.workspace-sticky .eyebrow { margin-bottom: 2px; }
.sticky-select { grid-template-columns: minmax(190px, .9fr) minmax(260px, 1.1fr) minmax(260px, 1.35fr); }
.current-client-meta { display: flex; flex-wrap: wrap; gap: 8px; align-self: end; }
.current-client-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 9px 10px; background: var(--panel-soft); color: var(--muted); font-size: 13px; }
.single-project-callout { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 14px; border: 1px dashed #93c5fd; border-radius: 8px; background: #eff6ff; }
.single-project-callout div { display: grid; gap: 4px; }
.single-project-callout span { color: var(--muted); }

.hero-panel { margin-bottom: 16px; border-top: 4px solid var(--accent); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.hero-grid h2 { font-size: 28px; margin-bottom: 6px; }
.workspace-select.simple { grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr); margin-top: 16px; }
.client-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.client-summary span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: var(--panel-soft); color: var(--muted); font-size: 13px; }
.next-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.next-card h3 { margin-bottom: 10px; color: var(--text); font-size: 16px; }
.steps-list { margin: 0; padding-left: 20px; color: var(--text); }
.steps-list li { margin: 8px 0; }
.client-picker { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.client-search { margin-bottom: 12px; max-width: 520px; }
.client-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-height: 360px; overflow: auto; padding-right: 4px; }
.client-card { display: grid; gap: 6px; min-height: 112px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); color: var(--text); text-decoration: none; transition: border-color .18s, transform .18s, background .18s; }
.client-card:hover { border-color: var(--accent); transform: translateY(-1px); background: #fff; }
.client-card.active { border-color: var(--accent); border-top: 3px solid var(--accent); background: #eef5ff; }
.client-card span, .client-card small { color: var(--muted); overflow-wrap: anywhere; }
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.action-card { display: grid; gap: 10px; min-height: 178px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.action-card strong { font-size: 16px; }
.action-card p { margin: 0; color: var(--muted); font-size: 14px; }
.mini-action-form { margin-top: auto; }
.muted-action { grid-column: 1 / -1; min-height: 130px; border-style: dashed; background: var(--panel-soft); }
.subpanel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); padding: 14px; }
.subpanel h3 { color: var(--text); margin-bottom: 12px; }
.inner-grid { margin-bottom: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.kpi { padding: 16px; border-top: 3px solid var(--accent); min-height: 110px; }
.kpi span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.kpi strong { display: block; font-size: 30px; line-height: 1; }
.kpi small { color: var(--muted); display: block; margin-top: 10px; }
.panel-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-bottom: 16px; }
.panel { padding: 18px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; margin-bottom: 16px; }
.workspace-panel { margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head.tight { margin-bottom: 8px; }
.panel-head span { color: var(--muted); font-size: 13px; }
.project-manager { margin-bottom: 16px; }
.project-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.project-card { display: grid; gap: 6px; min-height: 86px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); text-decoration: none; color: var(--text); transition: border-color .18s, transform .18s, background .18s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-1px); background: #fff; }
.project-card.active { border-color: var(--accent); border-top: 3px solid var(--accent); background: #eef5ff; }
.project-card span { color: var(--muted); font-size: 13px; }
.setup-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 14px; align-items: start; }
.setup-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.setup-card h3 { color: var(--text); margin: 0; }
.empty-state { padding: 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: var(--panel-soft); }
.checklist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.check-card { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.check-card.done { border-color: #b7e3cd; background: #f0faf5; }
.check-card.todo { border-color: #f0d79c; background: #fffaf0; }
.check-card span { width: max-content; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #fff; color: var(--muted); }
.check-card p { margin: 0; color: var(--muted); font-size: 13px; }
.hint-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.hint-card { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.hint-card span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.credential-bind { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; padding: 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.credential-bind h3 { grid-column: 1 / -1; margin: 0; color: var(--text); }
.mini-table h3 { color: var(--text); }
.compact-table table { font-size: 12px; }
.compact-table td, .compact-table th { padding: 8px; }
.status-dot { display: inline-flex; border-radius: 999px; padding: 3px 8px; background: #eef2ff; color: var(--accent); }
.status-dot.completed, .status-dot.verified, .status-dot.stored { background: #f0faf5; color: var(--green); }
.status-dot.failed, .status-dot.partial { background: #fff1f0; color: var(--red); }
.status-dot.skipped, .status-dot.queued { background: #fff8e8; color: var(--amber); }

.stack { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.span-2 { grid-column: span 2; }
.workspace-select { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.25fr) auto; gap: 12px; align-items: end; }
.checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 0; }
.checks.vertical { display: grid; gap: 8px; padding: 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; background: #fff; color: var(--text); }
textarea { min-height: 94px; resize: vertical; }
.btn { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: inherit; }
.btn.full { width: 100%; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.alert { padding: 12px; border-radius: 8px; margin-bottom: 14px; }
.alert-danger { background: #fff1f0; color: var(--red); border: 1px solid #ffc8c2; }

.source-list, .task-list { display: grid; gap: 10px; }
.source-list div, .task-list div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #edf1f7; padding-bottom: 10px; }
.source-list span, .task-list span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.oauth-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form.wrap { flex-wrap: wrap; align-items: center; }
.compact-form { gap: 8px; }
.top-gap { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); padding: 10px; }
td { border-bottom: 1px solid #edf1f7; padding: 10px; vertical-align: top; }
tbody tr:hover { background: var(--panel-soft); }
.risk { display: inline-block; border-radius: 999px; padding: 3px 9px; background: #eef2ff; color: var(--accent); }
.risk.high { background: #fff1f0; color: var(--red); }
.risk.medium { background: #fff8e8; color: var(--amber); }
.risk.low { background: #f0faf5; color: var(--green); }
.decision { display: grid; grid-template-columns: 100px minmax(160px, 1fr) auto; gap: 6px; min-width: 340px; }
.run-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.alert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.alert-card { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 16px; background: var(--panel-soft); }
.alert-card h3 { color: var(--text); margin-bottom: 0; font-size: 15px; }
.alert-card p { margin-bottom: 10px; }
.alert-card.critical { border-left-color: var(--red); background: #fff6f5; }
.alert-card.high { border-left-color: var(--amber); background: #fffaf0; }
.alert-card.medium { border-left-color: var(--accent); }
.alert-card.low { border-left-color: var(--green); background: #f6fcf9; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid, .form-grid, .form-grid.two, .source-grid, .alert-grid, .workspace-select, .setup-grid, .hint-grid, .credential-bind, .hero-grid, .quick-actions, .sticky-select { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .workspace-sticky { position: relative; }
  .workspace-sticky-head, .single-project-callout { align-items: stretch; flex-direction: column; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 9px 12px;
    height: auto;
    padding: 10px 12px;
  }
  .sidebar .brand-row.compact { margin: 0; }
  .sidebar .brand-mark { width: 34px; height: 34px; font-size: 12px; }
  .sidebar nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a { flex: 0 0 auto; padding: 8px 10px; font-size: 13px; }
  .sidebar > form { align-self: center; justify-self: end; }
  .sidebar > form .btn { width: auto; padding: 7px 10px; font-size: 12px; }
  .topbar { display: block; }
  .main { padding: 18px; }
  .kpi-grid, .run-grid { grid-template-columns: 1fr; }
}

/* StreamMyData-inspired report workspace */
.reports-shell .sidebar,
.report-sidebar {
  background: #24231f;
}

.reports-main,
.report-main {
  background: #f3f2f0;
}

.report-list-header,
.report-hero,
.flows-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid #ebe8e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(22, 32, 51, .05);
}

.report-list-header h1,
.report-hero h1,
.flows-hero h1 {
  margin-bottom: 4px;
}

.report-header-actions,
.report-toolbar,
.report-card-actions,
.flow-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.count-badge,
.source-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #dff7ea;
  color: #0c7a47;
  font-size: 13px;
  font-weight: 700;
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.report-card {
  display: grid;
  gap: 18px;
  min-height: 260px;
  padding: 22px;
  border: 1px solid #ebe8e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(22, 32, 51, .05);
}

.report-card-top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: start;
}

.report-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.avatar-letter {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #efe5ff;
  color: #6d28d9;
  font-weight: 800;
}

.report-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.report-card-meta strong {
  color: var(--text);
}

.report-empty {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
}

.report-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: #f3f2f0;
}

.report-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: #d7dde8;
}

.report-sidebar nav {
  display: grid;
  gap: 4px;
}

.report-sidebar a {
  color: #c6c3ba;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}

.report-sidebar a.active,
.report-sidebar a:hover {
  background: #3a3832;
  color: #fff;
}

.report-main {
  padding: 32px 36px 56px;
  min-width: 0;
}

.report-toolbar .btn,
.report-toolbar .status-dot,
.report-toolbar .source-count {
  min-height: 36px;
}

.kebab-menu {
  position: relative;
}

.kebab-menu summary {
  list-style: none;
  cursor: pointer;
  min-width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.kebab-menu summary::-webkit-details-marker {
  display: none;
}

.kebab-menu div {
  position: absolute;
  right: 0;
  top: 46px;
  z-index: 30;
  min-width: 250px;
  display: grid;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(22, 32, 51, .16);
}

.kebab-menu a,
.kebab-menu button,
.kebab-menu span {
  padding: 11px 10px;
  border: 0;
  border-bottom: 1px solid #edf1f7;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.kebab-menu .danger {
  color: var(--red);
}

.report-filter-shell,
.report-filter-row {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #ebe8e2;
  border-radius: 8px;
  background: #fff;
}

.report-filter-shell {
  grid-template-columns: auto minmax(300px, 1.3fr) minmax(170px, .7fr) minmax(180px, .8fr);
  align-items: end;
}

.report-filter-row {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.period-presets {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.period-presets button {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 10px 14px;
  background: #fff;
  cursor: pointer;
}

.period-presets button:last-child {
  border-right: 0;
}

.period-presets button.active,
.period-presets button:hover {
  background: #fff6d6;
}

.date-range-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.multi-filter {
  position: relative;
}

.multi-filter-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.multi-filter-trigger::after {
  content: "⌄";
  color: var(--text);
}

.multi-filter.open .multi-filter-trigger {
  border-color: #ffc400;
  color: var(--text);
}

.multi-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 35;
  display: none;
  width: min(280px, 92vw);
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(22, 32, 51, .16);
}

.multi-filter.open .multi-filter-menu {
  display: grid;
  gap: 6px;
}

.check-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px;
  border-bottom: 1px solid #edf1f7;
  color: var(--text);
}

.check-row input {
  width: 20px;
  height: 20px;
}

.section-band {
  margin-bottom: 10px;
  padding: 16px 18px;
  border: 1px solid #ebe8e2;
  border-radius: 8px;
  background: #fff;
}

.report-section {
  margin-bottom: 18px;
}

.report-grid {
  display: grid;
  gap: 16px;
}

.report-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-widget {
  position: relative;
  min-height: 330px;
  padding: 18px;
  border: 1px solid #ebe8e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 32, 51, .05);
}

.report-widget.full {
  min-height: auto;
}

.widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.widget-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.chart-canvas {
  width: 100%;
  height: 280px;
}

.widget-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcff;
}

.widget-empty.overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 10px 12px;
  background: rgba(255, 248, 232, .96);
}

.report-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.report-kpi-card {
  padding: 18px;
  border: 1px solid #ebe8e2;
  border-radius: 8px;
  background: #fff;
}

.report-kpi-card span,
.report-kpi-card small {
  display: block;
  color: var(--muted);
}

.report-kpi-card strong {
  display: block;
  margin: 8px 0;
  font-size: 32px;
  line-height: 1;
}

.report-table-wrap {
  max-height: 310px;
  overflow: auto;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.insight-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfcff;
}

.insight-card.high,
.insight-card.critical {
  border-left-color: var(--red);
}

.insight-card.medium {
  border-left-color: var(--amber);
}

.insight-card span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.ai-analyst,
.flow-group,
.flow-tabs {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #ebe8e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 32, 51, .05);
}

.ai-chat-log {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  margin: 14px 0;
}

.ai-message {
  max-width: 820px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.ai-message.user {
  margin-left: auto;
  background: #eef5ff;
}

.ai-message p {
  margin: 4px 0 0;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.report-loading .report-main {
  cursor: progress;
}

.flow-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.flow-list {
  display: grid;
  gap: 12px;
}

.flow-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-card.missing {
  background: #fff8ef;
  border-color: #f1dcc5;
}

.flow-card.ready {
  background: #fbfffd;
  border-color: #cfead9;
}

.flow-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flow-title small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.flow-icon,
.green-dot {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #dff7ea;
  color: #0c7a47;
  font-weight: 800;
}

.green-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
}

.flow-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.flow-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1aa66a;
}

@media (max-width: 1180px) {
  .report-page { grid-template-columns: 1fr; }
  .report-sidebar { position: relative; height: auto; }
  .report-filter-shell,
  .report-filter-row,
  .report-grid.two,
  .report-grid.three,
  .report-kpi-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .report-main,
  .reports-main {
    padding: 18px;
  }
  .report-list-header,
  .report-hero,
  .flows-hero,
  .ai-chat-form {
    display: grid;
    grid-template-columns: 1fr;
  }
  .report-card-top {
    grid-template-columns: 44px 1fr;
  }
}

/* Role-based workspace */
.role-main {
  background: #f6f7f9;
}

.role-context-bar {
  gap: 10px;
}

.role-context-form {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr .7fr .9fr .9fr;
  gap: 12px;
  align-items: end;
}

.role-context-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-context-meta span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.role-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.role-hero h1 {
  max-width: 880px;
}

.role-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-tabs,
.role-subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.module-tabs a {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(22, 32, 51, .06);
}

.module-tabs a span {
  font-weight: 800;
}

.module-tabs a small {
  color: var(--muted);
  font-size: 12px;
}

.module-tabs a.active,
.module-tabs a:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff, #eef5ff);
}

.role-tabs.compact {
  margin-bottom: 12px;
}

.role-tabs a,
.role-subtabs a {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
}

.role-tabs a.active,
.role-tabs a:hover,
.role-subtabs a:hover {
  border-color: var(--accent);
  background: #eef5ff;
  color: var(--accent);
}

.source-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.source-badge small {
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
}

.source-badge.ready {
  border-color: rgba(34, 197, 94, .35);
  color: #15803d;
}

.source-badge.ready small {
  background: #dcfce7;
  color: #15803d;
}

.source-badge.missing {
  border-color: rgba(245, 158, 11, .35);
  color: #92400e;
}

.source-badge.missing small {
  background: #fef3c7;
  color: #92400e;
}

.module-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.module-data-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mini-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mini-head h3 {
  margin: 0;
}

.mini-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-kpis div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-kpis span,
.mini-kpis strong {
  display: block;
}

.mini-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.mini-kpis strong {
  margin-top: 3px;
  font-size: 20px;
}

.skill-playbook-section {
  display: grid;
  gap: 14px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.skill-playbook-section > .mini-head {
  align-items: flex-start;
}

.skill-playbook-section > .mini-head p {
  margin: 6px 0 0;
}

.direct-client-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: 14px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.direct-client-main,
.direct-client-actions {
  display: grid;
  gap: 12px;
}

.direct-client-form {
  max-width: 520px;
}

.direct-client-form label,
.client-chat-form {
  display: grid;
  gap: 7px;
}

.direct-current-client {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.direct-current-client span,
.direct-steps {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.direct-current-client strong,
.direct-steps strong {
  color: var(--text);
}

.direct-steps {
  display: grid;
  gap: 4px;
}

.direct-summary-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.direct-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.direct-audit-report {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.direct-audit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.direct-audit-header h3,
.direct-audit-header p,
.direct-audit-block h4,
.direct-finding h5 {
  margin: 0;
}

.direct-readonly-badge {
  padding: 7px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.direct-audit-kpis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.direct-audit-kpis > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.direct-audit-kpis span,
.direct-audit-kpis strong {
  display: block;
}

.direct-audit-kpis span {
  color: var(--muted);
  font-size: 11px;
}

.direct-audit-kpis strong {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.direct-audit-note {
  padding: 11px 13px;
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
}

.direct-audit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.direct-audit-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-scroll {
  margin-top: 10px;
  overflow-x: auto;
}

.table-scroll.compact {
  max-height: 430px;
  overflow: auto;
}

.direct-audit-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12px;
}

.direct-audit-table th,
.direct-audit-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.direct-audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.direct-audit-table th:first-child,
.direct-audit-table td:first-child {
  text-align: left;
}

.direct-audit-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.direct-audit-table tr.needs-attention td {
  background: #fff7ed;
}

.direct-findings {
  display: grid;
  gap: 9px;
}

.direct-finding {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
}

.direct-finding.high {
  border-left-color: #dc2626;
}

.direct-finding.medium {
  border-left-color: #f59e0b;
}

.direct-finding > div {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.direct-finding > div span {
  padding: 3px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.direct-finding p {
  margin: 5px 0;
  font-size: 13px;
}

.direct-limitations {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.direct-limitations summary {
  cursor: pointer;
  font-weight: 800;
}

.direct-limitations li {
  margin: 6px 0;
}

.skill-playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.skill-playbook-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.skill-playbook-card p {
  margin: 0;
  font-size: 13px;
}

.skill-card-top {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}

.skill-card-top strong {
  font-size: 15px;
}

.skill-card-top span {
  max-width: 46%;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
  text-align: right;
}

.skill-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-source-row small {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
}

.role-process {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.role-process article,
.role-card,
.knowledge-card,
.timeline-list article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.role-process article {
  border-top: 3px solid var(--accent);
}

.role-process strong,
.role-process span {
  display: block;
}

.role-process span,
.role-card p,
.knowledge-card p,
.timeline-list p,
.timeline-list span,
.knowledge-card small {
  color: var(--muted);
  font-size: 13px;
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.role-card {
  min-height: 118px;
}

.role-card strong {
  display: block;
  margin-bottom: 8px;
}

.role-kpis {
  margin-top: 0;
}

.timeline-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.timeline-list article {
  border-left: 4px solid var(--accent);
}

.timeline-list strong {
  display: block;
  margin: 4px 0;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.knowledge-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.knowledge-card span {
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.knowledge-card small {
  overflow-wrap: anywhere;
}

.client-chat-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.client-chat-toggle,
.client-chat-panel {
  pointer-events: auto;
}

.client-chat-toggle {
  display: grid;
  justify-items: start;
  gap: 1px;
  margin-left: auto;
  padding: 11px 14px;
  border: 1px solid #b7c6dc;
  border-radius: 999px;
  background: var(--sidebar);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.client-chat-toggle span {
  font-weight: 800;
}

.client-chat-toggle small {
  max-width: 210px;
  overflow: hidden;
  color: #cbd5e1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-chat-panel {
  display: grid;
  gap: 0;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(22, 32, 51, .2);
}

.client-chat-panel[hidden] {
  display: none;
}

.client-chat-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.client-chat-panel header div {
  display: grid;
  gap: 2px;
}

.client-chat-panel header span {
  color: var(--muted);
  font-size: 12px;
}

.client-chat-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.client-chat-messages {
  display: grid;
  gap: 9px;
  max-height: 340px;
  overflow: auto;
  padding: 14px;
  background: var(--panel-soft);
}

.client-chat-message {
  max-width: 92%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  white-space: pre-wrap;
}

.client-chat-message.user {
  justify-self: end;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.client-chat-message.error {
  border-color: #ffc8c2;
  background: #fff1f0;
  color: var(--red);
}

.client-chat-message.loading {
  color: var(--muted);
}

.client-chat-form {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.client-chat-form textarea {
  min-height: 58px;
  resize: vertical;
}

.direct-automation {
  display: grid;
  gap: 18px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.direct-automation-kpis,
.direct-agent-grid,
.direct-automation-grid {
  display: grid;
  gap: 12px;
}

.direct-automation-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.direct-automation-kpis div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.direct-automation-kpis span,
.direct-automation-card p,
.direct-agent-card p {
  color: var(--muted);
  font-size: 13px;
}

.direct-automation-kpis strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.direct-automation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.direct-agent-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.direct-automation-card,
.direct-agent-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.direct-agent-card {
  display: grid;
  gap: 10px;
}

.direct-agent-card form,
.direct-automation-card form {
  margin-top: 8px;
}

.btn.tiny {
  padding: 5px 8px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .role-context-form,
  .role-process,
  .direct-client-workbench,
  .module-panel-grid,
  .direct-automation-grid {
    grid-template-columns: 1fr;
  }
  .role-hero {
    display: grid;
  }
  .role-hero-actions {
    justify-content: flex-start;
  }
  .direct-summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .direct-audit-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .direct-automation-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .direct-audit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .direct-audit-header {
    display: grid;
  }
  .direct-readonly-badge {
    white-space: normal;
  }
  .direct-audit-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .direct-automation-kpis {
    grid-template-columns: 1fr;
  }
  .client-chat-widget {
    right: 12px;
    bottom: 12px;
  }
  .client-chat-toggle {
    width: 52px;
    height: 52px;
    place-items: center;
    padding: 0;
    border-radius: 50%;
  }
  .client-chat-toggle small { display: none; }
  .client-chat-panel { max-height: calc(100vh - 88px); }
}
