:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #637381;
  --line: #d9e2ec;
  --soft: #f4f7fb;
  --paper: #ffffff;
  --navy: #1f4e79;
  --teal: #0f766e;
  --green: #4f8a3b;
  --amber: #b7791f;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef3f8;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: white;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 700;
}

button:hover {
  filter: brightness(1.05);
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}

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

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

.input-error {
  border-color: #d93f3f !important;
  box-shadow: 0 0 0 3px rgba(217, 63, 63, 0.14);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #dbe7f3;
  color: #193a57;
  text-align: left;
  font-weight: 800;
  border-bottom: 1px solid #b9c8d8;
}

td,
th {
  padding: 10px;
  border-bottom: 1px solid #e6edf4;
  vertical-align: middle;
}

td.numeric,
th.numeric {
  text-align: right;
}

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

.sidebar {
  background: #172b3a;
  color: white;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e7eef5;
  color: var(--navy);
  font-weight: 900;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3 {
  margin: 0;
}

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

.login-card .brand-mark {
  margin-bottom: 18px;
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
}

.login-card p {
  margin: 8px 0 20px;
  color: var(--muted);
  line-height: 1.4;
}

.login-card label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-card button {
  width: 100%;
  margin-top: 6px;
}

.login-error {
  margin-bottom: 14px;
  border-radius: 6px;
  background: #fdecec;
  color: var(--danger);
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
}

.brand h1 {
  font-size: 17px;
}

.brand p {
  margin-top: 4px;
  color: #b8c7d9;
  font-size: 12px;
  line-height: 1.35;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.sidebar select {
  margin-bottom: 22px;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.tab-button {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #dce7f2;
  text-align: left;
}

.tab-button.active {
  background: #f6fbff;
  color: #172b3a;
}

.sidebar-note {
  margin-top: 28px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #dce7f2;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-note span {
  display: block;
  margin-top: 6px;
}

main {
  min-width: 0;
  padding: 24px;
}

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

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 3px;
  font-size: 26px;
}

.toolbar {
  width: 220px;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--navy);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.toolbar .field-label {
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.staff-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi,
.panel,
.summary-tile {
  background: var(--paper);
  border: 1px solid #e0e8f0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 16px;
}

.summary-tile {
  padding: 12px 14px;
}

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

.kpi strong,
.summary-tile strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.summary-tile strong {
  font-size: 22px;
}

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

.setup-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: start;
}

.panel {
  overflow: hidden;
}

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

.panel-heading h3 {
  font-size: 16px;
}

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

.panel-heading input {
  max-width: 320px;
}

.bar-list,
.compact-list {
  padding: 14px 16px 18px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.cost-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid #eef2f6;
  font-size: 13px;
}

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

.cost-row strong,
.cost-row span {
  display: block;
}

.site-cost-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cost-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.cost-split span {
  border-radius: 6px;
  background: #f4f7fb;
  padding: 7px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.cost-split strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
}

.cost-split small {
  display: block;
  margin-top: 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.position-cost-table {
  min-width: 820px;
  font-size: 12px;
}

.position-cost-table th {
  position: static;
  background: #eef4fa;
}

.position-cost-table td,
.position-cost-table th {
  padding: 7px 8px;
}

.position-cost-table .total-row td {
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
  font-weight: 900;
}

.compact-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f6;
  font-size: 13px;
}

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

.table-wrap {
  max-height: calc(100vh - 210px);
  overflow: auto;
}

#staff-table tr {
  cursor: pointer;
}

#staff-table tr:hover,
.schedule-table tbody tr:hover {
  background: #f4f9fc;
}

#schedule-view .schedule-table tbody tr.schedule-leave-row {
  background: #fff9e8;
}

#schedule-view .schedule-table tbody tr.schedule-leave-row:hover {
  background: #fff3cf;
}

#schedule-view .schedule-table tbody tr.schedule-leave-row td.name {
  background: #fff7df;
}

.leave-row-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  border-radius: 999px;
  background: #f3b53f;
  color: #4c3200;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
}

#schedule-view .schedule-table td.leave-day-cell {
  background: #ffd98f;
}

#schedule-view .schedule-table td.leave-day-cell input {
  border-color: #d2941a;
  background: #fffaf0;
}

#staff-table tr.inactive-row {
  background: #f7f7f7;
  color: #6b7280;
}

#staff-table tr.sick-over-limit-row {
  background: #fff1f0;
}

#staff-table tr.sick-over-limit-row:hover {
  background: #ffe3e0;
}

.warning-tile {
  border-color: #f1b2aa;
  background: #fff6f5;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e7f4ec;
  color: #216e3f;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip.inactive {
  background: #f3e7e5;
  color: var(--danger);
}

.id-chip {
  display: inline-block;
  min-width: 48px;
  border-radius: 5px;
  background: #edf4fb;
  color: #1f4e79;
  padding: 4px 7px;
  font-weight: 900;
  text-align: center;
}

