:root {
  --ink: #111d2d;
  --navy: #102033;
  --navy-2: #182b43;
  --red: #c4202b;
  --red-dark: #941923;
  --paper: #f4f6f8;
  --card: #ffffff;
  --muted: #687386;
  --line: #dde2e9;
  --green: #11785f;
  --green-soft: #e8f5f1;
  --amber: #a86405;
  --amber-soft: #fff4dd;
  --red-soft: #fff0f1;
  --blue-soft: #eaf1f8;
  --shadow: 0 20px 55px rgba(16, 32, 51, 0.09);
  --shadow-sm: 0 8px 24px rgba(16, 32, 51, 0.08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 0 0, rgba(196, 32, 43, 0.06), transparent 28rem),
    var(--paper);
}

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

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup img {
  width: 142px;
  height: 36px;
  object-fit: contain;
  object-position: left center;
}

.demo-pill,
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.demo-pill {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.good,
.tag.good {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.warning,
.tag.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.danger,
.tag.danger {
  color: var(--red);
  background: var(--red-soft);
}

.tag.neutral {
  color: #526174;
  background: #edf0f4;
}

.card {
  background: var(--card);
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-heading {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  margin: 0 0 13px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.section-heading h2 { font-size: 1.25rem; }
.section-heading h3 { font-size: 1rem; }

.text-button {
  padding: 5px;
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 45px;
  padding: 11px 16px;
  border-radius: 13px;
  border: 0;
  font-weight: 850;
}

.primary-button {
  color: #fff;
  background: var(--red);
  box-shadow: 0 10px 22px rgba(196, 32, 43, 0.22);
}

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

.secondary-button {
  color: var(--navy);
  background: #edf1f5;
}

.danger-button {
  color: var(--red);
  background: var(--red-soft);
}

.field {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 0.83rem;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 500;
  line-height: 1.45;
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8b94a3;
  font-weight: 450;
  opacity: 1;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(196, 32, 43, 0.55);
  box-shadow: 0 0 0 4px rgba(196, 32, 43, 0.08);
}

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

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 92px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 13px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-weight: 750;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

dialog {
  width: min(480px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(16, 32, 51, 0.28);
}

dialog::backdrop {
  background: rgba(8, 18, 30, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-body { padding: 24px; }

.dialog-body h2 {
  margin: 0 0 8px;
  color: var(--navy);
  letter-spacing: -0.04em;
}

.dialog-body > p {
  margin: 0 0 19px;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.data-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.compact-button {
  min-height: 38px;
  padding: 8px 12px;
}

/* Worker PWA */

.worker-shell {
  width: min(540px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 92px;
  background: #f8f9fb;
  box-shadow: 0 0 80px rgba(16, 32, 51, 0.08);
}

.worker-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(15px, env(safe-area-inset-top)) 18px 13px;
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(18px);
}

.worker-header .brand-lockup img {
  width: 156px;
  height: auto;
}

.worker-account-actions {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.worker-account-actions .environment-badge {
  display: block;
  min-width: 0;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-language-control {
  display: block;
  min-width: 0;
}

.language-select {
  max-width: 112px;
  height: 35px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 750;
}

.worker-main { padding: 22px 16px; }

.worker-view[hidden] { display: none; }

.worker-greeting {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.worker-greeting h1 {
  margin: 0;
  color: var(--navy);
  font-size: 1.7rem;
  letter-spacing: -0.045em;
}

.worker-greeting p {
  margin: 4px 0 0;
  color: var(--muted);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--navy);
  font-weight: 900;
}

.assignment-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 105% -5%, rgba(255, 255, 255, 0.16), transparent 12rem),
    linear-gradient(135deg, var(--navy), #1d3858);
}

.assignment-card .eyebrow { color: #ff98a1; }

.assignment-card h2 {
  margin: 5px 0 5px;
  font-size: 1.42rem;
  letter-spacing: -0.04em;
}

.site-detail {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.shift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 18px 0;
}

.shift-detail {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
}

.shift-detail span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shift-detail strong {
  display: block;
  margin-top: 3px;
  font-size: 0.91rem;
}

.clock-button {
  display: grid;
  width: 100%;
  min-height: 62px;
  place-items: center;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 14px 30px rgba(196, 32, 43, 0.28);
  font-size: 1.04rem;
  font-weight: 900;
}

.clock-button.is-clocked-in {
  color: var(--red);
  background: #fff;
}

.clock-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.location-line,
.sync-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
  font-weight: 700;
}

.location-dot,
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #57d2ab;
}

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

.sync-dot { background: var(--green); }

.worker-section { margin-top: 22px; }

.money-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.money-card {
  min-width: 0;
  padding: 14px 12px;
}

.money-card span {
  display: block;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 750;
}

.money-card strong {
  display: block;
  color: var(--navy);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.description-card { padding: 17px; }

.description-card textarea { min-height: 80px; }

.description-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

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

.quick-action {
  min-height: 92px;
  padding: 15px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 17px;
  color: var(--navy);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
  font-weight: 850;
}

.quick-action span {
  display: grid;
  width: 31px;
  height: 31px;
  margin-bottom: 9px;
  place-items: center;
  border-radius: 10px;
  color: var(--red);
  background: var(--red-soft);
}

.worker-bottom-nav {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  display: grid;
  width: min(540px, 100%);
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 7px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(16, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.worker-nav-button {
  display: grid;
  gap: 4px;
  min-height: 53px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: #7a8494;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
}

.worker-nav-button .nav-icon { font-size: 1rem; }

.worker-nav-button.active {
  color: var(--red);
  background: var(--red-soft);
}

.page-title {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1.65rem;
  letter-spacing: -0.045em;
}

.page-subtitle {
  margin: 0 0 19px;
  color: var(--muted);
}

.summary-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 15px;
  background: var(--line);
}

.summary-stat {
  padding: 17px;
  background: #fff;
}

.summary-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.summary-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 1.25rem;
}

.list-card { overflow: hidden; }

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

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

.list-row h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 0.93rem;
}

.list-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.list-row .amount {
  color: var(--navy);
  font-weight: 900;
  text-align: right;
}

.request-stack {
  display: grid;
  gap: 10px;
}

.request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.request-row strong {
  display: block;
  color: var(--navy);
}

.request-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.request-row > span {
  color: var(--red);
  font-size: 1.2rem;
  font-weight: 900;
}

.profile-card {
  padding: 18px;
  margin-bottom: 13px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 13px;
}

.profile-identity .avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
}

.profile-identity h2 {
  margin: 0;
  color: var(--navy);
}

.profile-identity p {
  margin: 4px 0 0;
  color: var(--muted);
}

.progress {
  height: 8px;
  overflow: hidden;
  margin-top: 15px;
  border-radius: 999px;
  background: #e9edf2;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

/* Admin portal */

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 17px;
  color: #fff;
  background: var(--navy);
}

.admin-sidebar .brand-lockup {
  width: 100%;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.admin-sidebar .brand-lockup img {
  width: 190px;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
}

.admin-nav {
  display: grid;
  gap: 4px;
  margin-top: 20px;
}

.admin-nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
}

.admin-nav-button:hover,
.admin-nav-button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-nav-button.active { box-shadow: inset 3px 0 0 var(--red); }

.admin-sidebar-footer {
  position: absolute;
  right: 17px;
  bottom: 20px;
  left: 17px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-sidebar-footer strong,
.admin-sidebar-footer span {
  display: block;
}

.admin-sidebar-footer span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.75rem;
}

.admin-main { min-width: 0; }

.admin-topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.91);
  backdrop-filter: blur(18px);
}

.admin-topbar-title strong {
  display: block;
  color: var(--navy);
  font-size: 0.93rem;
}

.admin-topbar-title span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
  background: #fff;
}

.admin-content {
  width: min(1480px, 100%);
  padding: 28px;
}

.admin-view[hidden] { display: none; }

.admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-heading h1 {
  margin: 0;
  color: var(--navy);
  font-size: 1.8rem;
  letter-spacing: -0.045em;
}

.admin-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: var(--navy);
}

.metric-card.red::after { background: var(--red); }
.metric-card.amber::after { background: #df951c; }
.metric-card.green::after { background: var(--green); }

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin: 7px 0 5px;
  color: var(--navy);
  font-size: 1.75rem;
  letter-spacing: -0.05em;
}

.metric-card small {
  color: var(--muted);
  font-weight: 700;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.8fr);
  gap: 18px;
}

.panel { overflow: hidden; }

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

.panel-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
}

.data-table th {
  padding: 11px 15px;
  color: #748094;
  background: #f8f9fb;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 15px;
  border-top: 1px solid var(--line);
  color: #334155;
  white-space: nowrap;
}

.data-table tr:hover td { background: #fbfcfd; }

.data-table strong { color: var(--navy); }

.number-cell {
  font-variant-numeric: tabular-nums;
  text-align: right !important;
}

.activity-list { padding: 4px 18px 12px; }

.activity-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.activity-time {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
}

.activity-item strong {
  display: block;
  color: var(--navy);
  font-size: 0.82rem;
}

.activity-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.search-input {
  width: min(340px, 100%);
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.approval-list {
  display: grid;
  gap: 11px;
}

.approval-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, auto);
  gap: 17px;
  align-items: center;
  padding: 16px 17px;
}

.approval-card h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 0.94rem;
}

