:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --soft: #f1f1f1;
  --line: #ececec;
  --text: #242424;
  --muted: #929292;
  --accent: #ffc04d;
  --accent-dark: #f2aa2f;
  --green: #4caf50;
  --red: #e85d4f;
  --shadow: 0 18px 42px rgba(24, 24, 24, 0.08);
  --radius: 24px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 44px 0 14px;
  background-color: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  appearance: none;
  outline: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 14px) 50%;
  background-size:
    8px 8px,
    8px 8px;
  background-repeat: no-repeat;
}

select:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 4px rgba(255, 192, 77, 0.24);
}

.native-select-hidden {
  display: none !important;
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 900;
  text-align: left;
}

.custom-select-trigger::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.custom-select-trigger.open {
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px rgba(255, 192, 77, 0.18);
}

.custom-select-trigger.open::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.custom-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow: auto;
}

.custom-select-option {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  text-align: left;
  font-weight: 900;
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: #fff3d5;
}

.custom-select-option small {
  color: var(--muted);
  font-weight: 800;
}

.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand,
.top-actions,
.toolbar,
.terminal-head,
.section-title,
.worker-list li,
.event-list li,
.quick-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
  min-width: 0;
}

.brand > div:last-child {
  min-width: 0;
}

.brand strong,
.brand small {
  overflow-wrap: anywhere;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff;
}

.logo img {
  width: 116%;
  height: 116%;
  object-fit: cover;
  transform: translate(-8%, -8%);
}

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

.ghost,
.login {
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
}

.ghost {
  background: var(--soft);
}

.ghost.active,
.login {
  background: var(--accent);
}

.hidden {
  display: none !important;
}

body.logged-out .topbar,
body.logged-out .shell {
  display: none;
}

.shell {
  padding: 24px 32px 48px;
  max-width: 1920px;
  margin: 0 auto;
}

.toolbar {
  gap: 18px;
  margin-bottom: 24px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: min(420px, 100%);
  height: 56px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.segmented button {
  font-weight: 800;
}

.segmented .selected {
  background: var(--accent);
}

.location-pill,
.status-pill {
  min-height: 56px;
  border-radius: 999px;
  background: var(--soft);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  font-weight: 700;
}

.location-pill {
  flex: 1;
}

.pin {
  font-size: 24px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.12);
}

.terminal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 28px;
  align-items: start;
}

.terminal-card,
.side-panel,
.result-card,
.admin-card,
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.terminal-card,
.side-panel,
.admin-card,
.table-card,
.login-card {
  min-width: 0;
}

.terminal-card {
  min-height: 590px;
  padding: 36px;
}

.terminal-head {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 92px;
  line-height: 0.95;
  letter-spacing: 0;
}

.terminal-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 22px;
  font-weight: 700;
}

.mini-badge {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  font-weight: 900;
}

.tap-zone {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  margin: 40px 0 24px;
  border-radius: 30px;
  background: #f7f7f7;
  border: 1px solid var(--line);
  padding: 32px;
  width: 100%;
  color: var(--text);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.tap-zone:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(255, 192, 77, 0.2);
}

.tap-zone:active {
  transform: scale(0.99);
}

.tap-zone h2 {
  margin: 20px 0 10px;
  font-size: 36px;
}

.tap-zone p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.nfc-symbol {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  position: relative;
}

.nfc-symbol span {
  position: absolute;
  border: 4px solid var(--text);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(45deg);
}

.nfc-symbol span:nth-child(1) {
  width: 30px;
  height: 30px;
}

.nfc-symbol span:nth-child(2) {
  width: 54px;
  height: 54px;
}

.nfc-symbol span:nth-child(3) {
  width: 78px;
  height: 78px;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 18px;
  background: #fff7e3;
}

.notice.neutral {
  background: #f4f4f4;
}

.notice strong {
  flex: 0 0 auto;
}

.notice span {
  color: #786033;
}

.notice.neutral span {
  color: var(--muted);
}

.side-panel {
  padding: 26px;
}

.panel-section + .panel-section {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.section-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
}