.rate {
  font-weight: 800;
}

.leave-number {
  font-weight: 800;
}

.leave-number.danger {
  color: var(--danger);
}

.ghost-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
}

.schedule-tools {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.schedule-tools label {
  width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-label {
  display: grid;
  align-content: end;
  gap: 5px;
}

.upload-label input {
  width: 190px;
  min-height: 38px;
  padding: 7px;
  font-size: 12px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.schedule-note {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.schedule-wrap {
  max-height: calc(100vh - 260px);
}

#schedule-view .panel {
  width: 100%;
}

#schedule-view .schedule-table {
  font-size: 13px;
}

#schedule-view .schedule-table th,
#schedule-view .schedule-table td {
  min-width: 44px;
  padding: 6px 5px;
}

#schedule-view .schedule-table th.select-col,
#schedule-view .schedule-table td.select-col {
  min-width: 42px;
}

#schedule-view .schedule-table th.name,
#schedule-view .schedule-table td.name {
  min-width: 190px;
  max-width: 190px;
}

#schedule-view .schedule-table input {
  min-height: 26px;
  padding: 3px;
  font-size: 13px;
}

#schedule-view .schedule-row-actions {
  min-width: 102px;
}

#schedule-view .schedule-row-actions button {
  min-height: 26px;
  padding: 3px 6px;
  font-size: 12px;
}

.schedule-table th,
.schedule-table td {
  min-width: 54px;
  text-align: center;
}

.schedule-table th.select-col,
.schedule-table td.select-col {
  min-width: 58px;
}

.schedule-table th.premium-day,
.schedule-table td.premium-day {
  background: #fff7e6;
}

