:root {
  color-scheme: light dark;
  font: 16px/1.5 system-ui, sans-serif;
  color: light-dark(#201b32, #efedf7);
  background: light-dark(#f7f7fb, #14121c);
  --surface: light-dark(#fff, #211e2c);
  --surface-alt: light-dark(#faf9fd, #282434);
  --muted: light-dark(#625e73, #bbb5ca);
  --border: light-dark(#e6e3ef, #3c374c);
  --input-border: light-dark(#dcd7e9, #57506a);
  --accent: #6246db;
  --highlight: light-dark(#5840bd, #beadff);
  --accent-surface: light-dark(#efebff, #30254f);
  --accent-border: light-dark(#e1d8ff, #4c3b75);
  --accent-text: light-dark(#432bab, #ded3ff);
  --focus: light-dark(#6246db, #beadff);
  --control-height: 2.75rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; }
a { color: inherit; }
form, p { margin: 0; }
h1, h2 { margin: 0; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(2.15rem, 5vw, 3rem); }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2rem, 66rem); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 4.5rem; gap: .75rem; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: .45rem; }
.brand { display: inline-flex; gap: .65rem; align-items: center; font-weight: 750; text-decoration: none; }
.intro { padding-block: clamp(1.75rem, 5vw, 3.5rem) 1.5rem; }
.intro .muted, .login-card .muted { margin-top: .65rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 2px 6px #28204006; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; align-items: start; gap: .85rem; padding: 1.1rem; }
.filters:has(.apply-filters[hidden]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.filters.own-report { grid-template-columns: minmax(0, 1fr) auto; }
.filters.own-report:has(.apply-filters[hidden]) { grid-template-columns: minmax(0, 1fr); }
.date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.date-field { display: grid; gap: .35rem; min-width: 0; }
.date-trigger { width: 100%; text-align: left; }
.presets { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.presets button { padding-inline: .65rem; }
.apply-filters { margin-top: 1.66rem; }
.calendar { width: min(32rem, 100% - 1.5rem); max-height: calc(100% - 1.5rem); padding: clamp(.65rem, 3vw, 1.25rem); color: inherit; }
.calendar::backdrop { background: #17132688; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.calendar-heading h2 { text-align: center; text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; text-align: center; }
[data-weekdays] { color: var(--muted); font-size: .8rem; margin-bottom: .35rem; }
.calendar-grid button { width: 100%; padding-inline: 0; font-variant-numeric: tabular-nums; }
.calendar-grid .in-range { background: var(--accent-surface); color: var(--accent-text); }
.calendar-grid [aria-current] { border-color: var(--focus); }
.calendar-grid [aria-pressed="true"] { background: var(--accent); color: white; }
.calendar-footer { margin-top: .75rem; text-align: right; }
label { display: grid; gap: .35rem; min-width: 0; font-size: .875rem; font-weight: 650; }
input, select, button { font: inherit; }
input:not([type="hidden"]), select, button { height: var(--control-height); }
input:not([type="hidden"]), select {
  width: 100%; min-width: 0; padding: .5rem .65rem; border: 1px solid var(--input-border);
  border-radius: .55rem; background: var(--surface); color: inherit; font-size: 1rem; font-weight: 400;
}
select {
  appearance: none;
  padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right .95em center, right .65em center;
  background-size: .3em .3em;
  background-repeat: no-repeat;
}
button { cursor: pointer; border-radius: .55rem; font-size: .9rem; font-weight: 700; padding: .45rem .95rem; }
.primary { background: var(--accent); color: white; border: 1px solid transparent; }
.primary:hover { background: #5136c3; }
.quiet { background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.quiet:hover { background: var(--surface-alt); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-block: 1rem; }
.metric { padding: .95rem 1.1rem; }
.metric span { color: var(--muted); font-size: .85rem; }
.metric strong { display: block; font-size: clamp(1.45rem, 4vw, 2rem); font-variant-numeric: tabular-nums; line-height: 1.3; }
.metric small { font-size: .95rem; }
.accent { background: var(--accent-surface); border-color: var(--accent-border); color: var(--accent-text); }
.accent span { color: var(--accent-text); }
.projects { margin-bottom: 2rem; }
.projects-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.1rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .8rem 1.1rem; text-align: left; vertical-align: top; border-top: 1px solid var(--border); white-space: nowrap; }
thead th { background: var(--surface-alt); color: var(--muted); font-size: .8rem; font-weight: 650; }
th:last-child, td:last-child { text-align: right; }
.hours { font-variant-numeric: tabular-nums; }
.comment { white-space: pre-wrap; overflow-wrap: anywhere; width: 100%; min-width: 10rem; }
tfoot { font-weight: 700; background: var(--surface-alt); }
tbody a { text-decoration: none; }
tbody a:hover { color: var(--highlight); text-decoration: underline; }
.copy-status:not(:empty) { padding: .5rem 1.1rem; font-size: .85rem; }
.empty { text-align: center; padding: 2rem 1rem; border-top: 1px solid var(--border); }
.empty p { margin-top: .25rem; }
.notice {
  margin-top: 1rem; border: 1px solid light-dark(#f1c5bd, #683f43); border-radius: .65rem;
  padding: .8rem 1rem; background: light-dark(#fff3f0, #3a252a); color: light-dark(#842d27, #ffcbc3);
}
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card { width: min(100%, 26rem); padding: clamp(1.25rem, 5vw, 2rem); }
.login-card h1 { margin-top: 1.25rem; font-size: 2rem; }
.login-form { display: grid; gap: .9rem; margin-top: 1.25rem; }
.preferences { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; margin-block: 1rem; }
.preferences label { color: var(--muted); }
.compact-preferences { flex-wrap: nowrap; gap: .4rem; margin: 0; }
.compact-preferences select { font-size: .8rem; padding-left: .5rem; }
.login-card .preferences { border-top: 1px solid var(--border); padding-top: 1rem; margin-bottom: 0; }
@media (max-width: 42rem) {
  .filters, .filters:has(.apply-filters[hidden]), .filters.own-report { grid-template-columns: minmax(0, 1fr); }
  .apply-filters { margin-top: 0; }
}
@media (max-width: 31rem) {
  .topbar-inner { flex-wrap: wrap; padding-block: .6rem; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .summary .accent { grid-column: 1 / -1; }
  th, td { padding-inline: .65rem; }
}
