/* app.css — Work Pulse shell + shared components (uses the theme variables from styles.css) */
:root { --blue: #5b9bd5; --st-on_track: #5fb98c; --st-at_risk: #e0a93f; --st-blocked: #d9686b; --st-unknown: #7a8499; --st-completed: #5b9bd5; --st-cancelled: #4a5160; --st-unassigned: #4a5160; }
html, body { height: 100%; }
body { overflow: hidden; }
.sh { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.sh-side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.sh-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; padding: 4px 8px 18px; }
.sh-brand small { color: var(--text-faint); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-left: 2px; }
.sh-nav { display: grid; gap: 3px; }
.sh-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--text-dim); text-decoration: none; font-size: 13.5px; position: relative; }
.sh-nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sh-nav a:hover { background: var(--panel-2); color: var(--text); }
.sh-nav a.on { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.sh-badge { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.sh-badge.soft { background: var(--panel-3); color: var(--text-dim); }
.sh-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--text-dim); }
.sh-me { font-weight: 600; color: var(--text); } .sh-build { color: var(--text-faint); font-size: 11px; margin-top: 3px; }
.sh-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.sh-top { display: flex; align-items: center; gap: 14px; padding: 14px 26px; border-bottom: 1px solid var(--line); background: var(--bg); flex: none; }
.sh-top h1 { font-size: 19px; margin: 0; font-weight: 650; }
.sh-top-r { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.sh-menu { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }
.pg { padding: 22px 26px 90px; overflow-y: auto; flex: 1; max-width: none; margin: 0; }
.warn-strip { background: var(--warn-dim); border-bottom: 1px solid var(--warn); color: var(--text); padding: 8px 26px; font-size: 13px; }
@media (max-width: 860px) {
  .sh { grid-template-columns: 1fr; } .sh-side { position: fixed; left: -260px; top: 0; bottom: 0; width: 240px; z-index: 900; transition: left .18s; }
  .sh-side.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.6); } .sh-menu { display: block; } .pg { padding: 16px 14px 90px; } .sh-top { padding: 12px 14px; }
}
.btn-secondary.sm, .btn-primary.sm { padding: 6px 12px; font-size: 12.5px; }
.chip-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim); border-radius: 99px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--text); } .chip-btn.snap { border-color: var(--accent); color: var(--accent); }

/* generic building blocks */
.cd { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.cd > h2, .cd > h3, .cd-h { font-size: 13.5px; font-weight: 650; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.cd-h .sp { margin-left: auto; }
.mu { color: var(--text-dim); font-size: 12.5px; } .fa { color: var(--text-faint); font-size: 12px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g21 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .g2, .g3, .g21 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: default; border-left: 4px solid var(--line); text-align: left; color: var(--text); font: inherit; }
button.kpi { cursor: pointer; } button.kpi:hover { border-color: var(--accent); }
.kpi b { display: block; font-size: 28px; font-weight: 700; line-height: 1.1; font-family: var(--mono); } .kpi span { color: var(--text-dim); font-size: 12.5px; }
.kpi small { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 3px; }
.kpi.on_track { border-left-color: var(--st-on_track); } .kpi.at_risk { border-left-color: var(--st-at_risk); } .kpi.blocked { border-left-color: var(--st-blocked); }
.kpi.completed { border-left-color: var(--st-completed); } .kpi.unknown { border-left-color: var(--st-unknown); } .kpi.neutral { border-left-color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.on_track { color: var(--st-on_track); border-color: rgba(95,185,140,.5); background: var(--good-dim); }
.chip.at_risk { color: var(--st-at_risk); border-color: rgba(224,169,63,.5); background: var(--warn-dim); }
.chip.blocked { color: var(--st-blocked); border-color: rgba(217,104,107,.5); background: var(--bad-dim); }
.chip.unknown, .chip.unassigned { color: #aab3c2; } .chip.completed { color: var(--st-completed); border-color: rgba(91,155,213,.5); background: rgba(91,155,213,.12); }
.chip.high, .chip.sev-high { color: var(--st-blocked); border-color: rgba(217,104,107,.5); } .chip.medium, .chip.sev-medium { color: var(--st-at_risk); border-color: rgba(224,169,63,.5); } .chip.low, .chip.sev-low { color: var(--text-dim); }
.chip.conf-High { color: var(--good); } .chip.conf-Medium { color: var(--warn); } .chip.conf-Low, .chip.conf-None { color: var(--text-dim); }
.chip.suspected { color: var(--accent); border-color: var(--accent); border-style: dashed; }
.seg { display: flex; height: 38px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 6px 0 10px; }
.seg button { border: 0; padding: 0 8px; color: #10131a; font-weight: 700; font-size: 12.5px; cursor: pointer; min-width: 3px; overflow: hidden; white-space: nowrap; font-family: inherit; }
.seg button:hover { filter: brightness(1.12); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-dim); } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; } .tbl th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; } .tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--panel-2); }
.tbl-wrap { overflow-x: auto; }
.pgb { position: relative; height: 9px; background: var(--panel-3); border-radius: 5px; min-width: 90px; } .pgb i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--good); }
.pgb u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .75; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-danger { background: var(--bad-dim); border: 1px solid var(--bad); color: var(--bad); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; font-weight: 600; font-family: inherit; }
.linkish { color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; font: inherit; text-decoration: none; } .linkish:hover { text-decoration: underline; }
.empty { color: var(--text-dim); padding: 26px; text-align: center; font-size: 13.5px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-dim); text-decoration: none; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); } .tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.crumb { color: var(--text-dim); font-size: 12.5px; text-decoration: none; display: inline-block; margin-bottom: 8px; } .crumb:hover { color: var(--text); }
.ph { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .ph .av { width: 46px; height: 46px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; color: var(--accent); }
.ph h2 { margin: 0; font-size: 20px; }
.employee-status-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chronological-dropdown { margin-top: 24px; }
.chronological-dropdown > summary { cursor: pointer; font-weight: 650; font-size: 13.5px; padding: 3px 0; }
.chronological-content { padding-top: 18px; }
.task-work-tabs { display: flex; flex-wrap: wrap; gap: 4px; }

/* forms */
.fm { display: grid; gap: 12px; } .fm label { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.fm input, .fm select, .fm textarea { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 400; width: 100%; }
.fm input:focus, .fm select:focus, .fm textarea:focus { outline: none; border-color: var(--accent); } .fm textarea { min-height: 70px; resize: vertical; }
.fm .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .fm .hint { font-weight: 400; color: var(--text-faint); font-size: 11.5px; }
.fm .err { color: var(--bad); font-size: 12.5px; min-height: 16px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; } .filters select, .filters input { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; color: var(--text); font: inherit; font-size: 13px; }
.task-filters { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)) minmax(200px, 1.4fr) auto; align-items: center; }
.task-filters select, .task-filters input { width: 100%; min-width: 0; }
@media (max-width: 1050px) { .task-filters { grid-template-columns: repeat(3, minmax(145px, 1fr)); } }
@media (max-width: 620px) { .task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .task-filters input { grid-column: 1 / -1; } }

