:root {
  color-scheme: light;
  --bg: #f6f8f7; --paper: #fff; --ink: #192d2b; --muted: #5e706d;
  --teal: #12675e; --deep: #0b554e; --line: #dde5e2; --warn: #a43a34;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none; -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.4; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid #369b8b; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar, .crumb { display: none; }
.workspace { min-width: 0; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 4; }
.brand { display: inline-flex; align-items: center; gap: 9px; width: fit-content; }
.brand img { flex: none; }
.brand span, .profile-copy { display: grid; gap: 2px; }
.brand strong { font-size: 15px; letter-spacing: -.55px; font-weight: 710; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 10px; }
.identity { position: relative; }
.profile { display: flex; align-items: center; gap: 8px; min-height: 44px; border-radius: 12px; }
.profile .icon { width: 15px; height: 15px; color: var(--muted); }
.profile-copy { display: none; text-align: left; }
.profile-copy strong { font-size: 13px; font-weight: 620; }
.profile-copy small { font-size: 11px; color: var(--muted); }
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; width: min(302px, calc(100vw - 26px)); padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 14px 46px #193a3326; max-height: min(510px, 74dvh); overflow: auto; }
.menu-heading { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.person-choice { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; min-height: 46px; padding: 6px 8px; border-radius: 9px; font-size: 13px; }
.person-choice:hover, .person-choice[aria-pressed="true"] { background: #edf5f2; }
.person-choice .icon { margin-left: auto; width: 16px; color: var(--teal); }
main { max-width: 1440px; margin: 0 auto; padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
main:focus { outline: none; }
.hero { overflow: hidden; isolation: isolate; position: relative; border: 1px solid #135c54; border-radius: 18px; background: linear-gradient(110deg, #0d4f49 0%, #115c54 50%, #27766a 100%); color: white; padding: 18px 19px; }
.hero::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 49%; background: url("/optics.svg") 47% center / auto 108% no-repeat; opacity: .67; z-index: -1; mask-image: linear-gradient(90deg, transparent, black 40%); }
.hero-date { display: flex; align-items: center; gap: 7px; color: #d4e9e3; font-size: 11px; font-weight: 520; }
.hero-date .icon { width: 14px; height: 14px; }
h1 { font-size: clamp(26px, 4.1vw, 40px); line-height: 1.14; letter-spacing: -.048em; font-weight: 640; }
.hero h1 { margin: 9px 0 12px; }
.hero-link { width: fit-content; display: inline-flex; align-items: center; gap: 10px; min-height: 32px; border-bottom: 1px solid #9cd6c484; color: #ecfff8; font-size: 12px; font-weight: 530; }
.hero-link .icon { width: 15px; height: 15px; }
.hero-link:hover { border-color: #fff; }
.kpi-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
.kpi, .person-card, .surface, .metric { border: 1px solid var(--line); background: var(--paper); box-shadow: 0 2px 4px #21362c04; }
.kpi { padding: 12px 10px 10px; border-radius: 13px; min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 550; }
.kpi-label .icon { width: 14px; height: 14px; color: var(--tone); }
.kpi-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 7px; }
.kpi strong, .metric strong { font-variant-numeric: tabular-nums; font-size: 29px; font-weight: 600; line-height: 1.08; letter-spacing: -.055em; }
.tone-teal { --tone: #248276; --bar: #78afa3; }
.tone-blue { --tone: #57749d; --bar: #9cb4cf; }
.tone-red { --tone: #b25046; --bar: #d3a09b; }
.tone-red strong { color: var(--warn); }
.mini-chart { display: none; width: 70px; height: 25px; fill: var(--bar); }
.section-head, .page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 13px; }
.section-head h2, .group-title { display: flex; align-items: center; gap: 9px; }
h2 { font-size: 21px; font-weight: 640; letter-spacing: -.04em; line-height: 1.25; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 23px; height: 22px; padding: 0 6px; background: #e9eeeb; color: #576b64; border-radius: 7px; font-weight: 600; font-size: 12px; letter-spacing: 0; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border-radius: 10px; padding: 0 13px; background: var(--teal); color: white; font-weight: 575; font-size: 13px; box-shadow: 0 1px 3px #214c4020; }
.primary:hover { background: var(--deep); }
.primary .icon, .secondary .icon { width: 16px; height: 16px; }
.secondary { background: var(--paper); border: 1px solid var(--line); color: var(--teal); }
.people-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.person-card { padding: 14px 12px 11px; border-radius: 15px; position: relative; display: flex; flex-direction: column; min-width: 0; transition: border-color .16s, box-shadow .16s; }
.person-card:hover, .person-card:focus-within { border-color: #a5c2b8; box-shadow: 0 4px 14px #2b4c4210; }
.person-link { display: block; }
.person-link::after { content: ""; position: absolute; inset: 0; border-radius: 15px; }
.person-top { display: flex; align-items: flex-start; justify-content: space-between; }
.person-top > .icon { width: 15px; height: 15px; color: #93a29c; }
.avatar { width: 41px; height: 41px; display: inline-grid; place-content: center; flex: none; border-radius: 13px; font-size: 15px; letter-spacing: -.045em; font-weight: 650; background: var(--avatar-bg); color: var(--avatar-ink); }
.avatar.small { width: 31px; height: 31px; font-size: 11px; border-radius: 10px; }
.mint { --avatar-bg: #dcefe5; --avatar-ink: #276f54; }
.lilac { --avatar-bg: #eae4f5; --avatar-ink: #785897; }
.blue { --avatar-bg: #e0eaf7; --avatar-ink: #496e9a; }
.peach { --avatar-bg: #fae5d8; --avatar-ink: #9c6241; }
.pink { --avatar-bg: #f4e0e9; --avatar-ink: #935371; }
.aqua { --avatar-bg: #d8edee; --avatar-ink: #336c72; }
.sand { --avatar-bg: #f4ebcc; --avatar-ink: #8a7035; }
.slate { --avatar-bg: #e2e6ef; --avatar-ink: #576881; }
.person-card h3 { margin: 11px 0 12px; font-size: clamp(14px, 2.8vw, 17px); line-height: 1.25; letter-spacing: -.035em; font-weight: 640; min-height: 2.5em; overflow-wrap: anywhere; }
.counts { margin: auto 0 10px; display: grid; gap: 4px; font-size: 12px; }
.counts div { display: flex; justify-content: space-between; align-items: center; gap: 3px; }
.counts dt { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.counts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #5f9b88; }
.late .dot { background: #c7776e; }
.late dd { color: var(--warn); }
.none .dot { background: #b9c6c0; }
.none dd { color: var(--muted); }
.assign { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; border: 1px solid #dce5e0; border-radius: 9px; font-size: 13px; font-weight: 560; color: #375e53; background: #fbfcfb; }
.assign:hover, .secondary:hover { background: #edf5f1; border-color: #b7cfc4; }
.assign .icon { width: 15px; height: 15px; }
.bottom-nav { position: fixed; bottom: 0; z-index: 3; width: 100%; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fffffff7; backdrop-filter: blur(16px); }
.nav-link { display: flex; align-items: center; gap: 10px; color: #577069; font-size: 14px; font-weight: 520; border-radius: 9px; }
.bottom-nav .nav-link { flex-direction: column; gap: 4px; justify-content: center; min-height: 52px; font-size: 10px; }
.nav-link[aria-current="page"] { color: var(--deep); background: #e4f0e9; font-weight: 650; }
.nav-link:hover { background: #eff5f1; }
.nav-count { margin-left: auto; color: var(--muted); background: #eef2ef; padding: 1px 7px; border-radius: 6px; font-size: 11px; }
.bottom-nav .nav-count { display: none; }
.page-head { margin-top: 6px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(27px, 3.7vw, 36px); }
.page-head p, .author-line { color: var(--muted); margin-top: 6px; font-size: 13px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 13px; color: var(--teal); }
.back-link .icon { width: 15px; height: 15px; }
.person-heading { display: flex; gap: 12px; align-items: center; min-width: 0; }
.person-heading .avatar { width: 50px; height: 50px; font-size: 18px; }
.task-group { margin: 22px 0; }
.group-title { font-size: 17px; margin-bottom: 10px; }
.group-title .dot { width: 8px; height: 8px; }
.dot.overdue { background: #c65e53; }
.dot.today { background: #7895b8; }
.dot.future { background: #75998d; }
.dot.done { background: #439568; }
.surface { border-radius: 16px; overflow: hidden; }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 14px; }
.task-row + .task-row { border-top: 1px solid var(--line); }
.task-content { flex: 1; min-width: 0; }
.task-content h3 { font-size: 15px; line-height: 1.45; font-weight: 560; overflow-wrap: anywhere; white-space: pre-line; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .icon { width: 14px; height: 14px; }
.task-meta .overdue { color: var(--warn); }
.status-check { display: grid; place-content: center; width: 44px; height: 44px; flex: none; margin: -7px -6px -4px -8px; border-radius: 9px; }
.check-box { display: grid; place-content: center; border: 1.5px solid #aabeb6; border-radius: 6px; width: 21px; height: 21px; }
.status-check:hover { background: #f0f7f2; }
.status-check[aria-pressed="true"] .check-box { color: #fff; background: #41825c; border-color: #41825c; }
.check-box .icon { width: 15px; height: 15px; stroke-width: 2.3; }
.badge { flex: none; border-radius: 6px; padding: 3px 7px; font-size: 11px; font-weight: 580; }
.badge.overdue { background: #f9e6e2; color: #a3453a; }
.badge.today { background: #e7eff7; color: #506f91; }
.badge.future { background: #ecf2ee; color: #4c6e5e; }
.badge.done { background: #e1f0e4; color: #327146; }
.completed-text { color: #466052; }
.empty { padding: 22px; color: var(--muted); font-size: 14px; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.metric { padding: 15px; border-radius: 14px; }
.metric-label { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 13px; }
.metric-label .icon { width: 16px; height: 16px; color: var(--tone,var(--teal)); }
.metric strong { display: block; margin-top: 12px; font-size: clamp(25px, 3.2vw, 37px); }
.metric p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.analytics-detail { display: grid; gap: 10px; margin-top: 10px; }
.chart-panel { padding: 18px; margin-top: 17px; }
.chart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; margin-bottom: 10px; }
.chart-heading small { font-size: 12px; color: var(--muted); }
.chart-row { display: grid; grid-template-columns: 1fr 30px; align-items: center; gap: 3px 9px; padding: 7px 0; font-size: 13px; }
.chart-row b { text-align: right; font-variant-numeric: tabular-nums; }
.chart-row progress { grid-row: 2; grid-column: 1/-1; display: block; width: 100%; height: 8px; border: none; appearance: none; border-radius: 5px; overflow: hidden; color: #5c9c87; background: #ecf2ee; }
progress::-webkit-progress-bar { background: #ecf2ee; }
progress::-webkit-progress-value { background: #5c9c87; border-radius: 5px; }
progress::-moz-progress-bar { background: #5c9c87; border-radius: 5px; }
dialog { width: min(430px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 21px; color: var(--ink); box-shadow: 0 24px 90px #173d332f; }
dialog::backdrop { background: #122b2870; backdrop-filter: blur(3px); }
body:has(dialog[open]) { overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.modal-icon, .icon-btn { display: grid; place-content: center; width: 40px; height: 40px; border-radius: 12px; }
.modal-icon { color: var(--teal); background: #e4f1ea; }
.icon-btn { width: 44px; height: 44px; color: var(--muted); }
.icon-btn:hover { background: var(--bg); }
dialog h2 { font-size: 26px; }
dialog label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; }
.field-note { color: var(--muted); font-weight: 400; font-size: 11px; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; border: 1px solid #cbd9d2; border-radius: 9px; background: #fff; padding: 10px 11px; font-size: 16px; }
textarea { display: block; resize: vertical; }
input[type="date"] { display: block; -webkit-appearance: none; }
.submit { width: 100%; margin-top: 20px; }
.form-error { color: var(--warn); font-size: 13px; margin-top: 10px; }
.toast { position: fixed; bottom: calc(75px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); z-index: 8; padding: 12px 18px; background: #183e34; color: white; font-size: 13px; border-radius: 11px; box-shadow: 0 4px 20px #244c3d20; }
.toast:empty { display: none; }
.retry { margin-top: 12px; }
@media (min-width: 360px) and (max-width: 519px) {
  .profile-copy { display: block; max-width: 98px; }
  .profile-copy strong { display: block; font-size: 12px; line-height: 1.2; }
  .profile-copy small { display: none; }
}
@media (max-width: 355px) {
  main { padding-left: 10px; padding-right: 10px; }
  .kpi { padding: 10px 7px; }
  .kpi-label { gap: 4px; font-size: 11px; }
  .section-head { gap: 7px; }
  .primary { padding: 0 10px; }
}
@media (min-width: 520px) {
  main { padding: 22px 24px 95px; }
  .topbar { padding: 0 24px; }
  .profile-copy, .mini-chart { display: block; }
  .profile-copy small { display: block; }
  .hero { padding: 24px 26px; }
  .hero::after { opacity: .95; }
  .kpi-grid, .people-grid { gap: 14px; }
  .kpi { padding: 14px 17px; }
  .kpi-label { font-size: 13px; }
  .person-card { padding: 17px; }
  .analytics-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .analytics-detail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chart-row { grid-template-columns: minmax(150px, 1.1fr) 2fr 26px; gap: 12px; min-height: 39px; }
  .chart-row progress { grid-column: 2; grid-row: 1; }
  .chart-row b { grid-column: 3; }
}
@media (min-width: 800px) and (min-height: 540px), (min-width: 800px) and (hover: hover) and (pointer: fine) {
  :root { --rail: 206px; }
  .workspace { margin-left: var(--rail); }
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--rail); padding: 26px 14px 20px; background: #fdfefd; border-right: 1px solid var(--line); }
  .sidebar .brand { margin: 0 4px; gap: 10px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 11px; }
  .nav-list { display: grid; gap: 5px; margin-top: 43px; }
  .nav-list .nav-link { padding: 0 13px; min-height: 43px; }
  .nav-list .icon { width: 18px; height: 18px; }
  .demo-panel { margin: auto 6px 0; border-top: 1px solid var(--line); padding: 18px 4px 0; display: flex; align-items: flex-start; gap: 9px; }
  .demo-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #598e77; box-shadow: 0 0 0 3px #e7f2eb; }
  .demo-panel strong, .demo-panel small { display: block; font-weight: 540; font-size: 12px; }
  .demo-panel small { color: var(--muted); margin-top: 2px; font-size: 11px; font-weight: 400; }
  .mobile-brand, .bottom-nav { display: none; }
  .topbar { min-height: 70px; padding: 0 28px; }
  .crumb { display: flex; gap: 13px; align-items: center; color: var(--muted); font-size: 12px; }
  .crumb .icon { width: 16px; height: 16px; color: #83938b; }
  .crumb b { font-weight: 560; color: var(--ink); }
  .slash { color: #aab7b0; }
  .profile { gap: 10px; padding: 2px 4px; }
  main { padding: 24px 28px 36px; }
  .hero { padding: 21px 27px; border-radius: 19px; }
  .hero::after { width: 50%; background-size: auto 118%; background-position: center; }
  .hero-date { font-size: 12px; }
  .hero h1 { margin: 10px 0 11px; }
  .kpi-grid { margin-top: 14px; }
  .kpi { padding: 15px 18px; }
  .kpi-label { gap: 8px; }
  .kpi-label .icon { width: 17px; height: 17px; }
  .kpi strong { font-size: 33px; }
  .section-head { margin: 26px 0 15px; }
  h2 { font-size: 23px; }
  .person-card { padding: 17px 17px 14px; }
  .avatar { width: 44px; height: 44px; font-size: 16px; }
  .person-card h3 { font-size: 16px; }
  .counts { font-size: 13px; gap: 5px; margin-bottom: 13px; }
  .toast { bottom: 24px; }
}
@media (min-width: 990px) and (max-width: 1159px) {
  .people-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1160px) {
  :root { --rail: 216px; }
  main { padding: 26px 32px 40px; }
  .topbar { padding: 0 32px; }
  .people-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .hero { padding: 23px 29px; }
  .hero::after { width: 46%; background-size: auto 127%; }
  .people-grid, .kpi-grid { gap: 15px; }
  .section-head { margin-top: 26px; }
}
@media (min-width: 1440px) {
  :root { --rail: 234px; }
  .sidebar { padding-inline: 19px; }
  .hero { padding: 26px 33px; }
  .person-card { padding: 20px 20px 17px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Account screens reuse the existing controls, colours and typography. */
body[data-session="closed"] > :is(.workspace,.sidebar,.bottom-nav) { display: none; }
body[data-session="open"] > .auth-screen { display: none; }
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 18px; }
.auth-card { padding: 26px; width: min(100%, 400px); }
.auth-card .brand { margin-bottom: 24px; }
.auth-card h1 { font-size: 27px; }
.credential-form label { display: grid; gap: 5px; margin: 13px 0 0; font-size: 13px; font-weight: 600; }
.credential-form .check-line { display: flex; align-items: center; gap: 9px; min-height: 42px; }
.check-line input { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); }
.credential-form .secondary { width: 100%; margin-top: 8px; }
#temporary-value { display: block; overflow-wrap: anywhere; user-select: all; margin: 16px 0; font-family: monospace; }
body[data-access="employee"] .bottom-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
