/* Management BI additions on top of the Stormies styles (app.css, brand.css). */
:root { --bi-pos: #0a7d3b; --bi-neg: var(--ps-shocking-pink); }

.bi .wrap { max-width: 1240px; }
.bi .wrap h1.headline { font-size: clamp(36px, 5vw, 60px); margin: 0; }
.bi .bar { flex-wrap: wrap; row-gap: 10px; }
.bi .bar nav { flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.lede { max-width: 760px; color: #444; }
.lede a, .hint a { color: var(--ps-black); }
.hint { color: #666; font-size: 15px; }
.muted { color: #999; }

/* Pickers */
.picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; }
.picker label { color: #666; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.picker select, .inline-form input { font: inherit; font-size: 16px; padding: 10px 36px 10px 14px; border: 1px solid #bdbdbd; border-radius: 999px; background: var(--ps-white); color: var(--ps-black); }
.inline-form { display: flex; gap: 10px; align-items: center; max-width: 720px; }
.inline-form input { border-radius: 10px; padding-right: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th a { color: inherit; text-decoration: none; }
table.data th a:hover { color: var(--ps-black); }
table.data th[aria-sort] a { color: var(--ps-black); }
table.data tfoot td { font-weight: 400; border-top: 1px solid var(--ps-black); border-bottom: 0; }
table.data.compact td, table.data.compact th { padding: 8px 10px; }
.pos { color: var(--bi-pos); }
.neg { color: var(--bi-neg); }

.freshness { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: #666; font-size: 12px; margin: 12px 0 20px; }
.freshness form { margin: 0; }
details.note { margin-top: 32px; }
details.note summary { cursor: pointer; color: #666; font-size: 13px; }

/* Report */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 28px 32px; border-radius: 20px; background: #f2f2f2; margin: 16px 0; }
.hero.pos { background: #e9f6ee; color: var(--ps-black); }
.hero.neg { background: #fde7f0; color: var(--ps-black); }
.hero-amount { font-family: var(--ps-font-headline); font-weight: var(--ps-weight-headline); font-size: clamp(40px, 6vw, 64px); line-height: 1; margin: 6px 0; }
.hero.pos .hero-amount { color: var(--bi-pos); }
.hero.neg .hero-amount { color: var(--bi-neg); }
.hero-side { text-align: right; color: #444; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric { border: 1px solid #e6e6e6; border-radius: 16px; padding: 18px 20px; }
.metric .mono { color: #666; font-size: 12px; text-transform: uppercase; }
.metric-val { font-size: 26px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.tabs { margin: 0 0 12px; }

/* Staff time */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { border: 1px solid #e6e6e6; border-radius: 16px; padding: 18px 20px; }
.card h2.headline.small { margin: 0; }
ul.split { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; }
ul.split li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }
ul.split li .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.bar { width: 70px; height: 4px; }
svg.bar .track { fill: #e6e6e6; }
svg.bar .fill { fill: var(--ps-wonder-blue); }
.pie-wrap { display: flex; gap: 16px; align-items: flex-start; }
.pie-wrap ul.split { flex: 1; min-width: 0; margin-top: 0; }
svg.pie path, svg.pie circle { stroke: #fff; stroke-width: 1; }
.pie-label { font-family: var(--ps-font-mono); font-size: 12px; fill: var(--ps-black); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot[data-i="0"] { background: #5172ff; } .dot[data-i="1"] { background: #f8146d; } .dot[data-i="2"] { background: #000; }
.dot[data-i="3"] { background: #e4ff1b; } .dot[data-i="4"] { background: #9aa8ff; } .dot[data-i="5"] { background: #fb8ab5; }
.dot[data-i="6"] { background: #7a7a7a; } .dot[data-i="7"] { background: #c6d1ff; } .dot[data-i="8"] { background: #ffc2d9; }
.dot[data-i="9"] { background: #cfcfcf; }
ul.split li:not(:has(.dot)) { grid-template-columns: 1fr auto auto; }

/* Settings */
.settings-block { padding: 28px 0; border-top: 1px solid #e6e6e6; scroll-margin-top: 20px; }
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 24px; }
.rates label { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rates input { max-width: 130px; text-align: right; }
.rates .actions { grid-column: 1 / -1; }
.reveal-btn { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.reveal-btn .secret { filter: blur(6px); transition: filter .15s; font-variant-numeric: tabular-nums; }
.reveal-btn.revealed .secret { filter: none; }

/* Eye of the Storm */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { font-size: 12px; padding: 8px 14px; border-radius: 999px; border: 1px solid #bdbdbd; background: var(--ps-white); cursor: pointer; }
.chip:hover { border-color: var(--ps-black); }
ol.thread { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 860px; padding: 14px 18px; border-radius: 18px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--ps-black); color: var(--ps-white); white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: #f2f2f2; }
.msg.assistant p { margin: 0 0 8px; } .msg.assistant p:last-child { margin: 0; }
.msg.assistant table { margin: 8px 0; background: var(--ps-white); }
.msg.pending { color: #666; font-style: italic; }
.msg.error { background: #fde7f0; }
.ask-form textarea { resize: vertical; }
.ask-form .actions { display: flex; gap: 16px; align-items: center; margin-top: 10px; }

/* Waiting for a slow Toggl fetch */
body.loading { cursor: progress; }
body.loading main { opacity: .5; transition: opacity .3s .3s; }