/* modal + toast */
.md-ov { position: fixed; inset: 0; background: rgba(5,8,12,.66); z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 18px; }
.md { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(640px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.md.wide { width: min(860px, 100%); } .md-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); } .md-h h3 { margin: 0; font-size: 16px; } .md-x { margin-left: auto; background: none; border: 0; color: var(--text-dim); font-size: 22px; cursor: pointer; }
.md-b { padding: 18px 20px; overflow-y: auto; } .md-f { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--panel-3); border: 1px solid var(--line); border-left: 4px solid var(--good); padding: 10px 18px; border-radius: 10px; z-index: 1500; font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 90vw; }
.toast.err { border-left-color: var(--bad); }

/* alerts / lists */
.al { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; }
.al.sev-high { border-left-color: var(--st-blocked); } .al.sev-medium { border-left-color: var(--st-at_risk); } .al.sev-low { border-left-color: var(--text-faint); }
.al.handled { opacity: .62; } .al-h { padding: 13px 16px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; } .al-h h4 { margin: 0 0 3px; font-size: 14px; } .al-h p { margin: 0; color: var(--text-dim); font-size: 13px; }
.al-b { padding: 4px 16px 16px 16px; border-top: 1px solid var(--line-soft); display: none; } .al.open .al-b { display: block; }
.al-b h5 { margin: 14px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); } .al-b ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.row-list { display: grid; gap: 8px; } .row-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--panel-2); border-radius: var(--radius-sm); border: 1px solid var(--line-soft); font-size: 13px; cursor: pointer; text-align: left; color: var(--text); font-family: inherit; width: 100%; }
.row-item:hover { border-color: var(--accent); } .row-item .t { display: grid; gap: 2px; min-width: 0; } .row-item .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.feed { display: grid; gap: 0; } .feed-i { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; } .feed-i time { color: var(--text-faint); font-family: var(--mono); font-size: 11.5px; padding-top: 2px; }
.feed-i .k { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line); color: var(--text-dim); border-radius: 4px; padding: 0 5px; margin-right: 6px; }
.k.record { color: var(--accent); border-color: var(--accent); } .k.commit { color: var(--good); } .k.gap { color: var(--bad); }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; } .why li { display: flex; gap: 9px; } .why .m { width: 18px; flex: none; text-align: center; font-weight: 700; }
.why .y { color: var(--st-at_risk); } .why .n { color: var(--text-faint); } .why .q { color: var(--text-dim); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13px; margin: 0; } .dl dt { color: var(--text-dim); } .dl dd { margin: 0; }
.help-hl { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; transition: outline-color .3s; }
[data-help] { cursor: default; } button[data-help], a[data-help], .kpi[data-help], tr.click[data-help] { cursor: pointer; }
.sk { display: inline-block; background: var(--panel-3); border-radius: 99px; padding: 3px 10px; font-size: 12px; margin: 3px 4px 3px 0; }

.feed-i > div, .row-item .t, .al-h p, .dl dd { overflow-wrap: anywhere; }