.section-title span,
.section-title button {
  background: var(--soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
}

.section-title button {
  color: var(--text);
  background: var(--accent);
}

.worker-list,
.event-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.worker-list li,
.event-list li {
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.worker-list li {
  padding: 14px;
  border-radius: 18px;
  border-bottom: 0;
  margin-bottom: 10px;
}

.worker-list li.status-on {
  background: #eff9f0;
}

.worker-list li.status-off {
  background: #fff1f1;
}

.worker-list li:last-child,
.event-list li:last-child {
  border-bottom: 0;
}

.worker-list div,
.event-list div {
  flex: 1;
}

.worker-list strong,
.event-list strong {
  display: block;
}

.worker-list small,
.event-list small {
  color: var(--muted);
  font-weight: 700;
}

.worker-list b {
  font-size: 15px;
}

.status-pill-mini {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
}

.status-on .status-pill-mini {
  color: #2f7c33;
}

.status-off .status-pill-mini {
  color: #b94040;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent);
  color: var(--text);
  font-weight: 900;
}

.avatar.green {
  background: #e5f4e6;
  color: #2f7c33;
}

.avatar.amber {
  background: #fff1cd;
}

.avatar.gray {
  background: var(--soft);
  color: #777;
}

.avatar.large {
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
}

.employee-photo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: var(--accent);
  color: var(--text);
  font-weight: 900;
  background-size: cover;
  background-position: center;
}

.employee-photo.large {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
}

.photo-editor {
  display: flex;
  align-items: center;
  gap: 14px;
}

.proof-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--accent), #50b65a) border-box;
  border: 3px solid transparent;
}

.point-switcher,
.login-mode,
.admin-point-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-point-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.admin-point-bar span {
  color: var(--muted);
  font-weight: 900;
}

.point-switcher button,
.login-mode button,
.admin-point-bar button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 900;
}

.point-switcher button.selected,
.login-mode button.selected,
.admin-point-bar button.selected {
  background: var(--accent);
}

.states {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 28px;
}

.result-card,
.admin-card {
  padding: 28px;
}

.result-card {
  text-align: center;
}

.result-card.compact {
  padding: 0;
  box-shadow: none;
}

.result-card h2 {
  margin-bottom: 18px;
  font-size: 28px;
}

.result-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 56px;
  line-height: 1;
}

.result-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.result-type {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  background: #e6f5e8;
  color: #2f7c33;
  font-weight: 900;
  text-transform: uppercase;
}

.checkout .result-type {
  background: var(--soft);
  color: #606060;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metrics div {
  padding: 16px;
  border-radius: 18px;
  background: var(--soft);
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: 28px;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.issue {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 16px;
  border-radius: 18px;
  background: #fff0ee;
}

.issue.quiet {
  background: #f7f7f7;
}

.issue.quiet span {
  background: var(--green);
}

.issue span {
  width: 10px;
  min-width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--red);
}

.issue small {
  display: block;
  color: #8e5c56;
  margin-top: 2px;
}

.quick-actions {
  gap: 10px;
}

.quick-actions button {
  flex: 1;
  min-height: 46px;
  border-radius: 999px;
  background: var(--accent);
  font-weight: 900;
}

.quick-actions button + button {
  background: var(--soft);
}

.quick-actions .danger-button,
.danger-button {
  background: var(--red);
  color: #fff;
}

.timesheet {
  margin-top: 28px;
}

.schedule {
  margin-top: 28px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: grid;
}

.states.view-panel.active {
  display: grid;
}

.timesheet.view-panel.active {
  display: block;
}

.schedule.view-panel.active {
  display: block;
}

.admin-view {
  gap: 24px;
}

.admin-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.admin-tabs button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 900;
}

.admin-tabs button.selected {
  background: var(--accent);
}

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

.admin-grid.hidden {
  display: none;
}

.admin-card.wide {
  grid-column: 1 / -1;
}

.admin-shift-list {
  margin-top: 22px;
}

.settings-block {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.point-settings {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 8px;
}

.point-settings select,
.photo-editor input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  background: #fff;
  min-width: 0;
}

.point-settings button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  font-weight: 900;
}

.point-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 8px;
}

.point-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: #f7f7f7;
}

.settings-item {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.point-list-row strong,
.point-list-row small {
  display: block;
}

.point-list-row small,
.point-list-row span {
  color: var(--muted);
  font-weight: 800;
}

.point-list-row span {
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
}

.quick-actions.stacked {
  display: grid;
}

.employee-row,
.setting-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 1.1fr 1.4fr auto auto;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--text);
  min-width: 0;
}

