/* Phase 4A: honest UI. Follows DESIGN.md: text at 12px or larger, AA text colors, flat cards. */
:root {
  --text-warning: #8F5200;
  --text-green: #5E6608;
  --text-danger: #B53A3A;
  --text-purple: #5F4DA3;
}
body.dark {
  --text-warning: #E3A04A;
  --text-green: #D5DB5A;
  --text-danger: #FF8A8A;
  --text-purple: #B6A6F2;
}

/* Text colors that failed contrast on light surfaces. Fills keep the brand colors. */
.status.green { color: var(--text-green); }
.status.orange { color: var(--text-warning); }
.status.red { color: var(--text-danger); }
.status.purple { color: var(--text-purple); }
.status { font-size: 12px; }

.p4-note { padding: 18px 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.p4-muted { color: var(--muted); font-size: 12px; }

/* Integrations: only real states. "Belum tersedia" is neutral, not an error. */
.p4-int-list { display: grid; gap: 10px; }
.p4-int-row { display: grid; grid-template-columns: 180px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.p4-int-row strong { font-size: 14px; }
.p4-int-row p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.p4-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--cream); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.p4-pill.live { background: var(--green-soft); border-color: transparent; color: var(--text-green); }

/* Settings and preferences */
.pref-card .field select { min-height: 40px; font-size: 14px; }
.pref-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.pref-status { font-size: 13px; color: var(--muted); }
.p4-upcoming { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; color: var(--ink); }
.p4-upcoming span { color: var(--muted); }

/* FAQ */
.faq-question { font-size: 14px; }
.faq-answer { font-size: 14px; line-height: 1.6; }
.faq-item.hide { display: none; }
.faq-none { color: var(--muted); font-size: 13px; padding: 12px 4px; }

/* Overview: forecast bars and attention list */
.p4-bars { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 22px; border-bottom: 1px solid var(--line); }
.p4-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.p4-bar i { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 0 0; background: var(--green); }
.p4-bar.over i { background: var(--danger); }
.p4-bar .v { font-size: 12px; font-weight: 700; color: var(--ink); }
.p4-bar .l { font-size: 12px; color: var(--muted); padding-top: 6px; position: absolute; bottom: -24px; }
#overviewForecast { padding-bottom: 28px; }
.p4-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.p4-list li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.p4-list li > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p4-list strong { font-size: 14px; }
.p4-list p { margin: 6px 0 4px; font-size: 13px; color: var(--ink); line-height: 1.45; }
.p4-list small { font-size: 12px; color: var(--muted); }
.p4-chip { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.p4-chip.red { background: var(--danger-soft); color: var(--text-danger); }
.p4-chip.amber { background: var(--orange-soft); color: var(--text-warning); }
.date-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }

@media (max-width: 760px) {
  .p4-int-row { grid-template-columns: 1fr; gap: 8px; }
  .p4-bars { gap: 4px; }
  .p4-bar .v { font-size: 12px; }
}

/* ---------------------------------------------------------------- DESIGN.md: shape and depth */
/* No decorative gradients or blobs. Notes and banners are flat surfaces with a border. */
.profile-hero, .score-summary, .timeline-import-bar, .people-live-note, .people-profile-hero,
.workload-live-note, .bau21-import, .bau21-token-card, .bau-revision-note, .p2e-note, .p2e-score-banner,
.p2e-import, .staffing-note, .ogsm-live-note { background: var(--cream); border: 1px solid var(--line); }
.avatar { background: var(--orange); color: #212121; }
/* The tagline card sits on the dark sidebar, so it needs light text on a dark surface. */
.sidebar .gateway-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); }
.sidebar .gateway-card strong { color: #FFFFFF; }
.sidebar .gateway-card span { color: #D8D3D0; }
.bar span, .chart-fill, .cap-col span, .capacity-live-bar { background: var(--green); }
#pulseAuthGate { background: #171717; }
.kpi-card:after { display: none; }

/* The page is flat. Only floating layers (menus, toasts, modals) carry a shadow. */
:root { --shadow: none; }
.profile-menu, .toast { box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.topbar { backdrop-filter: none; }

/* A small, fixed radius set: 8 fields and chips, 12 buttons, 20 page cards. */
.field input, .field select, .field textarea, .search-box input { border-radius: 8px; }
.btn { border-radius: 12px; }

/* Visible focus for keyboard users, light and dark. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sidebar :focus-visible, .sidebar .nav-item:focus-visible { outline-color: #F5F2EE; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--orange); }

/* Icons: one coherent stroke set instead of text glyphs. */
.nav-icon svg, .kpi-icon svg, .action-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; margin: auto; }
.kpi-icon, .action-icon, .nav-icon { display: inline-flex; align-items: center; justify-content: center; }

/* Load bar: the Pulse motif. Hours used against capacity, tick at the 85% planning threshold. */
.p4-loadbar { position: relative; display: flex; height: 18px; border-radius: 99px; background: var(--cream); border: 1px solid var(--line); overflow: visible; }
.p4-loadbar .seg { display: block; height: 100%; }
.p4-loadbar .seg:first-child { border-radius: 99px 0 0 99px; }
.p4-loadbar .seg:last-of-type { border-radius: 0 99px 99px 0; }
.p4-loadbar .seg:only-of-type { border-radius: 99px; }
.seg-bau { background: var(--ink); }
.seg-project { background: var(--muted); }
.seg-internal { background: var(--line); border: 1px solid var(--muted); box-sizing: border-box; }
.p4-loadbar .tick { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--orange); }
.p4-loadbar .cap { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .35; }
.p4-loadsum { margin: 12px 0 8px; font-size: 14px; }
.p4-loadsum .over { color: var(--text-danger); font-weight: 700; }
.p4-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.p4-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.p4-legend b { color: var(--ink); }
.p4-prog { height: 8px; border-radius: 99px; background: var(--cream); border: 1px solid var(--line); margin: 8px 0 6px; overflow: hidden; }
.p4-prog i { display: block; height: 100%; background: var(--green); }
.p4-chip.ok { background: var(--green-soft); color: var(--text-green); }
.p4-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.p4-tags li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 13px; }
.p4-tags small { color: var(--muted); margin-left: 4px; }
.info-item span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.profile-hero h2 { margin: 0 0 4px; }
.profile-hero p { margin: 0; color: var(--muted); font-size: 14px; }

