:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #52657a;
  --quiet: #f6fbf9;
  --surface: #ffffff;
  --surface-2: #eef8f4;
  --line: #d7e8e2;
  --accent: #007f73;
  --accent-dark: #00675e;
  --blue: #2f68d8;
  --amber: #c46716;
  --danger: #b42318;
  --success: #009b61;
  --shadow: 0 18px 46px rgba(16, 24, 40, 0.09), 0 2px 6px rgba(16, 24, 40, 0.05);
  --panel-border: rgba(0, 127, 115, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fcfb 38%, #eef8f5 100%);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
    ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(0, 127, 115, 0.055), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(47, 104, 216, 0.035), rgba(255, 255, 255, 0) 30%);
}

.auth-shell {
  background: #ffffff;
  justify-content: center;
}

.auth-shell .screen {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 127, 115, 0.13);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px clamp(18px, 3vw, 32px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(145deg, #00695f, #00a57d);
  color: var(--surface);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 10px 22px rgba(0, 127, 115, 0.2);
  font-weight: 850;
  letter-spacing: 0;
}

.brand-title {
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1.05;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.segmented,
.tabs,
.admin-tabs {
  display: inline-flex;
  background: rgba(235, 248, 244, 0.92);
  border: 1px solid rgba(0, 127, 115, 0.14);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.04);
}

.segmented button,
.tabs button,
.admin-tabs button {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  white-space: nowrap;
}

.segmented button.active,
.tabs button.active,
.admin-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(0, 127, 115, 0.12), 0 1px 2px rgba(16, 24, 40, 0.08);
}

.screen {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2.2vw, 24px);
  flex: 1;
}

.kiosk-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(390px, 1.18fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 20px);
  align-items: stretch;
}

.employee-kiosk {
  height: calc(100vh - 120px);
  min-height: 520px;
  overflow: hidden;
}

.status-panel {
  overflow: hidden;
}

.employee-kiosk .status-panel {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 10px 12px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(253, 255, 254, 0.96)),
    var(--surface);
  border-color: rgba(0, 127, 115, 0.16);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.camera-panel {
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr;
  min-height: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  align-self: start;
  box-shadow: 0 24px 54px rgba(9, 38, 48, 0.14), 0 2px 8px rgba(16, 24, 40, 0.06);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.employee-kiosk .panel-head {
  padding: 10px 12px;
  min-height: 56px;
}

.panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

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

.panel-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.employee-kiosk .panel-note {
  font-size: 0.78rem;
}

.camera-wrap {
  position: relative;
  background:
    linear-gradient(145deg, #101b22 0%, #0a1117 52%, #111821 100%);
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.camera-wrap::before {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  background:
    linear-gradient(#ffffff, #ffffff) left top / 34px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) left top / 2px 34px no-repeat,
    linear-gradient(#ffffff, #ffffff) right top / 34px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) right top / 2px 34px no-repeat,
    linear-gradient(#ffffff, #ffffff) left bottom / 34px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) left bottom / 2px 34px no-repeat,
    linear-gradient(#ffffff, #ffffff) right bottom / 34px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) right bottom / 2px 34px no-repeat;
  opacity: 0.78;
}

.camera-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 17, 23, 0), rgba(10, 17, 23, 0.48));
}

video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-status {
  position: absolute;
  left: 22px;
  bottom: 22px;
  right: auto;
  z-index: 2;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  padding: 10px 13px 10px 32px;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.camera-status::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px rgba(0, 155, 97, 0.12);
}

.last-photo {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--surface);
}

.kiosk-panel {
  padding: clamp(16px, 2.1vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
  justify-content: center;
  height: 100%;
  min-height: 0;
  border-color: rgba(0, 127, 115, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 254, 252, 0.98)),
    var(--surface);
  box-shadow: 0 26px 60px rgba(0, 127, 115, 0.12), 0 2px 8px rgba(16, 24, 40, 0.05);
}

.pin-display {
  flex: 0 0 clamp(62px, 7.4vh, 74px);
  min-height: 0;
  border: 1px solid #cce7df;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfffd, #f0faf6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 1px 0 rgba(0, 127, 115, 0.05);
}

.pin-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 22px);
}

.pin-dot {
  width: clamp(14px, 1.8vw, 18px);
  height: clamp(14px, 1.8vw, 18px);
  border: 2px solid rgba(0, 127, 115, 0.9);
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 1px 2px rgba(0, 127, 115, 0.1);
}

.pin-dot.filled {
  background: var(--accent);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.05vw, 13px);
  flex: 1 1 auto;
  min-height: 0;
}

