@font-face {
  font-family: Inter;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 400 750;
}

@font-face {
  font-family: Fraunces;
  src: url('/fonts/fraunces-latin.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 450 750;
}

:root {
  color-scheme: light;
  --paper: #faf7f2;
  --white: #fffdfa;
  --surface: #fffdf9;
  --accent: #c4622d;
  --accent-ink: #9a4319;
  --accent-solid: #a64a21;
  --accent-wash: #f5e4d8;
  --accent-soft: #f9eee6;
  --ink: #1c1410;
  --rail: #251a15;
  --rail-line: #49362b;
  --rail-caption: #c2a99a;
  --muted: #695950;
  --line: #e8dfd4;
  --line-dark: #d8c9ba;
  --neutral: #efe9e2;
  --danger: #9f382c;
  --shadow: 0 2px 10px #43240906;
  --display: Fraunces, Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
input, select, textarea { color: var(--ink); }
input[type="date"], input[type="time"], input[type="datetime-local"] { -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; }
h1, h2, h3, p { margin: 0; }
::selection { color: var(--ink); background: #f1ccae; }
:focus-visible { outline: 3px solid #b15725; outline-offset: 3px; }
main:focus { outline: none; }
img { max-width: 100%; }

.icon { display: inline-block; width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 20; top: .8rem; left: .8rem; transform: translateY(-200%); padding: 10px 14px; background: var(--ink); color: var(--white); border-radius: 8px; }
.skip:focus { transform: none; }
.loading { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }

.brand { display: inline-flex; align-items: center; width: fit-content; gap: 9px; }
.brand img { display: block; width: 106px; height: auto; }
.brand span { display: inline-grid; align-items: center; align-self: center; padding: 2px 0 2px 9px; border-left: 1px solid var(--line-dark); font-size: 15px; font-weight: 700; letter-spacing: -.025em; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; min-height: 40px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 650; text-align: center; white-space: nowrap; }
.button .icon { width: 16px; height: 16px; }
.button--quiet { color: var(--muted); }
.button--quiet:hover { background: var(--neutral); color: var(--ink); }
.button--outline { border-color: var(--line-dark); background: var(--white); }
.button--outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.button--primary { background: var(--accent-solid); color: var(--white); border-color: var(--accent-solid); box-shadow: 0 1px 2px #58220d22; }
.button--primary:hover { background: #8b3918; border-color: #8b3918; }
.button--danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.button--danger:hover { background: #7a2b22; border-color: #7a2b22; }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid transparent; border-radius: 8px; color: currentColor; background: transparent; }
.icon-button:hover { background: var(--neutral); }

.public-page { display: flex; flex-direction: column; min-height: 100vh; }
.public-header, .public-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(100%, 1440px); margin: 0 auto; padding-inline: clamp(24px, 5.2vw, 76px); }
.public-header { min-height: 94px; }
.public-header .brand img { width: 130px; }
.public-header .brand span { font-size: 17px; }
.kiosk-link { border-color: var(--line-dark); padding-inline: 14px; }
.kiosk-link .trailing { margin-left: 4px; }
.public-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(345px, 405px); align-items: center; gap: clamp(40px, 7vw, 110px); width: min(100%, 1300px); flex: 1; margin: 0 auto; padding: 40px clamp(24px, 6vw, 94px) 66px; }
.public-intro { position: relative; align-self: center; isolation: isolate; }
.public-intro::after { position: absolute; z-index: -1; content: ''; inset: -44px -16px -48px -30px; background: radial-gradient(ellipse at 40% 50%, #efdbcc 0, transparent 68%); opacity: .56; pointer-events: none; }
.public-rule { width: 68px; border-top: 2px solid var(--accent); margin-bottom: 28px; }
.public-intro h1 { font: 590 clamp(76px, 10.5vw, 155px)/.87 var(--display); letter-spacing: -.073em; }
.public-intro h1 em { color: var(--accent-ink); font-style: normal; }
.public-intro > p { max-width: 405px; margin-top: 29px; color: var(--muted); font-size: clamp(15px, 1.48vw, 20px); line-height: 1.62; }
.feature-strip { display: flex; flex-wrap: wrap; gap: 17px 25px; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line-dark); }
.feature-strip > div { display: flex; align-items: flex-start; gap: 9px; }
.feature-strip > div > .icon { margin-top: 3px; color: var(--accent-ink); }
.feature-strip strong, .feature-strip small { display: block; }
.feature-strip strong { font-size: 13px; }
.feature-strip small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.public-footer { min-height: 66px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.public-footer span:first-child { font-weight: 650; }

.access-card { padding: clamp(24px, 3.5vw, 42px); border: 1px solid var(--line); border-radius: 21px; background: var(--white); box-shadow: 0 22px 64px #74451d11, 0 3px 10px #74451d06; }
.access-card header { margin-bottom: 25px; }
.access-card h2 { margin: 13px 0 3px; font: 600 33px/1.1 var(--display); letter-spacing: -.045em; }
.access-card header > p { margin-top: 8px; color: var(--muted); }
.section-icon { display: inline-grid; width: 45px; height: 45px; place-items: center; border: 1px solid #edd5c4; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.section-icon .icon { width: 22px; height: 22px; }
.access-card form { display: grid; gap: 15px; }
label { position: relative; display: block; font-size: 13px; font-weight: 650; }
label > input:not([type="radio"]), label > select, label > textarea { display: block; width: 100%; min-width: 0; min-height: 42px; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line-dark); border-radius: 8px; background: var(--white); font-size: 14px; font-weight: 450; }
label > select { padding-right: 9px; }
label > input::placeholder, label > textarea::placeholder { color: var(--muted); }
.form-error { padding: 9px 11px; border: 1px solid #efd0c9; border-radius: 8px; color: #842a21; background: #f8e9e6; font-size: 12px; }
.form-note { color: var(--muted); font-size: 12px; }
.login-submit { justify-content: space-between; width: 100%; min-height: 44px; padding-inline: 14px; margin-top: 2px; }
.demo-switch { margin-top: 26px; padding-top: 17px; border-top: 1px solid var(--line); }
.demo-switch > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 650; }
.demo-switch [role="group"] { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.demo-switch button { min-height: 33px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.demo-switch button[aria-pressed="true"] { color: var(--accent-ink); background: var(--white); border-color: var(--line); box-shadow: var(--shadow); }

.app-layout { display: grid; grid-template-columns: 234px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; inset: 0 auto auto 0; display: flex; flex-direction: column; align-self: start; height: 100vh; min-width: 0; color: #fff2e8; background: var(--rail); z-index: 5; }
.rail-top { display: flex; justify-content: space-between; align-items: center; min-height: 69px; padding: 10px 20px 10px 22px; }
.rail .brand img { width: 99px; filter: brightness(1.44) saturate(.73); }
.rail .brand span { border-color: var(--rail-line); color: #f4dac9; }
.rail-close, .menu-toggle, .rail-backdrop { display: none; }
.workspace-label { position: relative; display: flex; align-items: center; gap: 9px; min-height: 42px; margin: 0 15px 8px; padding: 7px 8px; border: 1px solid var(--rail-line); border-radius: 8px; background: #31231c; font-size: 12px; font-weight: 650; }
.workspace-label > .icon { width: 17px; height: 17px; color: #efa777; }
.workspace-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-label select { appearance: none; z-index: 1; width: 100%; min-height: 30px; margin: 0 0 0 -26px; padding: 5px 19px 5px 26px; border: 0; background: transparent; color: #fff1e6; font-size: 12px; font-weight: 650; }
.workspace-label option { color: var(--ink); background: var(--white); }
.workspace-label .select-arrow { position: absolute; right: 9px; width: 14px; height: 14px; }
.rail-nav { flex: 1; padding: 0 12px 14px; overflow-y: auto; }
.rail-group { display: grid; gap: 2px; margin-top: 17px; }
.rail-group > p { margin: 0 0 6px 12px; color: var(--rail-caption); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.rail-link { position: relative; display: flex; min-height: 37px; align-items: center; gap: 10px; padding: 7px 11px; border-radius: 7px; color: #e5d0c4; font-size: 13px; font-weight: 550; }
.rail-link .icon { width: 17px; height: 17px; color: #bd9c88; }
.rail-link:hover { color: #fff8ef; background: #37271f; }
.rail-link.is-active { color: #ffefe1; background: #513021; font-weight: 650; }
.rail-link.is-active::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: #e4915d; }
.rail-link.is-active .icon { color: #edaa7d; }
.rail-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 68px; padding: 10px 13px 10px 16px; border-top: 1px solid var(--rail-line); }
.rail-profile { display: flex; gap: 8px; align-items: center; min-width: 0; }
.rail-profile > span:last-child { display: block; min-width: 0; }
.rail-profile strong, .rail-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-profile strong { font-size: 12px; font-weight: 650; }
.rail-profile small { color: var(--rail-caption); font-size: 11px; }
.rail-bottom .icon-button, .rail-top .icon-button { color: var(--rail-caption); }
.rail-bottom .icon-button:hover, .rail-top .icon-button:hover { background: #49362b; color: var(--white); }
.avatar { display: inline-grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 50%; border: 1px solid #75503c; background: #4a3226; color: #ffcbb1; font-size: 11px; font-weight: 700; letter-spacing: -.02em; }
.avatar--top { width: 31px; height: 31px; border-color: #ebd4c3; background: var(--accent-soft); color: var(--accent-ink); }

.app-main { min-width: 0; }
.app-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 64px; padding: 0 clamp(23px, 3.25vw, 56px); border-bottom: 1px solid var(--line); background: var(--white); }
.app-breadcrumb, .top-actions { display: flex; align-items: center; gap: 13px; }
.app-breadcrumb { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 0; }
.app-breadcrumb strong { color: var(--ink); font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-slash { color: #947d6f; }
.top-actions { color: var(--muted); }
.network { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.network i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #a96437; box-shadow: 0 0 0 3px #f3e7da; }
.network--offline { color: #943923; }
.network--offline i { background: #a63b2b; box-shadow: 0 0 0 3px #f4ddd7; }
.bell i { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border: 2px solid var(--white); border-radius: 50%; background: var(--accent); }
.content { display: grid; gap: 20px; width: min(100%, 1600px); margin: 0 auto; padding: clamp(23px, 3.25vw, 52px); }
.dashboard-head, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 3px; }
.dashboard-head h1, .page-heading h1, .kiosk-intro h1 { margin: 0; font: 580 clamp(40px, 5.5vw, 82px)/.97 var(--display); letter-spacing: -.056em; }
.dashboard-head p, .page-heading p { margin-top: 11px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.page-heading h1 { font-size: clamp(41px, 4.7vw, 64px); }
.page-heading { min-height: 103px; padding-bottom: 4px; }
.heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.date-label { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--accent-ink); font-size: 12px; font-weight: 650; }
.date-label .icon { width: 16px; height: 16px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { position: relative; display: grid; min-width: 0; align-content: end; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.metric:hover { border-color: #d4ae93; background: #fff9f3; }
.metric-icon { display: inline-grid; place-items: center; width: 31px; height: 31px; margin-bottom: 10px; border-radius: 7px; color: var(--accent-ink); background: var(--accent-soft); }
.metric-icon .icon { width: 16px; height: 16px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 620; }
.metric strong { margin-top: 4px; font: 610 clamp(28px, 3vw, 45px)/.96 var(--display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric small { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); grid-template-areas: 'recent attention' 'recent week'; gap: 16px; align-content: start; align-items: start; }
.recent-panel { grid-area: recent; align-self: stretch; }
.attention-panel { grid-area: attention; }
.weekly-panel { grid-area: week; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 19px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font: 610 25px/1.13 var(--display); letter-spacing: -.035em; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.panel-actions { flex: 0 0 auto; }
.panel-actions .button { min-height: 34px; padding-block: 5px; font-size: 12px; }
.panel-body { padding: 17px 19px; }
.empty { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 91px; padding: 20px; color: var(--muted); font-size: 13px; }
.empty .icon { color: var(--accent-ink); }
.row-title { display: block; color: var(--ink); font-size: 13px; font-weight: 650; }
.row-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 450; }
.badge { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 7px; border-radius: 5px; font-size: 11px; font-weight: 650; line-height: 1.35; white-space: nowrap; }
.badge--neutral { color: #5b4c40; background: #f0ebe5; }
.badge--positive { color: #633a27; background: #efe1d6; }
.badge--warn { color: #8b421d; background: #f7e6d7; }

.timeline { padding: 2px 18px 8px; margin: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 61px; align-items: center; gap: 10px; min-height: 60px; padding: 7px 0; border-bottom: 1px solid #eee5dc; }
.timeline li:last-child { border-bottom: none; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; top: calc(50% + 17px); bottom: calc(-50% + 17px); left: 15px; width: 1px; background: var(--line-dark); }
.timeline-marker { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #f5eee7; color: var(--muted); }
.timeline-marker.is-in { border-color: #f1dece; background: var(--accent-soft); color: var(--accent-ink); }
.timeline-marker .icon { width: 15px; height: 15px; }
.timeline-type { color: var(--muted); font-size: 11px; }
.timeline-time { text-align: right; }
.timeline-time strong, .timeline-time small { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline-time strong { font-size: 13px; }
.timeline-time small { color: var(--muted); font-size: 10px; }
.attention-list { padding: 2px 17px 6px; }
.attention-row { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto 15px; align-items: center; gap: 8px; min-height: 45px; padding: 3px 1px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.attention-row:last-child { border-bottom: 0; }
.attention-row > .icon { width: 14px; height: 14px; color: var(--muted); }
.attention-row:hover { color: var(--accent-ink); }
.attention-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 6px; color: var(--accent-ink); background: var(--accent-soft); }
.attention-icon .icon { width: 13px; height: 13px; }
.attention-row strong { width: 26px; color: var(--accent-ink); font-size: 12px; text-align: right; }
.weekly-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; justify-items: center; min-height: 98px; padding: 10px 15px 9px; }
.weekly-bar { display: grid; width: 100%; justify-items: center; align-items: end; gap: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; text-align: center; }
.bar-track { position: relative; width: min(20px, 60%); height: 43px; overflow: hidden; border-radius: 3px; background: var(--paper); }
.bar-track rect { fill: #d8a07d; }
.weekly-bar.is-today { color: var(--accent-ink); font-weight: 700; }
.weekly-bar.is-today rect { fill: var(--accent); }
.bar-day { text-transform: capitalize; }

.table-scroll { width: 100%; overflow: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 12px; }
th, td { padding: 11px 12px; border-bottom: 1px solid #eee5dc; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
th { color: var(--muted); background: #fbf7f1; font-size: 11px; font-weight: 700; }
td { color: #49382c; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fdf9f4; }
td .row-subtitle { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 3px; }
.row-actions > .button, td > .button { min-height: 31px; padding: 4px 8px; font-size: 11px; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 10px 13px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.filters label { color: var(--muted); font-size: 11px; }
.filters label > input, .filters label > select { width: auto; min-width: 141px; min-height: 35px; margin-top: 3px; padding: 5px 7px; font-size: 12px; }
.filters .button { min-height: 35px; padding-block: 4px; }
.export-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.export-buttons .button { border: 1px solid var(--line); }
.subscription { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subscription .subtle { color: var(--muted); font-size: 11px; }
.subscription p { margin-top: 4px; font: 610 25px/1.15 var(--display); }
.subscription .badge { margin-left: 6px; vertical-align: middle; font-family: var(--sans); }

.worker-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.worker-clock, .kiosk-clock { font: 600 clamp(47px, 7vw, 84px)/1 var(--display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.worker-place { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.worker-place .icon { width: 16px; height: 16px; color: var(--accent-ink); }
.punch-body { padding-bottom: 20px; }
.punch-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-block: 16px 12px; }
.punch-actions .button { flex: 1 1 auto; }
.data-list { margin: 0; padding: 3px 19px 7px; }
.data-list > div { display: flex; justify-content: space-between; align-items: center; gap: 7px; min-height: 40px; border-bottom: 1px solid var(--line); }
.data-list > div:last-child { border-bottom: 0; }
.data-list dt { color: var(--muted); font-size: 12px; }
.data-list dd { margin: 0; font-weight: 650; text-align: right; }
.queue-issue { display: block; max-width: 38ch; color: var(--danger); white-space: normal; }

.kiosk-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 405px); align-items: start; align-content: center; gap: 25px 45px; flex: 1; width: min(100%, 1060px); margin: 0 auto; padding: 32px clamp(24px, 4vw, 66px) 50px; }
.kiosk-intro { padding-block: 25px; }
.kiosk-intro h1 { margin-top: 16px; font-size: clamp(47px, 6.9vw, 88px); }
.kiosk-intro p { margin-top: 13px; color: var(--muted); font-size: 16px; }
.kiosk-clock { margin: 20px 0 10px; color: var(--accent-ink); }
.kiosk-card { padding: clamp(21px, 3vw, 34px); }
.kiosk-card h2 { margin-top: 0; }
.kiosk-card header { margin-bottom: 18px; }
.kiosk-card > .button { margin: 12px 0 -3px -6px; font-size: 12px; }
.kiosk-queue { display: grid; gap: 12px; grid-column: 1/-1; }
.kiosk-queue:empty { display: none; }
.punch-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.punch-choice > legend { margin-bottom: 6px; color: var(--ink); font-size: 13px; font-weight: 650; }
.punch-choice > label { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 42px; padding: 5px 7px; border: 1px solid var(--line-dark); border-radius: 8px; color: var(--muted); background: var(--white); cursor: pointer; }
.punch-choice > label .icon { width: 16px; height: 16px; }
.punch-choice > label:has(input:checked) { border-color: #ce9c78; color: var(--accent-ink); background: var(--accent-soft); }
.punch-choice input { accent-color: var(--accent-ink); }
.kiosk-alternative { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.kiosk-alternative summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; font-weight: 650; }
.kiosk-alternative summary .icon { width: 16px; height: 16px; margin-inline: 4px; }
.kiosk-alternative form { margin-top: 12px; }
.kiosk-qr-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.kiosk-qr-actions .button { flex: 1; }

dialog { position: fixed; width: min(calc(100vw - 28px), 530px); max-height: calc(100dvh - 28px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line-dark); border-radius: 17px; color: var(--ink); background: var(--white); box-shadow: 0 25px 95px #20130e35; }
dialog::backdrop { background: #24191180; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px 14px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font: 610 28px/1.1 var(--display); letter-spacing: -.037em; }
.dialog-content, #dialog-form { padding: 17px 22px 22px; }
.dialog-message { margin-bottom: 14px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.field-wide { grid-column: 1/-1; }
.optional { display: inline-block; margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 450; }
#dialog-form .form-error { margin-top: 12px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 19px; }
.notice-list { padding: 0; margin: 0; list-style: none; }
.notice-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.notice-list li:last-child { border-bottom: 0; }
.grant-view { display: grid; gap: 14px; }
.grant-image { justify-self: center; width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.grant-view textarea { font-family: ui-monospace, monospace; font-size: 11px; }
.grant-actions { display: flex; justify-content: flex-end; gap: 7px; }
.scanner { display: block; width: 100%; max-height: 65dvh; margin-bottom: 10px; border-radius: 9px; background: var(--paper); }

.toast { position: fixed; z-index: 10; right: max(19px, env(safe-area-inset-right)); bottom: max(19px, env(safe-area-inset-bottom)); display: flex; align-items: flex-start; gap: 9px; width: max-content; max-width: min(calc(100vw - 38px), 410px); padding: 12px 15px; border: 1px solid #6c5040; border-radius: 10px; color: #fff7ec; background: #36251c; box-shadow: 0 7px 30px #1b130e33; font-size: 13px; pointer-events: none; }
.toast--error { background: #7f3127; border-color: #a6584a; }
.toast .icon { width: 17px; height: 17px; margin-top: 1px; }

@media (max-width: 1090px) {
  .app-layout { grid-template-columns: 205px minmax(0, 1fr); }
  .app-bar { padding-inline: 28px; }
  .content { padding: 32px 27px; }
  .metric { padding: 13px 12px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; }
  .public-intro h1 { font-size: clamp(67px, 11vw, 115px); }
  .feature-strip { column-gap: 14px; }
}

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 176px minmax(0, 1fr); }
  .rail-top { padding-left: 15px; }
  .rail-nav { padding-inline: 8px; }
  .workspace-label { margin-inline: 9px; }
  .rail-bottom { padding-inline: 9px; }
  .app-bar { padding-inline: 21px; }
  .content { padding-inline: 21px; }
  .public-main { gap: 28px; }
  .public-intro h1 { font-size: clamp(59px, 10.3vw, 88px); }
  .timeline { padding-inline: 12px; }
  .timeline li { grid-template-columns: 28px minmax(0, 1fr) auto 46px; gap: 7px; }
  .timeline-marker { width: 26px; height: 26px; }
  .timeline li:not(:last-child)::before { left: 12px; }
  .panel-head { padding-inline: 14px; }
  .panel-head h2 { font-size: 22px; }
}

@media screen and (max-width: 700px), screen and (max-width: 950px) and (max-height: 540px) and (pointer: coarse) {
  .app-layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(270px, calc(100vw - 44px)); height: 100dvh; transform: translateX(-101%); visibility: hidden; }
  .rail.is-open { transform: translateX(0); visibility: visible; animation: rail-slide-in .18s ease-out; }
  .rail-top { padding-inline: 14px; }
  .rail-close, .menu-toggle { display: inline-grid; }
  .rail-backdrop { position: fixed; z-index: 4; inset: 0; display: block; width: 100%; border: 0; background: #2b1a1280; }
  .app-bar { min-height: 55px; padding: 0 16px; }
  .app-breadcrumb, .top-actions { gap: 8px; }
  .app-breadcrumb > span { display: none; }
  .menu-toggle { width: 31px; height: 33px; margin-left: -5px; }
  .content { gap: 14px; padding: 23px 16px 31px; }
  .dashboard-head, .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .dashboard-head h1 { font-size: clamp(45px, 9vw, 61px); }
  .page-heading { min-height: auto; }
  .page-heading h1 { font-size: clamp(42px, 8vw, 56px); }
  .heading-actions { justify-content: flex-start; }
  .date-label { margin-bottom: 10px; }
  .dashboard-head p, .page-heading p { margin-top: 7px; font-size: 13px; }
  .metrics { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 12px; }
  .metric strong { font-size: 37px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'recent' 'attention' 'week'; }
  .timeline { padding-inline: 15px; }
  .timeline li { grid-template-columns: 29px minmax(0, 1fr) auto 49px; }
  .worker-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .table--mobile-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .table--mobile-stack,
  .table--mobile-stack tbody {
    display: block;
    width: 100%;
  }
  .table--mobile-stack tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--line);
  }
  .table--mobile-stack tr:last-child { border-bottom: 0; }
  .table--mobile-stack td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }
  .table--mobile-stack td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
  }
  .table--mobile-stack td:first-child,
  .table--mobile-stack td[data-label="Acciones"],
  .table--mobile-stack td[data-label="Checador"],
  .table--mobile-stack td[data-label="Resolución"] { grid-column: 1 / -1; }
  .table--mobile-stack td,
  .table--mobile-stack .row-subtitle { overflow-wrap: anywhere; }
  .table--mobile-stack td .row-subtitle { max-width: none; overflow: visible; text-overflow: clip; }
  .table--mobile-stack .row-actions { flex-wrap: wrap; gap: 4px; }
  .table--mobile-stack .button { min-height: 44px; padding-inline: 9px; white-space: normal; }
  .panel-head { flex-wrap: wrap; }
  .subscription { flex-wrap: wrap; justify-content: space-between; }
  .icon-button { width: 44px; height: 44px; }
  .form-grid, .setup-fields { min-width: 0; }
  .public-header { min-height: 68px; padding-inline: 17px; }
  .public-header .brand img { width: 100px; }
  .public-header .brand span { font-size: 14px; }
  .public-main, .kiosk-main { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 29px; width: min(100%, 540px); padding: 22px 19px 35px; }
  .public-rule { margin-bottom: 13px; width: 49px; }
  .public-intro h1 { font-size: clamp(56px, 12vw, 79px); }
  .public-intro > p { margin-top: 18px; font-size: 15px; }
  .feature-strip { gap: 11px 15px; margin-top: 18px; padding-top: 14px; }
  .feature-strip > div > .icon { width: 16px; height: 16px; }
  .feature-strip strong { font-size: 11px; }
  .feature-strip small { font-size: 10px; }
  .public-footer { min-height: 56px; padding-inline: 18px; font-size: 10px; }
  .access-card { padding: 22px; }
  .access-card h2 { font-size: 30px; }
  .kiosk-main { gap: 15px; }
  .kiosk-intro { padding-block: 10px; }
  .kiosk-intro h1 { margin-top: 10px; font-size: clamp(44px, 9.5vw, 68px); }
  .kiosk-intro p { margin-top: 8px; font-size: 14px; }
  .kiosk-clock { margin-top: 12px; }
}

@media (max-width: 375px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kiosk-link .trailing { display: none; }
  .panel-head h2 { font-size: 20px; }
  .panel-actions .button { padding-inline: 6px; font-size: 11px; }
  .filters label { flex: 1; }
  .filters label > input, .filters label > select { width: 100%; min-width: 0; }
}

@keyframes rail-slide-in { from { transform: translateX(-101%); } to { transform: translateX(0); } }

@supports (height: 100dvh) {
  .rail { height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Primera configuración y checador por cartel */

.public-setup-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.public-setup-link .button { min-height: 36px; }
.setup-shell, .setup-done {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(24px, 7vw, 96px);
  align-items: start; width: min(100% - 48px, 1040px); margin: clamp(24px, 5vw, 76px) auto 56px;
}
.setup-intro { padding: 14px 0; }
.setup-eyebrow, .setup-step-count { font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.setup-intro h1, .setup-done-copy h1 {
  font: 540 clamp(42px, 5.8vw, 78px)/.98 var(--display); letter-spacing: -.052em; margin: 14px 0;
}
.setup-intro h1 em { font-weight: 530; color: var(--accent-ink); }
.setup-intro > p:not(.setup-eyebrow), .setup-done-copy p { margin: 14px 0; color: var(--muted); max-width: 29rem; }
.setup-steps { margin: 32px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.setup-steps li { display: flex; align-items: center; gap: 12px; font-weight: 620; color: var(--muted); }
.setup-steps li span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; font-size: 12px; }
.setup-steps .current { color: var(--ink); }
.setup-steps .current span { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--white); }
.setup-steps .done span { background: var(--accent-wash); border-color: var(--accent-wash); color: var(--accent-ink); }
.setup-steps .icon { width: 15px; height: 15px; }
.setup-card { width: 100%; }
.setup-card form, .setup-options { display: grid; gap: 14px; }
.setup-card h2:focus { outline: none; }
.setup-card .setup-step-count { margin-bottom: 8px; color: var(--accent-ink); }
.setup-card .setup-toggle {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 12px; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; background: var(--paper);
}
.setup-toggle input { appearance: auto; accent-color: var(--accent-solid); width: 17px; min-height: unset; height: 17px; flex: 0 0 17px; margin: 1px 0; }
.setup-toggle small { display: block; font-weight: 450; color: var(--muted); padding-top: 3px; }
.setup-options { min-inline-size: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.setup-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setup-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 6px; }
.setup-actions .button { min-height: 44px; }
.setup-demo-note { margin-top: 16px; font-size: 11px; color: var(--muted); }
.setup-done { align-items: center; }
.setup-done-copy h1 { font-size: clamp(38px, 5vw, 65px); }
.checkin-poster {
  text-align: center; padding: clamp(20px, 3vw, 40px); background: var(--white);
  border: 1px solid var(--line-dark); border-radius: 18px; display: grid; gap: 12px; justify-items: center;
}
.poster-kicker { display: flex; justify-content: center; gap: 5px; align-items: center; color: var(--accent-ink); font-weight: 700; }
.checkin-poster h2 { font: 560 clamp(27px, 4vw, 45px)/1.04 var(--display); letter-spacing: -.055em; }
.checkin-poster p { color: var(--muted); }
.checkin-poster :is(h2,p) { overflow-wrap: anywhere; min-width: 0; }
.poster-company-logo { display: block; max-width: min(100%, 144px); max-height: 54px; width: auto; height: auto; }
.poster-editor { display: grid; gap: 12px; }
.poster-editor input[type="file"] { max-width: 100%; }
.poster-editor input[type="color"] { width: 58px; padding: 5px; cursor: pointer; }
.poster-editor-color { display: flex; align-items: end; gap: 12px; }
.poster-editor-color .form-note { margin: 0 0 4px; }
.poster-editor .poster-remove-logo { display: flex; align-items: center; gap: 8px; }
.poster-editor .poster-remove-logo input { appearance: auto; width: 16px; height: 16px; margin: 0; }
.poster-editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.poster-editor details > summary { cursor: pointer; margin-bottom: 10px; color: var(--accent-ink); font-weight: 650; }
.poster-code { width: min(100%, 240px); aspect-ratio: 1; height: auto; display: block; background: #fff; }
.poster-note { max-width: 280px; font-size: 12px; }
.poster-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.poster-manage { display: flex; justify-content: center; padding: 12px; }
.scan-shell { width: min(100% - 32px, 470px); margin: clamp(18px, 8vh, 86px) auto 50px; }
.scan-card { width: 100%; text-align: center; }
.scan-card .section-icon { margin-inline: auto; }
.scan-card h1 { font: 570 clamp(32px, 6vw, 47px)/1.08 var(--display); letter-spacing: -.06em; }
.scan-card form { text-align: left; }
.scan-card form button { width: 100%; min-height: 48px; }
.scan-place { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 13px; color: var(--accent-ink); }
.scan-clock { margin: 8px 0 18px; }
.scan-actions { display: grid; gap: 9px; }
.scan-actions .button { width: 100%; min-height: 49px; }
.scan-state { margin: 14px 0; padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); }
.scan-card .form-note { margin-top: 12px; }
.scan-last { display: grid; gap: 4px; margin: 18px 0 9px; padding: 13px 12px; border-top: 1px solid var(--line); color: var(--muted); }
.scan-last strong { color: var(--ink); }
#work-poster-print { display: none; }

@media screen and (max-width: 700px), screen and (max-width: 950px) and (max-height: 540px) and (pointer: coarse) {
  .setup-shell, .setup-done { grid-template-columns: 1fr; width: min(100% - 32px, 510px); margin-top: 18px; gap: 16px; }
  .setup-intro { padding: 0; }
  .setup-intro h1 { font-size: clamp(36px, 10vw, 48px); margin: 7px 0; }
  .setup-intro h1 br { display: none; }
  .setup-intro > p:not(.setup-eyebrow) { margin: 9px 0; }
  .setup-steps { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 15px; font-size: 11px; }
  .setup-steps li { gap: 5px; }
  .setup-steps li span { width: 23px; height: 23px; }
  .setup-header { min-height: 68px; }
  .setup-card { padding: 17px; }
  .scan-header { min-height: 64px; }
}

@media print {
  body:has(> #work-poster-print) > :not(#work-poster-print) { display: none !important; }
  body:has(> #work-poster-print) { display: block; min-height: 0; margin: 0; background: #fff; }
  #work-poster-print { display: block; margin: 0 auto; padding-block: 17mm; width: 150mm; max-width: 100%; break-inside: avoid; }
  #work-poster-print .print-brand { display: block; margin: 0 auto 12mm; }
  #work-poster-print .checkin-poster { border: 1px solid #a89b8f; background: #fff; padding: 14mm 8mm; }
  #work-poster-print .poster-code { width: 84mm; }
  #work-poster-print .checkin-poster h2 { font-size: 27pt; }
}

#reports-filter .form-error { flex-basis: 100%; }

@media screen and (max-width: 700px), screen and (max-width: 950px) and (max-height: 540px) and (pointer: coarse) {
  .button, .filters .button, .panel-actions .button { min-height: 44px; }
  .filters { align-items: stretch; }
  .filters label { flex: 1 1 130px; min-width: 0; }
  .filters label > input, .filters label > select { width: 100%; min-width: 0; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea,
  .filters label > input, .filters label > select,
  .setup-card input, .setup-card select { min-height: 44px; font-size: 16px; }
}