.schedule-table th.premium-day em {
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.sunday-cost,
.public-holiday-cost {
  color: var(--amber);
  font-weight: 800;
}

.schedule-table th.name,
.schedule-table td.name {
  left: 0;
  position: sticky;
  z-index: 2;
  min-width: 220px;
  max-width: 220px;
  background: white;
  text-align: left;
}

.schedule-table th.name {
  background: #dbe7f3;
  z-index: 3;
}

.schedule-table input {
  min-height: 30px;
  padding: 4px;
  text-align: center;
}

.shift-group-row td {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #eef6f4;
  color: var(--teal);
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.shift-group-input {
  min-width: 140px;
}

.schedule-row-actions {
  display: flex;
  min-width: 150px;
  gap: 6px;
}

.schedule-row-actions button {
  min-height: 30px;
  padding: 4px 8px;
}

.schedule-row-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.leave-form {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.leave-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.leave-detail-panel {
  margin-bottom: 16px;
}

.leave-detail-panel .panel-heading select {
  max-width: 360px;
}

.leave-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.leave-card {
  display: block;
  min-height: 92px;
  border: 1px solid #dbe5ee;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 12px;
}

.leave-card.active {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 2px rgba(31, 78, 121, 0.12);
}

.leave-card.warning {
  border-color: #e48a7f;
  background: #fff4f2;
}

.leave-card.warning strong {
  color: var(--danger);
}

.leave-card span,
.leave-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.leave-card strong {
  display: block;
  margin: 7px 0;
  font-size: 24px;
  color: var(--ink);
}

.leave-breakdown-wrap {
  max-height: 280px;
}

.approval-panel {
  margin-bottom: 16px;
}

.approval-wrap {
  max-height: 300px;
}

.activity-wrap {
  max-height: 70vh;
}

#activity-table td:last-child {
  min-width: 260px;
}

.approval-actions {
  display: flex;
  gap: 8px;
  min-width: 180px;
}

.approval-actions button,
.record-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.danger-button {
  border-color: #f1c1bd;
  color: var(--danger);
}

.setup-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.employee-form {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  align-items: end;
}

.staff-filter-controls {
  display: block;
  width: min(620px, 100%);
}

.table-sort-button {
  min-height: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
  font-weight: 800;
}

.table-sort-button.numeric {
  text-align: right;
}

.table-sort-button.active {
  color: var(--navy);
}

.edit-dialog {
  width: min(900px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.edit-dialog::backdrop {
  background: rgba(23, 32, 38, 0.45);
}

.edit-dialog h3 {
  margin: 0;
}

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

.user-management {
  display: grid;
  gap: 12px;
}

.user-form {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.setup-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setup-form button {
  align-self: end;
}

.wide-field {
  grid-column: span 2;
}

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

.store-links {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.import-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
}

.store-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.store-link-row strong,
.store-link-row a {
  display: block;
}

.store-link-row a {
  margin-top: 4px;
  color: var(--navy);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex;
  gap: 8px;
  min-width: 150px;
}

.user-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.store-page {
  background: #eef3f7;
}

.store-shell {
  width: min(980px, calc(100% - 28px));
  margin: 28px auto;
}

.store-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.store-schedule-card {
  width: min(1500px, calc(100vw - 28px));
  margin-top: 18px;
  margin-left: 50%;
  transform: translateX(-50%);
}

.store-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.store-heading h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 4vw, 36px);
}

.store-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(20px, 3vw, 28px);
}

#store-status {
  align-self: start;
  border: 1px solid #cfdae5;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.store-actor-row {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.store-actor-row label {
  display: block;
  width: min(420px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.store-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store-notes {
  grid-column: span 2;
}

.store-table-wrap {
  max-height: 420px;
}

.store-month-label {
  width: min(220px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store-schedule-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.store-photo-label {
  width: min(260px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store-schedule-wrap {
  max-height: 70vh;
}

.store-schedule-table {
  font-size: 13px;
}

.store-schedule-table th,
.store-schedule-table td {
  padding: 6px 5px;
}

.store-schedule-table th.name,
.store-schedule-table td.name {
  min-width: 180px;
  max-width: 180px;
}

.store-schedule-table th:not(.name),
.store-schedule-table td:not(.name) {
  min-width: 44px;
}

.store-schedule-table input {
  width: 42px;
  min-height: 26px;
  padding: 3px;
  font-size: 13px;
}

.store-schedule-table .schedule-row-actions {
  min-width: 102px;
}

.store-schedule-table .schedule-row-actions button {
  min-height: 26px;
  padding: 3px 6px;
  font-size: 12px;
}

.store-shift-group-input {
  width: 116px;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  transform: translateY(20px);
  opacity: 0;
  transition: 0.2s ease;
  border-radius: 8px;
  background: #172b3a;
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 14px;
  }

  .brand {
    margin-bottom: 14px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

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

  .brand p,
  .sidebar-note {
    display: none;
  }

  .sidebar select {
    min-height: 44px;
    margin-bottom: 12px;
  }

  .nav-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 0 16px;
    white-space: nowrap;
  }

  main {
    padding: 14px;
  }

  button,
  input,
  select {
    min-height: 44px;
    font-size: 16px;
  }

  .staff-filter-controls {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    margin: -14px -14px 14px;
    padding: 12px 14px;
    background: #eef3f8;
    border-bottom: 1px solid var(--line);
  }

  .topbar h2 {
    font-size: 24px;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid,
  .staff-summary,
  .leave-summary-cards,
  .split-grid,
  .setup-grid,
  .employee-form,
  .user-form,
  .leave-form,
  .store-form,
  .store-link-row {
    grid-template-columns: 1fr;
  }

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

  .kpi,
  .summary-tile {
    padding: 12px;
  }

  .kpi strong,
  .summary-tile strong {
    font-size: 22px;
  }

  .wide-field,
  .store-notes {
    grid-column: auto;
  }

  .cost-row,
  .cost-split {
    grid-template-columns: 1fr;
  }

  .topbar,
  .schedule-tools,
  .import-panel,
  .store-heading,
  .store-schedule-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .schedule-tools label,
  .store-month-label,
  .panel-heading input {
    width: 100%;
    max-width: none;
  }

  .table-wrap {
    max-height: 68vh;
    margin-inline: -2px;
    -webkit-overflow-scrolling: touch;
  }

  .schedule-wrap,
  .store-schedule-wrap {
    max-height: 62vh;
  }

  #schedule-view .schedule-table,
  .store-schedule-table {
    font-size: 12px;
  }

  #schedule-view .schedule-table th,
  #schedule-view .schedule-table td,
  .store-schedule-table th,
  .store-schedule-table td {
    min-width: 40px;
    padding: 5px 4px;
  }

  #schedule-view .schedule-table th.name,
  #schedule-view .schedule-table td.name,
  .store-schedule-table th.name,
  .store-schedule-table td.name {
    min-width: 156px;
    max-width: 156px;
  }

  #schedule-view .schedule-table input,
  .store-schedule-table input {
    width: 38px;
    min-height: 34px;
    font-size: 15px;
  }

  .schedule-row-actions {
    min-width: 92px;
  }

  .schedule-row-actions button,
  .store-schedule-table .schedule-row-actions button {
    min-height: 34px;
    padding: 3px 6px;
  }

  .leave-row-badge {
    display: table;
    margin: 4px 0 0;
  }

  .store-shell {
    width: 100%;
    margin: 0;
    padding: 10px;
  }

  .store-card {
    border-radius: 8px;
  }

  .store-schedule-card {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .store-heading {
    padding: 14px;
  }

  .store-heading h1 {
    font-size: 26px;
  }

  .store-form,
  .store-actor-row,
  .store-schedule-tools {
    padding: 14px;
  }

  #toast {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .kpi-grid,
  .staff-summary,
  .leave-summary-cards {
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: flex-start;
  }

  .store-table-wrap {
    max-height: 300px;
  }
}