/* OGSM and My Goals: use theme tokens instead of fixed light colors, so dark mode has no white cards. Text 12px or larger. */
.ogsm-kpi, .ogsm-objective-card, .my-ogsm-objective, .ogsm-empty { background: var(--paper); border-color: var(--line); }
.ogsm-empty { border-style: dashed; color: var(--muted); }
.ogsm-empty strong, .ogsm-title strong, .ogsm-kpi strong { color: var(--ink); }
.ogsm-goal-row, .ogsm-strategy-block, .my-ogsm-measure { background: var(--cream); border-color: var(--line); }
.my-ogsm-numbers div { background: var(--paper); }
.ogsm-goals, .ogsm-measurement { border-color: var(--line); }
.ogsm-detail-goal { border-color: var(--line); }
.ogsm-mini-bar { background: var(--line); }
.ogsm-kpi span, .ogsm-kpi small, .ogsm-title span, .ogsm-goal-copy span, .ogsm-measurement small, .ogsm-detail-goal-head p, .my-ogsm-objective-head p, .my-ogsm-measure p, .my-ogsm-numbers span { color: var(--muted); font-size: 12px; }
.ogsm-measurement .metric-value { color: var(--ink); font-size: 12px; }
.ogsm-goal-copy strong, .ogsm-measurement strong, .ogsm-strategy-title strong { font-size: 13px; }
.ogsm-status { font-size: 12px; }
.ogsm-code { background: rgba(118, 81, 201, .16); color: var(--text-purple); }
.ogsm-status.green { background: rgba(185, 201, 39, .18); color: var(--text-green); }
.ogsm-status.orange { background: rgba(245, 155, 35, .18); color: var(--text-warning); }
.ogsm-status.purple { background: rgba(118, 81, 201, .16); color: var(--text-purple); }
.ogsm-status.grey { background: var(--cream); color: var(--muted); }
body.dark .ogsm-kpi, body.dark .ogsm-objective-card { background: var(--paper); }
