:root {
  color-scheme: light;
  --page: #f1f5f5; --surface: #fff; --muted: #52636d; --ink: #122331;
  --border: #dbe5e6; --accent: #096951; --accent-soft: #e1f7ed;
  --nav: #0e232b; --nav-text: #c6dadd; --mint: #a8f1d5; --danger: #a02732;
  --shadow: 0 8px 26px rgb(21 48 50 / 5%);
  font-family: Inter, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b141c; --surface: #14232e; --muted: #a6b8c1; --ink: #ecf6f6;
  --border: #293e4a; --accent: #a2f2d2; --accent-soft: #193d38; --danger: #ffb0b5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b141c; --surface: #14232e; --muted: #a6b8c1; --ink: #ecf6f6;
    --border: #293e4a; --accent: #a2f2d2; --accent-soft: #193d38; --danger: #ffb0b5;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 16px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
button, .button { cursor: pointer; }
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .amount { letter-spacing: -.035em; }
h1 { font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1.1; }
h2 { font-size: 1.35rem; line-height: 1.2; }
h3 { font-size: 1.05rem; }
p, label, .detail { line-height: 1.55; }
small, .muted { color: var(--muted); }
small { font-size: .85rem; }
[hidden] { display: none !important; }
.skip { position: fixed; top: -100px; left: 1rem; z-index: 9; padding: .8rem; background: var(--surface); }
.skip:focus { top: .5rem; }
.boot { padding: 3rem; text-align: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px;
  padding: .65rem .95rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-weight: 650; text-decoration: none; text-align: center;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: #145f4d; color: #fff; border-color: #145f4d; }
.button.primary:hover { background: #0d493c; }
.button.danger { color: var(--danger); }
.button:disabled { opacity: .55; cursor: wait; }
.button.quiet { background: transparent; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.stack { display: grid; gap: 1rem; }
.tight { gap: .55rem; }
.flow, .bar, .row { display: flex; gap: .75rem; align-items: center; }
.flow { flex-wrap: wrap; }
.bar, .row { justify-content: space-between; }
.bar { flex-wrap: wrap; }
.card, .metric { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.card { padding: clamp(1rem, 2.5vw, 1.5rem); min-width: 0; }
.section { display: grid; gap: 1rem; }
.tag { display: inline-block; border-radius: 100px; padding: .3rem .65rem; color: var(--accent); background: var(--accent-soft); font-size: .82rem; font-weight: 700; }
.amount { font-size: clamp(1.35rem, 3.2vw, 2.15rem); font-weight: 750; font-variant-numeric: tabular-nums; }
.label { font-size: .88rem; font-weight: 600; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border: 0; padding-bottom: 0; }
.empty { padding: 1.4rem 0; color: var(--muted); }
.record-date { display: inline-grid; justify-items: center; padding: .4rem .6rem; min-width: 3rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); line-height: 1.12; }
.record-date strong { font-size: 1.25rem; }
.record-date small { color: inherit; font-size: .75rem; }
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100dvh; }
.side { display: flex; flex-direction: column; gap: 2rem; background: var(--nav); color: var(--nav-text); padding: 1.35rem 1rem; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.14rem; font-weight: 750; color: inherit; letter-spacing: -.04em; }
.brand img { flex: 0 0 auto; width: 40px; height: 40px; object-fit: cover; border-radius: 10px; }
.side .brand { color: #fff; }
.links { display: grid; gap: .3rem; }
.links button { display: flex; gap: .8rem; min-height: 46px; align-items: center; padding: .55rem .75rem; border: 0; border-radius: 9px; color: inherit; background: transparent; text-align: left; }
.links button:hover, .links button[aria-current="page"] { color: var(--mint); background: #1b3940; }
.side-end { margin-top: auto; padding: .75rem; overflow-wrap: anywhere; font-size: .88rem; }
.mobile-head { display: none; }
main.workspace { width: min(100%, 1280px); margin: 0 auto; padding: clamp(1.2rem, 3.2vw, 3rem); }
.intro { margin-bottom: 1.55rem; }
.intro h1 + p { margin-top: .4rem; }
.hero { color: #f3fffa; background: #143831; border-radius: 21px; padding: clamp(1.25rem, 3vw, 2.4rem); display: grid; gap: 1.65rem; }
.hero .muted { color: #bbd9ce; }
.hero .amount { font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.1; }
.hero .tag { background: #285349; color: #d4f9e9; }
.hero .button.primary { background: var(--mint); color: #12382d; border-color: var(--mint); }
.hero .button.quiet { color: #f3fffa; border-color: #6f9287; }
.hero-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; border-top: 1px solid #4d6e64; padding-top: 1rem; }
.hero-info strong { display: block; margin-top: .3rem; font-size: clamp(1rem, 3vw, 1.25rem); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.metric { padding: 1rem; min-width: 0; display: grid; align-content: start; gap: .45rem; }
.metric .icon { color: var(--accent); }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.form-grid > .wide { grid-column: 1 / -1; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; min-width: 0; }
label.check { display: flex; align-items: center; gap: .55rem; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: .6rem .7rem; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 400;
}
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: #14735a; }
textarea { resize: vertical; }
fieldset { margin: 0; border: 0; padding: 0; min-width: 0; }
input[type="month"] { min-width: 9rem; }
summary { cursor: pointer; font-weight: 650; }
details > :not(summary) { margin-top: .85rem; }
dialog { border: 1px solid var(--border); border-radius: 18px; padding: 0; color: var(--ink); background: var(--surface); width: min(620px, calc(100% - 1rem)); max-height: calc(100dvh - 1.5rem); }
dialog::backdrop { background: rgb(5 19 23 / 64%); }
.dialog-body { padding: 1.2rem; }
.error { color: var(--danger); font-size: .9rem; overflow-wrap: anywhere; }
#notice { position: fixed; z-index: 5; right: 1rem; bottom: 1rem; max-width: min(400px, calc(100% - 2rem)); }
#notice:not(:empty) { padding: 1rem; background: var(--nav); color: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.auth { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); min-height: 100dvh; }
.auth-brand { background: #102b2c; color: #e7fff6; display: grid; align-content: center; justify-items: center; padding: 2rem; text-align: center; gap: 1.3rem; }
.auth-brand img { width: min(58%, 248px); height: auto; border-radius: 23%; box-shadow: 0 22px 65px #081f20; }
.auth-brand p { color: #bee0d7; max-width: 29ch; }
.auth-content { display: grid; align-content: center; justify-items: center; padding: 2rem 1.25rem; }
.auth-content > div { width: min(100%, 410px); }
.auth-content form { margin: .35rem 0; }
.auth-content .full { width: 100%; }
.auth-links { display: grid; gap: .2rem; justify-items: start; }
.auth-links button { background: transparent; border: 0; color: var(--accent); padding: .5rem 0; text-align: left; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar .weekday { text-align: center; font-size: .85rem; color: var(--muted); }
.calendar button { min-height: 53px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); padding: .2rem; display: grid; place-content: center; }
.calendar button.has-record { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.calendar button.planned { border-color: var(--accent); border-style: dashed; }
.calendar button.leave small { font-size: .7rem; font-weight: 700; color: inherit; }
.calendar button.leave { border-bottom: 3px solid #577484; }
.calendar button.leave-vacation { border-bottom-color: #7687dc; }
.calendar button.leave-rol { border-bottom-color: #149577; }
.calendar button.leave-sick { border-bottom-color: #b06886; }
.calendar button.leave-holiday { border-bottom-color: #bd8113; }
.calendar button.leave-free { border-bottom-color: #9377ac; }
.chart { display: grid; gap: .65rem; }
.chart li { display: grid; grid-template-columns: minmax(4.3rem, 1fr) minmax(0, 3fr) auto; align-items: center; gap: .5rem; font-size: .88rem; }
progress { width: 100%; height: .65rem; accent-color: #188267; }
code.invite { padding: .6rem; display: block; user-select: all; overflow-wrap: anywhere; background: var(--accent-soft); border-radius: 8px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 178px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 660px) {
  .shell { display: block; }
  .side { position: fixed; inset: auto 0 0; z-index: 2; height: auto; padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); }
  .side .brand, .side-end { display: none; }
  .links { display: flex; justify-content: space-around; gap: 0; }
  .links button { flex: 1 1 0; min-width: 0; padding: .25rem .1rem; flex-direction: column; gap: .15rem; justify-content: center; text-align: center; font-size: .72rem; }
  .mobile-head { display: block; background: var(--surface); border-bottom: 1px solid var(--border); padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; }
  .mobile-head .brand img { width: 32px; height: 32px; }
  main.workspace { padding: 1rem .8rem calc(5.5rem + env(safe-area-inset-bottom)); }
  .hero-info { gap: .35rem; }
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 1.25rem; gap: .45rem; }
  .auth-brand img { width: 82px; }
  .auth-brand h1 { font-size: 1.4rem; }
  .auth-brand p { display: none; }
  .auth-content { align-content: start; }
  #notice { bottom: calc(4.2rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) { .form-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color .15s ease, border-color .15s ease; }
}