.approval-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.approval-amount {
  min-width: 82px;
  color: var(--navy);
  font-weight: 900;
  text-align: right;
}

.approval-actions {
  display: flex;
  gap: 7px;
}

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

.profit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.profit-card { padding: 20px; }

.profit-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.profit-card strong {
  display: block;
  margin-top: 7px;
  color: var(--navy);
  font-size: 1.55rem;
}

.mobile-menu-button { display: none; }

.environment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.environment-badge.demo {
  color: #6f4909;
  background: #fff0cf;
}

.environment-badge.live {
  color: #0e654f;
  background: #dff6ee;
}

.auth-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 27, 45, 0.84);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.auth-card {
  width: min(430px, 100%);
  padding: 30px;
}

.auth-logo {
  width: 230px;
  max-width: 100%;
  height: auto;
  margin-bottom: 24px;
}

.auth-card h1 { margin: 5px 0 8px; color: var(--navy); }
.auth-card > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); }
.auth-form { display: grid; gap: 14px; }

.auth-error {
  padding: 10px 12px;
  border-radius: 10px;
  color: #8f241f;
  background: #fee9e7;
  font-size: 0.8rem;
  font-weight: 700;
}

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

.fatal-card {
  max-width: 620px;
  margin: 40px auto;
  padding: 28px;
}

