:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: rgba(255, 255, 255, 0.86);
  --surface-soft: #f9f9fb;
  --sidebar: rgba(248, 248, 250, 0.92);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-strong: #3a3a3c;
  --line: rgba(60, 60, 67, 0.16);
  --line-strong: rgba(60, 60, 67, 0.28);
  --accent: #007aff;
  --accent-strong: #0066d6;
  --accent-soft: rgba(0, 122, 255, 0.11);
  --green: #248a3d;
  --green-soft: rgba(36, 138, 61, 0.12);
  --amber: #b26a00;
  --amber-soft: rgba(255, 159, 10, 0.14);
  --red: #d70015;
  --red-soft: rgba(255, 69, 58, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --content-width: 1080px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-raised: rgba(28, 28, 30, 0.88);
    --surface-soft: #2c2c2e;
    --sidebar: rgba(22, 22, 24, 0.92);
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --muted-strong: #d1d1d6;
    --line: rgba(235, 235, 245, 0.14);
    --line-strong: rgba(235, 235, 245, 0.24);
    --accent: #0a84ff;
    --accent-strong: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --green: #32d74b;
    --green-soft: rgba(50, 215, 75, 0.17);
    --amber: #ffd60a;
    --amber-soft: rgba(255, 214, 10, 0.16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.17);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  }

  .company-logo {
    filter: invert(1);
    mix-blend-mode: screen;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 40px;
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon,
.button-icon,
.field-icon,
.card-icon {
  display: block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon {
  width: 22px;
  height: 22px;
}

.button-icon {
  width: 24px;
  height: 24px;
}

.field-icon {
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.card-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  padding: 40px 18px 24px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 8px 32px;
  color: var(--ink);
}

.brand-clock {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.clock-face {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.clock-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 50% 100%;
}

.clock-hour {
  width: 3px;
  height: 9px;
  transform: translateX(-50%) rotate(var(--hour-angle, 0deg));
}

.clock-minute {
  width: 2px;
  height: 13px;
  transform: translateX(-50%) rotate(var(--minute-angle, 0deg));
}

.clock-second {
  width: 1.5px;
  height: 14px;
  background: var(--red);
  transform: translateX(-50%) rotate(var(--second-angle, 0deg));
}

.clock-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-time {
  font-size: 29px;
  font-weight: 780;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.brand-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.mode-tabs,
.side-actions {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-strong);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 650;
  text-align: left;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.nav-button.quiet {
  min-height: 50px;
  color: var(--muted);
}

.nav-button:hover,
.sidebar-link:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.employee-quick-button:hover,
.admin-access-button:hover,
.stepper button:hover {
  transform: translateY(-1px);
}

.nav-button:focus-visible,
.sidebar-link:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.danger-button:focus-visible,
.employee-quick-button:focus-visible,
.admin-access-button:focus-visible,
.stepper button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.28);
  outline-offset: 2px;
}

.sidebar-spacer {
  flex: 1 1 auto;
  min-height: 28px;
}

.sidebar-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card h2 {
  font-size: 15px;
  font-weight: 720;
  line-height: 1.25;
}

.sidebar-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.sidebar-link {
  grid-column: 2;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.side-actions {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.sidebar-footer {
  display: grid;
  justify-items: start;
  gap: 18px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 8px 0;
}

.sidebar-admin-button {
  width: 100%;
  padding-inline: 6px;
}

.sidebar-admin-chevron {
  margin-left: auto;
}

.company-logo {
  display: block;
  width: 112px;
  height: auto;
  margin-left: 6px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.workspace {
  min-width: 0;
  padding: 32px min(56px, 5vw) 56px;
}

.topbar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 24px;
}

.admin-access-button {
  display: inline-flex;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.admin-access-button .icon {
  width: 18px;
  height: 18px;
}

.admin-access-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.neutral {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted-strong);
}

.status-pill.good {
  border-color: color-mix(in srgb, var(--green) 36%, transparent);
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.warn {
  border-color: color-mix(in srgb, var(--amber) 38%, transparent);
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.bad {
  border-color: color-mix(in srgb, var(--red) 38%, transparent);
  background: var(--red-soft);
  color: var(--red);
}

.content {
  width: min(100%, var(--content-width));
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
}

.section-head.inline {
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.panel,
.entry-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel {
  padding: 24px;
  box-shadow: var(--shadow);
}

.entry-panel {
  border-color: transparent;
  background: transparent;
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.employee-quick-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.employee-quick-button {
  display: grid;
  min-height: 96px;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.employee-quick-button span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.employee-quick-button strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.2;
}

.employee-quick-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.punch-panel {
  display: flex;
  min-height: 176px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px;
  box-shadow: var(--shadow);
}

.punch-panel h2 {
  margin-top: 12px;
}

.punch-panel p {
  margin-top: 7px;
}

.punch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
  min-width: min(100%, 380px);
}

.punch-timer {
  display: grid;
  min-width: 172px;
  place-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 17px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), var(--shadow-sm);
  text-align: center;
}

.punch-timer span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.punch-timer strong {
  font-size: 31px;
  font-weight: 830;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.punch-actions button {
  min-height: 86px;
  flex-direction: column;
  gap: 8px;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 16px;
}

.form-grid.compact {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.form-grid.wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.login-grid {
  grid-template-columns: minmax(220px, 1.1fr) minmax(170px, 0.7fr) auto;
}

.field-block {
  display: grid;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
}

.field-block em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.helper-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.35;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.counter {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.input-shell {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16);
}

.display-field {
  font-size: 19px;
  font-weight: 650;
}

.end-icon {
  margin-left: auto;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  outline: 0;
}

.input-shell input,
.input-shell select,
.input-shell textarea {
  min-height: 58px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 520;
}

.input-shell select {
  appearance: none;
}

.input-shell input[type="date"],
.input-shell input[type="time"] {
  color-scheme: light dark;
}

.input-shell input[type="number"] {
  appearance: textfield;
}

.input-shell input[type="number"]::-webkit-outer-spin-button,
.input-shell input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.note-shell {
  min-height: 104px;
  align-items: stretch;
  padding: 0 16px;
}

.note-shell textarea {
  min-height: 102px;
  padding: 15px 0;
  line-height: 1.45;
  resize: vertical;
}

.pause-shell {
  padding-right: 10px;
}

.stepper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  min-width: 122px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.stepper button {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--accent);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.stepper button + button {
  border-left: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 720;
  text-align: center;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.primary-button {
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.23);
}

.submit-button {
  min-height: 68px;
  font-size: 18px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--accent);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-strong);
}

.danger-button {
  border: 1px solid color-mix(in srgb, var(--red) 36%, transparent);
  background: var(--red-soft);
  color: var(--red);
}

.full-span {
  grid-column: 1 / -1;
}

.summary-box {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 18px 22px;
}

.summary-box span {
  display: block;
  font-size: 20px;
  font-weight: 730;
}

.summary-box small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.summary-box strong {
  color: var(--accent);
  font-size: 36px;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

.notice,
.error-box,
.form-message {
  border-radius: var(--radius);
  padding: 12px 14px;
  line-height: 1.45;
}

.notice {
  border: 1px solid color-mix(in srgb, var(--amber) 34%, transparent);
  background: var(--amber-soft);
  color: var(--amber);
}

.error-box {
  border: 1px solid color-mix(in srgb, var(--red) 34%, transparent);
  background: var(--red-soft);
  color: var(--red);
}

.form-message {
  margin-top: 12px;
  color: var(--muted);
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.export-required {
  border-color: color-mix(in srgb, var(--amber) 38%, transparent);
  background: color-mix(in srgb, var(--amber-soft) 46%, var(--surface));
}

.button-row,
.restore-row,
.employee-row,
.month-controls {
  display: flex;
  align-items: center;
}

.button-row {
  gap: 10px;
  flex-wrap: wrap;
}

.restore-row {
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
}

.file-label {
  display: grid;
  flex: 1 1 260px;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.list,
.audit-list,
.check-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.check-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.check-item strong {
  font-size: 16px;
}

.check-item span {
  color: var(--muted);
  line-height: 1.4;
}

.check-item.good {
  border-color: color-mix(in srgb, var(--green) 34%, transparent);
  background: var(--green-soft);
}

.check-item.good strong {
  color: var(--green);
}

.check-item.warn {
  border-color: color-mix(in srgb, var(--amber) 34%, transparent);
  background: var(--amber-soft);
}

.check-item.warn strong {
  color: var(--amber);
}

.restore-preview {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.restore-preview span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.restore-preview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.restore-preview strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.employee-row {
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.employee-meta {
  display: grid;
  gap: 6px;
}

.employee-meta strong {
  font-size: 17px;
  font-weight: 720;
}

.employee-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.month-controls {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.summary-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.summary-tile strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  font-weight: 760;
}

.employee-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
}

.employee-month-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.employee-month-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
}

.employee-month-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.employee-month-card strong {
  display: block;
  font-size: 17px;
  font-weight: 730;
}

.employee-month-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
}

.employee-month-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.employee-month-stats span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-month-stats b {
  font-size: 16px;
  font-weight: 730;
  line-height: 1.15;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

tr.weekend td {
  background: var(--amber-soft);
}

tr:last-child td {
  border-bottom: 0;
}

.audit-item {
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px 14px;
  color: var(--muted);
}

.audit-item strong {
  display: block;
  color: var(--ink);
  font-weight: 720;
}

.hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 276px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
  }

  .workspace {
    padding-inline: 30px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .employee-month-grid,
  .employee-month-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 14px;
  }

  .brand {
    padding-bottom: 18px;
  }

  .mode-tabs,
  .side-actions {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin-top: 16px;
    padding-inline: 0;
  }

  .company-logo {
    width: 92px;
    margin: 0 8px 0 0;
  }

  .sidebar-spacer,
  .sidebar-card {
    display: none;
  }

  .workspace {
    padding: 18px 16px 40px;
  }

  .topbar {
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }

  .form-grid,
  .form-grid.compact,
  .form-grid.wide,
  .login-grid,
  .entry-form {
    grid-template-columns: 1fr;
  }

  .section-head,
  .section-head.inline,
  .action-panel,
  .punch-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .month-controls,
  .button-row,
  .restore-row,
  .employee-actions,
  .punch-actions {
    justify-content: stretch;
  }

  .month-controls > *,
  .button-row > *,
  .restore-row > *,
  .employee-actions > *,
  .punch-timer,
  .punch-actions > * {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-month-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 21px;
  }

  .brand-time {
    font-size: 25px;
  }

  .mode-tabs,
  .side-actions {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .field-block {
    font-size: 16px;
  }

  .input-shell {
    min-height: 58px;
  }

  .input-shell input,
  .input-shell select,
  .input-shell textarea {
    font-size: 16px;
  }

  .pause-shell {
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .stepper {
    width: 100%;
  }

  .punch-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .summary-box {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .summary-box strong {
    font-size: 32px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .employee-month-stats {
    grid-template-columns: 1fr;
  }

  .employee-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Employee archive and vacation planning */
.vacation-panel { margin-top: 24px; }
.employee-archive { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.employee-archive summary { cursor: pointer; font-weight: 720; padding: 12px 0; }
.vacation-panel h3, #vacation-admin-panel h3 { margin-top: 26px; }
.vacation-request { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.vacation-request p { margin: 0; }
.vacation-request-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.vacation-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.vacation-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.vacation-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 630px; gap: 5px; margin: 16px 0 24px; }
.vacation-weekday { text-align: center; font-weight: 720; padding: 8px; }
.vacation-day { min-height: 90px; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.vacation-day.weekend { background: var(--surface-soft); }
.vacation-day time { font-weight: 720; }
.vacation-person { font-size: 12px; padding: 4px 6px; background: var(--accent-soft); border-radius: 5px; overflow-wrap: anywhere; }
#vacation-admin-panel caption { text-align: left; font-weight: 720; padding: 12px 0; }
@media (max-width: 820px) { .vacation-filters { grid-template-columns: 1fr; } }

/* Focused tablet layout: local type, clear destinations and comfortable touch targets. */
@font-face {
  font-family: Manrope;
  src: url("fonts/manrope-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --bg: #f1f4f7;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --sidebar: #e9eef3;
  --ink: #192c3d;
  --muted: #586a79;
  --muted-strong: #344b5e;
  --line: #d9e2e9;
  --line-strong: #bccbd7;
  --accent: #246397;
  --accent-strong: #1b507c;
  --accent-soft: #e5eff8;
  --green: #28704c;
  --green-soft: #e6f2e9;
  --amber: #895c16;
  --amber-soft: #fbf0d9;
  --red: #a13d48;
  --red-soft: #f9e8eb;
  --shadow: none;
  --shadow-sm: none;
  --radius: 12px;
  --content-width: 1216px;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131d26;
    --surface: #1c2a36;
    --surface-soft: #223240;
    --sidebar: #17232e;
    --ink: #eef4f8;
    --muted: #b2c1cd;
    --muted-strong: #d4e0e9;
    --line: #364959;
    --line-strong: #536c80;
    --accent: #a3c8ee;
    --accent-strong: #c2ddf7;
    --accent-soft: #2b4257;
    --green: #a4dabc;
    --green-soft: #243e33;
    --amber: #f1d493;
    --amber-soft: #423824;
    --red: #f1b2b9;
    --red-soft: #452f36;
  }
}
body, .app-shell { min-height: 100dvh; }
body { font-size: 16px; line-height: 1.55; }
h1 { font-size: clamp(30px, 3.2vw, 44px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 24px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.3; text-wrap: balance; }
h3 { font-size: 18px; font-weight: 750; letter-spacing: -0.018em; line-height: 1.4; }
p { text-wrap: pretty; }
.app-shell { grid-template-columns: 242px minmax(0, 1fr); }
.sidebar { min-height: 100dvh; height: 100dvh; padding: 30px 18px 24px; background: var(--sidebar); backdrop-filter: none; -webkit-backdrop-filter: none; overflow-y: auto; }
.brand-label { padding: 0 12px; font-size: 20px; font-weight: 800; letter-spacing: -0.035em; }
.brand { padding: 10px 12px 30px; }
.brand-clock { display: none; }
.brand-time { font-size: 23px; font-weight: 650; color: var(--muted-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.brand-date { font-size: 12px; line-height: 1.5; }
.mode-tabs { display: grid; gap: 8px; }
.nav-button { min-height: 56px; gap: 12px; padding: 14px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--muted-strong); background: transparent; box-shadow: none; }
.nav-button.active { background: var(--surface); color: var(--accent); border-color: var(--surface); box-shadow: none; }
.nav-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: auto; padding: 0 5px; border-radius: 7px; background: var(--accent); color: var(--surface); font-size: 12px; }
.sidebar-card { background: var(--surface); border: 0; padding: 18px; border-radius: 14px; box-shadow: none; }
.sidebar-card h2 { font-size: 15px; }
.sidebar-footer { border-top: 0; padding-top: 22px; }
.company-logo { width: 104px; max-height: 86px; object-fit: contain; }
.workspace { min-width: 0; padding: 30px 34px 48px; }
.topbar { display: flex; gap: 8px; align-items: center; margin-bottom: 30px; }
.workspace-label { flex: 1; color: var(--muted); font-size: 13px; font-weight: 650; }
.admin-access-button { width: 48px; height: 48px; min-height: 48px; border-radius: 12px; box-shadow: none; }
.status-pill { min-height: 30px; border: 0; border-radius: 7px; font-size: 12px; font-weight: 750; padding: 5px 10px; }
.section-head { gap: 18px; margin-bottom: 26px; align-items: center; }
.section-description { margin-top: 10px; max-width: 65ch; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 650; text-transform: none; margin-bottom: 6px; }
.panel, .punch-panel { border: 0; border-radius: 18px; padding: 28px; box-shadow: none; }
.panel > .muted { margin: 10px 0 20px; max-width: 70ch; }
.admin-stack { gap: 22px; }
.admin-section-hidden { display: none !important; }
.admin-section-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--surface); border-radius: 14px; }
.admin-section-nav button { flex: 1 1 auto; min-height: 48px; border: 0; border-radius: 10px; padding: 10px 14px; background: transparent; color: var(--muted-strong); font-size: 14px; font-weight: 750; }
.admin-section-nav button.active { background: var(--accent-soft); color: var(--accent); }
.admin-shortcuts { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.overview-shortcut { display: flex; align-items: center; gap: 16px; padding: 24px; text-align: left; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); }
.overview-shortcut > span { flex: 1; display: grid; gap: 8px; }
.overview-shortcut small { color: var(--muted); font-size: 13px; font-weight: 650; }
.overview-shortcut strong { font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }
.overview-shortcut > span > span { font-size: 13px; color: var(--accent); }
.vacation-shortcut { background: var(--accent-soft); }
.login-panel { max-width: 940px; }
.employee-quick-list { gap: 12px; margin-bottom: 24px; }
.employee-quick-button { min-height: 102px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.employee-quick-button span { border-radius: 10px; background: var(--surface); font-weight: 800; }
.employee-quick-button.active { border: 2px solid var(--accent); padding: 15px; }
.empty-state { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px; background: var(--surface-soft); border-radius: 14px; }
.empty-state > .icon { width: 32px; height: 32px; color: var(--accent); }
.empty-state p { margin-top: 5px; max-width: 58ch; font-size: 14px; }
.empty-state .secondary-button { font-size: 14px; }
.login-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr) auto; }
.field-block { gap: 8px; font-size: 14px; font-weight: 750; }
.input-shell { min-height: 56px; padding: 0 14px; border-radius: 10px; background: var(--surface-soft); box-shadow: none; }
.input-shell input, .input-shell select, .input-shell textarea { font-size: 16px; background: transparent; }
.input-shell textarea { line-height: 1.6; }
input, select, textarea { border-radius: 10px; font-size: 16px; }
.input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.primary-button, .secondary-button, .danger-button, .ghost-button { min-height: 52px; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 750; box-shadow: none; }
.primary-button { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.primary-button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.secondary-button { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.secondary-button:hover, .overview-shortcut:hover { background: var(--accent-soft); border-color: var(--accent); }
.danger-button { color: var(--red); border-color: var(--red-soft); background: var(--red-soft); }
.punch-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; }
.punch-actions { grid-column: 1 / -1; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.punch-actions button { min-height: 90px; font-size: 18px; flex-direction: row; }
.punch-timer { border: 0; border-radius: 14px; box-shadow: none; padding: 20px; }
.punch-timer span { text-transform: none; font-size: 13px; }
.punch-timer strong { font-size: 32px; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
#punch-start { border-color: var(--accent); color: var(--accent); }
.entry-form { gap: 20px; }
.entry-panel { margin-bottom: 26px; }
.summary-box { box-shadow: none; border-radius: 14px; }
.summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.summary-tile { border: 0; border-radius: 12px; padding: 18px; background: var(--surface-soft); }
.summary-tile span { font-size: 13px; color: var(--muted); }
.summary-tile strong { margin-top: 8px; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.employee-row { padding: 18px; border: 0; border-radius: 12px; }
.employee-meta strong { font-size: 16px; }
.employee-month-card { border-radius: 14px; box-shadow: none; }
.employee-month-stats b, td, .brand-time { font-variant-numeric: tabular-nums; }
.employee-archive summary { min-height: 48px; }
.form-message { padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); }
.vacation-panel { margin-top: 24px; scroll-margin-top: 20px; }
#vacation-admin-panel h3 { margin-top: 26px; margin-bottom: 14px; }
.vacation-jump-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.vacation-jump-links a { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 16px; border-radius: 10px; background: var(--surface-soft); color: var(--accent); font-size: 14px; font-weight: 750; text-decoration: none; }
.vacation-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: end; }
.calendar-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.calendar-controls button { min-height: 48px; padding: 10px 16px; }
.vacation-calendar { min-width: 560px; gap: 6px; margin-top: 12px; }
.vacation-weekday { color: var(--muted); font-size: 12px; }
.vacation-day { min-height: 94px; border: 0; background: var(--surface-soft); padding: 10px; border-radius: 10px; }
.vacation-day.weekend { background: var(--bg); }
.vacation-day time { font-size: 14px; font-variant-numeric: tabular-nums; }
.vacation-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.vacation-person { background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 750; padding: 5px 6px; border-radius: 5px; }
.vacation-request { border: 0; border-radius: 14px; padding: 22px; gap: 14px; }
.vacation-request-head strong { font-size: 17px; }
.vacation-note { max-width: 65ch; }
.table-wrap { max-width: 100%; border: 0; border-radius: 12px; }
thead { background: var(--surface-soft); }
th { font-size: 13px; font-weight: 750; text-transform: none; }
td { font-size: 14px; }
th, td { padding: 16px; }
.check-item { padding: 18px; border-radius: 12px; box-shadow: none; }
.audit-item { padding: 16px 18px; border-radius: 10px; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 10; padding: 14px 18px; border-radius: 10px; background: var(--accent); color: var(--surface); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
button, a { touch-action: manipulation; }
button, a, .input-shell { transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button:active:not(:disabled) { transform: translateY(1px); }
html { scroll-behavior: smooth; }
@media (max-width: 1199px) and (min-width: 901px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .workspace { padding: 24px; }
  .login-grid { grid-template-columns: 1fr 1fr; }
  .login-grid > button { grid-column: 1 / -1; }
  .form-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-shortcut { padding: 20px; gap: 12px; }
  .overview-shortcut strong { font-size: 17px; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 16px 20px; border-right: 0; }
  .brand-label { grid-column: 1; grid-row: 1; padding: 0; font-size: 19px; }
  .brand { grid-column: 1; grid-row: 2; padding: 0; }
  .brand-copy { gap: 2px; }
  .brand-time { font-size: 18px; }
  .brand-date { font-size: 11px; }
  .sidebar-footer { grid-column: 2; grid-row: 1 / 3; align-self: center; padding: 0; margin: 0; display: block; }
  .company-logo { width: 80px; max-height: 62px; margin: 0; }
  .mode-tabs { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
  .nav-button { justify-content: center; gap: 7px; padding: 12px 8px; font-size: 13px; min-height: 52px; }
  .nav-count { margin-left: 0; }
  .sidebar-admin-chevron, .sidebar-spacer, .sidebar-card { display: none; }
  .side-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
  .side-actions .nav-button { min-height: 44px; padding: 8px; font-size: 12px; }
  .workspace { padding: 22px 20px 40px; }
  .topbar { margin-bottom: 22px; }
  .admin-shortcuts { grid-template-columns: 1fr 1fr; }
  .login-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  .login-grid > button { grid-column: 1 / -1; }
  .form-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .punch-panel { flex-direction: initial; }
  .punch-actions > *, .punch-timer { width: auto; }
  .employee-actions > * { width: auto; }
}
@media (max-width: 600px) {
  .sidebar { padding: 14px 16px; }
  .workspace { padding: 20px 16px 36px; }
  .workspace-label { display: none; }
  .topbar { justify-content: flex-end; gap: 6px; }
  .topbar .status-pill { font-size: 10px; padding: 6px 8px; white-space: normal; }
  .nav-button { flex-direction: column; gap: 5px; font-size: 11px; min-height: 62px; position: relative; }
  .nav-count { position: absolute; right: 5px; top: 5px; min-width: 19px; height: 19px; font-size: 10px; }
  .side-actions .nav-button { flex-direction: row; min-height: 44px; }
  .panel, .punch-panel { padding: 20px; border-radius: 15px; }
  .section-head, .section-head.inline { align-items: stretch; }
  .section-description { font-size: 14px; }
  .empty-state { grid-template-columns: auto 1fr; padding: 18px; gap: 14px; }
  .empty-state .secondary-button { grid-column: 1 / -1; }
  .form-grid, .form-grid.compact, .form-grid.wide, .login-grid, .entry-form, .vacation-filters { grid-template-columns: minmax(0, 1fr); }
  .employee-quick-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-quick-button strong { font-size: 14px; }
  .admin-shortcuts { grid-template-columns: 1fr; }
  .overview-shortcut { padding: 20px; }
  .admin-section-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-section-nav button:last-child { grid-column: 1 / -1; }
  .punch-panel { grid-template-columns: minmax(0, 1fr); }
  .punch-actions { grid-template-columns: minmax(0, 1fr); }
  .summary-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .summary-tile strong { margin: 0; }
  .employee-actions { justify-content: stretch; }
  .employee-actions > * { flex: 1; }
  .calendar-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .calendar-controls button:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button, a, .input-shell { transition: none; }
  button:active:not(:disabled) { transform: none; }
}

/* Keep intrinsic table widths inside their scroll containers on tablets. */
.content, .panel, .admin-stack, .table-wrap { min-width: 0; }
.admin-stack { grid-template-columns: minmax(0, 1fr); }
.table-wrap { width: 100%; overflow-x: auto; }
h1[tabindex]:focus { outline: none; }
@media (max-width: 900px) {
  .side-actions { border: 0; margin: 0; padding: 0; }
  .section-head, .section-head.inline { flex-direction: row; align-items: stretch; }
}
@media (max-width: 600px) {
  .section-head, .section-head.inline { flex-direction: column; }
}

/* Fit full destination names and counts without a second scrollbar. */
@media (min-width: 901px) {
  .app-shell { grid-template-columns: 242px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; overflow-x: hidden; }
  .mode-tabs .nav-button { gap: 8px; padding-inline: 10px; font-size: 13px; }
  .mode-tabs .nav-button > .icon { width: 20px; height: 20px; }
  .nav-count { flex-shrink: 0; }
  .sidebar-card { display: block; padding: 16px; }
  .sidebar-card > .card-icon { display: none; }
  .sidebar-card p { font-size: 12px; line-height: 1.6; margin-top: 8px; }
  .sidebar-link { width: 100%; min-height: 44px; justify-content: space-between; }
}