.employee-row.settings-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px 0;
}

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

.employee-main strong,
.employee-main small {
  overflow-wrap: anywhere;
}

.employee-main small {
  color: var(--muted);
  font-weight: 800;
}

.rate-pill {
  justify-self: end;
  padding: 9px 12px;
  border-radius: 999px;
  background: #fff7e5;
  white-space: nowrap;
}

.employee-row > *,
.setting-row > * {
  min-width: 0;
}

.employee-row strong {
  display: flex;
  align-items: center;
  gap: 10px;
}

.employee-row button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 900;
}

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

.row-actions .danger-button {
  background: var(--red);
}

.employee-row span,
.setting-row span {
  color: var(--muted);
  font-weight: 800;
}

.setting-row {
  grid-template-columns: 1fr minmax(180px, 280px);
}

.setting-row.point-setting-row {
  grid-template-columns: 180px minmax(0, 1fr);
}

.setting-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  background: #fff;
}

.password-wrap {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
}

.password-wrap button {
  min-height: 42px;
  border-radius: 14px;
  background: var(--soft);
  font-weight: 900;
}

.setting-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--accent-dark);
}

.point-card {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
  background: transparent;
}

.point-card strong,
.point-card span {
  display: block;
}

.point-card span {
  color: var(--muted);
  margin-top: 4px;
  font-weight: 800;
}

.edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.edit-form label,
.login-card label {
  display: grid;
  gap: 8px;
}

.edit-form span,
.login-card label span {
  color: var(--muted);
  font-weight: 900;
}

.edit-form input,
.edit-form select,
.login-card input,
.login-card select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  min-width: 0;
}

.edit-form select,
.login-card select {
  padding-right: 44px;
}

.field-with-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.field-with-button button {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--accent);
  font-weight: 900;
}

.calendar-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-bar > * {
  min-width: 0;
}

.calendar-bar label {
  display: grid;
  gap: 6px;
}

.calendar-bar label span {
  color: var(--muted);
  font-weight: 900;
}

.calendar-bar input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  font: inherit;
  font-weight: 900;
}

.calendar-bar button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 900;
}

.calendar-bar button.selected {
  background: var(--accent);
}

.calendar-bar > span {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff7e3;
  color: #786033;
  font-weight: 900;
}

.edited-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 18px;
}

.edited-days:empty {
  display: none;
}

.day-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #ffe7e7;
  color: #a43b3b;
  font-weight: 900;
}

.wide-field {
  grid-column: 1 / -1;
}

.employee-editor .quick-actions {
  margin-top: 20px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.22);
  z-index: 10;
}

