:root {
  --background: #f6f4ef;
  --foreground: #15201d;
  --muted: #66736f;
  --panel: #fffefa;
  --line: #dedbd1;
  --ink-soft: #354540;
  --accent: #0d7f66;
  --accent-dark: #075b4a;
  --mint: #dff3eb;
  --sky: #dfeeff;
  --amber: #ffe7ac;
  --shadow: 0 18px 50px rgba(32, 42, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  background:
    linear-gradient(135deg, rgba(13, 127, 102, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(55, 117, 190, 0.12), transparent 30%),
    var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(13, 127, 102, 0.28);
  outline-offset: 2px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--foreground);
  padding: 12px 13px;
}

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

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
  max-width: 1280px;
  overflow-x: clip;
  margin: 0 auto;
  padding: 20px 28px;
}

.topbar {
  display: flex;
  min-width: 0;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 20px;
}

.brand-block {
  min-width: 0;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
}

h2 {
  font-size: 22px;
  line-height: 1.15;
}

.panel-date {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.timebox {
  min-width: 172px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.84);
  padding: 12px 16px;
  text-align: right;
  box-shadow: var(--shadow);
}

.timebox span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.timebox strong {
  display: block;
  margin-top: 3px;
  font-size: 32px;
}

.segmented {
  display: flex;
  align-self: stretch;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ece9df;
  padding: 4px;
}

.segmented button {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  min-height: 44px;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 800;
}

.segmented button.active {
  background: var(--panel);
  color: var(--foreground);
  box-shadow: 0 7px 18px rgba(32, 42, 38, 0.1);
}

.clock-layout {
  display: grid;
  min-width: 0;
  width: 100%;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.attendance-layout {
  display: grid;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.attendance-panel {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 420px;
}

.attendance-query {
  display: grid;
  grid-template-columns: minmax(280px, 1.8fr) minmax(160px, 0.55fr) minmax(170px, 0.65fr) 140px;
  gap: 12px;
  align-items: end;
}

.attendance-query label {
  display: grid;
  min-width: 0;
  grid-template-rows: 20px 44px;
}

.attendance-query label > span {
  margin: 0;
  align-self: start;
}

.attendance-query select,
.attendance-query input {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 12px;
  color: var(--foreground);
  font: inherit;
}

.attendance-query .wide-button {
  min-height: 44px;
  height: 44px;
}

.attendance-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.attendance-message.error {
  color: #9d403b;
}

.employee-week-panel {
  margin-top: 18px;
  border: 1px solid rgba(13, 127, 102, 0.2);
  border-radius: 8px;
  background: rgba(223, 243, 235, 0.38);
  padding: 14px;
}

.employee-week-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.employee-week-head > div {
  display: grid;
  gap: 2px;
}

.employee-week-head span,
.employee-week-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

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

.employee-week-day {
  min-width: 0;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  padding: 10px;
}

.employee-week-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(13, 127, 102, 0.16);
}

.employee-week-day.rest,
.employee-week-day.empty {
  background: #f3f2ed;
}

.employee-week-day.leave {
  background: #fff5d6;
}

.employee-week-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.employee-week-date strong {
  font-size: 13px;
}

.employee-week-date span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.employee-week-shift {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.employee-week-shift strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.employee-week-shift span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.attendance-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
}

.attendance-result-head strong,
.attendance-result-head span {
  display: block;
}

.attendance-result-head strong {
  font-size: 20px;
}

.attendance-result-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.attendance-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.attendance-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f1;
  padding: 11px 12px;
}

.attendance-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.attendance-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  line-height: 1;
}

.attendance-summary .warn strong,
.attendance-summary .danger-stat strong {
  color: #9d403b;
}

.attendance-records {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.attendance-calendar {
  width: 100%;
  min-width: 760px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.attendance-calendar-weekdays,
.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.attendance-calendar-weekdays span {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f1efe8;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.attendance-calendar-day,
.attendance-calendar-blank {
  min-height: 112px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 8px;
}

.attendance-calendar-blank {
  background: #f6f4ef;
}

.attendance-calendar-day.normal {
  background: #f2fbf7;
}

.attendance-calendar-day.warn {
  background: #fff8e7;
}

.attendance-calendar-day.danger {
  background: #fff0ef;
}

.attendance-calendar-day.pending,
.attendance-calendar-day.empty,
.attendance-calendar-day.rest {
  background: #f7f6f1;
}

.attendance-calendar-day.leave {
  background: #fff8e7;
}

.attendance-calendar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.attendance-calendar-top strong {
  font-size: 16px;
  line-height: 1;
}

.attendance-calendar-top span {
  max-width: 78px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--mint);
  padding: 3px 6px;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-calendar-day.warn .attendance-calendar-top span,
.attendance-calendar-day.danger .attendance-calendar-top span {
  background: #f8dddd;
  color: #8b302c;
}

.attendance-calendar-day.pending .attendance-calendar-top span,
.attendance-calendar-day.empty .attendance-calendar-top span,
.attendance-calendar-day.rest .attendance-calendar-top span {
  background: #e4e6e4;
  color: #57605c;
}

.attendance-calendar-day.leave .attendance-calendar-top span {
  background: #ffe5a8;
  color: #6f5310;
}

.attendance-calendar-shift {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.attendance-calendar-times {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.9);
  padding: 22px;
  box-shadow: var(--shadow);
}

.primary-panel,
.punch-panel {
  min-height: 520px;
}

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

.badge,
.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.badge {
  background: var(--mint);
}

.green {
  background: #ccebdd;
  color: #096245;
}

.blue {
  background: var(--sky);
  color: #155b92;
}

.amber {
  background: var(--amber);
  color: #765315;
}

.gray {
  background: #e4e6e4;
  color: #57605c;
}

.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 13px;
}

.employee-card {
  position: relative;
  display: grid;
  min-height: 154px;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  color: var(--foreground);
  text-align: left;
}

.employee-card:hover,
.employee-card.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 26px rgba(13, 127, 102, 0.15);
  transform: translateY(-1px);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.employee-card strong {
  margin-top: 8px;
  font-size: 22px;
}

.employee-card small,
.shift {
  color: var(--muted);
  font-size: 13px;
}

.mini-status {
  align-self: end;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 800;
}

.punch-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.pin-row,
.note-field {
  display: block;
  min-width: 0;
  margin: 0;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-grid button,
.wide-button,
.inline-actions button {
  min-height: 52px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.action-grid button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 900;
}

.action-grid button:hover,
.wide-button:hover,
.inline-actions button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.danger {
  background: #9d403b !important;
}

.danger:hover {
  background: #7a302c !important;
}

.record-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 18px;
}

.record-strip div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f1;
  padding: 11px;
}

.record-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-strip strong {
  display: block;
  margin-top: 9px;
  font-size: 18px;
}

.location-alert,
.distance-note {
  border: 1px solid #f0cf7a;
  border-radius: 8px;
  background: #fff5d6;
  color: #765315;
  padding: 12px 13px;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 16px;
}

.location-alert.ok,
.distance-note {
  border-color: rgba(13, 127, 102, 0.25);
  background: var(--mint);
  color: var(--accent-dark);
}

.distance-note {
  margin: 14px 0 0;
  font-weight: 700;
}

.manager-layout {
  display: grid;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  gap: 18px;
}

#dashboardPanel {
  display: flex;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  flex-direction: column;
  gap: 18px;
}

#dashboardPanel > .stats-grid,
#dashboardPanel > .manager-grid {
  margin: 0;
}

#dashboardPanel > .stats-grid { order: 1; }
#dashboardPanel > .records-panel { order: 2; }
#dashboardPanel > .schedule-panel { order: 3; }
#dashboardPanel > .payroll-panel { order: 4; }
#dashboardPanel > .manager-grid { order: 5; }
#dashboardPanel > .location-panel { order: 6; }
#dashboardPanel > .clear-records-panel { order: 7; }

.unlock-panel {
  display: grid;
  max-width: 480px;
  gap: 16px;
}

.muted {
  margin: 10px 0 0;
  color: var(--muted);
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.9);
  padding: 18px;
  box-shadow: var(--shadow);
}

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

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 34px;
  line-height: 1;
}

.stat.warn strong {
  color: #9d403b;
}

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

.inline-actions button {
  min-height: 40px;
  padding: 0 14px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 140px 220px;
  gap: 12px;
  align-items: end;
}

.location-picker {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 150px;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.location-point-manager {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 10px;
}

.location-point-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.location-point-heading strong {
  font-size: 13px;
}

.location-point-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.location-point-list {
  display: grid;
  gap: 5px;
}

.location-point-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #dfe7e3;
  padding: 3px 0;
}

.location-point-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.location-point-identity {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.location-point-identity strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-point-identity small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.location-point-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.location-point-actions .location-primary-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.location-primary-label {
  font-weight: 800;
}

.location-point-item button {
  min-height: 28px;
  border: 1px solid #b9ded0;
  border-radius: 6px;
  background: #edf8f3;
  padding: 0 9px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.location-point-item button.danger-link {
  border-color: #e2c8c6;
  background: #fff6f5;
  color: #9d403b;
}

.add-location-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px 170px;
  align-items: end;
  gap: 8px;
  margin-top: 9px;
}

.add-location-row label {
  min-width: 0;
}

.add-location-row label span {
  margin-bottom: 4px;
  font-size: 11px;
}

.add-location-row input,
.add-location-row button {
  min-height: 36px;
}

.add-location-row input {
  padding: 7px 9px;
  font-size: 12px;
}

.add-location-row button {
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
}

.link-button,
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
}

.link-button:hover,
.quiet-button:hover {
  background: #ccebdd;
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.record-cards {
  display: none;
}

.record-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  padding: 11px;
}

.record-card.manager-assisted {
  border-color: #d6b267;
  box-shadow: inset 3px 0 0 #d6a13e;
}

.record-card-head,
.record-card-shift,
.record-card-foot {
  display: flex;
  min-width: 0;
  align-items: center;
}

.record-card-head {
  justify-content: space-between;
  gap: 10px;
}

.record-card-person {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}