.keypad button {
  min-height: 0;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfefd);
  border: 1px solid rgba(0, 127, 115, 0.14);
  color: var(--ink);
  font-size: clamp(1.28rem, 2vw, 1.55rem);
  font-weight: 850;
  box-shadow: inset 0 -1px 0 rgba(16, 24, 40, 0.045), 0 4px 10px rgba(0, 127, 115, 0.06);
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.keypad button:hover,
.secondary:hover,
.ghost:hover {
  background: #f3fbf8;
}

.keypad button:active {
  background: #eaf7f2;
  border-color: rgba(0, 127, 115, 0.34);
  box-shadow: inset 0 1px 3px rgba(16, 24, 40, 0.1);
  transform: scale(0.985);
}

.keypad [data-action="clear-pin"],
.keypad [data-action="back"] {
  color: var(--accent);
}

.icon-key svg {
  width: 34px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.primary,
.secondary,
.danger,
.ghost,
.success {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.employee-kiosk .primary {
  min-height: 38px;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

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

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

.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
}

.danger {
  background: var(--danger);
  color: #ffffff;
}

.success {
  background: var(--success);
  color: #ffffff;
}

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

.action-row > button,
.action-row > a {
  flex: 1 1 150px;
}

.status-box {
  border-radius: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fbfcfa;
  min-height: 62px;
}

.status-box strong {
  display: block;
  margin-bottom: 4px;
}

.status-box.success-state {
  border-color: rgba(23, 107, 58, 0.35);
  background: #eef8f1;
}

.status-box.success-state strong {
  color: var(--success);
}

.status-box.error-state {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff1ef;
}

.status-line {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-loading {
  color: var(--muted);
  padding: 22px;
  font-weight: 700;
}

.status-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 168px;
}

.employee-kiosk .status-columns {
  min-height: 0;
  height: calc(100% - 38px);
}

.employee-kiosk .kiosk-status-panel .status-columns {
  height: 100%;
}

.employee-kiosk .status-panel .panel-head {
  min-height: 38px;
  padding: 7px 10px;
}

.status-column {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

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

.employee-kiosk .status-column + .status-column {
  border-left: 1px solid rgba(0, 127, 115, 0.14);
  border-top: 0;
  padding-left: 14px;
}

.status-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.status-column.in .status-column-head {
  background: #eef8f1;
}

.status-column.out .status-column-head {
  background: #fff7ed;
}

.employee-kiosk .status-column-head {
  padding: 0 4px 11px;
  border-bottom: 0;
  background: transparent;
}

.employee-kiosk .status-column.in .status-column-head,
.employee-kiosk .status-column.out .status-column-head {
  background: transparent;
}

.status-column-head strong {
  font-size: 0.88rem;
}

.employee-kiosk .status-column-head strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  font-weight: 850;
}

.employee-kiosk .status-column-head strong::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 3px solid var(--success);
  border-radius: 999px;
  background: transparent;
}

.employee-kiosk .status-column.out .status-column-head strong::before {
  border-color: var(--amber);
}

.status-column-head span {
  min-width: 32px;
  min-height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  background: var(--surface-2);
  font-weight: 900;
}

.employee-kiosk .status-column-head span {
  min-width: 30px;
  min-height: 24px;
  font-size: 0.78rem;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.04), 0 1px 2px rgba(16, 24, 40, 0.04);
}

.status-column.in .status-column-head span {
  background: #e4f8ee;
  color: var(--success);
}

.status-column.out .status-column-head span {
  background: #fff1df;
  color: var(--amber);
}

.status-list {
  display: grid;
  align-content: start;
  min-height: 0;
}