.fatal-card h1 { margin: 0 0 8px; color: var(--navy); }
.fatal-card p { margin: 0; color: var(--muted); }
.fatal-card .eyebrow { margin-bottom: 10px; color: var(--red); }
.fatal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.fatal-actions .primary-button,
.fatal-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@media (max-width: 1060px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .approval-card { grid-template-columns: minmax(180px, 1fr) auto auto; }
  .approval-card .tag { display: none; }
}

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

  .admin-sidebar {
    position: fixed;
    z-index: 60;
    width: 246px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .admin-sidebar.open { transform: translateX(0); }
  .mobile-menu-button { display: grid; }
  .admin-topbar { padding: 12px 16px; }
  .admin-content { padding: 20px 14px; }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .profit-grid { grid-template-columns: 1fr; }
  .approval-card { grid-template-columns: 1fr auto; }
  .approval-card .approval-amount { display: none; }
}

@media (max-width: 430px) {
  /* Prevent automatic focus zoom in iOS Safari. */
  input,
  textarea,
  select,
  .field input,
  .field textarea,
  .field select,
  .language-select {
    font-size: 16px;
  }

  .worker-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  }

  .worker-header .brand-lockup {
    grid-column: 1 / -1;
  }

  .worker-header .brand-lockup img {
    width: 178px;
  }

  .worker-account-actions {
    grid-column: 1;
    min-width: 0;
  }

  .worker-account-actions .environment-badge {
    max-width: calc(100vw - 180px);
  }

  .worker-language-control {
    grid-column: 2;
  }

  .language-select {
    width: 112px;
    max-width: 112px;
    height: 44px;
  }

  .auth-overlay {
    align-items: start;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 20px;
  }

  .auth-logo {
    width: 190px;
    margin-bottom: 14px;
  }

  .auth-card > p:not(.eyebrow) {
    margin-bottom: 16px;
  }

  .auth-form {
    gap: 12px;
  }

  .money-grid { grid-template-columns: 1fr 1fr; }
  .money-card:first-child { grid-column: 1 / -1; }
  .metric-grid { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
