:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #637083;
  --border: #d9dee7;
  --brand: #8b1f2f;
  --brand-dark: #651522;
  --accent: #0f6b6e;
  --danger: #b42318;
  --ok: #146c43;
  --shadow: 0 10px 24px rgba(23, 32, 42, 0.08);
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app {
  height: 100dvh;
  min-height: 0;
}

body.page-scroll-enabled {
  overflow: hidden;
}

.app-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(139, 31, 47, 0.11), rgba(15, 107, 110, 0.08)),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  margin-bottom: 22px;
}

h2 {
  font-size: 1.35rem;
}

.topbar {
  flex: 0 0 auto;
  min-height: 72px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-dev {
  background: #fff7e6;
  border-bottom-color: #d97706;
  box-shadow: 0 2px 0 rgba(217, 119, 6, 0.16);
}

.topbar-dev .clock {
  color: #8a3b00;
}

.topbar-dev .muted {
  color: #6f4f23;
}

.env-badge {
  display: inline-grid;
  min-height: 22px;
  place-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #d97706;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.view-switcher {
  position: relative;
}

.view-switcher-button {
  min-width: 150px;
  text-align: left;
}

.view-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  max-height: min(60dvh, 360px);
  overflow: auto;
  display: grid;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}

.view-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 800;
}

.view-menu button:hover,
.view-menu button.active {
  background: #f5eef0;
  color: var(--brand);
}

.brand {
  font-weight: 800;
  font-size: 1.05rem;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--brand);
}

.layout {
  width: 100%;
  margin: 0;
  padding: 16px max(18px, 3vw);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.dashboard-view,
.section {
  height: 100%;
  min-height: 0;
}

.section {
  margin-bottom: 0;
}

.section-header,
.selected-user-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 6px;
}

.section-header p,
.muted {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
}

.admin-section {
  display: flex;
  flex-direction: column;
}

.employee-section {
  display: flex;
  flex-direction: column;
}

.employee-section > .employee-carousel {
  flex: 1 1 auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  margin-bottom: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.panel,
.subpanel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  min-height: 0;
}

.admin-grid > .panel {
  overflow: hidden;
}

.admin-grid > .wide {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.selected-user-header {
  flex: 0 0 auto;
}

.admin-carousel {
  flex: 1 1 auto;
  min-height: 0;
}

.subpanel {
  margin-top: 16px;
  box-shadow: none;
}

.selected-user-panel-inactive {
  background: #f7f8fa;
  border-style: dashed;
}

.panel-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 14px;
}

.panel-title.small {
  font-size: 0.95rem;
}

.day-timeline-panel {
  margin-bottom: 16px;
}

.employee-carousel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.employee-carousel-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding-block: 2px;
}

.carousel-tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  margin: -2px;
  scrollbar-width: thin;
}

.carousel-tab,
.carousel-arrow {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(23, 32, 42, 0.06);
}

