:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --ink: #17211f;
  --muted: #64706d;
  --line: #dfe5df;
  --panel: #ffffff;
  --soft: #edf2ed;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --gold: #c9852d;
  --rose: #c2410c;
  --shadow: 0 12px 28px rgba(23, 33, 31, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.12), transparent 260px), var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.topbar,
.section-head,
.quick-actions,
.input-row,
.row-actions,
.payroll-top,
.staff-actions,
.calendar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar,
.section-head,
.payroll-top {
  justify-content: space-between;
}

.brand-block {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 12px;
}

.brand-block .server-status {
  grid-column: 1 / -1;
}

.app-logo {
  width: 82px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}

.eyebrow,
.status-label,
.helper-text,
.meta {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
}

.server-status {
  display: inline-block;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff4df;
  color: #8a5a16;
  font-size: 12px;
  font-weight: 800;
}

.server-status.online {
  background: #e7f4f2;
  color: var(--teal-dark);
}

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

h1 {
  font-size: 27px;
}

h2 {
  font-size: 18px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.role-switch,
.tabs {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.role-switch {
  grid-template-columns: repeat(2, 1fr);
}

.tabs {
  grid-template-columns: repeat(3, 1fr);
}

.role-button,
.tab {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.role-button.active,
.tab.active {
  background: var(--panel);
  color: var(--teal-dark);
  box-shadow: 0 2px 8px rgba(23, 33, 31, 0.08);
}

.status-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.status-band div {
  min-height: 76px;
  padding: 12px;
  background: var(--panel);
}

.status-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-band strong {
  font-size: 24px;
}

.role-view,
.view,
.hidden {
  display: none;
}

.role-view.active,
.view.active {
  display: block;
}

#managerView.locked .manager-private {
  display: none;
}

.employee-picker,
.contact-panel,
.manager-gate,
.staff-form,
.request-form,
.menu-form {
  display: grid;
  gap: 8px;
  margin: 14px 0 12px;
}

label,
.inline-input {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
}

.contact-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.contact-panel.needs-contact {
  border-color: var(--gold);
  background: #fffaf0;
}

.helper-text,
.meta {
  font-size: 13px;
}

.quick-actions {
  margin-bottom: 12px;
}

.primary-action,
.secondary-action {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  background: var(--teal);
  color: white;
}

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

.action-icon {
  margin-right: 8px;
  font-size: 12px;
}

.section-head {
  margin: 18px 0 10px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.insight-panel {
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.insight-panel strong {
  display: block;
  margin-bottom: 6px;
}

.staff-list,
.instruction-list,
.menu-list,
.payroll-list,
.session-list,
.request-list,
.store-settings-list,
.attendance-calendar {
  display: grid;
  gap: 10px;
}

.staff-card,
.instruction-card,
.menu-card,
.payroll-card,
.session-card,
.request-card,
.staff-edit-card,
.store-card,
.empty-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.staff-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.compact-head {
  margin-top: 12px;
}

.calendar-controls {
  gap: 6px;
  white-space: nowrap;
}

.calendar-controls .mini-button {
  min-width: 38px;
  min-height: 34px;
  font-size: 20px;
  line-height: 1;
}

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

.calendar-weekday {
  min-height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.calendar-day {
  min-width: 0;
  min-height: 72px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  display: grid;
  align-content: start;
  gap: 3px;
  text-align: left;
}

.calendar-day strong,
.calendar-day span,
.calendar-day small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day strong {
  font-size: 13px;
}

.calendar-day span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}

.calendar-day small {
  color: var(--muted);
  font-size: 10px;
}

.calendar-day.today {
  border-color: var(--teal);
}

.calendar-day.selected {
  background: #e7f4f2;
  box-shadow: inset 0 0 0 2px var(--teal);
}

.calendar-day.blank {
  background: transparent;
  border-color: transparent;
}

.calendar-record {
  border-left: 4px solid var(--teal);
}

.mini-button {
  min-width: 52px;
  min-height: 36px;
  border-radius: 7px;
  background: #e7f4f2;
  color: var(--teal-dark);
  font-weight: 900;
}

.mini-button.danger {
  background: #fff1ed;
  color: var(--rose);
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 900;
}

.text-button.danger {
  color: var(--rose);
}

.badge {
  display: inline-block;
  width: fit-content;
  margin: 4px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f4f2;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.muted-badge {
  background: var(--soft);
  color: var(--muted);
}

.toggle-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  width: fit-content;
  color: var(--ink);
}

.toggle-line input {
  width: 22px;
  min-height: 22px;
}

.input-row {
  align-items: stretch;
}

.input-row input {
  flex: 1;
}

form button {
  min-height: 46px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--teal);
  color: white;
  font-weight: 900;
}

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

.instruction-card,
.request-card.pending {
  border-left: 4px solid var(--gold);
}

.request-card.approved {
  border-left: 4px solid var(--teal);
}

.request-card.rejected {
  border-left: 4px solid var(--rose);
}

.instruction-card.done,
.menu-card.inactive,
.staff-edit-card.inactive {
  opacity: 0.55;
}

.menu-card {
  grid-template-columns: 74px 1fr;
  align-items: center;
}

.menu-thumb,
.menu-photo {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 8px;
}

.menu-thumb {
  background: #fff4df;
  color: var(--gold);
  font-weight: 900;
}

.menu-photo {
  object-fit: cover;
  background: var(--soft);
}

.photo-upload {
  margin-top: 8px;
}

.photo-upload input {
  margin-top: 6px;
  min-height: 42px;
  padding: 8px;
}

.payroll-card {
  gap: 12px;
}

.payroll-top > strong {
  color: var(--teal-dark);
  white-space: nowrap;
}

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

.payroll-grid span {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.compact {
  margin-top: -4px;
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .brand-block {
    grid-template-columns: 70px 1fr;
    gap: 10px;
  }

  .app-logo {
    width: 70px;
    height: 50px;
  }

  .status-band div {
    padding: 10px 8px;
  }

  .status-band strong {
    font-size: 20px;
  }

  .staff-card,
  .payroll-top {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