[data-confirm-modal],
[data-day-edit-modal] {
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.login-card {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card.wide-modal {
  width: min(940px, 100%);
}

.modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.modal-heading {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.modal-heading h3 {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.modal-heading span {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 16px;
  background: #f1f1f1;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.modal-close-button {
  min-width: 124px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  font-weight: 900;
  white-space: nowrap;
}

.login-help {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff7e3;
  color: #786033;
  font-weight: 800;
}

.confirm-text {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.submit-login {
  min-height: 52px;
  border-radius: 999px;
  background: var(--accent);
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.table-card {
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) repeat(3, minmax(120px, auto));
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

button.table-row {
  width: 100%;
  text-align: left;
}

.table-row.clickable-row {
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.table-row.clickable-row:hover,
.table-row.clickable-row.selected {
  background: #fff9ec;
  box-shadow: inset 4px 0 0 var(--accent);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row.head {
  grid-template-columns: minmax(230px, 1fr) repeat(3, minmax(120px, auto));
  color: var(--muted);
  font-weight: 900;
  background: #f7f7f7;
  min-height: 52px;
}

.table-row.warning {
  background: #fffaf0;
}

.table-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  font: inherit;
  font-weight: 800;
}

.table-row button {
  min-height: 40px;
  border-radius: 999px;
  background: var(--accent);
  font-weight: 900;
}

.table-row.edited,
.employee-row.edited {
  background: #fff1f1;
}

.timesheet-person {
  display: grid;
  gap: 4px;
}

.timesheet-person strong {
  font-size: 18px;
}

.timesheet-person small {
  color: var(--muted);
  font-weight: 900;
}

.timesheet-stat {
  display: grid;
  gap: 5px;
  min-width: 112px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f7f7f7;
}

.timesheet-stat::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.timesheet-stat b {
  font-size: 18px;
}

.timesheet-stat.payout {
  background: #fff3d5;
}

.record-button {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
}

.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.schedule-controls {
  margin: 0 0 18px;
}

.schedule-weekday {
  padding: 0 8px 8px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.schedule-day {
  min-height: 168px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  min-width: 0;
}

.schedule-day.muted {
  background: transparent;
  box-shadow: none;
}

.schedule-day.edited {
  background: #fff1f1;
}

.schedule-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.schedule-day-head strong {
  font-size: 22px;
}

.schedule-day-head span,
.schedule-empty {
  color: var(--muted);
  font-weight: 900;
}

.schedule-shifts {
  display: grid;
  align-content: start;
  gap: 6px;
}

.schedule-shift,
.schedule-add-day {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  text-align: left;
  font: inherit;
}

.schedule-shift {
  background: #fff7e5;
  min-width: 0;
}

.schedule-add-day {
  justify-content: center;
  border: 1px dashed #e5c26d;
  color: #8a6a1e;
  background: #fffaf0;
  font-weight: 900;
}

.schedule-shift b,
.schedule-shift small {
  overflow-wrap: anywhere;
}

.schedule-shift small {
  color: var(--muted);
  font-weight: 800;
}

.terminal-journal-grid {
  display: grid;
  gap: 12px;
}

.employee-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.employee-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border-radius: 18px;
  background: #f7f7f7;
  text-align: left;
  font-weight: 900;
}

.employee-choice.selected {
  background: #fff3d5;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.employee-choice small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: #f7f7f7;
  color: var(--muted);
  font-weight: 900;
}

.terminal-journal-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: #f7f7f7;
  min-width: 0;
}

.terminal-journal-card.edited {
  background: #fff1f1;
}

.terminal-journal-card strong,
.terminal-journal-card span {
  display: block;
}

.terminal-journal-card small {
  color: var(--muted);
  font-weight: 800;
}

.journal-time-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 10px;
}

.journal-time-item {
  display: grid;
  gap: 6px;
}

.journal-time-item small {
  color: var(--muted);
  font-weight: 900;
}

.time-pill {
  min-width: 86px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  text-align: center;
  font-weight: 900;
}

.time-in {
  background: #eaf7ec;
  color: #2f7c33;
}

.time-out {
  background: #fff1e2;
  color: #9b6422;
}

.time-total {
  background: #eef2ff;
  color: #40528f;
}

@media (max-width: 1100px) {
  .terminal-layout,
  .states,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .panel-section + .panel-section {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
  }

  .schedule-calendar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .schedule-weekday,
  .schedule-day.muted {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 18px 22px;
  }

  .shell {
    padding: 20px 22px 40px;
  }

  .terminal-layout {
    gap: 20px;
  }

  .admin-tabs,
  .admin-point-bar {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .admin-tabs button {
    flex: 1 1 150px;
    min-width: 0;
    padding: 0 14px;
    font-size: 15px;
  }

  .admin-point-bar button {
    flex: 1 1 150px;
    min-width: 0;
    padding: 0 14px;
    font-size: 15px;
  }

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

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

  .schedule-day {
    min-height: 150px;
  }

  .calendar-bar > span {
    grid-column: 1 / -1;
    justify-content: center;
    text-align: center;
  }

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

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

  .employee-row.settings-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
    margin: 10px 0;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
  }

  .table-row.head {
    display: none;
  }

  button.table-row {
    text-align: left;
  }

  .table-row > [data-label] {
    display: grid;
    grid-template-columns: minmax(92px, auto) 1fr;
    gap: 10px;
    align-items: baseline;
  }

  .table-row > [data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    padding: 16px 22px;
    gap: 12px;
    align-items: center;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .toolbar,
  .side-panel {
    flex-direction: column;
  }

  .toolbar,
  .segmented,
  .admin-point-bar {
    width: 100%;
  }

  .top-actions {
    display: flex;
    width: auto;
    justify-content: flex-end;
  }

  .top-actions .admin-nav.hidden {
    display: none !important;
  }

  .ghost,
  .login {
    padding: 0 16px;
    width: auto;
    height: 42px;
    min-width: 86px;
  }

  .shell {
    padding: 14px;
  }

  .logo {
    width: 48px;
    height: 48px;
  }

  .brand {
    align-items: center;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    font-size: 13px;
  }

  .terminal-card {
    min-height: auto;
    padding: 18px;
    border-radius: 20px;
  }

  .terminal-head {
    align-items: flex-start;
    gap: 14px;
  }

  h1 {
    font-size: 56px;
  }

  h2 {
    font-size: 24px;
  }

  .mini-badge {
    width: 54px;
    height: 54px;
    font-size: 14px;
  }

  .tap-zone {
    min-height: 230px;
    margin: 24px 0 0;
    padding: 24px 18px;
    border-radius: 24px;
  }

  .tap-zone h2 {
    font-size: 25px;
  }

  .tap-zone p {
    font-size: 14px;
  }

  .nfc-symbol {
    width: 96px;
    height: 96px;
  }

  .notice {
    display: block;
  }

  .notice span {
    display: block;
    margin-top: 4px;
  }

  .side-panel {
    display: block;
    padding: 18px;
    border-radius: 20px;
  }

  .panel-section + .panel-section {
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--line);
  }

  .metrics,
  .table-row,
  .edit-form,
  .setting-row,
  .field-with-button,
  .point-settings,
  .password-wrap {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .row-actions button {
    flex: 1;
  }

  .employee-row.settings-item {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 0;
  }

  .employee-row.settings-item .rate-pill {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }

  .employee-main strong {
    font-size: 18px;
  }

  .employee-main small {
    font-size: 13px;
    line-height: 1.25;
  }

  .table-row {
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
    margin: 10px 0;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
  }

  button.table-row {
    text-align: left;
  }

  .table-row > [data-label] {
    display: grid;
    grid-template-columns: minmax(92px, auto) 1fr;
    gap: 10px;
    align-items: baseline;
  }

  .table-row > [data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .table-row.head {
    display: none;
  }

  .terminal-journal-card,
  .journal-time-grid,
  .point-settings,
  .point-list-row,
  .employee-picker {
    grid-template-columns: 1fr;
  }

  .employee-choice {
    min-height: 64px;
  }

  .point-list-row {
    align-items: stretch;
  }

  .journal-time-grid span {
    text-align: left;
  }

  .time-pill {
    min-width: 0;
  }

  .terminal-journal-card {
    padding: 16px;
    border-radius: 18px;
  }

  .calendar-bar {
    grid-template-columns: 1fr;
    padding: 14px;
    border-radius: 20px;
  }

  .calendar-bar button,
  .calendar-bar input,
  .calendar-bar > span {
    width: 100%;
  }

  .admin-card,
  .result-card {
    padding: 18px;
    border-radius: 20px;
  }

  .admin-tabs {
    gap: 8px;
  }

  .admin-point-bar {
    gap: 8px;
  }

  .admin-point-bar span {
    flex: 1 0 100%;
  }

  .section-title {
    align-items: flex-start;
    gap: 10px;
  }

  .section-title span,
  .section-title button {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .employee-row strong {
    align-items: flex-start;
  }

  .photo-editor {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo-editor input {
    width: 100%;
  }

  .login-card {
    width: 100%;
    max-height: calc(100dvh - 28px);
    overflow: auto;
    padding: 20px;
    border-radius: 20px;
  }

  .modal-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-heading h3 {
    font-size: 26px;
  }

  .modal-heading span {
    width: 100%;
    min-height: 0;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .modal-close-button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }

  .modal {
    padding: 14px;
    align-items: center;
  }

  [data-shift-result-modal] {
    place-items: center;
  }

  .toast {
    width: calc(100% - 28px);
    text-align: center;
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .schedule-calendar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .segmented {
    min-width: 0;
  }

  h1 {
    font-size: 46px;
  }

  .terminal-head {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .worker-list li {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .worker-list li .status-pill-mini {
    grid-column: 1 / -1;
  }

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