/* Visual layer. Loaded after styles.css. Plain and quiet on purpose: one accent colour,
   hairline borders, no gradients, no glow, no decorative motion. */

:root {
  --radius: 8px;
  --topnav: 56px;
  --sidebar: 244px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, .12);
  --bg: #f7f7f5; --card: #fff; --line: #e4e4df; --soft: #f1f1ed;
  --ink: #1d1d1b; --ink2: #43433f; --muted: #7a7a73;
  font-family: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
}
[data-theme="dark"] {
  --bg: #161614; --card: #1e1e1c; --ink: #ecece8; --ink2: #c9c9c3; --muted: #8d8d86; --line: #2f2f2c; --soft: #272725;
  --shadow: none; --shadow-lg: 0 8px 24px rgba(0, 0, 0, .5);
}
body { background: var(--bg); font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: inherit; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topnav { position: sticky; top: 0; z-index: 35; height: var(--topnav); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.logoplate { display: flex; align-items: center; padding: 0; background: none; border: 0; box-shadow: none; }
.logoplate img { height: 26px; width: auto; display: block; }
[data-theme="dark"] .logoplate { background: #fff; padding: 5px 9px; border-radius: 6px; }
.prod { font-weight: 600; font-size: 14px; padding-left: 14px; border-left: 1px solid var(--line); line-height: 1.2; color: var(--ink); }
.prod small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.topnav .menu { display: none; }
.topnav .iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--ink2); }
.topnav .iconbtn:hover { background: var(--soft); }
.me { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 6px; color: var(--ink); font-weight: 500; max-width: 220px; }
.me:hover { background: var(--soft); }
.me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico-svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- sidebar ---------- */
.shell { min-height: calc(100vh - var(--topnav)); }
.sidebar { top: var(--topnav); height: calc(100vh - var(--topnav)); padding: 14px 10px; gap: 1px; background: var(--card); border-right: 1px solid var(--line); }
.ws { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.ws-mark { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-weight: 650; font-size: 13px; color: var(--brand-ink); background: var(--brand); flex: none; }
.ws-l { display: none; }
.ws-n { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.side-title { color: var(--muted); padding: 16px 8px 5px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.nav a, .nav button { padding: 7px 8px; border-radius: 6px; color: var(--ink2); font-weight: 500; }
.nav a:hover, .nav button:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: color-mix(in srgb, var(--brand) 11%, var(--card)); color: color-mix(in srgb, var(--brand) 78%, var(--ink)); font-weight: 600; }
.nav .ico { width: 20px; display: grid; place-items: center; color: var(--muted); }
.nav a.on .ico { color: var(--brand); }
.team-pill { padding: 7px 8px; border-radius: 6px; font-weight: 500; color: var(--ink2); }
.team-pill:hover { background: var(--soft); }
.team-pill.on { background: color-mix(in srgb, var(--tc) 12%, var(--card)); color: var(--ink); font-weight: 600; }
.team-pill .em { font-size: 15px; }
.main { padding: 26px 32px 64px; max-width: 1280px; }

/* ---------- surfaces ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 18px 20px; background: var(--card); }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.stat .v { font-size: 26px; font-weight: 650; color: var(--ink); margin-top: 2px; letter-spacing: -.02em; }
.stat .s { color: var(--muted); opacity: 1; font-weight: 400; }
.stat .v::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: middle; position: relative; top: -3px; }
.hero { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: none; }
.hero::after { display: none; }
.hero h1 { font-size: 22px; }
.hero .muted { color: var(--muted); }
.badge, .chip { font-weight: 600; }
.chip { border-radius: 4px; }

/* ---------- controls ---------- */
.btn { padding: 8px 14px; border-radius: 6px; font-weight: 550; border-color: var(--line); background: var(--card); box-shadow: none; transition: background .15s, border-color .15s, transform .12s var(--ease-out); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.sm { padding: 5px 10px; border-radius: 6px; }
.btn.lg { padding: 10px 18px; border-radius: 6px; }
.btn:disabled { opacity: .55; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea {
  padding: 8px 11px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); outline: none; }
label.f { font-size: 12.5px; font-weight: 550; letter-spacing: 0; text-transform: none; color: var(--ink2); margin: 14px 0 5px; }
.seg { background: var(--soft); border-radius: 6px; padding: 3px; }
.seg button { border-radius: 4px; }
.seg button.on { box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.pchip { border-radius: 6px; }
.switch input:checked + span { background: var(--brand); }
.progress > i { background: var(--brand); }

/* ---------- tables ---------- */
.tablewrap { border-radius: var(--radius); box-shadow: none; border: 1px solid var(--line); }
th { background: var(--soft); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 9px 14px; color: var(--ink2); }
td { padding: 10px 14px; }
tr.click:hover td { background: var(--soft); }

/* ---------- overlays ---------- */
#drawer { border-radius: 0; box-shadow: var(--shadow-lg); }
#drawer-bg { background: rgba(20, 20, 18, .4); }
#drawer .dh, #drawer .db { padding: 18px 22px; } #drawer .df { padding: 14px 22px; }
.toast { background: #1d1d1b; color: #fff; border: 0; border-radius: 6px; box-shadow: var(--shadow-lg); }
.toast.err { background: #8c1d1d; } .toast.ok { background: #1f5c3b; }
.taskrow { border-radius: 6px; }
.avatar { box-shadow: none; }
.empty .big { font-size: 0; height: 0; margin: 0; }
.empty { padding: 36px 20px; }
.empty .big::before { content: ""; }

/* ---------- motion: feedback, state, continuity ---------- */
/* a new view settles in; nothing waits on it */
#page > * { animation: settle .22s var(--ease-out) both; }
@keyframes settle { from { opacity: 0; transform: translateY(4px); } }
/* a list appearing as a list: first rows step in, total delay capped */
tbody tr { animation: settle .26s var(--ease-out) both; }
tbody tr:nth-child(1) { animation-delay: 0ms; } tbody tr:nth-child(2) { animation-delay: 22ms; } tbody tr:nth-child(3) { animation-delay: 44ms; }
tbody tr:nth-child(4) { animation-delay: 66ms; } tbody tr:nth-child(5) { animation-delay: 88ms; } tbody tr:nth-child(6) { animation-delay: 110ms; }
tbody tr:nth-child(7) { animation-delay: 132ms; } tbody tr:nth-child(8) { animation-delay: 154ms; } tbody tr:nth-child(n+9) { animation-delay: 176ms; }
/* the row you just changed is marked once, then fades */
tr.flash td { animation: flashrow 1.8s var(--ease-out) both; }
@keyframes flashrow { 0% { background: color-mix(in srgb, var(--brand) 20%, var(--card)); } 100% { background: transparent; } }
.progress > i { transition: width .7s var(--ease-out); }
/* hover never moves the element under the pointer */
.card, .stat, tr.click td, .nav a, .team-pill, .seg button { transition: background .15s, border-color .15s, color .15s; }
.seg button { transition: background .18s var(--ease-out), color .15s, box-shadow .18s; }
/* overlays: arrive with confidence, leave quickly */
#drawer { transition: transform .3s var(--ease-out); }
#drawer:not(.open) { transition-duration: .2s; transition-timing-function: var(--ease-in); }
#drawer-bg { transition: opacity .25s var(--ease-out); }
.toast { animation: toastin .28s var(--ease-out) both; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.switch span, .switch span::after { transition: background .18s var(--ease-out), transform .22s var(--ease-out); }
.sidebar { transition: transform .28s var(--ease-out); }
/* browser surfaces carry the palette too */
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; }
input, textarea { caret-color: var(--brand); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.btn:focus-visible, .nav a:focus-visible, .seg button:focus-visible, .iconbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- loading ---------- */
.skel { display: grid; gap: 14px; }
.skel > div { border-radius: var(--radius); background: var(--soft); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- sign-in ---------- */
.authsplit { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.authbrand { display: none; }
.authside { width: 100%; display: grid; place-items: center; }
.authmobile-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.authmobile-logo .logoplate img { height: 32px; }
.authcard { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 28px; }
.authcard h1 { font-size: 20px; margin: 0 0 4px; }
.authcard .logo { display: none; }
.authwrap { background: var(--bg); }
.err-text { min-height: 22px; }
.splash { display: grid; justify-items: center; gap: 16px; padding: 10px 0; }
.splash .bar { width: 120px; height: 3px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.splash .bar i { display: block; height: 100%; width: 40%; background: var(--brand); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .topnav { padding: 0 12px; gap: 10px; }
  .topnav .menu { display: grid; }
  .prod, .me span:last-child { display: none; }
  .sidebar { width: 280px; }
  .main { padding: 18px 14px 80px; }
  .hero { padding: 16px; }
}
@media (max-width: 640px) { .hide-sm { display: none; } .topnav .btn.sm { padding: 6px 10px; } }
/* reduced motion: no travel or stagger; colour and state changes stay, quickly */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; scroll-behavior: auto !important; }
  #drawer, .sidebar { transition-duration: .01ms !important; }
  tr.flash td { animation: flashrow-static 1.8s linear both !important; animation-duration: 1.8s !important; }
  @keyframes flashrow-static { 0%, 70% { background: color-mix(in srgb, var(--brand) 16%, var(--card)); } 100% { background: transparent; } }
}
.seg button .ico-svg { display: block; width: 16px; height: 16px; }

/* People: hierarchy rows keep the name readable and let the controls wrap below it */
.tree-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tree-row > .grow { flex: 1 1 210px; min-width: 0; overflow-wrap: anywhere; }
.tree-row > .grow b { overflow-wrap: normal; }
.tree-ctl { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; flex: 1 1 340px; min-width: 0; }
.tree-ctl select { flex: 1 1 0; width: auto; min-width: 90px; max-width: none; text-overflow: ellipsis; }
.tree-ctl .iconbtn { flex: none; width: auto; padding: 6px 10px; }

/* Post form: "filled from your last standup" strip */
.prefill { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 4px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line)); font-size: 13.5px; color: var(--ink2); }
.prefill span { flex: 1; }
.prefill.quiet { background: var(--soft); border-color: var(--line); }

/* ---------- project picker (standup form): search, tags, create on the spot ---------- */
.pp-box { position: relative; }
.pp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-height: 42px; cursor: text; }
.pp-tags:focus-within { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.ptag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); font-weight: 650; font-size: 13.5px; }
.ptag-x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.ptag-x:hover { background: color-mix(in srgb, var(--c) 25%, transparent); color: var(--ink); }
.ptag-x .ico-svg { width: 13px; height: 13px; }
.pp-tags input.pp-q { flex: 1 1 160px; min-width: 120px; border: 0; outline: 0; box-shadow: none; background: transparent; padding: 6px 4px; }
.pp-tags input.pp-q:focus { outline: 0; box-shadow: none; }
.pp-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; }
.pp-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 550; }
.pp-opt.on { background: color-mix(in srgb, var(--brand) 12%, var(--card)); }
.pp-opt mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.pp-opt.add { color: color-mix(in srgb, var(--brand) 80%, var(--ink)); border-top: 1px solid var(--line); margin-top: 4px; }
.pp-opt.add .ico-svg { width: 16px; height: 16px; }
.pp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.pp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-none, .pp-more { padding: 10px; color: var(--muted); font-size: 13px; }
.pp-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.plist { max-height: 420px; overflow-y: auto; padding-right: 4px; }

/* ---------- hierarchy as a graph ---------- */
.orgchart { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.oc-view { overflow: auto; max-height: 68vh; min-height: 280px; background-image: radial-gradient(color-mix(in srgb, var(--muted) 30%, transparent) 1px, transparent 1px); background-size: 22px 22px; cursor: grab; }
.oc-view.grab { cursor: grabbing; user-select: none; }
.oc-stage { position: relative; }
.oc-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.oc-canvas svg { position: absolute; left: 0; top: 0; overflow: visible; }
.oc-canvas path { fill: none; stroke: color-mix(in srgb, var(--muted) 60%, transparent); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ocdraw .7s var(--ease-out, ease-out) forwards; animation-delay: calc(var(--d) * 110ms + 140ms); }
@keyframes ocdraw { to { stroke-dashoffset: 0; } }
.ocn { position: absolute; width: 208px; animation: ocpop .45s var(--ease-out, ease-out) both; animation-delay: calc(var(--d) * 110ms); }
@keyframes ocpop { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.oc-card { position: relative; display: flex; align-items: center; gap: 10px; height: 86px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: var(--shadow); cursor: pointer; transition: box-shadow .2s, border-color .15s; }
.oc-card:hover { box-shadow: var(--shadow-lg); border-color: var(--c); }
.oc-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.oc-card .avatar { width: 40px; height: 40px; font-size: 14px; }
.oc-who { display: grid; min-width: 0; line-height: 1.25; }
.oc-who b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-who span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-st { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--ink2) !important; font-weight: 600; }
.oc-st i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.oc-n { position: absolute; right: -8px; bottom: -8px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 700; border: 2px solid var(--card); }
.oc-tools { position: absolute; z-index: 5; top: 10px; right: 12px; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.oc-tools button { min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--ink2); font-weight: 700; cursor: pointer; }
.oc-tools button:hover { background: var(--soft); color: var(--ink); }
.oc-z { min-width: 44px; text-align: center; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.oc-hint { padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .oc-canvas path { stroke-dashoffset: 0; animation: none; } .ocn { animation: none; } }

/* ---------- sidebar card: fills the space under the menu with something useful ---------- */
#side-card:empty { display: none; }
.sc { margin: 8px 2px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); display: grid; gap: 10px; }
.sc-hi { font-family: var(--display, inherit); font-weight: 800; font-size: 15px; letter-spacing: -.02em; line-height: 1.2; }
.sc-state { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 13.5px; line-height: 1.4; }
.sc-state.ok { color: color-mix(in srgb, #16a34a 75%, var(--ink)); font-weight: 600; }
.sc-state .ico-svg { width: 17px; height: 17px; flex: none; }
.sc-cta { width: 100%; justify-content: center; margin-top: -2px; }
.sc-streak { display: grid; gap: 7px; font-size: 13px; color: var(--ink2); }
.sc-streak b { font-family: var(--display, inherit); font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; margin-right: 2px; }
.sc-week { display: flex; gap: 5px; }
.sc-week i { flex: 1; height: 14px; border-radius: 4px; background: var(--soft); border: 1.5px solid transparent; }
.sc-week i.posted { background: var(--brand); }
.sc-week i.leave { background: transparent; border: 1.5px dashed var(--muted); }
.sc-week i.today { border-color: var(--brand); background: transparent; }
.sc-week i.missed { background: color-mix(in srgb, var(--muted) 22%, var(--soft)); }
.sc-team { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sc-bar { height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.sc-bar i { display: block; height: 100%; border-radius: 6px; background: var(--brand); transition: width .6s var(--ease-out, ease-out); }
