@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --paper-deep: #ebe4d7;
  --card: #fffdf8;
  --ink: #18231f;
  --muted: #555f59;
  --line: #d6d0c4;
  --pine: #203c32;
  --pine-dark: #17231f;
  --amber: #e7b658;
  --amber-ink: #36250d;
  --clay: #9c421f;
  --focus: #075e88;
  --success: #1f5b3e;
  --danger: #8f2e2e;
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background:
    radial-gradient(ellipse at 83% 8%, rgb(231 182 88 / 10%), transparent 27rem),
    linear-gradient(90deg, transparent 0 95%, rgb(32 60 50 / 3%) 95% 95.15%, transparent 95.15%),
    var(--paper);
}
a { color: var(--pine); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--clay); }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link {
  position: fixed; z-index: 20; left: 1rem; top: 1rem; transform: translateY(-180%);
  padding: .8rem 1rem; border-radius: .5rem; background: var(--pine-dark); color: white;
}
.skip-link:focus { transform: translateY(0); }
.skip-link:focus-visible, .site-header :focus-visible { outline-color: #fff3cd; }
.site-header {
  min-height: 78px; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem clamp(1.1rem, 5vw, 5rem); color: var(--paper);
  background: var(--pine-dark); border-bottom: 4px solid var(--amber);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--paper); text-decoration: none; }