.employee-kiosk .status-list {
  grid-template-columns: none;
  grid-template-rows: repeat(6, minmax(30px, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: minmax(74px, 1fr);
  gap: 6px;
  overflow: hidden;
}

.employee-kiosk .status-column.out .status-list {
  grid-auto-columns: minmax(72px, 1fr);
}

.status-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.employee-kiosk .status-person {
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 6px;
  padding: 4px 8px;
  min-height: 0;
  align-items: center;
  border: 1px solid rgba(0, 127, 115, 0.1);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 1px 2px rgba(16, 24, 40, 0.035);
}

.employee-kiosk .status-column.in .status-person {
  background: linear-gradient(180deg, #effbf5, #e9f8f1);
  border-color: #cbeedd;
}

.employee-kiosk .status-column.out .status-person {
  background: linear-gradient(180deg, #fff8ee, #fff1e4);
  border-color: #f1d5b6;
}

.status-person strong {
  display: block;
  overflow-wrap: anywhere;
}

.status-person > div {
  min-width: 0;
}

.employee-kiosk .status-person strong {
  font-size: 0.75rem;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-person div div {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 2px;
}

.status-compact-name {
  display: none;
}

.employee-kiosk .status-full-name {
  display: none;
}

.employee-kiosk .status-compact-name {
  display: inline;
}

.employee-kiosk .status-person div div {
  display: block;
  margin-top: 1px;
  font-size: 0.56rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (orientation: landscape) and (min-width: 900px) {
  .screen {
    padding: 12px clamp(18px, 2.3vw, 24px);
  }

  .employee-kiosk {
    height: calc(100vh - 98px);
    min-height: 0;
  }

  .kiosk-grid {
    grid-template-columns: minmax(330px, 0.78fr) minmax(520px, 1.22fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(14px, 1.6vw, 20px);
  }

  .camera-panel {
    height: auto;
  }

  .kiosk-panel {
    padding: clamp(13px, 1.7vw, 18px);
    gap: clamp(8px, 1vw, 11px);
  }

  .pin-display {
    flex-basis: clamp(56px, 7.5vh, 68px);
  }

  .keypad button {
    min-height: 0;
  }

  .employee-kiosk .status-list {
    grid-template-rows: repeat(6, minmax(30px, 1fr));
    grid-auto-columns: minmax(84px, 1fr);
  }

  .employee-kiosk .status-column.out .status-list {
    grid-auto-columns: minmax(82px, 1fr);
  }

  .employee-kiosk .status-person {
    padding-block: 4px;
  }
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  margin-top: 6px;
  background: var(--amber);
}

.employee-kiosk .status-dot {
  width: 8px;
  height: 8px;
  margin-top: 2px;
  box-shadow: 0 0 0 3px rgba(0, 155, 97, 0.1);
}

.status-dot.in {
  background: var(--success);
}

.employee-kiosk .status-dot.out {
  box-shadow: 0 0 0 3px rgba(196, 103, 22, 0.12);
}

.status-person.just-moved {
  animation: rosterMove 2.8s ease-out;
}

.status-person.moved-in {
  --move-glow: rgba(23, 107, 58, 0.24);
  --move-bg: #e8f7ee;
}

.status-person.moved-out {
  --move-glow: rgba(161, 92, 22, 0.24);
  --move-bg: #fff3df;
}

.punch-popup {
  position: fixed;
  top: 86px;
  left: 50%;
  z-index: 90;
  width: min(440px, calc(100vw - 28px));
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 16px 18px;
  color: #ffffff;
  box-shadow: 0 20px 50px rgba(23, 32, 42, 0.25);
  text-align: center;
  animation: punchPopup 2.4s ease both;
}

.punch-popup.in {
  background: var(--success);
}

.punch-popup.out {
  background: var(--amber);
}

.punch-popup.error {
  background: var(--danger);
}

.punch-popup div {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.punch-popup strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.15;
  margin-top: 3px;
}

.punch-popup span {
  display: block;
  margin-top: 5px;
  font-weight: 800;
  opacity: 0.9;
}

.punch-popup.is-handing-off {
  animation: popupHandoff 1050ms ease forwards;
}

.roster-flight {
  position: fixed;
  z-index: 95;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 120px;
  max-width: 190px;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--ink);
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.22);
  will-change: transform, opacity;
}

.roster-flight.in {
  background: #f1faf5;
  border: 1px solid #cdebdc;
}

.roster-flight.out {
  background: #fff8ee;
  border: 1px solid #f0d7b7;
}

.roster-flight .status-dot {
  margin: 0;
}

.roster-flight strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  line-height: 1;
}

.status-person.landing-pulse {
  animation: rosterLanding 1.7s ease;
}

@keyframes punchPopup {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.96);
  }
  12%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.98);
  }
}