.record-card-person strong {
  font-size: 16px;
}

.record-card-person span,
.record-card-shift span,
.record-card-shift small,
.record-card-times span,
.record-card-foot b {
  color: var(--muted);
  font-size: 11px;
}

.record-card-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
}

.record-card-shift {
  gap: 7px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.record-card-shift strong {
  font-size: 13px;
}

.record-card-shift small {
  margin-left: auto;
}

.record-card-times {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.record-card-times div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f7f1;
  padding: 6px;
  text-align: center;
}

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

.record-card-times strong {
  margin-top: 2px;
  font-size: 13px;
  white-space: nowrap;
}

.record-card-foot {
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.record-card-foot > span {
  display: flex;
  min-width: 0;
  gap: 5px;
  border-radius: 6px;
  background: #eef7f3;
  padding: 6px 8px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}

.record-card-foot b {
  flex: 0 0 auto;
}

.record-card-reminder {
  flex: 1 1 auto;
}

.compact-table {
  display: none;
}

.schedule-import {
  display: grid;
  grid-template-columns: 170px minmax(320px, 1fr) 180px;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.schedule-panel-head,
.records-panel-head,
.roster-panel-head,
.location-panel-head {
  align-items: center;
  margin-bottom: 0;
}

.panel-toggle-button {
  min-width: 92px;
  min-height: 34px;
  border: 1px solid #b9ded0;
  border-radius: 6px;
  background: #edf8f3;
  padding: 0 12px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.panel-toggle-button[aria-expanded="true"] {
  border-color: #cfd8d3;
  background: #f5f6f5;
  color: var(--muted);
}

.schedule-editor-body {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.roster-panel-body,
.location-panel-body {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.location-panel-status {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.schedule-editor-note {
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.schedule-import > label {
  display: grid;
  min-width: 0;
  grid-template-rows: 22px auto;
}

.schedule-import > label > span {
  margin: 0;
  align-self: start;
  line-height: 1.2;
}

.schedule-import input {
  min-width: 0;
  height: 48px;
  min-height: 48px;
  padding: 9px 11px;
}

.schedule-week-field,
.schedule-file-field {
  overflow: hidden;
}

.schedule-week-field input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

.schedule-file-field {
  position: relative;
  cursor: pointer;
}

.schedule-file-field > input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker-control {
  display: flex;
  min-width: 0;
  height: 48px;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 9px;
}

.file-picker-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  margin: 0;
  border-radius: 6px;
  background: #eef3f0;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

.file-picker-name {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-file-field:focus-within .file-picker-control {
  outline: 3px solid rgba(13, 127, 102, 0.28);
  outline-offset: 2px;
}

.schedule-import > .wide-button {
  align-self: start;
  min-height: 48px;
  height: 48px;
  margin-top: 22px;
}

.compact-table table {
  min-width: 760px;
}

.compact-table td,
.compact-table th {
  padding: 9px 10px;
  font-size: 13px;
}

.compact-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.schedule-edit-cell {
  min-width: 138px;
}

.schedule-edit-cell input {
  min-height: 32px;
  padding: 6px 7px;
  font-size: 12px;
}

.schedule-label-input {
  margin-bottom: 6px;
}

.schedule-time-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.schedule-off-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-off-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.schedule-switch {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: #c8cfcb;
  transition: background 160ms ease;
}

.schedule-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(21, 32, 29, 0.24);
  content: "";
  transition: transform 160ms ease;
}

.schedule-off-toggle input:checked + .schedule-switch {
  background: var(--accent);
}

.schedule-off-toggle input:checked + .schedule-switch::after {
  transform: translateX(16px);
}

.schedule-off-toggle input:focus-visible + .schedule-switch {
  outline: 3px solid rgba(13, 127, 102, 0.28);
  outline-offset: 2px;
}

.schedule-off-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1;
}

.schedule-cell-actions {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  align-items: center;
}

.mini-save {
  width: 100%;
  min-height: 30px;
  margin-top: 6px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

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

.off-cell {
  color: var(--muted);
  border-color: #b9ded0;
  background: #f3faf7;
}

.schedule-mobile-tools {
  display: block;
  max-width: 260px;
  margin-bottom: 10px;
}

.schedule-mobile-tools label {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
}

.schedule-mobile-tools select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  color: var(--foreground);
  font: inherit;
}

.schedule-day-card {
  border-top: 1px solid var(--line);
  padding: 10px 0 2px;
}

.schedule-day-card:first-child {
  border-top: 0;
  padding-top: 0;
}

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

.schedule-day-head {
  margin-bottom: 8px;
}

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

.schedule-day-head strong small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.schedule-day-head span {
  border-radius: 999px;
  background: #e2f3ec;
  padding: 4px 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
}

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

.schedule-person-card {
  display: flex;
  min-width: 0;
  min-height: 154px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(32, 42, 38, 0.05);
}

.schedule-person-head {
  align-items: flex-start;
  min-height: 28px;
  margin-bottom: 8px;
}

.schedule-person-head strong {
  font-size: 14px;
}

.schedule-person-head strong,
.schedule-person-head span {
  min-width: 0;
}

.schedule-person-head span {
  max-width: 68%;
  overflow: hidden;
  border-radius: 999px;
  background: #eef7f3;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-summary b,
.schedule-summary small {
  color: inherit;
  font: inherit;
}

.schedule-summary small {
  margin-left: 4px;
}

.mobile-schedule-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(96px, 0.72fr) minmax(0, 1.28fr);
  gap: 8px;
  align-items: stretch;
}

.mobile-schedule-cell input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  box-sizing: border-box;
  padding: 7px 8px;
  font-size: 12px;
}

.mobile-schedule-cell .schedule-field {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mobile-schedule-cell .schedule-field > span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.mobile-schedule-cell .schedule-label-input {
  margin-bottom: 0;
}

.mobile-schedule-cell .schedule-time-edit {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mobile-schedule-cell .schedule-cell-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

.mobile-schedule-cell .schedule-off-toggle {
  justify-content: flex-start;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf8;
  padding: 0 9px;
  margin-top: 0;
  font-size: 11px;
}

.mobile-schedule-cell .mini-save {
  min-height: 36px;
  margin-top: 0;
  padding: 0 10px;
  font-size: 12px;
}

.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

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

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

td strong,
td span {
  display: block;
}

td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.manager-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.roster-panel {
  min-width: 0;
}

.roster-add-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.roster-add-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(110px, auto);
  align-items: center;
  gap: 8px;
}

.roster-add-form .wide-button {
  min-height: 42px;
}

.roster-list {
  display: grid;
  gap: 8px;
}

.roster-row {
  display: grid;
  gap: 8px;
  align-items: stretch;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
}

.roster-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.roster-summary strong,
.roster-summary span {
  display: block;
}

.roster-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.roster-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 6px;
}

.roster-actions .wide-button,
.roster-edit-grid .wide-button,
.roster-actions .quiet-button,
.roster-edit-grid .quiet-button {
  min-height: 34px;
}

.roster-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.roster-edit-grid label {
  min-width: 0;
}

.roster-edit-grid label span {
  margin-bottom: 5px;
}

.roster-edit-grid input {
  min-height: 42px;
  padding: 9px 10px;
}

.roster-list {
  gap: 5px;
}

.roster-row {
  gap: 0;
  min-height: 46px;
  padding: 6px 8px;
}

.roster-row.expanded {
  gap: 8px;
  padding: 9px 10px;
}

.roster-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.roster-identity {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.roster-identity strong {
  flex: 0 0 auto;
  color: var(--foreground);
  font-size: 14px;
}

.roster-identity span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-status {
  display: inline-flex;
  min-width: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.roster-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #aab5b0;
  content: "";
}

.roster-status.active::before {
  background: var(--accent);
}

.roster-edit-trigger {
  min-width: 48px;
  min-height: 30px;
  border: 1px solid #b9ded0;
  border-radius: 6px;
  background: #edf8f3;
  padding: 0 9px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.roster-edit-trigger.quiet {
  border-color: var(--line);
  background: #f6f7f6;
  color: var(--muted);
}

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

.roster-edit-actions button {
  min-height: 34px;
  border-radius: 6px;
  font-size: 12px;
}

.roster-edit-actions [data-save] {
  background: var(--accent);
  color: #ffffff;
}

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 40px;
}

.toggle input {
  width: auto;
}

.toggle span {
  margin: 0;
  color: var(--foreground);
}

.form-grid,
.settings-panel {
  display: grid;
  gap: 12px;
}

.time-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 28px 0 68px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(460px, calc(100vw - 44px));
  border: 1px solid rgba(13, 127, 102, 0.22);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 16px;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .clock-layout,
  .manager-grid {
    grid-template-columns: 1fr;
  }

  .primary-panel,
  .punch-panel {
    min-height: auto;
  }

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

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

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

  .schedule-import > .wide-button {
    grid-column: 1 / -1;
  }

  .schedule-import > .wide-button {
    margin-top: 0;
  }

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

@media (max-width: 720px) {
  .shell {
    padding: 14px 12px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 4px 2px 10px;
  }

  .brand-block {
    flex: 1 1 auto;
  }

  .brand-block h1 {
    font-size: 28px;
    line-height: 1.05;
  }

  .timebox {
    flex: 0 0 auto;
    width: auto;
    min-width: 96px;
    border: 0;
    background: transparent;
    padding: 2px 0 2px 8px;
    text-align: right;
    box-shadow: none;
  }

  .timebox span {
    display: inline;
    font-size: 10px;
    line-height: 1.25;
  }

  .timebox span + span {
    margin-left: 3px;
  }

  .timebox strong {
    margin-top: 2px;
    font-size: 28px;
    line-height: 1;
  }

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

  .segmented button {
    min-height: 38px;
  }

  #dashboardPanel {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .panel {
    padding: 12px;
  }

  .employee-grid {
    gap: 8px;
  }

  .employee-card {
    grid-template-columns: 14px 1fr auto;
    grid-template-areas:
      "dot name status"
      "dot role status"
      "dot shift status";
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
    min-height: 74px;
    padding: 10px 12px;
  }

  .employee-card.selected {
    box-shadow: 0 8px 18px rgba(13, 127, 102, 0.13);
  }

  .employee-card .status-dot {
    grid-area: dot;
    width: 10px;
    height: 10px;
    align-self: start;
    margin-top: 5px;
  }

  .employee-card strong {
    grid-area: name;
    margin-top: 0;
    font-size: 18px;
    line-height: 1.2;
  }

  .employee-card small {
    grid-area: role;
    font-size: 12px;
    line-height: 1.2;
  }

  .employee-card .shift {
    grid-area: shift;
    font-size: 12px;
    line-height: 1.25;
  }

  .employee-card .mini-status {
    grid-area: status;
    align-self: center;
    margin-top: 0;
    padding-left: 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .punch-panel .section-head {
    align-items: center;
    flex-direction: row;
    margin-bottom: 12px;
  }

  .punch-panel .state-pill {
    align-self: center;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .punch-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .punch-fields input {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 12px;
  }

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

  .action-grid button {
    min-height: 44px;
    gap: 6px;
    font-size: 14px;
  }

  .button-icon {
    min-width: 29px;
    height: 23px;
    font-size: 10px;
  }

  .record-strip {
    gap: 8px;
    margin-top: 12px;
  }

  .record-strip div {
    min-height: 58px;
    padding: 8px 10px;
  }

  .record-strip strong {
    margin-top: 4px;
    font-size: 16px;
  }

  .attendance-query {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .employee-week-panel {
    margin-top: 14px;
    padding: 10px;
  }

  .employee-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .employee-week-day {
    min-height: 72px;
    padding: 8px 9px;
  }

  .employee-week-shift {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 6px;
  }

  .attendance-query label:first-child,
  .attendance-query .wide-button {
    grid-column: 1 / -1;
  }

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

  .schedule-import input {
    height: 42px;
    min-height: 42px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .schedule-week-field input {
    padding: 7px 6px;
    text-align: center;
  }

  .file-picker-control {
    height: 42px;
    gap: 6px;
    padding: 5px 6px;
  }

  .file-picker-button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .file-picker-name {
    font-size: 11px;
  }

  .schedule-import > .wide-button {
    grid-column: 1 / -1;
    height: 42px;
    min-height: 42px;
    margin-top: 0;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
  }

  h2 {
    font-size: 19px;
  }

  input,
  textarea {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 13px;
  }

  label span {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .record-strip {
    grid-template-columns: 1fr 1fr;
  }

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

  .stat {
    min-width: 0;
    padding: 8px 7px;
  }

  .stat span {
    font-size: 10px;
    white-space: nowrap;
  }

  .stat strong {
    margin-top: 3px;
    font-size: 21px;
  }

  .settings-row,
  .location-picker,
  .roster-edit-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .location-panel {
    padding: 10px;
  }

  .location-point-manager {
    margin-bottom: 8px;
    padding: 8px;
  }

  .location-point-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  .location-point-actions {
    gap: 4px;
  }

  .location-point-item button {
    min-height: 26px;
    padding: 0 7px;
    font-size: 10px;
  }

  .add-location-row {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 7px;
  }

  .add-location-row button {
    grid-column: 1 / -1;
    min-height: 34px;
  }

  .manager-layout {
    gap: 10px;
  }

  .manager-grid {
    gap: 10px;
    margin-top: 0;
  }

  .location-panel .section-head,
  .location-panel .settings-row,
  .location-panel .location-picker {
    margin-bottom: 8px;
  }

  .location-panel .location-panel-head {
    margin-bottom: 0;
  }

  .location-panel .badge {
    align-self: flex-start;
    min-height: 24px;
    padding: 0 9px;
    font-size: 11px;
  }

  .location-panel .wide-button,
  .location-panel .link-button {
    min-height: 34px;
    font-size: 12px;
  }

  .location-panel .location-picker {
    display: none;
  }

  .location-panel .muted {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .form-grid,
  .settings-panel {
    gap: 8px;
  }

  .form-grid .wide-button {
    min-height: 36px;
  }

  .inline-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .inline-actions button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .compact-table {
    display: none;
  }

  .records-panel .table-wrap {
    display: none;
  }

  .record-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .schedule-mobile-tools {
    width: 100%;
    max-width: none;
    margin: 2px 0 12px;
  }

  .schedule-date-picker {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f4faf7;
    padding: 8px 10px;
  }

  .schedule-date-picker > span {
    margin: 0;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
  }

  .schedule-mobile-tools .schedule-date-picker select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    border-color: #cfdad5;
    background: #ffffff;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 800;
  }

  .schedule-cards {
    display: grid;
    gap: 10px;
  }

  .schedule-day-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .schedule-person-card {
    overflow: hidden;
    min-height: 0;
    padding: 9px 10px;
  }

  .mobile-schedule-cell {
    width: 100%;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
  }

  .mobile-schedule-cell .schedule-label-field,
  .mobile-schedule-cell .schedule-time-edit,
  .mobile-schedule-cell .schedule-cell-actions {
    width: 100%;
    min-width: 0;
  }

  .mobile-schedule-cell .schedule-time-edit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .schedule-person-head {
    align-items: center;
    min-height: 24px;
    margin-bottom: 6px;
  }

  .schedule-person-head span {
    max-width: none;
    padding: 3px 7px;
    font-size: 10px;
  }

  .schedule-person-head strong {
    font-size: 15px;
  }

  .schedule-summary small {
    display: none;
  }

  .mobile-schedule-cell input[type="time"] {
    width: calc(100% - 2px);
    min-width: 0;
    max-width: calc(100% - 2px);
    justify-self: start;
    -webkit-appearance: none;
    appearance: none;
    padding: 5px 6px;
    font-size: 11px;
    text-align: center;
  }

  .mobile-schedule-cell .schedule-time-edit .schedule-field:last-child input[type="time"] {
    justify-self: end;
  }

  .mobile-schedule-cell input[type="time"]::-webkit-calendar-picker-indicator {
    display: none;
  }

  .mobile-schedule-cell .schedule-off-copy {
    font-size: 11px;
  }

  .mobile-schedule-cell .schedule-off-copy::after {
    content: none;
  }

  .mobile-schedule-cell .schedule-cell-actions {
    grid-template-columns: minmax(0, 1fr) minmax(74px, 0.58fr);
  }

  .roster-row {
    gap: 0;
    min-height: 44px;
    padding: 5px 7px;
  }

  .roster-row.expanded {
    gap: 8px;
    padding: 8px;
  }

  .roster-summary {
    gap: 8px;
  }

  .roster-summary strong {
    font-size: 14px;
  }

  .roster-summary span {
    font-size: 11px;
    line-height: 1.35;
  }

  .mini-badge {
    min-width: 42px;
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .roster-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
  }

  .roster-actions .wide-button,
  .roster-actions .quiet-button {
    width: auto;
    min-width: 58px;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .roster-edit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 8px;
  }

  .roster-edit-grid input {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .schedule-panel-head,
  .records-panel-head,
  .roster-panel-head,
  .location-panel-head {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .schedule-panel-head h2,
  .records-panel-head h2,
  .roster-panel-head h2,
  .location-panel-head h2 {
    font-size: 18px;
  }

  .panel-toggle-button {
    min-width: 82px;
    min-height: 32px;
    padding: 0 9px;
  }

  .schedule-editor-body {
    margin-top: 10px;
    padding-top: 10px;
  }

  .roster-panel-body,
  .location-panel-body {
    margin-top: 10px;
    padding-top: 10px;
  }

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

  .roster-add-form .wide-button {
    width: 100%;
    min-height: 36px;
  }
}

@media (pointer: coarse) {
  .compact-table {
    display: none;
  }

  .schedule-cards {
    display: grid;
    gap: 10px;
  }

  .schedule-day-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .records-panel .table-wrap {
    display: none;
  }

  .record-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .schedule-person-card {
    overflow: hidden;
    min-height: 0;
  }

  .mobile-schedule-cell {
    width: 100%;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
  }

  .mobile-schedule-cell .schedule-time-edit {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-schedule-cell .schedule-cell-actions {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(74px, 0.58fr);
  }
}

@media (max-width: 460px) {
  .brand-block h1 {
    font-size: 25px;
  }

  .timebox {
    min-width: 88px;
  }

  .timebox strong {
    font-size: 26px;
  }

  .location-picker {
    grid-template-columns: 1fr;
  }

  .schedule-import > .wide-button {
    grid-column: 1 / -1;
  }

  .attendance-panel {
    min-height: 0;
  }

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

  .attendance-calendar {
    min-width: 700px;
  }

  .attendance-calendar-day,
  .attendance-calendar-blank {
    min-height: 102px;
    padding: 7px;
  }

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

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

  .schedule-day-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .schedule-person-card {
    min-height: 0;
    padding: 9px;
  }

  .employee-card {
    min-height: 68px;
    padding: 9px 10px;
  }

  .employee-card strong {
    font-size: 17px;
  }

  .time-pair {
    grid-template-columns: 1fr;
  }

  .schedule-time-edit,
  .schedule-cell-actions {
    grid-template-columns: 1fr;
  }

  .mobile-schedule-cell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .mobile-schedule-cell .schedule-time-edit {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-schedule-cell .schedule-cell-actions {
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .schedule-off-toggle {
    margin-top: 2px;
  }

  .mini-save {
    min-height: 38px;
    margin-top: 0;
  }

  .mobile-schedule-cell .mini-save {
    min-height: 30px;
  }
}

/* Salary and leave management */
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--foreground);
  padding: 10px 12px;
  font: inherit;
}

.salary-layout,
.salary-panel,
.payroll-panel {
  min-width: 0;
  width: 100%;
}

.salary-query {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.45fr);
  gap: 12px;
  margin-top: 16px;
}

.salary-panel-head {
  align-items: flex-end;
}

.salary-heading-month {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(138px, 180px);
  align-items: center;
  gap: 7px;
}

.salary-heading-month > span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.salary-heading-month select {
  height: 38px;
  min-height: 38px;
  padding-block: 6px;
}

.salary-identity-picker {
  margin-top: 14px;
}

.salary-identity-heading,
.payroll-identity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.payroll-identity-heading {
  justify-content: flex-start;
}

.payroll-identity-heading strong {
  color: var(--foreground);
}

.salary-identity-heading > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.salary-identity-heading span,
.payroll-identity-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.salary-identity-heading strong,
.payroll-identity-heading strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#managerPayrollIdentityName {
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
}

.salary-identity-count {
  flex: none;
  border-radius: 999px;
  background: var(--mint);
  padding: 5px 9px;
  color: var(--accent-dark) !important;
}

.salary-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.salary-identity-card {
  display: grid;
  min-width: 0;
  min-height: 68px;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
  color: var(--foreground);
  text-align: left;
}

.manager-payroll-identity-card {
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.salary-identity-card:hover,
.salary-identity-card.selected {
  border-color: var(--accent);
  background: #f7fffc;
  box-shadow: 0 7px 18px rgba(13, 127, 102, 0.1);
}

.salary-identity-card .status-dot {
  width: 9px;
  height: 9px;
}

.salary-identity-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.salary-identity-copy strong,
.salary-identity-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salary-identity-copy strong {
  font-size: 15px;
}

.salary-identity-copy small {
  color: var(--muted);
  font-size: 11px;
}

.salary-identity-state {
  border-radius: 999px;
  background: #f1f2ed;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.salary-identity-card.selected .salary-identity-state {
  background: var(--mint);
  color: var(--accent-dark);
}

.salary-query label,
.salary-auth-fields label,
.salary-login-row label,
.payroll-picker-row label,
.payroll-field-grid label {
  display: grid;
  min-width: 0;
  grid-template-rows: 20px 44px;
}

.salary-query label > span,
.salary-auth-fields label > span,
.salary-login-row label > span,
.payroll-picker-row label > span,
.payroll-field-grid label > span {
  margin: 0;
}

.salary-query select,
.salary-auth-fields input,
.salary-login-row input,
.payroll-picker-row select,
.payroll-field-grid input {
  height: 44px;
  min-height: 44px;
}

.salary-auth-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.38fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f1;
  padding: 14px;
}

.salary-auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.salary-auth-copy strong {
  font-size: 17px;
}

.salary-auth-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.salary-auth-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 130px;
  gap: 10px;
  align-items: end;
}

.salary-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  align-items: end;
}

.salary-auth-fields .wide-button,
.salary-login-row .wide-button {
  height: 44px;
  min-height: 44px;
}

.salary-result {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.salary-result-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-radius: 8px;
  background: var(--mint);
  padding: 16px 18px;
}

.salary-result-head span,
.salary-result-head strong {
  display: block;
}

.salary-result-head > div:first-child span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.salary-result-head > div:first-child strong {
  margin-top: 4px;
  font-size: 22px;
}

.salary-net {
  text-align: right;
}

.salary-net span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.salary-net strong {
  margin-top: 3px;
  font-size: 30px;
}

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

.salary-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.salary-group-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 14px;
  list-style: none;
}

.salary-group-summary::-webkit-details-marker {
  display: none;
}

.salary-group-summary h3,
.payroll-form-group h3 {
  margin: 0;
  font-size: 15px;
}

.salary-group-summary-total {
  display: block;
  margin-left: auto;
  color: var(--foreground);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.salary-group-body {
  padding: 0 14px 14px;
}

@media (min-width: 721px) {
  .salary-group > .salary-group-body {
    display: block !important;
  }

  .salary-group-summary {
    cursor: default;
  }
}

.salary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid #ece9df;
  color: var(--muted);
  font-size: 13px;
}

.salary-line strong {
  color: var(--foreground);
  white-space: nowrap;
}

.salary-line.subtotal,
.salary-line.total {
  margin-top: 5px;
  border-bottom: 0;
  color: var(--foreground);
  font-weight: 900;
}

.salary-line.deduction strong {
  color: #a53e38;
}

.salary-policy-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1efe8;
  overflow: hidden;
}

.salary-policy-details summary {
  display: flex;
  min-height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  list-style: none;
}

.salary-policy-details summary::-webkit-details-marker {
  display: none;
}

.salary-policy-details summary strong,
.salary-policy-current > strong {
  color: var(--accent-dark);
}

.salary-policy-action {
  flex: none;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.salary-policy-action::before {
  content: "展开";
}

.salary-policy-details[open] .salary-policy-action::before {
  content: "收起";
}

.salary-policy-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.salary-policy-content {
  padding: 14px;
}

.salary-policy-intro,
.salary-policy-closing {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.salary-policy-content section {
  margin-top: 14px;
}

.salary-policy-content h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.salary-policy-content ol {
  display: grid;
  margin: 0;
  padding-left: 22px;
  gap: 9px;
}

.salary-policy-content li {
  padding-left: 2px;
  color: var(--foreground);
  font-size: 12px;
  line-height: 1.65;
}

.salary-policy-content li strong,
.salary-policy-content li span {
  display: block;
}

.salary-policy-content li strong {
  margin-bottom: 1px;
}

.salary-policy-content li span,
.salary-policy-current span,
.salary-notes {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.salary-policy-current {
  display: grid;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  gap: 4px;
}

.salary-policy-closing {
  margin-top: 12px;
}

.salary-notes {
  margin: 10px 0 0;
  border-left: 3px solid var(--accent);
  padding: 7px 10px;
}

.payroll-editor-body {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.payroll-picker-row {
  display: block;
}

.payroll-identity-picker {
  min-width: 0;
  margin-top: 0;
}

.manager-payroll-identity-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manager-payroll-identity-card {
  min-height: 62px;
}

.payroll-status-box {
  display: grid;
  min-width: 0;
  height: 58px;
  grid-template-rows: 18px 40px;
}

.payroll-status-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.payroll-status-box strong {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f1;
  padding: 0 12px;
}

.payroll-control-row {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(150px, 220px) minmax(170px, 1fr);
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.payroll-control-row > label {
  grid-template-rows: 18px 40px;
}

.payroll-control-row select {
  height: 40px;
  min-height: 40px;
}

.payroll-net-box {
  display: flex;
  min-width: 0;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(13, 127, 102, 0.24);
  border-radius: 8px;
  background: var(--mint);
  padding: 0 12px;
}

.payroll-net-box span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.payroll-net-box strong {
  color: var(--accent-dark);
  font-size: 18px;
  white-space: nowrap;
}

.payroll-status-box strong.published {
  border-color: rgba(13, 127, 102, 0.3);
  background: var(--mint);
  color: var(--accent-dark);
}

.payroll-summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.records-panel-body {
  margin-top: 10px;
}

.records-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.manager-punch-box {
  margin-bottom: 12px;
  border: 1px solid #c9ddd5;
  border-radius: 8px;
  background: #f5faf7;
  padding: 11px;
}

.manager-punch-heading strong,
.manager-punch-heading span {
  display: block;
}

.manager-punch-heading strong {
  font-size: 14px;
}

.manager-punch-heading span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.manager-punch-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 0.55fr) minmax(220px, 1.4fr) 120px;
  align-items: end;
  gap: 8px;
  margin-top: 9px;
}

.manager-punch-fields label {
  min-width: 0;
}

.manager-punch-fields.attendance-adjustment-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attendance-adjustment-fields label:nth-child(3),
.attendance-adjustment-fields .manager-punch-reason {
  grid-column: span 2;
}

.attendance-adjustment-fields #managerAttendanceReload {
  grid-column: 3;
  color: var(--accent-dark);
  background: var(--mint);
}

.attendance-adjustment-fields #managerPunchSubmit {
  grid-column: 4;
}

@media (max-width: 720px) {
  .manager-punch-fields.attendance-adjustment-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-adjustment-fields #managerAttendanceReload {
    grid-column: 1;
  }

  .attendance-adjustment-fields #managerPunchSubmit {
    grid-column: 2;
  }
}

.manager-punch-fields label span {
  margin-bottom: 4px;
  font-size: 10px;
}

.manager-punch-fields input,
.manager-punch-fields select,
.manager-punch-fields button {
  min-width: 0;
  min-height: 38px;
}

.manager-punch-fields button {
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.manager-punch-box .attendance-message {
  margin-top: 7px;
  font-size: 11px;
}

.payroll-summary-strip > div {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.payroll-summary-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.payroll-summary-strip strong {
  font-size: 17px;
  white-space: nowrap;
}

.payroll-preview-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.payroll-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 10px;
}

.payroll-workspace .payroll-preview-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.payroll-workspace .payroll-rule-group {
  margin-top: 0;
}

.payroll-workspace .payroll-field-grid.payroll-base-fields {
  grid-template-columns: minmax(0, 1fr);
}

.payroll-preview-strip > .payroll-preview-card {
  min-width: 0;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payroll-preview-strip > div.payroll-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.payroll-preview-card > span,
.payroll-preview-details summary > span {
  display: grid;
  gap: 2px;
}

.payroll-preview-details {
  padding: 0;
  overflow: hidden;
}

.payroll-preview-details summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.payroll-preview-details summary::-webkit-details-marker {
  display: none;
}

.payroll-preview-details summary small {
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
}

.payroll-preview-details summary::after {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.payroll-preview-details[open] {
  grid-column: auto;
}

.payroll-preview-details[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.payroll-preview-lines {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  padding: 8px 10px 10px;
}

.payroll-preview-lines > div {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
}

.payroll-preview-lines > div:last-child {
  border-bottom: 0;
}

.payroll-preview-lines strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.payroll-field-grid.payroll-base-fields {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  padding: 8px 10px 3px;
}

.payroll-base-fields > label,
.payroll-base-fields .payroll-subsidy-fields label {
  grid-template-columns: minmax(0, 1fr) minmax(78px, 96px);
  grid-template-rows: none;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
}

.payroll-base-fields input {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding-inline: 8px;
  text-align: right;
}

.payroll-base-default-toggle {
  margin: 7px 10px 9px;
  font-size: 11px;
}

.payroll-penalty-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  padding: 8px 10px;
}

.payroll-penalty-item {
  display: grid;
  min-width: 0;
  min-height: 52px;
  align-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 7px 2px;
}

.payroll-penalty-item:last-child {
  border-bottom: 0;
}

.payroll-penalty-item > div {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.payroll-penalty-item span,
.payroll-penalty-item small {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.payroll-penalty-item strong {
  flex: none;
  color: #a53e38;
  font-size: 14px;
  white-space: nowrap;
}

.payroll-penalty-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.payroll-penalty-inline input,
.payroll-penalty-editable input {
  width: 62px;
  height: 25px;
  min-height: 25px;
  border-radius: 6px;
  padding: 2px 6px;
  text-align: right;
}

.payroll-penalty-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0 10px 3px;
}

.payroll-penalty-settings label,
.payroll-note-field {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(78px, 96px);
  grid-template-rows: none;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.payroll-penalty-settings label {
  border-bottom: 1px solid var(--line);
}

.payroll-penalty-settings label > span,
.payroll-note-field > span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.payroll-penalty-settings input,
.payroll-note-field input {
  width: 100%;
  height: 32px;
  min-height: 32px;
}

.payroll-note-field {
  margin: 5px 10px 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 16px 32px;
  gap: 2px;
  padding: 0;
}

.payroll-preview-net {
  border-color: rgba(13, 127, 102, 0.24) !important;
  background: var(--mint) !important;
}

.payroll-preview-net strong {
  color: var(--accent-dark);
}

.payroll-penalty-details .payroll-reserved-note {
  margin: 5px 10px 9px;
  line-height: 1.45;
}

.payroll-rule-group {
  margin-top: 10px;
  border: 1px solid rgba(13, 127, 102, 0.24);
  border-radius: 8px;
  background: #f2faf6;
  padding: 10px;
}

.payroll-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payroll-group-heading h3,
.payroll-group-heading p {
  margin: 0;
}

.payroll-group-heading h3 {
  font-size: 16px;
  line-height: 1.25;
}

.payroll-group-heading p,
.payroll-rule-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.payroll-group-heading button {
  min-height: 34px;
  flex: 0 0 auto;
  border-radius: 7px;
  padding: 0 12px;
  font-size: 12px;
}

.payroll-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.payroll-workspace .payroll-rule-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.payroll-workspace .payroll-rule-grid > label {
  display: grid;
  min-width: 0;
  min-height: 34px;
  grid-template-columns: minmax(122px, 0.42fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.payroll-workspace .payroll-rule-grid > label > span:first-child {
  display: flex;
  min-height: 18px;
  align-items: center;
  overflow: visible;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
}

.payroll-revenue-field small {
  margin-left: 6px;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 800;
}

.payroll-revenue-field input.remembered-value {
  border-color: rgba(13, 127, 102, 0.18);
  background: var(--mint);
  color: var(--ink-soft);
}

.payroll-workspace .payroll-rule-grid > label input,
.payroll-workspace .payroll-check-field .check-control {
  height: 34px;
  min-height: 34px;
}

.payroll-products-field {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(13, 127, 102, 0.18);
  padding-top: 7px;
}

.payroll-products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payroll-products-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-products-heading button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.payroll-product-rows {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.payroll-products-empty {
  margin: 0;
  border: 1px dashed rgba(13, 127, 102, 0.28);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
}

.payroll-product-row {
  display: grid;
  grid-template-columns: 60px minmax(150px, 1fr) minmax(150px, 0.8fr) 54px;
  align-items: end;
  gap: 7px;
  border: 1px solid rgba(13, 127, 102, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  padding: 7px;
}

.payroll-product-row > label {
  display: grid;
  min-width: 0;
  grid-template-rows: 17px 38px;
}

.payroll-product-row label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.payroll-product-row input,
.payroll-product-row select {
  width: 100%;
  height: 38px;
  min-height: 38px;
}

.payroll-product-index {
  display: flex;
  height: 38px;
  align-items: center;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.payroll-product-remove {
  min-height: 38px;
  border-radius: 7px;
  background: #f5dddd;
  padding: 0 8px;
  color: var(--danger);
  font-size: 12px;
}

.payroll-check-field .check-control {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 800;
}

.payroll-check-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.payroll-auto-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.payroll-auto-lines > div {
  display: flex;
  min-height: 70px;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  border: 1px solid #e3e0d6;
  border-radius: 7px;
  background: #fff;
  padding: 9px 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.payroll-auto-lines strong {
  color: var(--accent-dark);
  font-size: 15px;
  white-space: nowrap;
}

.payroll-form-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.payroll-form-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f1;
  padding: 10px;
}

.payroll-form-group h3 {
  margin-bottom: 7px;
}

.payroll-fixed-group .payroll-field-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payroll-subsidy-fields {
  display: contents;
}

.payroll-subsidy-fields.hidden {
  display: none;
}

.payroll-deduction-group {
  grid-column: 1 / -1;
}

.payroll-fixed-group .payroll-field-grid label,
.payroll-form-group .payroll-subsidy-fields label {
  grid-template-rows: 18px 38px;
}

.payroll-fixed-group .payroll-field-grid input,
.payroll-form-group .payroll-subsidy-fields input {
  height: 38px;
  min-height: 38px;
}

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

.payroll-field-grid.three {
  grid-template-columns: 1fr;
}

.payroll-note-field {
  grid-column: 1 / -1;
}

.payroll-reserved-note {
  margin: 9px 0 0;
  font-size: 11px;
}

.payroll-default-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.payroll-default-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.payroll-default-toggle span {
  margin: 0;
}

.payroll-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.payroll-actions button {
  min-height: 40px;
  border-radius: 7px;
  background: var(--accent);
  padding: 0 16px;
  color: #fff;
  font-weight: 900;
}

.payroll-actions .quiet-button {
  background: var(--mint);
  color: var(--accent-dark);
}

.payroll-actions .danger {
  margin-left: auto;
  background: #a8423d;
}

.payroll-actions button:disabled {
  cursor: default;
  opacity: 0.55;
}

.schedule-day-status {
  display: grid;
  min-width: 0;
  grid-template-rows: 15px 30px;
}

.schedule-day-status > span {
  margin: 0;
  font-size: 10px;
}

.schedule-day-status select {
  min-width: 0;
  height: 30px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 800;
}

.schedule-cell-actions {
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: end;
  margin-top: 6px;
}

.schedule-cell-actions .mini-save {
  margin-top: 0;
}

@media (max-width: 980px) {
  .salary-auth-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .salary-auth-fields .wide-button {
    grid-column: 1 / -1;
  }

  .salary-groups {
    grid-template-columns: 1fr;
  }

  .payroll-form-groups {
    grid-template-columns: minmax(0, 1.15fr) minmax(230px, 0.85fr);
  }

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

  .payroll-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .payroll-workspace .payroll-preview-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .segmented button {
    min-height: 40px;
    padding: 0 4px;
    font-size: 13px;
  }

  .salary-query {
    grid-template-columns: minmax(0, 1.25fr) minmax(118px, 0.75fr);
    gap: 8px;
  }

  .salary-panel-head {
    align-items: flex-end;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 14px;
  }

  .salary-panel-head h2 {
    font-size: 21px;
  }

  .salary-heading-month {
    grid-template-columns: minmax(118px, 134px);
  }

  .salary-heading-month > span {
    display: none;
  }

  .salary-heading-month select {
    height: 36px;
    min-height: 36px;
    padding-inline: 8px;
  }

  .salary-identity-grid,
  .manager-payroll-identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .salary-identity-card {
    grid-template-columns: 9px minmax(0, 1fr);
    min-height: 74px;
    gap: 7px;
    padding: 9px;
  }

  .salary-identity-state {
    grid-column: 2;
    justify-self: start;
  }

  .salary-auth-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 11px;
  }

  .salary-auth-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .salary-auth-fields label:first-child {
    grid-column: 1 / -1;
  }

  .salary-auth-fields .wide-button {
    grid-column: 1 / -1;
  }

  .salary-login-row {
    grid-template-columns: minmax(0, 1fr) 110px;
  }

  .salary-result-head {
    padding: 13px;
  }

  .salary-result-head > div:first-child strong {
    font-size: 18px;
  }

  .salary-net strong {
    font-size: 24px;
  }

  .salary-groups {
    gap: 8px;
  }

  .salary-group {
    padding: 0;
  }

  .salary-group-summary {
    min-height: 52px;
    cursor: pointer;
    padding: 11px 12px;
  }

  .salary-group-summary-total {
    display: block;
    font-size: 16px;
  }

  .salary-group-summary::after {
    content: "+";
    flex: none;
    color: var(--accent-dark);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
  }

  .salary-group[open] .salary-group-summary::after {
    content: "−";
  }

  .salary-group[open] .salary-group-summary {
    border-bottom: 1px solid var(--line);
  }

  .salary-group-body {
    padding: 0 11px 11px;
  }

  .salary-policy-details summary {
    min-height: 42px;
    padding: 9px 11px;
  }

  .salary-policy-content {
    padding: 12px 11px;
  }

  .payroll-control-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .payroll-net-box {
    grid-column: 1 / -1;
  }

  .payroll-status-box {
    grid-column: auto;
    height: 64px;
    grid-template-columns: 1fr;
    grid-template-rows: 20px 44px;
    gap: 0;
  }

  .payroll-status-box strong {
    height: 44px;
  }

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

  .payroll-workspace .payroll-preview-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .payroll-preview-details[open] {
    grid-column: auto;
  }

  .payroll-summary-strip > div {
    padding: 8px 10px;
  }

  .payroll-preview-strip > .payroll-preview-card {
    min-height: 54px;
  }

  .payroll-preview-strip > div.payroll-preview-card,
  .payroll-preview-details summary {
    padding: 8px 10px;
  }

  .payroll-preview-details summary {
    min-height: 52px;
    gap: 6px;
  }

  .payroll-preview-details summary > span {
    white-space: nowrap;
  }

  .payroll-preview-details summary strong {
    font-size: 15px;
  }

  .payroll-preview-lines {
    grid-template-columns: 1fr;
  }

  .payroll-field-grid.payroll-base-fields {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 9px 3px;
  }

  .payroll-penalty-items {
    padding: 8px 9px;
  }

  .payroll-penalty-settings {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 9px 3px;
  }

  .payroll-note-field {
    margin-inline: 9px;
  }

  .payroll-form-group {
    padding: 10px;
  }

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

  .payroll-deduction-group {
    grid-column: auto;
  }

  .payroll-fixed-group .payroll-field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .payroll-subsidy-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .payroll-group-heading {
    align-items: center;
    flex-direction: row;
    gap: 7px;
  }

  .payroll-group-heading button {
    width: auto;
  }

  .payroll-rule-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .payroll-rule-grid label:first-child,
  .payroll-products-field {
    grid-column: 1 / -1;
  }

  .payroll-product-row {
    grid-template-columns: 1fr 1fr;
  }

  .payroll-product-index {
    grid-column: 1;
    grid-row: 1;
    height: 28px;
  }

  .payroll-product-remove {
    grid-column: 2;
    grid-row: 1;
    min-height: 28px;
    justify-self: end;
  }

  .payroll-product-row > label {
    grid-row: 2;
  }

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

  .payroll-actions .danger {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .mobile-schedule-cell .schedule-cell-actions {
    grid-template-columns: minmax(0, 1fr) 78px;
  }
}

@media (max-width: 390px) {
  .segmented button {
    font-size: 12px;
  }

  .salary-query,
  .salary-login-row {
    grid-template-columns: 1fr;
  }

  .salary-panel-head h2 {
    font-size: 19px;
  }

  .salary-heading-month {
    grid-template-columns: minmax(112px, 122px);
  }

  .salary-identity-heading > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .salary-login-row .wide-button {
    width: 100%;
  }

  .salary-result-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .salary-net {
    width: 100%;
    text-align: left;
  }
}

/* 2026-09 workspace finish: brand header, identity clock and shared backdrop. */
body {
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: url("/feelcoffee-mark.jpg") center 58% / min(58vw, 680px) auto no-repeat;
  opacity: 0.024;
  filter: grayscale(1);
}

.shell {
  position: relative;
  z-index: 1;
}

.brand-topbar {
  justify-content: center;
  padding: 12px 0 22px;
  text-align: center;
}

.brand-topbar .brand-block {
  width: 100%;
}

.brand-topbar h1 {
  width: 100%;
  font-size: clamp(52px, 6.4vw, 78px);
  line-height: 1;
  text-align: center;
}

.primary-panel > .section-head {
  align-items: center;
}

.identity-heading-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.identity-timebox {
  min-width: 158px;
  padding: 8px 12px;
  box-shadow: none;
}

.identity-timebox strong {
  font-size: 27px;
}

.attendance-calendar-manager {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(13, 127, 102, 0.24);
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
}

.personal-workspace-section > .personal-view-panel > .personal-view-head,
.personal-workspace-section > .personal-view-panel > .personal-identity-picker {
  display: none;
}

.unlock-panel {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 420px) 150px;
  align-items: end;
  gap: 16px;
}

@media (max-width: 720px) {
  body::before {
    background-position: center 56%;
    background-size: 86vw auto;
    opacity: 0.02;
  }

  .brand-topbar {
    padding: 4px 0 12px;
  }

  .brand-topbar h1 {
    font-size: 42px;
  }

  .primary-panel > .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .identity-heading-meta {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .identity-timebox {
    display: grid;
    min-width: 112px;
    grid-template-columns: auto auto;
    justify-content: end;
    gap: 0 5px;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: right;
  }

  .identity-timebox span {
    display: inline;
    font-size: 10px;
  }

  .identity-timebox strong {
    grid-column: 1 / -1;
    font-size: 28px;
    line-height: 1;
  }

  .identity-heading-meta > .badge {
    padding: 4px 8px;
    font-size: 10px;
  }

  .unlock-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 390px) {
  .brand-topbar h1 {
    font-size: 37px;
  }

  .identity-timebox {
    min-width: 100px;
  }
}

.payroll-product-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.payroll-product-row .payroll-product-index {
  grid-column: 1;
  grid-row: 1;
  height: 28px;
}

.payroll-product-row .payroll-product-remove {
  grid-column: 2;
  grid-row: 1;
  min-height: 28px;
  justify-self: end;
}

.payroll-product-row > label {
  grid-row: 2;
}

.payroll-product-participants {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  margin: 0;
  padding: 4px 0 0;
  border: 0;
}

.payroll-product-participants legend {
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.payroll-product-participants label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  cursor: pointer;
}

.payroll-product-participants input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent-dark);
}

.payroll-product-participants label > span {
  color: var(--foreground);
  font-size: 12px;
  font-weight: 500;
}

.payroll-product-participants input:disabled + span {
  color: var(--muted);
  opacity: 0.6;
}

/* 2026-09-06: compact brand mark, punch controls and section-owned month filters. */
.brand-topbar {
  min-height: 102px;
  background: var(--background);
  padding: 6px 0 14px;
}

.brand-topbar .brand-block {
  display: grid;
  place-items: center;
}

.brand-mark {
  display: grid;
  width: 104px;
  height: 82px;
  overflow: hidden;
  place-items: center;
  background: var(--background) url("/feelcoffee-mark.jpg") center / 142% auto no-repeat;
  background-blend-mode: multiply;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.42);
  opacity: 0;
}

.punch-fields {
  grid-template-columns: minmax(0, 1fr);
}

.action-grid,
.record-strip,
.record-card-times {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.personal-hub-head {
  display: block;
}

.attendance-result-head,
.personal-detail-toolbar {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.attendance-result-head > div,
.personal-detail-toolbar > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.attendance-result-head > div > span,
.personal-detail-toolbar > div > span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.attendance-result-head > div > strong,
.personal-detail-toolbar > div > strong {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-detail-month {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto 152px;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.personal-detail-month > span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.personal-detail-month select {
  width: 152px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--foreground);
  padding: 8px 10px;
  font: inherit;
}

.salary-detail-toolbar {
  margin-top: 14px;
}

@media (max-width: 720px) {
  .brand-topbar {
    min-height: 78px;
    padding: 2px 0 10px;
  }

  .brand-mark {
    width: 86px;
    height: 66px;
  }

  .brand-mark img {
    transform: scale(1.42);
  }

  .personal-hub-head {
    display: block;
  }

  .attendance-result-head,
  .personal-detail-toolbar {
    align-items: center;
    gap: 8px;
  }

  .attendance-result-head > div > strong,
  .personal-detail-toolbar > div > strong {
    font-size: 17px;
  }

  .personal-detail-month {
    grid-template-columns: auto 116px;
    gap: 5px;
  }

  .personal-detail-month select {
    width: 116px;
    min-height: 38px;
    padding: 7px 8px;
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  .personal-detail-month {
    grid-template-columns: 108px;
  }

  .personal-detail-month > span {
    display: none;
  }

  .personal-detail-month select {
    width: 108px;
  }
}

/* Unified employee workspace */
.personal-workspace {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 12px;
}

.personal-workspace.hidden {
  display: none;
}

.personal-hub-panel {
  overflow: hidden;
  padding-bottom: 14px;
}

.personal-hub-head {
  align-items: end;
  margin-bottom: 0;
}

.personal-hub-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.personal-workspace-month {
  display: grid;
  grid-template-columns: auto 152px;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.personal-workspace-month > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.personal-workspace-month select {
  width: 152px;
  min-height: 40px;
}

.personal-workspace-identity {
  margin-top: 14px;
}

.personal-subnav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ece9df;
}

.personal-subnav button {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 800;
}

.personal-subnav button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(35, 42, 36, 0.08);
}

.personal-workspace-section,
.personal-workspace-section > .panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.personal-workspace-section > .personal-view-panel {
  padding-top: 16px;
}

.personal-workspace-section > .personal-view-panel > .personal-view-head,
.personal-workspace-section > .personal-view-panel > .personal-identity-picker {
  display: none;
}

.growth-layout {
  display: grid;
}

.growth-layout.hidden {
  display: none;
}

.growth-head {
  align-items: center;
}

.growth-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.growth-overview > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--background);
}

.growth-overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.growth-overview strong {
  font-size: 20px;
}

.growth-empty-state {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 16px;
  border-left: 3px solid var(--accent);
  background: var(--mint);
}

.growth-empty-state span {
  color: var(--muted);
  line-height: 1.6;
}

/* Manager sign-in uses the full content width on desktop. */
.unlock-panel {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 420px) 150px;
  align-items: end;
  gap: 16px;
}

.unlock-panel > div {
  align-self: center;
}

.unlock-panel > label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.unlock-panel > label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.unlock-panel input,
.unlock-panel .wide-button {
  width: 100%;
  min-height: 48px;
}

@media (max-width: 720px) {
  .personal-hub-panel {
    padding: 14px;
  }

  .personal-hub-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 10px;
    align-items: end;
  }

  .personal-hub-subtitle,
  .personal-workspace-month > span {
    display: none;
  }

  .personal-workspace-month,
  .personal-workspace-month select {
    display: block;
    width: 124px;
  }

  .personal-subnav button {
    min-height: 42px;
    padding: 8px 4px;
    font-size: 13px;
  }

  .growth-overview {
    gap: 6px;
  }

  .growth-overview > div {
    padding: 10px;
  }

  .growth-overview strong {
    font-size: 17px;
  }

  .unlock-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .unlock-panel > div {
    align-self: auto;
  }
}

@media (max-width: 390px) {
  .personal-hub-head {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .personal-workspace-month,
  .personal-workspace-month select {
    width: 112px;
  }

  .personal-subnav button {
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  .manager-punch-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-punch-reason {
    grid-column: 1 / -1;
  }

  .manager-punch-fields button {
    grid-column: 1 / -1;
    min-height: 40px;
  }

  .roster-edit-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}

/* Compact payroll, schedule and attendance editors */
.attendance-query.attendance-query-auto {
  grid-template-columns: minmax(260px, 1.45fr) minmax(170px, 0.55fr);
  max-width: 760px;
}

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

.payroll-module-card {
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 11px;
  color: var(--foreground);
  text-align: left;
}

.payroll-module-card > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  font-size: 14px;
  font-weight: 900;
}

.payroll-module-card small {
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 800;
}

.payroll-module-card strong {
  font-size: 16px;
  white-space: nowrap;
}

.payroll-module-card:hover,
.payroll-module-card.active {
  border-color: rgba(13, 127, 102, 0.5);
  background: var(--mint);
}

.payroll-module-panels {
  margin-top: 8px;
}

.payroll-module-panel,
.payroll-module-panel.payroll-rule-group {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  padding: 12px;
}

.payroll-module-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.payroll-module-panel-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.payroll-module-panel-head strong {
  font-size: 15px;
}

.payroll-module-panel-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.payroll-module-panel .payroll-field-grid.payroll-base-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  padding: 0;
}

.payroll-module-panel .payroll-base-fields > label,
.payroll-module-panel .payroll-base-fields .payroll-subsidy-fields label,
.payroll-module-panel .payroll-penalty-settings label,
.payroll-module-panel .payroll-note-field,
.payroll-module-panel .payroll-rule-grid > label {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 17px 36px;
  align-items: stretch;
  gap: 3px;
  border: 0;
  padding: 0;
}

.payroll-module-panel .payroll-base-fields label > span,
.payroll-module-panel .payroll-penalty-settings label > span,
.payroll-module-panel .payroll-note-field > span,
.payroll-module-panel .payroll-rule-grid > label > span:first-child {
  display: block;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-module-panel input:not([type="checkbox"]):not([type="hidden"]),
.payroll-module-panel select,
.payroll-module-panel .check-control {
  width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
}

.payroll-module-panel .payroll-subsidy-fields {
  display: contents;
}

.payroll-module-panel .payroll-subsidy-fields.hidden {
  display: none;
}

.payroll-module-panel .payroll-base-default-toggle {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
}

.payroll-module-panel input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.payroll-module-panel .payroll-preview-lines {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  padding: 0;
}

.payroll-module-panel .payroll-preview-lines > div {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf8;
  padding: 8px 10px;
}

.payroll-module-panel .payroll-penalty-items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  padding: 0;
}

.payroll-module-panel .payroll-penalty-item {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf8;
  padding: 8px 10px;
}

.payroll-module-panel .payroll-penalty-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 9px 0 0;
}

.payroll-module-panel .payroll-note-field {
  margin: 8px 0 0;
}

.payroll-module-panel .payroll-reserved-note {
  margin: 7px 0 0;
}

.payroll-module-panel .payroll-rule-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.payroll-module-panel .payroll-products-field {
  grid-column: 1 / -1;
}

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

.schedule-person-card.schedule-person-details {
  display: block;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.schedule-person-details[open] {
  grid-column: span 2;
}

.schedule-person-details > .schedule-person-head {
  min-height: 54px;
  align-items: center;
  margin: 0;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.schedule-person-details > .schedule-person-head::-webkit-details-marker {
  display: none;
}

.schedule-person-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.schedule-person-details .schedule-person-identity > strong {
  flex: none;
  font-size: 14px;
}

.schedule-person-details .schedule-person-identity > .schedule-summary {
  display: block;
  max-width: none;
  overflow: hidden;
  padding: 3px 7px;
  text-overflow: ellipsis;
}

.schedule-person-toggle {
  flex: none;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
}

.schedule-person-toggle::before {
  content: "展开";
}

.schedule-person-details[open] .schedule-person-toggle::before {
  content: "收起";
}

.schedule-person-body {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.schedule-person-body .mobile-schedule-cell {
  grid-template-columns: minmax(120px, 0.75fr) minmax(0, 1.25fr);
  gap: 8px;
}

@media (max-width: 980px) {
  .payroll-module-grid,
  .schedule-day-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-module-panel .payroll-field-grid.payroll-base-fields,
  .payroll-module-panel .payroll-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-person-details[open] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .attendance-query.attendance-query-auto {
    grid-template-columns: minmax(0, 1.35fr) minmax(112px, 0.65fr);
    gap: 8px;
  }

  .attendance-query.attendance-query-auto label {
    grid-template-rows: 18px 40px;
  }

  .attendance-query.attendance-query-auto label:first-child {
    grid-column: auto;
  }

  .attendance-query.attendance-query-auto select {
    height: 40px;
    min-height: 40px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .payroll-module-card {
    min-height: 54px;
    padding: 8px 9px;
  }

  .payroll-module-card strong {
    font-size: 14px;
  }

  .payroll-module-panel,
  .payroll-module-panel.payroll-rule-group {
    padding: 10px;
  }

  .payroll-module-panel .payroll-preview-lines,
  .payroll-module-panel .payroll-penalty-items {
    grid-template-columns: minmax(0, 1fr);
  }

  .payroll-module-panel .payroll-penalty-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-person-body .mobile-schedule-cell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .schedule-person-body .mobile-schedule-cell .schedule-label-field,
  .schedule-person-body .mobile-schedule-cell .schedule-time-edit,
  .schedule-person-body .mobile-schedule-cell .schedule-cell-actions {
    grid-column: 1 / -1;
  }

  .schedule-person-body .mobile-schedule-cell .schedule-time-edit {
    gap: 8px;
  }
}

/* Shared attendance and salary page structure */
.personal-view-layout,
.personal-view-panel {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.personal-view-panel {
  overflow-x: clip;
}

.personal-view-head {
  align-items: flex-end;
  min-width: 0;
  margin-bottom: 14px;
}

.personal-view-head > div {
  min-width: 0;
}

.personal-view-head h2 {
  font-size: 22px;
}

.personal-heading-month {
  display: grid;
  flex: 0 0 auto;
  min-width: 0;
  grid-template-columns: auto 160px;
  align-items: center;
  gap: 7px;
}

.personal-heading-month > span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.personal-heading-month select {
  width: 160px;
  height: 40px;
  min-height: 40px;
  padding: 7px 10px;
}

.personal-identity-picker {
  margin-top: 14px;
}

.personal-identity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.personal-identity-heading > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.personal-identity-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.personal-identity-heading strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.personal-identity-grid .salary-identity-card {
  min-height: 72px;
  padding: 10px 11px;
}

.employee-week-day {
  position: relative;
  overflow: hidden;
  border-top-width: 4px;
}

.employee-week-day.shift-tone-early {
  border-top-color: #e7ad32;
  background: #fffaf0;
}

.employee-week-day.shift-tone-middle {
  border-top-color: #16866e;
  background: #f4fcf8;
}

.employee-week-day.shift-tone-late {
  border-top-color: #d6684b;
  background: #fff6f2;
}

.employee-week-day.shift-tone-office {
  border-top-color: #4e7fb4;
  background: #f4f8fd;
}

.employee-week-day.shift-tone-rest,
.employee-week-day.shift-tone-empty {
  border-top-color: #a9aaa5;
  background: #f3f2ed;
}

.employee-week-day.shift-tone-leave {
  border-top-color: #bd6679;
  background: #fff5f7;
}

.employee-week-day.shift-tone-other {
  border-top-color: #786ca8;
  background: #faf8ff;
}

.employee-week-shift strong {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--foreground);
  font-weight: 900;
}

.salary-preview-notice,
.salary-policy-responsibility {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(194, 137, 35, 0.3);
  border-radius: 8px;
  background: #fff8e8;
  padding: 10px 12px;
}

.salary-preview-notice {
  margin-top: 10px;
}

.salary-preview-notice strong,
.salary-policy-responsibility strong {
  color: #75500c;
  white-space: nowrap;
}

.salary-preview-notice span,
.salary-policy-responsibility span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.salary-policy-responsibility {
  margin-top: 14px;
  border-color: rgba(78, 127, 180, 0.25);
  background: #f4f8fd;
}

.salary-policy-responsibility strong {
  color: #315f8e;
}

@media (max-width: 720px) {
  .personal-view-head {
    align-items: flex-end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 122px;
    gap: 10px;
    width: 100%;
  }

  .personal-view-head h2 {
    font-size: 20px;
  }

  .personal-heading-month {
    width: 122px;
    grid-template-columns: 122px;
    justify-self: end;
  }

  .personal-heading-month > span {
    display: none;
  }

  .personal-heading-month select {
    width: 122px;
    height: 38px;
    min-height: 38px;
  }

  .personal-identity-heading > div {
    align-items: baseline;
    flex-direction: row;
    gap: 8px;
  }

  .personal-identity-heading > div > span {
    flex: none;
  }

  .personal-identity-heading > div > strong {
    flex: 1 1 auto;
    font-size: 14px;
  }

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

  .personal-identity-grid .salary-identity-card {
    min-height: 68px;
    padding: 9px 10px;
  }

  .salary-preview-notice,
  .salary-policy-responsibility {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 390px) {
  .payroll-module-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .payroll-module-card strong {
    justify-self: start;
  }
}

/* Payroll expansion layout: vertical details in two side-by-side panels. */
.payroll-module-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  margin-top: 8px;
}

.payroll-module-panel,
.payroll-module-panel.payroll-rule-group {
  min-width: 0;
}

.payroll-module-panel-head > div {
  display: grid;
  align-items: start;
  gap: 2px;
}

.payroll-module-panel .payroll-field-grid.payroll-base-fields,
.payroll-module-panel .payroll-preview-lines,
.payroll-module-panel .payroll-penalty-items,
.payroll-module-panel .payroll-penalty-settings {
  grid-template-columns: minmax(0, 1fr);
}

.payroll-rule-note:empty {
  display: none;
}

.salary-preview-notice,
.salary-policy-responsibility {
  min-height: 44px;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
}

.salary-preview-notice strong,
.salary-policy-responsibility strong {
  line-height: 1.55;
}

@media (max-width: 720px) {
  .payroll-module-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .payroll-module-panel,
  .payroll-module-panel.payroll-rule-group {
    padding: 8px;
  }

  .payroll-module-panel .payroll-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .payroll-module-panel .payroll-rule-grid > label:first-child {
    grid-column: auto;
  }

  .salary-preview-notice,
  .salary-policy-responsibility {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
  }
}

/* Payroll heading: keep employee selection, month and net pay on one row. */
.payroll-identity-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.payroll-identity-selection {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.payroll-identity-selection > span {
  flex: none;
}

.payroll-identity-selection > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-heading-controls {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(130px, 180px) minmax(160px, 220px);
  align-items: end;
  gap: 8px;
  margin-left: auto;
}

.payroll-picker-row .payroll-heading-month {
  display: grid;
  grid-template-rows: 16px 36px;
  gap: 2px;
}

.payroll-heading-month > span {
  margin: 0;
  font-size: 10px;
  line-height: 16px;
}

.payroll-heading-month select {
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 6px 9px;
}

.payroll-heading-controls .payroll-net-box {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
}

.payroll-heading-controls .payroll-net-box strong {
  font-size: 16px;
}

@media (max-width: 720px) {
  .payroll-identity-heading {
    display: grid;
    grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.55fr);
    align-items: end;
    gap: 8px;
  }

  .payroll-identity-selection {
    display: grid;
    gap: 2px;
  }

  .payroll-identity-selection > strong {
    font-size: 13px;
  }

  .payroll-heading-controls {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .payroll-heading-month select {
    padding-inline: 6px;
    font-size: 12px;
  }

  .payroll-heading-controls .payroll-net-box {
    grid-column: auto;
    gap: 5px;
    padding-inline: 7px;
  }

  .payroll-heading-controls .payroll-net-box span {
    font-size: 9px;
  }

  .payroll-heading-controls .payroll-net-box strong {
    font-size: 13px;
  }
}

/* Payroll editor: compact module cards with readable two-column details. */
.payroll-workspace {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.payroll-module-grid,
.payroll-module-panels {
  display: contents;
}

.payroll-module-grid > [data-payroll-module="base"] {
  grid-column: 1;
  grid-row: 1;
}

.payroll-module-grid > [data-payroll-module="incentive"] {
  grid-column: 2;
  grid-row: 1;
}

.payroll-module-grid > [data-payroll-module="penalty"] {
  grid-column: 3;
  grid-row: 1;
}

.payroll-module-grid > [data-payroll-module="rules"] {
  grid-column: 4;
  grid-row: 1;
}

.payroll-module-panels > [data-payroll-panel="base"] {
  grid-column: 1 / 3;
  grid-row: 2;
}

.payroll-module-panels > [data-payroll-panel="incentive"] {
  grid-column: 3 / 5;
  grid-row: 2;
}

.payroll-module-panels > [data-payroll-panel="penalty"] {
  grid-column: 1 / 3;
  grid-row: 3;
}

.payroll-module-panels > [data-payroll-panel="rules"] {
  grid-column: 3 / 5;
  grid-row: 3;
}

.payroll-module-panel,
.payroll-module-panel.payroll-rule-group {
  width: 100%;
  min-width: 0;
  align-self: start;
  margin: 0;
  background: #fffefa;
}

.payroll-module-panel.payroll-rule-group {
  border-color: var(--line);
  background: #fffefa;
}

.payroll-module-panel-head > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.payroll-module-panel .payroll-field-grid.payroll-base-fields,
.payroll-module-panel .payroll-preview-lines,
.payroll-module-panel .payroll-penalty-settings,
.payroll-module-panel .payroll-rule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payroll-module-panel .payroll-penalty-items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.payroll-module-panel .payroll-base-fields > label,
.payroll-module-panel .payroll-base-fields .payroll-subsidy-fields label,
.payroll-module-panel .payroll-preview-lines > div,
.payroll-module-panel .payroll-penalty-item {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}

.payroll-module-panel .payroll-base-fields > label,
.payroll-module-panel .payroll-base-fields .payroll-subsidy-fields label {
  grid-template-columns: minmax(0, 1fr) minmax(74px, 96px);
  grid-template-rows: none;
  align-items: center;
  background: #ffffff;
}

.payroll-module-panel .payroll-preview-lines > div,
.payroll-module-panel .payroll-penalty-item:not(.payroll-penalty-editable) {
  background: #f2f4f1;
}

.payroll-module-panel .payroll-penalty-item.payroll-penalty-editable {
  background: #ffffff;
}

.payroll-module-panel .payroll-base-fields label > span,
.payroll-module-panel .payroll-penalty-settings label > span,
.payroll-module-panel .payroll-note-field > span,
.payroll-module-panel .payroll-rule-grid > label > span:first-child {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.payroll-module-panel .payroll-penalty-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  align-items: center;
  gap: 6px;
}

.payroll-module-panel .payroll-penalty-inline > span {
  white-space: nowrap;
}

.payroll-module-panel .payroll-penalty-inline input {
  width: 62px;
  max-width: 62px;
  min-width: 0;
  height: 28px;
  min-height: 28px;
}

.payroll-module-panel .payroll-rule-grid > label:first-child {
  grid-column: auto;
}

.payroll-module-panel .payroll-rule-grid > label {
  grid-template-rows: minmax(17px, auto) 36px;
}

.payroll-module-panel.payroll-rule-group .payroll-group-heading {
  display: flex;
  grid-template-columns: none;
  align-items: center;
}

.payroll-module-panel.payroll-rule-group .payroll-group-heading button {
  width: auto;
  min-width: 104px;
}

.payroll-module-panel .payroll-products-field {
  grid-column: 1 / -1;
}

.payroll-module-panel input[readonly],
.payroll-module-panel input.remembered-value {
  border-color: #d9ddd8;
  background: #eef1ed;
  color: var(--ink-soft);
}

@media (max-width: 980px) {
  .payroll-workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-module-grid > [data-payroll-module="base"] {
    grid-column: 1;
    grid-row: 1;
  }

  .payroll-module-grid > [data-payroll-module="incentive"] {
    grid-column: 2;
    grid-row: 1;
  }

  .payroll-module-panels > [data-payroll-panel="base"] {
    grid-column: 1;
    grid-row: 2;
  }

  .payroll-module-panels > [data-payroll-panel="incentive"] {
    grid-column: 2;
    grid-row: 2;
  }

  .payroll-module-grid > [data-payroll-module="penalty"] {
    grid-column: 1;
    grid-row: 3;
  }

  .payroll-module-grid > [data-payroll-module="rules"] {
    grid-column: 2;
    grid-row: 3;
  }

  .payroll-module-panels > [data-payroll-panel="penalty"] {
    grid-column: 1;
    grid-row: 4;
  }

  .payroll-module-panels > [data-payroll-panel="rules"] {
    grid-column: 2;
    grid-row: 4;
  }

  .payroll-module-panel .payroll-field-grid.payroll-base-fields,
  .payroll-module-panel .payroll-preview-lines,
  .payroll-module-panel .payroll-penalty-items,
  .payroll-module-panel .payroll-penalty-settings,
  .payroll-module-panel .payroll-rule-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .payroll-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .payroll-module-grid,
  .payroll-module-panels {
    display: grid;
    grid-column: 1 / -1;
    gap: 6px;
  }

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

  .payroll-module-panels {
    grid-template-columns: minmax(0, 1fr);
  }

  .payroll-module-grid > [data-payroll-module],
  .payroll-module-panels > [data-payroll-panel] {
    grid-column: auto;
    grid-row: auto;
  }

  .payroll-module-panel .payroll-field-grid.payroll-base-fields,
  .payroll-module-panel .payroll-preview-lines,
  .payroll-module-panel .payroll-penalty-settings,
  .payroll-module-panel .payroll-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-module-panel .payroll-penalty-items {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  .payroll-module-panel .payroll-field-grid.payroll-base-fields,
  .payroll-module-panel .payroll-preview-lines,
  .payroll-module-panel .payroll-penalty-settings,
  .payroll-module-panel .payroll-rule-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Final responsive overrides for the shared page header and personal workspace. */
.brand-topbar {
  justify-content: center;
  min-height: 102px;
  padding: 6px 0 14px;
  text-align: center;
}

.brand-topbar .brand-block,
.brand-topbar h1 {
  width: 100%;
  text-align: center;
}

.brand-topbar h1 {
  font-size: clamp(52px, 6.4vw, 78px);
  line-height: 1;
}

.identity-title-block {
  min-width: 0;
}

.primary-panel .identity-eyebrow {
  font-size: 14px;
  line-height: 1.2;
}

.identity-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.identity-title-row h2 {
  margin: 0;
}

.identity-shift-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.2;
}

.personal-workspace-section > .personal-view-panel > .personal-view-head,
.personal-workspace-section > .personal-view-panel > .personal-identity-picker {
  display: none;
}

@media (max-width: 720px) {
  .brand-topbar {
    min-height: 78px;
    padding: 2px 0 10px;
  }

  .brand-topbar .brand-block {
    flex: 1 1 100%;
  }

  .brand-topbar h1 {
    font-size: 42px;
  }

  .primary-panel > .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .identity-heading-meta {
    display: block;
  }

  .identity-timebox {
    display: grid;
    width: auto;
    min-width: 112px;
    grid-template-columns: auto auto;
    justify-content: end;
    gap: 0 5px;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: right;
    box-shadow: none;
  }

  .identity-timebox span,
  .identity-timebox span + span {
    display: inline;
    margin: 0;
    font-size: 10px;
  }

  .identity-timebox strong {
    grid-column: 1 / -1;
    margin-top: 1px;
    font-size: 28px;
    line-height: 1;
  }

  .primary-panel .identity-eyebrow {
    margin-bottom: 4px;
    font-size: 13px;
  }

  .identity-title-row {
    gap: 7px;
  }

  .identity-title-row h2 {
    font-size: 21px;
  }

  .identity-shift-count {
    padding: 3px 7px;
    font-size: 9px;
  }

  .personal-hub-head {
    display: block;
  }
}

@media (max-width: 390px) {
  .brand-topbar h1 {
    font-size: 37px;
  }

  .identity-timebox {
    min-width: 100px;
  }
}