.brand:hover { color: white; }
.brand-mark {
  display: grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: 50%;
  color: var(--pine-dark); background: var(--amber); font: 700 1.25rem var(--display);
}
.brand strong { display: block; font: 700 1.15rem var(--display); letter-spacing: .1em; }
.brand small { display: block; margin-top: .1rem; color: #c7cec8; font: 600 .59rem var(--mono); letter-spacing: .15em; }
.top-nav { display: flex; align-items: center; gap: clamp(.65rem, 2.2vw, 1.8rem); }
.top-nav a, .nav-button { color: #e5e9e5; font-size: .9rem; text-decoration: none; }
.top-nav a { display: inline-flex; align-items: center; min-height: 32px; }
.top-nav a[aria-current="page"] { color: var(--amber); text-decoration: underline; text-underline-offset: .5rem; }
.nav-button { border: 0; padding: .5rem 0; background: transparent; cursor: pointer; }
.nav-button:hover { color: var(--amber); }
.logout-form { margin: 0; }
.flash {
  max-width: 1120px; margin: 1rem auto 0; padding: .85rem 1rem; border-left: 4px solid var(--success);
  background: #e4efe6; color: #153c27;
}
main { width: min(1120px, calc(100% - 2.4rem)); flex: 1; min-height: 0; margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem) 0 4rem; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { color: var(--ink); font-family: var(--display); font-weight: 500; letter-spacing: -.035em; }
h1 { margin-bottom: .6rem; font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1.02; }
h1, h2, .brand, .temp-password code { overflow-wrap: anywhere; }
h1 em { color: var(--clay); font-weight: 500; }
h2 { margin-bottom: .55rem; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.1; }
h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 500; }
.eyebrow { margin-bottom: .7rem; color: var(--clay); font: 700 .7rem var(--mono); letter-spacing: .14em; }
.muted { color: var(--muted); line-height: 1.6; }
.form-hint { margin: .5rem 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.optional { color: var(--muted); font-weight: 400; }
.card { border: 1px solid var(--line); border-radius: 1rem; background: var(--card); box-shadow: 0 10px 28px rgb(24 35 31 / 5%); }
.button {
  display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: .75rem;
  padding: .7rem 1rem; border: 1px solid transparent; border-radius: .55rem; font-weight: 700;
  line-height: 1.25; text-decoration: none; cursor: pointer; transition: transform .15s ease, background-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--amber); color: var(--amber-ink); }
.button-primary:hover { background: #f0c66e; color: #2d200e; }
.button-secondary { background: var(--pine); color: white; }
.button-secondary:hover { background: #2a4c3f; color: white; }
.button-outline { border-color: #7b8780; background: transparent; color: var(--ink); }
.button-outline:hover { background: var(--paper-deep); color: var(--ink); }
.button-soft { min-height: 42px; border-color: var(--line); background: #f4f0e7; color: var(--pine-dark); }
.button-soft:hover { background: var(--paper-deep); }
.button-wide { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem clamp(1.1rem, 5vw, 5rem); color: #d2dbd4; background: var(--pine-dark); font: .72rem var(--mono); letter-spacing: .05em; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); align-items: center; gap: clamp(2rem, 7vw, 6rem); max-width: 1000px; min-height: 62vh; margin: 0 auto; }
.auth-intro { padding-left: clamp(0rem, 5vw, 4rem); }
.auth-intro h1 { font-size: clamp(3rem, 6vw, 5.2rem); }
.auth-intro .muted { max-width: 27rem; }
.auth-card { padding: clamp(1.4rem, 3vw, 2.25rem); }
.auth-card h2 { margin-bottom: 1.5rem; }
label { display: block; margin: 1rem 0 .45rem; color: #313d37; font-size: .87rem; font-weight: 700; }
input, select {
  width: 100%; min-height: 46px; padding: .68rem .75rem; border: 1px solid #7b8780; border-radius: .45rem;
  background: #fff; color: var(--ink);
}
input::placeholder { color: #69736d; }
input:focus-visible, select:focus-visible { border-color: var(--focus); }
.auth-card .button { margin-top: 1.35rem; }
.auth-card .form-hint { margin-top: 1rem; }
.form-error { padding: .75rem; border-left: 4px solid var(--danger); background: #fbebea; color: #6d1b1b; line-height: 1.5; }

.dashboard-heading, .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.dashboard-heading h1 { font-size: clamp(2.15rem, 4.5vw, 3.4rem); }
.dashboard-heading .text-link { margin-bottom: .8rem; white-space: nowrap; }
.clock-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 1.15rem; }
.clock-face {
  position: relative; overflow: hidden; min-height: 310px; padding: clamp(1.4rem, 3vw, 2.25rem);
  border-radius: 1rem; color: var(--paper); background: var(--pine-dark);
}
.clock-face::after { position: absolute; right: -55px; bottom: -105px; width: 285px; height: 285px; border: 1px solid rgb(231 182 88 / 35%); border-radius: 50%; content: ""; box-shadow: 0 0 0 20px rgb(231 182 88 / 5%), 0 0 0 42px rgb(231 182 88 / 4%); }
.clock-face-top { display: flex; align-items: center; justify-content: space-between; }
.clock-face .eyebrow { color: #e8bd70; }
.live-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #8fc49b; box-shadow: 0 0 0 5px rgb(143 196 155 / 13%); }
.clock-time { display: block; position: relative; z-index: 1; margin: 1.8rem 0 .2rem; color: #fff9ec; font: 500 clamp(3.6rem, 7vw, 5.4rem)/1 var(--mono); letter-spacing: -.08em; font-variant-numeric: tabular-nums; }
.clock-date { color: #c5cec7; font-size: .95rem; }
.clock-rule { height: 1px; margin: 1.45rem 0 1.1rem; background: #4a5b52; }
.shift-status { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .75rem; align-items: baseline; }
.status-label { color: #bfc9c1; font: .65rem var(--mono); letter-spacing: .13em; }
.shift-status strong { color: var(--amber); font: 1.1rem var(--display); }
.status-detail { grid-column: 2; color: #d6ded8; font-size: .8rem; }
.punch-card { padding: clamp(1.4rem, 3vw, 2.25rem); }
.punch-card h2 { margin-bottom: .5rem; }
.punch-card > .muted { min-height: 2.8em; }
.punch-actions { display: grid; gap: .65rem; margin-top: 1.4rem; }
.punch-actions form { margin: 0; }
.punch-footnote { margin: 1rem 0 0; color: var(--muted); font-size: .75rem; }
.below-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; margin-top: 1.15rem; }
.today-card, .alerts-card { padding: clamp(1.25rem, 2.7vw, 1.8rem); }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.25rem; }
.section-heading h2 { margin-bottom: 0; }
.section-heading .eyebrow { margin-bottom: .45rem; }
.mini-index { padding: .35rem .5rem; border: 1px solid #c9ab70; color: #6c4c17; font: .68rem var(--mono); letter-spacing: .04em; }
.time-ledger { margin: 1.2rem 0 0; }
.time-ledger > div { display: flex; justify-content: space-between; gap: 1rem; padding: .68rem 0; border-top: 1px solid var(--line); }
.time-ledger dt { color: var(--muted); font-size: .85rem; }
.time-ledger dd { margin: 0; color: var(--ink); font: 700 .82rem var(--mono); text-align: right; }
.alerts-card { display: flex; flex-direction: column; align-items: flex-start; }
.alerts-card h2 { max-width: none; }
.alerts-card > .muted { margin-bottom: 1rem; }
.alerts-card form { margin-top: .6rem; }
.alerts-card .form-hint { margin: 0 0 .8rem; }

.page-heading { align-items: end; }
.page-heading .muted { max-width: 43rem; margin-bottom: 0; }
.history-list { display: grid; gap: .8rem; }
.history-card { overflow: hidden; }
.history-card summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 1.4rem; align-items: center; gap: 1rem; min-height: 76px; padding: .85rem 1.2rem; cursor: pointer; list-style: none; }
.history-card summary::-webkit-details-marker { display: none; }
.history-card summary:focus-visible { outline-offset: -4px; }
.history-card summary::after { width: 1.4rem; height: 1.4rem; content: "+"; display: grid; place-items: center; justify-self: end; border: 1px solid var(--line); border-radius: 50%; font: 1rem var(--mono); }
.history-card[open] summary::after { content: "−"; }
.history-date strong, .history-date small { display: block; }
.history-date strong { font: 1.15rem var(--display); }
.history-date small { margin-top: .2rem; color: var(--muted); font: .7rem var(--mono); }
.history-hours { font: 700 .95rem var(--mono); font-variant-numeric: tabular-nums; }
.history-state { color: var(--muted); font-size: .8rem; }
.history-details { padding: 0 1.2rem 1.3rem; border-top: 1px solid var(--line); }
.compact { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.6rem; }
.edit-entry { margin-top: 1.5rem; padding: 1.2rem; border-radius: .7rem; background: #f5f1e8; }
.edit-entry h3 { margin-bottom: .35rem; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.edit-entry .button { margin-top: 1rem; }
.empty-state { padding: 3rem 1rem; text-align: center; }
.empty-mark { display: block; margin-bottom: .8rem; color: #8e9a91; font: 3rem var(--display); }

.admin-heading .button { flex: 0 0 auto; }
.report-actions { display: grid; gap: .75rem; justify-items: end; }
.range-export { min-width: min(100%, 440px); }
.range-export > label { margin-top: 0; text-align: right; }
.range-export > div { display: flex; align-items: center; gap: .45rem; }
.range-export input { min-width: 0; min-height: 42px; padding: .5rem; font-size: .78rem; }
.range-export > div > span { color: var(--muted); font-size: .75rem; }
.range-export .button { white-space: nowrap; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.account-create, .accounts-card, .audit-card { padding: clamp(1.2rem, 2.5vw, 1.7rem); }
.stack-form .button { margin-top: 1.2rem; }
.accounts-card { min-width: 0; }
.table-wrap { position: relative; width: 100%; overflow-x: auto; }
.table-hint { margin: 0 0 .75rem; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.accounts-card table { min-width: 39rem; }
.audit-card table { min-width: 48rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .78rem .55rem; border-top: 1px solid var(--line); vertical-align: top; font-size: .8rem; }
thead th { color: var(--muted); font: 700 .65rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
tbody th { font-weight: 500; }
tbody th strong, tbody th small { display: block; }
tbody th small { margin-top: .2rem; color: var(--muted); font: .7rem var(--mono); }
.account-status { display: inline-block; padding: .24rem .45rem; border-radius: 99px; background: #e1eee2; color: #17462d; font-size: .69rem; }
.account-status.is-disabled { background: #f6e5df; color: #702b18; }
.account-actions { display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.account-actions form { margin: 0; }
.small-action { min-height: 32px; padding: .2rem .25rem; border: 0; background: transparent; color: var(--pine); font-size: .72rem; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.danger-action { color: var(--danger); }
.audit-card { margin-top: 1.1rem; }
.audit-card td { line-height: 1.45; }
.audit-card tr:not(.audit-values-row) td:first-child { white-space: nowrap; font: .72rem var(--mono); }
.audit-target, .audit-reason { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.audit-changes summary { min-height: 28px; color: var(--pine); cursor: pointer; font-size: .75rem; text-decoration: underline; text-underline-offset: .15em; }
.audit-changes dl { display: grid; gap: .35rem; margin: .45rem 0 0; }
.audit-changes dl > div { display: grid; grid-template-columns: minmax(5.5rem, .6fr) minmax(0, 1.4fr); gap: .35rem; padding-top: .35rem; border-top: 1px solid var(--line); }
.audit-changes dt { font-weight: 700; }
.audit-changes dd { display: grid; gap: .15rem; margin: 0; overflow-wrap: anywhere; font-size: .76rem; }
.audit-pagination { display: flex; justify-content: center; margin-top: .9rem; }
.temp-password { margin-top: 1rem; padding: 1.3rem; border-left: 5px solid var(--amber); }
.temp-password p:not(.eyebrow) { max-width: 55rem; color: var(--muted); line-height: 1.55; }
.temp-password code { display: inline-block; padding: .7rem .85rem; border-radius: .4rem; background: var(--pine-dark); color: #fff4dc; font: 700 1.15rem var(--mono); letter-spacing: .08em; user-select: all; }
.telegram-card { display: grid; justify-items: start; gap: 1rem; max-width: 600px; padding: 1.6rem; }
.telegram-card p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 780px) {
  main { width: min(100% - 1.5rem, 650px); padding-top: 2.2rem; }
  .site-header { min-height: 68px; padding-inline: .85rem; }
  .top-nav { flex: 1; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; }
  .top-nav a, .nav-button { font-size: .8rem; }
  .brand-mark { width: 2.2rem; height: 2.2rem; }
  .brand strong { font-size: 1rem; }
  .auth-layout { grid-template-columns: 1fr; gap: 1.4rem; max-width: 480px; min-height: auto; }
  .auth-intro { padding: 0; }
  .auth-intro h1 { font-size: clamp(2.8rem, 13vw, 4rem); }
  .clock-grid, .below-grid { grid-template-columns: 1fr; }
  .clock-face { min-height: 290px; }
  .clock-time { font-size: clamp(3.5rem, 17vw, 5rem); }
  .dashboard-heading, .page-heading { align-items: flex-start; flex-direction: column; gap: .6rem; }
  .dashboard-heading .text-link { margin: .4rem 0 0; }
  .admin-heading .button { width: 100%; }
  .report-actions { width: 100%; justify-items: stretch; }
  .range-export > label { text-align: left; }
  .range-export > div { flex-wrap: wrap; }
  .range-export input { flex: 1 1 40%; }
  .range-export .button { flex: 1 1 100%; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .top-nav { gap: .55rem; }
  .site-header { align-items: flex-start; }
  .brand { flex: 0 0 auto; }
  .top-nav { column-gap: .45rem; row-gap: .15rem; }
  .top-nav a, .nav-button { font-size: .72rem; }
  .history-card summary { grid-template-columns: minmax(0, 1fr) auto 1.4rem; gap: .5rem; padding-inline: .8rem; }
  .history-state { grid-column: 2; grid-row: 2; }
  .history-card summary::after { grid-column: 3; grid-row: 1 / 3; }
  .history-details { padding-inline: .8rem; }
  .history-state { font-size: .7rem; }
  .edit-entry { padding: .85rem; }
  .edit-grid { grid-template-columns: 1fr; }
  .compact { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: .3rem; }
  .table-wrap { margin-inline: -.3rem; width: calc(100% + .6rem); }
  th, td { padding: .65rem .4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.weekly-summary { margin-block: 1.15rem; }
button[aria-disabled="true"] { opacity: .7; cursor: wait; }

.settings-card, .weekly-summary { padding: clamp(1rem, 3vw, 1.5rem); }
.settings-card h2, .settings-card h3 { margin-top: 0; }
.settings-card .stack-form { margin-top: 1rem; }
.settings-card + .history-list { margin-top: 1.5rem; }
.settings-card + .settings-card { margin-top: 1.15rem; }
.choice-label { display: flex; align-items: center; gap: .65rem; min-height: 44px; cursor: pointer; }
input.choice-input { flex: 0 0 1.25rem; width: 1.25rem; height: 1.25rem; min-height: 0; padding: 0; margin: 0; accent-color: var(--pine); }
.settings-card fieldset { margin: 1rem 0; padding: .75rem 1rem; border: 1px solid #777b72; border-radius: .5rem; }
.settings-card legend { padding-inline: .25rem; font-weight: 600; }
.settings-card textarea { width: 100%; min-height: 6rem; padding: .7rem; border: 1px solid #777b72; border-radius: .4rem; background: #fff; color: var(--ink); font: inherit; resize: vertical; }
.payroll-ledger { margin-block: 1rem; }
.settings-card .table-wrap table { min-width: 48rem; }

[data-focus-message]:focus { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Brief confirmations sit above the page without moving its content. */
.toast { position: fixed; z-index: 30; top: 1rem; right: 1rem; display: flex; align-items: center; gap: 1rem; max-width: min(28rem, calc(100% - 2rem)); padding: .8rem 1rem; border: 1px solid #7b9b85; border-radius: .75rem; background: #e4efe6; color: #153c27; box-shadow: 0 8px 28px rgb(24 35 31 / 16%); }
.toast-dismiss { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: #153c27; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.toast-dismiss:hover { color: var(--pine-dark); }
.shift-total { padding: .35rem 0; color: var(--pine); font: 700 .9rem var(--mono); white-space: nowrap; }
.reminder-channel { width: 100%; padding: 1rem 0; border-top: 1px solid var(--line); }
.reminder-channel h3 { margin: 0 0 .6rem; font: 700 .85rem var(--body); }
.reminder-channel .form-hint { margin: .6rem 0 0; }
.reminder-alternative { width: 100%; padding-top: .65rem; border-top: 1px solid var(--line); }
.reminder-alternative summary { min-height: 44px; padding-block: .65rem; color: var(--pine); font-size: .85rem; cursor: pointer; }
.alerts-card .reminder-admin-note { margin: .8rem 0 0; }
.add-teammate { margin-bottom: 1rem; }
.account-dialog { width: min(32rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; color: var(--ink); overflow-y: auto; }
.account-dialog:not(:modal) { position: static; margin: 0 0 1rem; }
.account-dialog::backdrop { background: rgb(17 28 23 / 55%); backdrop-filter: blur(6px); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.5rem 0; }
.dialog-heading h2 { margin: 0; }
.account-dialog .account-create { padding-top: 0; }
body:has(dialog:modal) { overflow: hidden; }
.audit-card td { overflow-wrap: anywhere; }
.audit-values-row > td { padding-top: 0; border-top: 0; }
.audit-changes summary { min-height: 44px; padding-block: .65rem; }
.audit-changes dl { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--paper); }
.audit-changes dl > div { grid-template-columns: minmax(10rem, .7fr) minmax(0, 1.3fr); gap: 1rem; }
.audit-changes dl > div:first-child { border-top: 0; }
.audit-changes dd { font-size: .8rem; }
.audit-pagination { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }
.audit-pagination > div { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 780px) {
  .audit-card table { min-width: 0; table-layout: fixed; }
  .audit-card th, .audit-card td { white-space: normal; font-size: .72rem; }
  .audit-card tr:not(.audit-values-row) td:first-child { white-space: normal; font-size: .65rem; }
  .audit-changes dl { padding: .65rem; }
  .audit-changes dl > div { grid-template-columns: 1fr; gap: .25rem; }
  .dialog-heading { padding-inline: 1.2rem; }
}
