:root {
    color-scheme: light;
    --canvas: #edf2f6;
    --white: #fff;
    --ink: #172934;
    --muted: #526675;
    --line: #d9e3ea;
    --navy: #112a3b;
    --navy-active: #26485a;
    --teal: #076b63;
    --teal-dark: #05554f;
    --teal-light: #e0f2ee;
    --danger: #a42e2e;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 100%;
    line-height: 1.45;
    color: var(--ink);
    background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
a { color: var(--teal-dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -.045em; line-height: 1.12; }
h2 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #0c8f91; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.workspace { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 2.1rem; align-self: start; min-height: 100vh; position: sticky; top: 0; padding: 1.5rem 1rem; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 0 .25rem; }
.mark { min-width: 2.55rem; height: 2.55rem; border-radius: .65rem; display: grid; grid-auto-flow: column; align-items: center; place-content: center; background: #a8e6db; color: #103b3c; font-weight: 850; letter-spacing: -.08em; }
.mark span { font-size: .7em; padding: 0 .06em; }
.brand strong, .identity strong { display: block; font-size: .875rem; line-height: 1.25; }
.brand small, .identity small { display: block; color: #b4cbd6; font-size: .8rem; margin-top: .2rem; }
.sidebar nav { display: grid; gap: .32rem; }
.sidebar nav a { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #d8e7ee; padding: .72rem .8rem; border-radius: .55rem; font-size: .95rem; font-weight: 620; }
.sidebar nav a:hover { background: #1b394b; }
.sidebar nav a[aria-current] { background: var(--navy-active); color: #fff; box-shadow: inset 3px 0 #a8e6db; }
.nav-symbol { position: relative; width: 1rem; height: 1rem; flex: none; border: 1.5px solid currentColor; border-radius: .18rem; }
.nav-symbol::after { content: ""; position: absolute; left: .15rem; right: .15rem; top: .3rem; border-top: 1.5px solid currentColor; }
.nav-symbol.billing { border-radius: 50%; }
.nav-symbol.billing::after { content: "$"; inset: -.13rem 0 0; text-align: center; border: 0; font-size: .7rem; }
.nav-symbol.projects { height: .75rem; }
.nav-symbol.projects::after { left: 0; right: auto; top: -.28rem; width: .45rem; height: .2rem; border: 1px solid currentColor; border-bottom: 0; border-radius: .1rem .1rem 0 0; }
.nav-symbol.staff { border-radius: 50% 50% .2rem .2rem; height: .5rem; margin-top: .5rem; }
.nav-symbol.staff::after { left: .25rem; right: auto; top: -.68rem; width: .38rem; height: .38rem; border: 1px solid currentColor; border-radius: 50%; }
.identity { margin-top: auto; padding: 1rem .25rem 0; border-top: 1px solid #365060; display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: center; }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #2e5364; font-size: .75rem; font-weight: 750; }
.identity form { grid-column: 2; }
.signout, .text-button { border: 0; padding: 0; background: transparent; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; font-size: .875rem; font-weight: 650; }
.signout { color: #c0d8e4; }
.text-button { color: var(--danger); }

.main { width: min(100%, 87rem); padding: clamp(1rem, 3vw, 2.75rem); display: grid; gap: 1.1rem; align-content: start; margin: 0 auto; }
.page-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.page-head { min-height: 4.7rem; }
.page-head p { color: var(--muted); margin-top: .4rem; }
.sep { padding: 0 .4em; color: #6d8795; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; box-shadow: 0 1px 2px #182b3510; }
.section-head { padding: .9rem 1.1rem; min-height: 3.6rem; }
.section-head p { color: var(--muted); margin-top: .3rem; }
.week-toolbar { padding: .85rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.period > strong { font-size: 1.13rem; letter-spacing: -.02em; white-space: nowrap; }
.week-nav, .week-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
.billing-filters { padding: .95rem 1.05rem; }
.billing-filters label:first-of-type { min-width: 12rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.metric { border-radius: .7rem; border: 1px solid #c8dce3; padding: .8rem 1rem; background: #f8fcfd; min-width: 0; }
.metric:first-child { background: #e1f2ee; border-color: #b7dcd2; }
.metric > span { display: block; font-size: .875rem; color: #37535c; font-weight: 650; }
.metric > strong { display: block; font-size: clamp(1.3rem, 3vw, 2.05rem); font-variant-numeric: tabular-nums; line-height: 1.12; margin-top: .24rem; letter-spacing: -.045em; overflow-wrap: anywhere; }
.metric small { font-size: .6em; color: #4b6a73; }
.status { padding: .24rem .7rem; display: inline-flex; font-size: .875rem; font-weight: 720; background: #e0e9f3; color: #294661; border-radius: 1rem; white-space: nowrap; }
.status.approved { background: var(--teal-light); color: #12534c; }
.status.submitted, .status.pending { background: #fff1ce; color: #654600; }

label { display: grid; min-width: 0; gap: .3rem; font-size: .875rem; font-weight: 670; color: #344c59; }
input, select, textarea { min-width: 0; width: 100%; padding: .48rem .62rem; border: 1px solid #aebfc9; border-radius: .4rem; background: white; color: var(--ink); font-weight: 450; min-height: 2.4rem; }
textarea { resize: vertical; }
select { padding-right: 2rem; appearance: none; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5l4 4 4-4' fill='none' stroke='%23405b68' stroke-width='1.5'/%3E%3C/svg%3E") right .65rem center / .875rem no-repeat; }
.button, .primary { border: 1px solid #b6c8d0; background: white; border-radius: .45rem; color: #244654; padding: .48rem .72rem; min-height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; font-size: .875rem; text-align: center; cursor: pointer; }
.button:hover { background: #edf6f7; }
.primary { border-color: var(--teal); background: var(--teal); color: white; }
.primary:hover { background: var(--teal-dark); }
.entry-grid, .settings-form { display: grid; grid-template-columns: 10rem minmax(0, 1fr) 6rem; align-items: end; gap: .75rem; padding: 0 1.1rem 1.1rem; }
.entry-grid .notes { grid-column: span 2; }
.entry-grid button { justify-self: end; white-space: nowrap; }
.settings-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-form button { justify-self: start; }

.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .56rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
th { font-size: .875rem; white-space: nowrap; }
td { font-size: .925rem; color: var(--muted); }
thead { background: #f2f6f9; color: #3d5866; }
tbody th { color: var(--ink); font-weight: 675; }
tr.has-time td { color: var(--ink); background: #f1faf8; }
tr.has-time th { background: #f1faf8; }
.code { white-space: nowrap; margin-left: .25rem; }
.description { width: 48%; min-width: 12rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; white-space: nowrap; font-weight: 650; }
.add-ctr { white-space: nowrap; }
.subcell { display: block; color: var(--muted); font-size: .83rem; }
.empty { padding: 1.4rem 1rem; color: var(--muted); }
.recent-row { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: .65rem; padding: .65rem 1rem; border-top: 1px solid var(--line); text-decoration: none; }
.recent-row:hover { background: #eff7f7; }
.recent-row > span:nth-child(2) { color: var(--muted); font-size: .875rem; }

details > summary { cursor: pointer; list-style-position: inside; font-weight: 680; }
.disclosure summary { padding: .9rem 1.1rem; }
.catalog { border-top: 1px solid var(--line); }
.catalog summary { padding: .75rem 1.1rem; }
.catalog summary span { color: var(--muted); font-size: .875rem; margin-left: .65rem; }
.catalog summary:hover { background: #f4f8fa; }
.notice { border-radius: .55rem; padding: .68rem .95rem; color: #104c44; background: #e5f5ed; border: 1px solid #b5dcce; font-weight: 600; }
.notice.error { background: #fce8e7; color: #792628; border-color: #ecc1bd; }
.guest { display: grid; place-items: center; min-height: 100vh; background: var(--navy); padding: 1rem; }
.login-wrap { width: min(100%, 28rem); display: grid; gap: .75rem; }
.login { padding: clamp(1.3rem, 4vw, 2.35rem); }
.login .mark { width: 2.55rem; margin-bottom: 1.1rem; }
.login h1 { font-size: 1.9rem; }
.stack { display: grid; gap: .9rem; margin-top: 1.45rem; }

@media (max-width: 920px) {
    .workspace { grid-template-columns: 12.5rem minmax(0, 1fr); }
    .sidebar { padding-inline: .65rem; }
}
@media (max-width: 690px) {
    .workspace { display: block; }
    .sidebar { position: static; min-height: 0; gap: .55rem; display: grid; grid-template-columns: 1fr auto; padding: .75rem .8rem; }
    .sidebar nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; }
    .sidebar nav a { gap: .35rem; font-size: .875rem; padding: .55rem; }
    .identity { padding: 0; border: 0; display: block; align-self: center; margin: 0; }
    .identity > :not(form) { display: none; }
    .main { padding: .9rem; }
    .settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entry-grid { grid-template-columns: 1fr 1fr; }
    .entry-grid label:nth-of-type(2) { grid-column: 1 / -1; grid-row: 2; }
    .entry-grid .notes { grid-column: 1 / -1; }
    .entry-grid button { grid-column: 1 / -1; }
    .daily-record table, .daily-record tbody { display: block; }
    .daily-record thead { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .daily-record tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .65rem; padding: .6rem .85rem; border-top: 1px solid var(--line); }
    .daily-record tr.has-time { background: #f1faf8; }
    .daily-record th, .daily-record td { min-width: 0; padding: 0; border: 0; }
    .daily-record .description { width: auto; grid-column: 1 / -1; grid-row: 3; }
    .daily-record .numeric { grid-column: 2; grid-row: 1; }
    .daily-record .has-time .numeric::after { content: " h"; }
    .daily-record .no-print { grid-column: 2; grid-row: 2; }
    .daily-record tr:not(.has-time) td:not(.numeric) { display: none; }
    .daily-record tr:not(.has-time):has(.add-ctr) .numeric { display: none; }
    .daily-record tr:not(.has-time) td:has(.add-ctr) { display: block; grid-row: 1; }
    .metric { padding: .55rem .45rem; }
    .filters label { flex: 1 1 8rem; }
    th, td { padding-inline: .6rem; }
}
@media print {
    .sidebar, .week-toolbar, .week-actions, .capture, .recent, .no-print, .notice { display: none !important; }
    .workspace, .main { display: block; background: white; padding: 0; }
    .page-head, .metrics { margin-bottom: 1rem; }
    .panel { box-shadow: none; }
}

[hidden] { display: none !important; }
.project-picker { display: grid; min-width: 0; gap: .55rem; }
.entry-grid { align-items: end; }
.catalog-filter { padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
.panel > .settings-form:first-child { padding-top: 1.1rem; }
.project-details { padding: .95rem 1.1rem; display: grid; gap: .55rem; border-top: 1px solid var(--line); }
.project-details .settings-form { padding: 0; }
.table-wrap caption { padding: .8rem 1.1rem; text-align: left; font-weight: 700; }
@media (max-width: 690px) {
    .entry-grid .project-picker { grid-column: 1 / -1; grid-row: 2; }
    .entry-grid > label:nth-of-type(2) { grid-column: 2; grid-row: 1; }
}

.period-fields { grid-column: 1 / -1; padding: 0; margin: 0; border: 0; display: flex; gap: .65rem; flex-wrap: wrap; align-items: end; }
.period-fields label { min-width: min(100%, 10rem); }
.period-fields p { flex-basis: 100%; font-size: .875rem; color: var(--muted); }
.budget-indicator { font-size: .875rem; color: var(--muted); margin: 0; }
.budget-indicator[data-level="50"], .budget-indicator[data-level="80"] { color: #744700; font-weight: 650; }
.notice.warning { color: #654600; background: #fff5da; border-color: #e7ca83; }