@keyframes popupHandoff {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.94);
  }
}

@keyframes rosterMove {
  0% {
    background: var(--move-bg);
    box-shadow: inset 0 0 0 999px var(--move-glow);
    transform: translateY(-7px) scale(1.03);
  }
  45% {
    background: var(--move-bg);
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0);
    transform: translateY(0) scale(1);
  }
  100% {
    background: var(--surface);
    box-shadow: none;
    transform: translateY(0) scale(1);
  }
}

@keyframes rosterLanding {
  0% {
    box-shadow:
      inset 0 0 0 999px rgba(255, 255, 255, 0),
      0 0 0 0 rgba(15, 118, 110, 0);
    transform: scale(1);
  }
  28% {
    box-shadow:
      inset 0 0 0 999px rgba(255, 255, 255, 0.34),
      0 0 0 5px rgba(15, 118, 110, 0.12);
    transform: scale(1.045);
  }
  100% {
    box-shadow:
      inset 0 0 0 999px rgba(255, 255, 255, 0),
      0 0 0 0 rgba(15, 118, 110, 0);
    transform: scale(1);
  }
}

.status-empty {
  color: var(--muted);
  padding: 18px 16px;
  font-weight: 700;
}

.employee-kiosk .status-empty {
  padding: 10px;
  font-size: 0.78rem;
}

.admin-login {
  width: min(440px, 100%);
  margin: 8vh auto 0;
  padding: 24px;
}

.kiosk-login {
  width: min(360px, 100%);
  margin: 0;
  padding: 24px;
  border-color: #d0d5dd;
  box-shadow: none;
}

.login-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.form-error {
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff1ef;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--ink);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

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

.admin-toolbar {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.toolbar-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
}

.metric:nth-child(2) {
  border-left-color: var(--accent);
}

.metric:nth-child(3) {
  border-left-color: var(--amber);
}

.metric:nth-child(4) {
  border-left-color: var(--success);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
}

.metric-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  margin-top: 4px;
}

.section-panel {
  overflow: hidden;
}

.section-body {
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfcfa;
}

td {
  font-size: 0.93rem;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--blue);
  background: #eef3ff;
}

.badge.open {
  color: var(--amber);
  background: #fff4e6;
}

.badge.off {
  color: var(--muted);
  background: var(--surface-2);
}

.photo-thumb {
  width: 48px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: block;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.84rem;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 42, 0.4);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.modal {
  width: min(640px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.25);
  border: 1px solid var(--line);
}

.modal-body {
  padding: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--ink);
  color: #ffffff;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 800;
  box-shadow: var(--shadow);
  max-width: min(92vw, 560px);
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .kiosk-grid,
  .toolbar-row,
  .status-columns,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .employee-kiosk {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .employee-kiosk .status-panel {
    grid-column: auto;
  }

  .employee-kiosk .status-columns {
    height: auto;
  }

  .status-column + .status-column {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .employee-kiosk .status-column + .status-column {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .camera-panel {
    min-height: 420px;
  }
}

@media (max-width: 620px) {
  .screen {
    padding: 12px;
  }

  .brand {
    min-width: 0;
  }

  .segmented,
  .tabs,
  .admin-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .segmented button,
  .tabs button,
  .admin-tabs button {
    flex: 1 0 auto;
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .keypad button {
    aspect-ratio: 1.25;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .no-print,
  .topbar,
  .modal-backdrop,
  .toast,
  .row-actions,
  .photo-thumb {
    display: none !important;
  }

  .screen {
    width: 100%;
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: 1px solid #b8b8b8;
  }

  .admin-stack {
    display: block;
  }

  .section-panel {
    margin-bottom: 16px;
    break-inside: avoid;
  }

  table {
    min-width: 0;
    font-size: 11px;
  }

  th,
  td {
    padding: 6px;
  }
}