.carousel-tab {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.carousel-tab:hover,
.carousel-tab.active,
.carousel-arrow:hover {
  border-color: var(--brand);
  background: #fff8f9;
  color: var(--brand);
}

.carousel-arrow {
  width: 44px;
  min-height: 44px;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
}

.employee-carousel-viewport {
  overflow: hidden;
  border-radius: 8px;
  min-height: 0;
}

.employee-carousel-track {
  display: flex;
  align-items: stretch;
  height: 100%;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.employee-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 0;
  padding-inline: 1px;
  overflow: auto;
}

.employee-carousel-slide > .panel {
  height: 100%;
  margin-bottom: 0;
}

.employee-carousel-slide[aria-hidden="true"] {
  pointer-events: none;
}

.period-slide {
  min-width: 0;
}

.period-slide.slide-forward {
  animation: period-slide-from-right 1000ms cubic-bezier(0.22, 1, 0.36, 1);
}

.period-slide.slide-back {
  animation: period-slide-from-left 1000ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes period-slide-from-right {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes period-slide-from-left {
  from {
    opacity: 0;
    transform: translateX(-34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .employee-carousel-track,
  .period-slide.slide-forward,
  .period-slide.slide-back {
    animation: none;
    transition: none;
  }
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.timeline-header .panel-title {
  margin-bottom: 4px;
}

.timeline-header p {
  color: var(--muted);
  font-weight: 700;
}

.timeline-alert {
  flex: 1 1 320px;
  max-width: 560px;
  display: grid;
  gap: 3px;
  padding: 8px 12px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: #fff4f2;
  color: var(--text);
}

.timeline-alert strong {
  color: var(--danger);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.timeline-alert span {
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.3;
}

.compliance-alerts {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.timeline-header .compliance-alerts {
  flex: 1 1 320px;
  max-width: 560px;
  margin: 0;
}

.compliance-alert {
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 8px;
  background: #fff4f2;
  color: var(--text);
}

.compliance-alert strong {
  color: var(--danger);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.compliance-alert span {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.timeline-metrics {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex: 0 0 auto;
}

.timeline-total {
  min-width: 110px;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: right;
}

.timeline-total span,
.timeline-tr span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-total strong {
  color: var(--accent);
  font-size: 1.35rem;
}

.timeline-tr {
  min-width: 82px;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: center;
}

.timeline-tr strong {
  font-size: 1.1rem;
}

.timeline-tr.yes {
  border-color: rgba(20, 108, 67, 0.3);
  background: #edf7f1;
}

.timeline-tr.yes strong {
  color: var(--ok);
}

.timeline-tr.no {
  border-color: #e2e6ed;
  background: #f6f7f9;
}

.timeline-tr.no strong {
  color: var(--muted);
}

.timeline-stage {
  display: grid;
  gap: 10px;
  padding: 18px 10px 4px;
}

.timeline-track {
  position: relative;
  height: 74px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), rgba(99, 112, 131, 0.14) calc(12.5% - 1px), rgba(99, 112, 131, 0.14) 12.5%),
    #fbfcfd;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #cfd8dc;
  transform: translateY(-50%);
}

.timeline-segment {
  position: absolute;
  top: calc(50% - 8px);
  height: 16px;
  border-radius: 999px;
  background: rgba(15, 107, 110, 0.28);
  border: 1px solid rgba(15, 107, 110, 0.38);
  z-index: 1;
}

.timeline-segment.open {
  background: repeating-linear-gradient(135deg, rgba(15, 107, 110, 0.32) 0 8px, rgba(15, 107, 110, 0.18) 8px 16px);
}

.timeline-marker {
  position: absolute;
  top: 50%;
  z-index: 2;
  min-width: 58px;
  display: grid;
  gap: 2px;
  justify-items: center;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.timeline-marker::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(23, 32, 42, 0.14);
}

.timeline-marker.in::before {
  background: var(--ok);
}

.timeline-marker.out::before {
  background: var(--brand);
}

.timeline-marker span {
  color: var(--muted);
}

.timeline-marker strong {
  padding: 2px 5px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 32, 42, 0.12);
}

.timeline-ticks {
  position: relative;
  height: 20px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.timeline-ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-ticks span:first-child {
  transform: translateX(0);
}

.timeline-ticks span:last-child {
  transform: translateX(-100%);
}

.timeline-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.timeline-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.in {
  background: var(--ok);
}

.legend-dot.out {
  background: var(--brand);
}

.legend-line {
  width: 22px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 107, 110, 0.28);
  border: 1px solid rgba(15, 107, 110, 0.38);
}

.filters,
.inline-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.login-form,
.stacked-form,
.schedule-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(15, 107, 110, 0.22);
  border-color: var(--accent);
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.plus-button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 8px 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.punch-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 20px;
}

#punch-button,
#cancel-last-button {
  font-size: 1.25rem;
  padding: 14px 56px;
  min-height: 58px;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

#punch-button {
  box-shadow: 0 6px 20px rgba(139, 31, 47, 0.35);
}

#cancel-last-button {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(180, 35, 24, 0.35);
}


.ghost-button {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.danger-button {
  background: #fff;
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--danger);
}

.icon-button {
  min-height: 28px;
  padding: 4px 8px;
  background: #fff;
  border-color: var(--border);
  color: var(--danger);
  font-size: 0.78rem;
}

.plus-button {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

.selected-user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.select-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.service-manager {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.inline-form.compact {
  align-items: end;
}

.service-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.service-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-user-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.full {
  width: 100%;
  display: block;
  text-align: center;
  text-decoration: none;
}

.message {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 700;
}

.message.error {
  background: #fff2f0;
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.2);
}

.message.ok {
  background: #edf7f1;
  color: var(--ok);
  border: 1px solid rgba(20, 108, 67, 0.2);
}

.week-focus {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(139, 31, 47, 0.08), rgba(15, 107, 110, 0.08)),
    #fff;
}

.week-focus-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.week-eyebrow {
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.week-focus-title {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.1;
}

.week-focus small {
  color: var(--muted);
  font-weight: 700;
}

.week-focus-bounds {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.week-date-pill {
  min-width: 94px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 107, 110, 0.2);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.week-date-pill span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.week-date-pill strong {
  color: var(--accent);
  font-size: 0.98rem;
}

.week-date-separator {
  color: var(--muted);
  font-weight: 900;
}

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

.stats > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.stats strong {
  font-size: 1.15rem;
}

.stat-card-wide {
  grid-column: span 2;
}

.week-calendar-filter,
.month-calendar-filter {
  width: min(220px, 100%);
  justify-self: end;
}

.week-calendar-filter input,
.month-calendar-filter input {
  width: 100%;
}


.negative {
  color: var(--danger);
}

.positive {
  color: var(--ok);
}

.table-wrap {
  overflow: auto;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}

.table-wrap.compact {
  max-height: none;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.restaurant-table.tr-only {
  min-width: 0;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr.has-alert {
  background: #fff7f5;
}

tr.has-alert td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.punch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lunch-break-select {
  min-height: 30px;
  max-width: 132px;
  padding: 4px 26px 4px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.lunch-break-select:disabled {
  color: var(--muted);
  background: #f3f4f6;
}

.lunch-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #173a5e;
  font-size: 0.68rem;
  font-weight: 900;
}

.punch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 700;
}

.punch-chip[data-tooltip],
.punch-edit-chip[data-tooltip] {
  cursor: help;
}

.app-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.28);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.app-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #17202a;
  transform: translateX(-50%) rotate(45deg);
}

.app-tooltip.below::after {
  bottom: auto;
  top: -5px;
}

.punch-chip.in {
  background: #173a5e;
  color: #fff;
}

.punch-chip.out {
  background: #d9ecff;
  border-color: #b7d7f4;
  color: #173a5e;
}

.punch-chip.lunch {
  border-color: #2d8f6f;
  box-shadow: inset 0 0 0 1px rgba(45, 143, 111, 0.25);
}

.punch-chip.editable-punch {
  cursor: text;
}

.punch-chip.canceled {
  color: var(--muted);
  text-decoration: line-through;
  background: #f3f4f6;
  border-color: #d8dde5;
}

.punch-edit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px;
  white-space: nowrap;
}

.punch-edit-chip.in {
  background: #173a5e;
  border-color: #173a5e;
}

.punch-edit-chip.out {
  background: #d9ecff;
  border-color: #b7d7f4;
}

.punch-edit-chip input {
  width: 96px;
  min-height: 32px;
}

.week-table-frame {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.week-nav-button {
  width: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 1.4rem;
  font-weight: 900;
}

.week-nav-button:hover {
  border-color: var(--brand);
  background: #fff8f9;
}

.day-popover-row td {
  background: #fbfcfd;
  border-bottom: 0;
}

.day-punch-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.plus-button.small {
  width: 32px;
  min-height: 32px;
  font-size: 1.15rem;
}


.month-admin-filter {
  margin-top: 24px;
}

.admin-carousel .month-admin-filter {
  margin-top: 0;
}

.week-table-frame table {
  min-width: 720px;
}

.month-table {
  min-width: 560px;
}

.employee-month-stats {
  grid-template-columns: minmax(0, 180px) minmax(0, 220px);
  justify-content: space-between;
}

.employee-month-table {
  min-width: 260px;
}

.month-table th:nth-child(2),
.month-table th:nth-child(3),
.month-table th:nth-child(4),
.month-table td:nth-child(2),
.month-table td:nth-child(3),
.month-table td:nth-child(4) {
  width: 92px;
}

.tr-mode {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.tr-mode.forced {
  border-color: rgba(139, 31, 47, 0.35);
  color: var(--brand);
  background: #fff8f9;
}

.tr-override-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tr-override-controls .icon-button {
  min-width: 34px;
  min-height: 30px;
  border-color: var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.tr-override-controls .icon-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tr-override-controls .icon-button.active.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.restaurant-total {
  font-size: 4rem;
  line-height: 1;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  margin-bottom: 12px;
}

.user-directory-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.user-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 6px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

#add-user-form-slot:empty,
#service-manager-slot:empty {
  display: none;
}

.add-user-form {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  transform-origin: top;
  will-change: opacity, transform;
}

.add-user-form.is-opening {
  animation: reveal-down 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.add-user-form.is-closing {
  animation: reveal-up 190ms ease-in both;
  pointer-events: none;
}

.toggle-add-user-button {
  width: 100%;
  margin-top: 12px;
}

.user-row {
  display: flex;
  min-height: 64px;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}

.user-row.active {
  border-color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}

.user-list-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.user-list-separator::before,
.user-list-separator::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
}

.user-row.is-inactive {
  background: #f7f8fa;
  border-style: dashed;
  color: #667085;
}

.user-row.is-inactive small,
.user-row.is-inactive em {
  color: #667085;
}

.user-row.has-alert,
.user-row[data-alert="true"] {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}

.user-row.has-alert.active,
.user-row[data-alert="true"].active {
  border-color: #7a1a13 !important;
  box-shadow: inset 3px 0 0 #fff;
}

.user-row span {
  min-width: 0;
}

.user-row strong,
.user-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row small {
  color: var(--muted);
}

.user-row.has-alert strong,
.user-row.has-alert small,
.user-row[data-alert="true"] strong,
.user-row[data-alert="true"] small {
  color: #fff !important;
  opacity: 0.92;
}

.user-row em {
  font-style: normal;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.8rem;
}

.user-row.has-alert em,
.user-row[data-alert="true"] em {
  color: #fff !important;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
}

.check-label {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.check-label input {
  min-height: auto;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
}


:where(.primary-button, .ghost-button, .danger-button, .icon-button, .plus-button, .carousel-tab, .carousel-arrow, .week-nav-button, .user-row, .view-menu button) {
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  transition:
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

:where(.primary-button, .ghost-button, .danger-button, .icon-button, .plus-button, .carousel-tab, .carousel-arrow, .week-nav-button, .user-row, .view-menu button):focus-visible {
  outline: 3px solid rgba(15, 107, 110, 0.25);
  outline-offset: 2px;
}

:where(.primary-button, .ghost-button, .danger-button, .icon-button, .plus-button, .carousel-tab, .carousel-arrow, .week-nav-button, .user-row, .view-menu button):active {
  transform: translateY(1px) scale(0.98);
}

:where(.primary-button, .ghost-button, .danger-button, .icon-button, .plus-button, .carousel-tab, .carousel-arrow, .week-nav-button, .user-row, .view-menu button).is-rippling::after {
  content: "";
  position: absolute;
  left: var(--ripple-x, 50%);
  top: var(--ripple-y, 50%);
  width: var(--ripple-size, 120px);
  height: var(--ripple-size, 120px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: button-ripple 520ms ease-out;
}

:where(.ghost-button, .icon-button, .carousel-tab, .carousel-arrow, .week-nav-button, .user-row, .view-menu button).is-rippling::after {
  background: rgba(139, 31, 47, 0.14);
}

:where(.danger-button, .cancel-admin-punch).is-rippling::after,
button.user-row.has-alert.is-rippling::after,
button.user-row[data-alert="true"].is-rippling::after {
  background: rgba(255, 255, 255, 0.24);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none !important;
  box-shadow: none !important;
}

.login-panel {
  animation: surface-enter 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}


.view-menu {
  transform-origin: top right;
  will-change: opacity, transform;
}

.view-menu.open {
  animation: menu-enter 150ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}

.view-menu.closing {
  animation: menu-exit 140ms ease-in both;
  pointer-events: none;
}

.message {
  animation: notice-enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message.error {
  animation: notice-enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both, error-nudge 260ms ease-out 70ms;
}

.service-manager.is-opening,
.edit-user-form.is-opening,
.day-punch-form.is-opening,
.punch-edit-chip.is-opening {
  animation: reveal-down 1100ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.day-popover-row.is-opening td {
  animation: reveal-down 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}


.dashboard-view.is-opening {
  animation: surface-enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

tr.is-updated td {
  animation: row-update 780ms ease-out both;
}

.stats > div,
.week-date-pill,
.timeline-total,
.timeline-tr,
.service-row,
.punch-chip,
.tr-mode {
  transition:
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.punch-chip.is-opening {
  animation: chip-enter 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.punch-edit-chip {
  transform-origin: left center;
}

tbody tr {
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.period-slide.slide-forward .stats > div,
.period-slide.slide-back .stats > div,
.period-slide.slide-forward tbody tr,
.period-slide.slide-back tbody tr {
  animation: list-item-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.period-slide.slide-forward .stats > div:nth-child(2),
.period-slide.slide-back .stats > div:nth-child(2),
.period-slide.slide-forward tbody tr:nth-child(2),
.period-slide.slide-back tbody tr:nth-child(2) {
  animation-delay: 35ms;
}

.period-slide.slide-forward .stats > div:nth-child(3),
.period-slide.slide-back .stats > div:nth-child(3),
.period-slide.slide-forward tbody tr:nth-child(3),
.period-slide.slide-back tbody tr:nth-child(3) {
  animation-delay: 70ms;
}

.period-slide.slide-forward tbody tr:nth-child(n + 4),
.period-slide.slide-back tbody tr:nth-child(n + 4) {
  animation-delay: 95ms;
}

#employee-day-timeline.timeline-animate .timeline-track {
  animation: timeline-track-enter 260ms ease-out both;
}

.timeline-segment {
  transform-origin: left center;
}

#employee-day-timeline.timeline-animate .timeline-segment {
  animation-name: timeline-segment-enter;
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: var(--segment-delay, 0ms);
  animation-fill-mode: both;
}

.timeline-segment.open {
  background-size: 24px 24px;
}

#employee-day-timeline.timeline-animate .timeline-segment.open {
  animation-name: timeline-segment-enter, timeline-stripes;
  animation-duration: 520ms, 1300ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1), linear;
  animation-delay: var(--segment-delay, 0ms), 520ms;
  animation-fill-mode: both, none;
  animation-iteration-count: 1, infinite;
}

#employee-day-timeline.timeline-animate .timeline-marker {
  animation: timeline-marker-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--marker-delay, 0ms);
}

.timeline-marker::before,
.timeline-marker strong {
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.compliance-alert,
.timeline-alert {
  position: relative;
  overflow: hidden;
}

.compliance-alert::before,
.timeline-alert::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(180, 35, 24, 0.42);
  animation: alert-edge-pulse 1800ms ease-in-out infinite;
}

@media (hover: hover) {
  .primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(139, 31, 47, 0.22);
  }

  .ghost-button:hover,
  .view-menu button:hover {
    transform: translateY(-1px);
    border-color: rgba(139, 31, 47, 0.38);
    background: #fff8f9;
    color: var(--brand);
    box-shadow: 0 7px 16px rgba(23, 32, 42, 0.08);
  }

  .danger-button:hover,
  .cancel-admin-punch:hover {
    transform: translateY(-1px);
    border-color: rgba(180, 35, 24, 0.62);
    background: #fff4f2;
    box-shadow: 0 8px 16px rgba(180, 35, 24, 0.14);
  }

  .icon-button:hover {
    transform: translateY(-1px);
    border-color: rgba(139, 31, 47, 0.34);
    background: #fff8f9;
    box-shadow: 0 6px 13px rgba(23, 32, 42, 0.08);
  }

  .tr-override-controls .icon-button.active:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
  }

  .tr-override-controls .icon-button.active.danger:hover {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
  }

  .plus-button:hover {
    transform: translateY(-1px) scale(1.03);
    background: #0b5f62;
    box-shadow: 0 8px 16px rgba(15, 107, 110, 0.2);
  }

  .carousel-tab:hover,
  .carousel-arrow:hover,
  .week-nav-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(139, 31, 47, 0.12);
  }

  .user-row:hover {
    transform: translateY(-1px);
    border-color: rgba(139, 31, 47, 0.3);
    box-shadow: 0 8px 16px rgba(23, 32, 42, 0.08);
  }

  .user-row.has-alert:hover,
  .user-row[data-alert="true"]:hover {
    box-shadow: 0 9px 18px rgba(180, 35, 24, 0.2);
  }

  .user-row.active:hover {
    box-shadow: inset 3px 0 0 var(--brand), 0 8px 16px rgba(23, 32, 42, 0.08);
  }

  .user-row.has-alert.active:hover,
  .user-row[data-alert="true"].active:hover {
    box-shadow: inset 3px 0 0 #fff, 0 9px 18px rgba(180, 35, 24, 0.22);
  }

  .cancel-admin-punch:hover {
    background-color: #8f1c13;
    color: #fff;
  }

  .stats > div:hover,
  .week-date-pill:hover,
  .timeline-total:hover,
  .timeline-tr:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 107, 110, 0.28);
    box-shadow: 0 8px 16px rgba(23, 32, 42, 0.08);
  }

  tbody tr:not(.day-popover-row):hover {
    background: #fbf4f5;
  }

  tbody tr.has-alert:hover {
    background: #fff0ed;
  }

  .service-row:hover,
  .punch-chip:not(.canceled):hover,
  .tr-mode:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(23, 32, 42, 0.08);
  }

  .timeline-marker:hover {
    z-index: 4;
  }

  .timeline-marker:hover::before {
    transform: scale(1.22);
  }

  .timeline-marker:hover strong {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(23, 32, 42, 0.16);
  }
}

@keyframes button-ripple {
  from {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes menu-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menu-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

@keyframes notice-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes error-nudge {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  55% {
    transform: translateX(4px);
  }
  80% {
    transform: translateX(-2px);
  }
}

@keyframes reveal-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-up {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

 chip-enter {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes list-item-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes row-update {
  0% {
    background-color: #fff6d9;
  }
  100% {
    background-color: transparent;
  }
}

@keyframes timeline-track-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timeline-segment-enter {
  from {
    opacity: 0;
    transform: scaleX(0.08);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes timeline-stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 24px 0;
  }
}

@keyframes timeline-marker-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  65% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes alert-edge-pulse {
  0%, 100% {
    opacity: 0.46;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  :where(.primary-button, .ghost-button, .danger-button, .icon-button, .plus-button, .carousel-tab, .carousel-arrow, .week-nav-button, .user-row, .view-menu button):hover,
  .stats > div:hover,
  .week-date-pill:hover,
  .timeline-total:hover,
  .timeline-tr:hover,
  .service-row:hover,
  .punch-chip:not(.canceled):hover,
  .tr-mode:hover {
    transform: none;
  }
}

@media (max-width: 980px) {
  .layout {
    overflow: auto;
  }

  .dashboard-view,
  .section {
    height: auto;
  }

  .grid.two,
  .admin-grid,
  .edit-user-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-header,
  .selected-user-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .view-menu {
    left: 0;
    right: auto;
  }

  .layout {
    padding: 18px max(18px, 5vw);
  }

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

  .timeline-header {
    align-items: stretch;
    flex-direction: column;
  }

  .timeline-alert,
  .timeline-header .compliance-alerts {
    max-width: none;
  }

  .timeline-total {
    text-align: left;
  }

  .timeline-metrics {
    width: 100%;
  }

  .timeline-total,
  .timeline-tr {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .stat-card-wide {
    grid-column: auto;
  }

  .login-panel,
  .panel,
  .subpanel {
    padding: 14px;
  }

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

  .week-calendar-filter,
  .month-calendar-filter {
    width: 100%;
    justify-self: stretch;
  }

  .week-focus {
    align-items: stretch;
    flex-direction: column;
  }

  .week-focus-bounds {
    width: 100%;
  }

  .week-date-pill {
    flex: 1;
    min-width: 0;
  }

  .inline-form {
    display: grid;
  }

  .week-table-frame {
    gap: 6px;
  }

  .week-nav-button {
    width: 34px;
    flex-basis: 34px;
  }

  .day-punch-form {
    display: grid;
  }

  .clock {
    font-size: 1.4rem;
  }

  .employee-carousel-header {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 6px;
  }

  .carousel-arrow {
    width: 38px;
    min-height: 38px;
  }

  .carousel-tab {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.88rem;
  }

  .timeline-stage {
    padding-inline: 0;
  }

  .timeline-track {
    height: 96px;
  }

  .timeline-marker {
    min-width: 48px;
    font-size: 0.72rem;
  }

  .timeline-ticks {
    font-size: 0.68rem;
  }
}

.cancel-admin-punch {
  color: white;
  background-color: #b42318;
}

button.user-row.has-alert,
button.user-row[data-alert="true"] {
  background: #b42318 !important;
  border-color: #b42318 !important;
  color: #fff !important;
}

button.user-row.has-alert *,
button.user-row[data-alert="true"] * {
  color: #fff !important;
}
