:root {
  /* Allegiance Bay Care brand (from official logo) */
  --brand-purple: #8b3db8;
  --brand-blue: #2eb6e8;
  --teal: #2eb6e8;
  --teal-dark: #6e2f9a;
  --teal-soft: #eef6fc;
  --ink: #1c1a28;
  --muted: #5f6173;
  --line: #d9dceb;
  --bg: #f5f6fb;
  --white: #ffffff;
  --danger: #c0392b;
  --ok: #1f8a4c;
  --warn: #c47f17;
  --shadow: 0 8px 24px rgba(60, 30, 90, 0.08);
  --radius: 14px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.btn-secondary {
  background: #fff;
  color: var(--brand-purple, #6b2d96);
  border: 1px solid rgba(107, 45, 150, .35);
  box-shadow: none;
}
.btn-secondary:hover {
  background: #f7eefb;
  color: var(--brand-purple, #6b2d96);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border: 0; border-radius: 9px; padding: .48rem .9rem; font-weight: 700;
  cursor: pointer; text-decoration: none; font-size: .875rem;
  letter-spacing: .01em; min-height: 2.3rem; line-height: 1.15;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal-dark); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9b2c20; color: #fff; }
.btn-ghost.btn-danger-ghost {
  color: var(--danger);
  border-color: #f0c9c4;
  background: #fff8f7;
}
.btn-ghost.btn-danger-ghost:hover {
  background: #fdecea;
  color: var(--danger);
}
.btn-ghost.btn-warn-ghost {
  color: #8a5a12;
  border-color: #f0d9a8;
  background: #fffdf8;
}
.btn-ghost.btn-warn-ghost:hover {
  background: #fff6e8;
  color: #8a5a12;
}
.btn-block { width: 100%; }
.btn-lg { padding: .7rem 1.15rem; font-size: .95rem; letter-spacing: .02em; min-height: 2.75rem; }
input.is-readonly,
.is-readonly {
  background: #f5f6fb;
  color: var(--muted);
  border: 1px solid var(--line);
  pointer-events: none;
}

.flash {
  padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1rem;
  background: var(--teal-soft); color: var(--teal-dark); border: 1px solid #c5e8e8;
}
.flash-error { background: #fdecea; color: var(--danger); border-color: #f5c6c2; }
.flash-success { background: #e7f7ee; color: var(--ok); border-color: #b7e4c7; }

.form-grid {
  display: grid;
  gap: .85rem 1rem;
  grid-template-columns: 1fr;
  align-items: start;
}
.form-grid > input[type="hidden"] {
  display: none;
}
.form-grid > .form-span-2,
.form-grid > .form-span-full,
.form-grid > .btn,
.form-grid > button {
  grid-column: 1 / -1;
}
.form-grid.one { grid-template-columns: 1fr !important; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .form-grid:not(.two):not(.one) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid:not(.two):not(.one) > .form-span-2 {
    grid-column: 1 / -1;
  }
}
@media (min-width: 980px) {
  .form-grid:not(.two):not(.one) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .form-grid:not(.two):not(.one) > .form-span-2 {
    grid-column: span 2;
  }
}
@media (max-width: 720px) {
  .form-grid.two,
  .form-grid.three { grid-template-columns: 1fr; }
}
label { display: block; font-size: .85rem; font-weight: 650; margin-bottom: .35rem; color: var(--muted); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .8rem; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: .85rem; }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem;
}
.card + .card { margin-top: 1rem; }
.card h2, .card h3 { margin: 0 0 .75rem; font-family: var(--display); font-weight: 650; }

.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: middle; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.15;
  vertical-align: middle;
  background: var(--teal-soft);
  color: var(--teal-dark);
  box-sizing: border-box;
}
.badge-open { background: #fff4d6; color: var(--warn); }
.badge-missed { background: #fdecea; color: var(--danger); }
.badge-ok { background: #e7f7ee; color: var(--ok); }

/* Auth / Login */
.auth-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  background:
    radial-gradient(900px 480px at 10% -10%, #ffffffaa, transparent 55%),
    radial-gradient(700px 420px at 95% 110%, #cfefff88, transparent 50%),
    linear-gradient(155deg, #f3e9fb, #dff4fb 45%, #f7f8fc);
  overflow: hidden;
}
.auth-atmosphere {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(139, 61, 184, .12), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(46, 182, 232, .14), transparent 32%);
}
.auth-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  color: #fff;
  background:
    linear-gradient(145deg, rgba(107, 45, 150, .94), rgba(31, 143, 191, .9)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-panel-inner { width: min(440px, 100%); }
.auth-panel-logo {
  display: block;
  width: min(150px, 42%);
  height: auto;
  margin-bottom: 1.35rem;
  background: rgba(255,255,255,.96);
  border-radius: 14px;
  padding: .55rem .7rem;
  box-shadow: 0 12px 28px rgba(20, 30, 60, .18);
}
.auth-panel-kicker {
  margin: 0 0 .55rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .88;
}
.auth-panel-title {
  margin: 0 0 .85rem;
  font-family: var(--display);
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
}
.auth-panel-copy {
  margin: 0 0 1.35rem;
  font-size: 1.02rem;
  line-height: 1.55;
  opacity: .92;
  max-width: 36ch;
}
.auth-panel-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .55rem;
}
.auth-panel-points li {
  position: relative;
  padding-left: 1.35rem;
  font-size: .94rem;
  line-height: 1.4;
  opacity: .95;
}
.auth-panel-points li::before {
  content: "";
  position: absolute;
  left: 0; top: .45rem;
  width: .55rem; height: .55rem;
  border-radius: 50%;
  background: #9fe3f8;
  box-shadow: 0 0 0 3px rgba(159, 227, 248, .25);
}
.auth-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  gap: 1rem;
}
.auth-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 1.75rem 1.55rem 1.5rem;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 18px 48px rgba(60, 30, 90, 0.12);
  backdrop-filter: blur(8px);
}
/* Apply / solo auth — no left marketing column, centered responsive card */
.auth-shell--centered {
  grid-template-columns: 1fr;
  align-items: stretch;
  justify-items: center;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(46, 182, 232, .12), transparent 55%),
    radial-gradient(720px 380px at 100% 0%, rgba(110, 47, 154, .08), transparent 50%),
    linear-gradient(180deg, #eef2f7 0%, #f5f6fb 55%, #eef1f6 100%);
}
.auth-shell--centered .auth-atmosphere {
  background:
    radial-gradient(circle at 18% 12%, rgba(46, 182, 232, .1), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(110, 47, 154, .08), transparent 32%);
  opacity: .85;
}
.auth-shell--centered .auth-orb { opacity: .35; }
.auth-shell--centered .auth-main {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(1rem, 2.8vw, 2rem) clamp(.85rem, 2.5vw, 1.25rem) 1.5rem;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
}
.auth-shell--centered .auth-card--wide {
  width: min(900px, 100%);
  text-align: left;
  padding: clamp(1.15rem, 2.4vw, 1.65rem) clamp(1rem, 2.4vw, 1.65rem) 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(28, 32, 48, .08);
}
.auth-shell--centered .auth-card-brand {
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "logo title"
    "logo sub";
  column-gap: .85rem;
  align-items: center;
  margin-bottom: .95rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.auth-shell--centered .auth-card .brand-logo {
  grid-area: logo;
  margin: 0;
  width: 64px;
}
.auth-shell--centered .auth-card .brand-mark {
  grid-area: title;
  font-family: var(--font);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--ink);
}
.auth-shell--centered .auth-card .brand-sub {
  grid-area: sub;
  margin: .2rem 0 0;
  font-size: .86rem;
  color: var(--muted);
}
.auth-shell--centered .auth-form-stage {
  text-align: left;
}
.auth-shell--centered .auth-footnote {
  width: 100%;
  max-width: 900px;
}
.auth-shell--centered .apply-form label,
.auth-shell--centered .apply-form .help {
  text-align: left;
}
.auth-shell--centered .apply-form input,
.auth-shell--centered .apply-form select,
.auth-shell--centered .apply-form textarea {
  width: 100%;
}

/* Apply wizard */
.apply-chrome {
  margin: 0 0 1rem;
  display: grid;
  gap: .65rem;
}
.apply-progress-meta {
  display: grid;
  gap: .4rem;
}
.apply-progress-meta-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
}
.apply-progress-meta-text strong {
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink);
}
.apply-progress-meta-text span {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.apply-progress-track {
  height: .42rem;
  border-radius: 999px;
  background: #e7ebf2;
  overflow: hidden;
}
.apply-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d8a8a, #2eb6e8);
  transition: width .25s ease;
}
.apply-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .15rem;
  margin: 0;
  padding: .55rem .55rem;
  border-radius: 12px;
  background: #f6f8fb;
  border: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.apply-progress-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .22rem;
  min-width: 3.1rem;
  flex: 0 0 auto;
}
.apply-progress-dot {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  background: #fff;
  color: var(--muted);
  border: 1.5px solid #d5d8e6;
}
.apply-progress-item.is-current .apply-progress-dot {
  background: #0d8a8a;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(13, 138, 138, .28);
}
.apply-progress-item.is-done .apply-progress-dot {
  background: #1f8a4c;
  color: #fff;
  border-color: transparent;
}
.apply-progress-label {
  font-size: .64rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .01em;
  white-space: nowrap;
}
.apply-progress-item.is-current .apply-progress-label {
  color: #0a6b6b;
}
.apply-progress-rail {
  flex: 1 1 10px;
  height: 2px;
  min-width: 8px;
  margin: 0 .05rem .85rem;
  background: #d9dceb;
  border-radius: 99px;
}
.apply-progress-rail.is-done {
  background: #1f8a4c;
}
.apply-form {
  display: grid;
  gap: .85rem;
}
.apply-section {
  display: grid;
  gap: .7rem;
  padding: .9rem .95rem;
  border-radius: 12px;
  background: #fafbfd;
  border: 1px solid var(--line);
}
.apply-section-head h3 {
  margin: 0;
  font-family: var(--font);
  font-size: .98rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
}
.apply-section-head p {
  margin: .15rem 0 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}
.apply-optional {
  font-weight: 650;
  color: var(--muted);
  font-size: .78rem;
  text-transform: none;
  letter-spacing: 0;
}
.apply-grid {
  display: grid;
  gap: .65rem;
}
.apply-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.apply-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.apply-grid-name {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.apply-grid-city {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .55fr) minmax(0, .7fr);
}
.apply-grid-edu {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, .55fr);
}
.apply-field {
  display: grid;
  gap: .28rem;
  min-width: 0;
}
.apply-field--full {
  grid-column: 1 / -1;
}
.apply-field label {
  font-size: .78rem;
  font-weight: 750;
  color: #3d4154;
}
.apply-field input,
.apply-field select,
.apply-field textarea {
  width: 100%;
  border: 1.5px solid #d5d8e6;
  border-radius: 10px;
  background: #fff;
  padding: .62rem .75rem;
  font: inherit;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.apply-field input:focus,
.apply-field select:focus,
.apply-field textarea:focus {
  outline: none;
  border-color: #2eb6e8;
  box-shadow: 0 0 0 3px rgba(46, 182, 232, .16);
}
.apply-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .4rem;
}
.apply-day-chip {
  position: relative;
  display: block;
  cursor: pointer;
}
.apply-day-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.apply-day-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  border-radius: 9px;
  border: 1.5px solid #d5d8e6;
  background: #fff;
  font-size: .84rem;
  font-weight: 750;
  color: #4b4f63;
}
.apply-day-chip input:checked + span {
  border-color: transparent;
  color: #fff;
  background: #0d8a8a;
  box-shadow: 0 4px 12px rgba(13, 138, 138, .22);
}
.apply-block {
  display: grid;
  gap: .5rem;
  padding-top: .5rem;
  border-top: 1px dashed #d9dceb;
}
.apply-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.apply-block-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #0a6b6b;
}
.apply-actions {
  display: flex;
  gap: .55rem;
  justify-content: space-between;
  align-items: center;
  margin-top: .25rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.apply-actions .btn {
  min-width: 7.5rem;
}
.apply-continue {
  min-width: 9.5rem;
  box-shadow: 0 8px 18px rgba(13, 138, 138, .18);
}
.apply-sig {
  width: 100%;
  height: 150px;
  border: 1.5px dashed #9ec9d8;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f7fcfc);
  touch-action: none;
  display: block;
}
.apply-agree {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  font-size: .88rem;
  font-weight: 550;
  line-height: 1.45;
  color: #3d4154;
  padding: .7rem .8rem;
  border-radius: 10px;
  background: #eef8fd;
  border: 1px solid #c5e4f0;
}
.apply-agree input {
  width: auto !important;
  margin-top: .2rem;
  flex-shrink: 0;
}
.apply-review {
  border-radius: 12px;
  padding: .9rem 1rem;
  background: #f6f8fb;
  border: 1px solid var(--line);
}
.apply-review-name {
  font-family: var(--font);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: .65rem;
}
.apply-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem .85rem;
}
.apply-review-grid span {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.apply-review-grid strong {
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
}
.apply-phone-row .phone-field {
  min-width: 0;
}
.apply-addr-picker {
  margin: 0;
}
.auth-shell--centered .apply-addr-picker {
  background: #fafbfd;
}
.auth-shell--centered .apply-addr-picker--compact {
  padding: .9rem .95rem;
  border-radius: 12px;
}
.auth-shell--centered .apply-addr-picker--compact .addr-picker-head h3 {
  font-size: .98rem;
  font-family: var(--font);
  font-weight: 800;
}
.auth-shell--centered .apply-addr-picker--compact .addr-fields {
  margin-top: .35rem;
}
.apply-thanks {
  display: grid;
  gap: .75rem;
}
.apply-thanks-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f7ef;
  color: #1f8a4c;
  font-weight: 800;
  font-size: 1.1rem;
  border: 1px solid #b7e0c8;
}
.apply-thanks-lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 650;
}
.apply-thanks-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  display: grid;
  gap: .25rem;
}
.apply-thanks-actions {
  border-top: 0;
  padding-top: .25rem;
  justify-content: flex-start;
}
@media (max-width: 720px) {
  .apply-grid-name {
    grid-template-columns: 1fr 1fr;
  }
  .apply-grid-name .apply-field:first-child {
    grid-column: 1 / -1;
  }
  .auth-shell--centered .auth-card-brand {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "title"
      "sub";
    text-align: center;
    justify-items: center;
  }
  .auth-shell--centered .auth-card .brand-logo {
    width: min(88px, 36%);
  }
}
@media (max-width: 560px) {
  .apply-phone-row,
  .apply-grid-name {
    grid-template-columns: 1fr;
  }
  .apply-grid-name .apply-field:first-child {
    grid-column: auto;
  }
}
.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;
}
@media (max-width: 760px) {
  .apply-grid-3,
  .apply-grid-edu {
    grid-template-columns: 1fr 1fr;
  }
  .apply-grid-edu .apply-field:last-child,
  .apply-grid-3 .apply-field:last-child {
    grid-column: 1 / -1;
  }
  .apply-day-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .apply-progress-label {
    display: none;
  }
  .apply-progress-rail {
    margin-bottom: 0;
  }
}
@media (max-width: 560px) {
  .auth-shell--centered .auth-main {
    padding: .85rem .65rem 1.25rem;
    justify-content: flex-start;
  }
  .auth-shell--centered .auth-card--wide {
    width: 100%;
    padding: 1rem .85rem 1rem;
    border-radius: 14px;
  }
  .apply-grid-2,
  .apply-grid-3,
  .apply-grid-city,
  .apply-grid-edu,
  .apply-review-grid {
    grid-template-columns: 1fr;
  }
  .apply-grid-edu .apply-field:last-child,
  .apply-grid-3 .apply-field:last-child {
    grid-column: auto;
  }
  .apply-day-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .apply-section {
    padding: .8rem .75rem;
  }
  .apply-actions .btn {
    flex: 1 1 auto;
  }
}
.auth-card-brand { margin-bottom: .15rem; }
.auth-card .brand-logo {
  display: block; margin: 0 auto .55rem; width: min(132px, 44%); height: auto;
}
.auth-card .brand-mark {
  font-family: var(--display); font-size: clamp(1.3rem, 3.2vw, 1.55rem);
  margin: 0 0 .25rem; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card .brand-sub {
  margin: 0 0 1.25rem; color: var(--muted); font-size: .92rem;
}
.auth-form,
.login-form { text-align: left; }
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  padding: .78rem .9rem;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 2.85rem !important;
}
.password-toggle {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--teal-dark);
  background: var(--teal-soft);
  outline: none;
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.login-remember {
  display: flex !important;
  gap: .5rem;
  align-items: center;
  font-weight: 500 !important;
  color: var(--ink) !important;
  margin: 0;
}
.login-remember input {
  width: auto !important;
  margin: 0;
}
.auth-link {
  font-size: .9rem;
  font-weight: 650;
  color: var(--teal-dark);
  white-space: nowrap;
}
.auth-link:hover { text-decoration: underline; }
.auth-alt {
  margin: 1rem 0 0;
  text-align: center;
  font-size: .92rem;
}
.auth-apply-cta {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.45;
}
.auth-apply-cta .auth-link {
  display: inline;
  white-space: normal;
}
.auth-footnote {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}
.auth-form .btn-lg,
.login-form .btn-lg {
  margin-top: .15rem;
  border-radius: 12px;
  background: linear-gradient(100deg, var(--brand-purple), #4a8fd4 55%, var(--brand-blue));
  border: 0;
  box-shadow: 0 10px 22px rgba(74, 100, 180, .22);
}
.auth-form .btn-lg:hover,
.login-form .btn-lg:hover {
  filter: brightness(1.04);
  background: linear-gradient(100deg, var(--brand-purple), #4a8fd4 55%, var(--brand-blue));
}

/* Auth motion — presence without noise */
.auth-atmosphere {
  overflow: hidden;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.auth-orb--a {
  width: 42vmin;
  height: 42vmin;
  left: -8%;
  top: 12%;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 68%);
}
.auth-orb--b {
  width: 34vmin;
  height: 34vmin;
  right: -6%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(159,227,248,.35), transparent 70%);
}
.auth-orb--c {
  width: 22vmin;
  height: 22vmin;
  left: 38%;
  top: 58%;
  background: radial-gradient(circle, rgba(196,150,230,.28), transparent 72%);
}
.auth-shell--motion.is-ready .auth-orb {
  opacity: 1;
  animation: authOrbDrift 14s ease-in-out infinite;
}
.auth-shell--motion.is-ready .auth-orb--b { animation-duration: 18s; animation-direction: reverse; }
.auth-shell--motion.is-ready .auth-orb--c { animation-duration: 11s; animation-delay: -3s; }

.auth-rise {
  opacity: 0;
  transform: translateY(14px);
}
.auth-shell--motion.is-ready .auth-rise {
  animation: authRise .7s cubic-bezier(.22,1,.36,1) forwards;
  animation-delay: var(--auth-delay, 0s);
}

.auth-card--enter {
  opacity: 0;
  transform: translateY(22px) scale(.985);
}
.auth-shell--motion.is-ready .auth-card--enter {
  animation: authCardIn .75s cubic-bezier(.22,1,.36,1) .18s forwards;
}

.auth-panel {
  overflow: hidden;
}
.auth-panel::after {
  content: "";
  position: absolute;
  inset: -20% -30%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.12) 50%, transparent 65%);
  transform: translateX(-40%);
  opacity: 0;
  pointer-events: none;
}
.auth-shell--motion.is-ready .auth-panel::after {
  animation: authSheen 4.8s ease-in-out 1.1s infinite;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.auth-form input:focus,
.login-form input:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(46, 182, 232, .18), 0 8px 18px rgba(60, 30, 90, .06);
}

.auth-form .btn-lg,
.login-form .btn-lg {
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.auth-form .btn-lg::after,
.login-form .btn-lg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 48%, transparent 66%);
  transform: translateX(-120%);
  pointer-events: none;
}
.auth-form .btn-lg:hover,
.login-form .btn-lg:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(74, 100, 180, .28);
}
.auth-form .btn-lg:hover::after,
.login-form .btn-lg:hover::after {
  animation: authBtnSheen .85s ease;
}
.auth-form .btn-lg:active,
.login-form .btn-lg:active {
  transform: translateY(1px) scale(.99);
}

.auth-link {
  transition: color .18s ease, letter-spacing .18s ease;
}
.auth-link:hover {
  letter-spacing: .01em;
}

.auth-panel-logo {
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.auth-shell--motion.is-ready .auth-panel-logo:hover {
  transform: translateY(-2px) scale(1.02);
}

@keyframes authRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(22px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes authOrbDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4%, -5%, 0) scale(1.08); }
}
@keyframes authSheen {
  0%, 70%, 100% { opacity: 0; transform: translateX(-45%); }
  20% { opacity: .55; }
  45% { opacity: 0; transform: translateX(35%); }
}
@keyframes authBtnSheen {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell--motion .auth-rise,
  .auth-shell--motion .auth-card--enter,
  .auth-shell--motion .auth-orb,
  .auth-shell--motion .auth-panel::after,
  .auth-form .btn-lg::after,
  .login-form .btn-lg::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .auth-form input:focus,
  .login-form input:focus,
  .auth-form .btn-lg:hover,
  .login-form .btn-lg:hover {
    transform: none;
  }
}

/* Legacy standalone login canvas — DO NOT apply to mirror guest chrome.
   body.page.login-page hosts header/nav/footer + form; grid+overflow:hidden made the page look dead. */
body.page.login-page {
  display: block;
  position: static;
  min-height: 0;
  place-items: unset;
  overflow: visible;
  padding: 0;
  background: transparent;
}
/* Keep old fullscreen look only for a true standalone shell (unused now). */
body.login-page:not(.page) {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 480px at 10% -10%, #ffffffaa, transparent 55%),
    radial-gradient(700px 420px at 95% 110%, #cfefff88, transparent 50%),
    linear-gradient(155deg, #f3e9fb, #dff4fb 45%, #f7f8fc);
  padding: 1.5rem;
  overflow: hidden;
}
.login-atmosphere {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(139, 61, 184, .12), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(46, 182, 232, .14), transparent 32%);
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  text-align: center;
  padding: 1.75rem 1.6rem 1.55rem;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 18px 48px rgba(60, 30, 90, 0.12);
  backdrop-filter: blur(6px);
}
.login-card form,
.login-form { text-align: left; }
.login-brand { margin-bottom: .35rem; }
.login-card .brand-logo {
  display: block; margin: 0 auto .55rem; width: min(148px, 48%); height: auto;
}
.login-card .brand-mark {
  font-family: var(--display); font-size: clamp(1.35rem, 3.5vw, 1.65rem);
  margin: 0 0 .2rem; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card .brand-sub {
  margin: 0 0 1.35rem; color: var(--muted); font-size: .92rem;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .auth-panel {
    padding: 1.35rem 1.25rem 1.15rem;
    min-height: auto;
  }
  .auth-panel-inner { width: 100%; }
  .auth-panel-logo {
    width: min(112px, 36%);
    margin-bottom: .85rem;
  }
  .auth-panel-title {
    font-size: clamp(1.45rem, 6vw, 1.85rem);
    margin-bottom: .45rem;
  }
  .auth-panel-copy {
    margin-bottom: .75rem;
    font-size: .95rem;
    max-width: none;
  }
  .auth-panel-points { display: none; }
  .auth-main {
    padding: 1.15rem 1rem 1.5rem;
    justify-content: flex-start;
  }
  .auth-card {
    padding: 1.4rem 1.15rem 1.25rem;
  }
}
@media (max-width: 420px) {
  .auth-row { flex-direction: column; align-items: flex-start; }
}
.brand-logo {
  display: block; margin: 0 auto .65rem; width: min(160px, 52%); height: auto;
}
.brand-mark {
  font-family: var(--display); font-size: 1.55rem; margin: 0 0 .25rem;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { margin: 0 0 1.25rem; color: var(--muted); }
.brand-lockup {
  display: flex; align-items: center; gap: .75rem;
}
.brand-lockup img { width: 64px; height: auto; flex-shrink: 0; }
.brand-lockup .name {
  font-family: var(--display); font-size: 1.05rem; line-height: 1.2; font-weight: 700;
  background: linear-gradient(90deg, #d8b4f8, #9fe3f8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-lockup.light .name {
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dashboard-hero { display: none; }

/* Apply lean page (header-only chrome) */

/* Apply lean page (header-only chrome) */
.auth-shell--apply {
  min-height: 0;
  display: block;
  background: transparent;
  overflow: visible;
  grid-template-columns: none;
}
.auth-shell--apply .auth-main,
.auth-shell--apply.auth-shell--centered .auth-main {
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}
.auth-card--apply,
.auth-shell--apply .auth-card--wide {
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: left;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line, #e4e7ef);
  box-shadow: 0 8px 28px rgba(28, 32, 48, .06);
}
.apply-page-head {
  margin: 0 0 .85rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line, #e4e7ef);
}
.apply-page-title {
  margin: 0;
  font-family: var(--font, "Source Sans 3", sans-serif);
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink, #1c2030);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}
.apply-page-sub {
  margin: .25rem 0 0;
  font-size: .88rem;
  color: var(--muted, #667085);
}
.apply-chrome--slim {
  margin: 0 0 1rem;
}
.apply-chrome--slim .apply-progress-meta {
  margin-bottom: .35rem;
}

@media (max-width: 700px) {
  .auth-card--apply,
  .auth-shell--apply .auth-card--wide {
    padding: .9rem .8rem 1rem;
    border-radius: 12px;
  }
  .apply-page-head {
    margin-bottom: .7rem;
    padding-bottom: .6rem;
  }
  .auth-shell--apply .apply-grid-2,
  .auth-shell--apply .apply-grid-3 {
    grid-template-columns: 1fr !important;
  }
  .auth-shell--apply .apply-actions {
    flex-direction: column;
  }
  .auth-shell--apply .apply-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 420px) {
  .apply-page-title { font-size: 1.12rem; }
  .apply-page-sub { font-size: .82rem; }
}

/* Mirror guest: login + apply inside public site chrome */
.auth-shell--mirror {
  min-height: 0;
  display: block;
  overflow: visible;
  background: transparent;
  grid-template-columns: none;
}
/* Never leave the sign-in form invisible if motion JS fails */
.auth-shell--mirror .auth-rise,
.auth-shell--mirror .auth-card--enter {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}
.auth-shell--mirror .auth-atmosphere,
.auth-shell--mirror .auth-orb,
.auth-shell--mirror .auth-panel { display: none !important; }
.auth-shell--mirror .auth-main {
  min-height: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
}
.auth-shell--mirror .auth-footnote { display: none; }
.auth-shell--login .auth-card {
  width: min(440px, 100%);
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(40, 30, 70, .08);
  padding: 1.55rem 1.35rem 1.4rem;
}
.auth-shell--login .auth-form-stage,
.auth-shell--login .login-form { text-align: left; }
.auth-shell--login .auth-card-brand {
  margin-bottom: 1rem;
}
.auth-shell--login .brand-logo {
  width: min(120px, 40%);
  margin: 0 auto .65rem;
  display: block;
  height: auto;
}
.auth-shell--login .brand-mark {
  font-family: var(--display);
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  margin: 0 0 .25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}
.auth-shell--login .brand-sub {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}
.auth-shell--login .login-form input[type="email"],
.auth-shell--login .login-form input[type="password"],
.auth-shell--login .login-form input[type="text"] {
  min-height: 48px;
  font-size: 1rem;
  width: 100%;
}
.auth-shell--login .auth-apply-cta {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.auth-shell--login .auth-apply-cta p { margin: 0 0 .65rem; color: var(--muted); font-size: .92rem; }
.auth-shell--login .auth-apply-kicker {
  font-size: .88rem;
  font-weight: 650;
  color: var(--ink);
}
.auth-shell--login .auth-home-link { margin-top: .85rem !important; }
.auth-shell--mirror.auth-shell--centered .auth-main {
  min-height: 0;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
}
.auth-shell--mirror.auth-shell--centered .auth-card--wide {
  width: 100%;
  max-width: 960px;
}
.auth-shell--mirror.auth-shell--centered .auth-card-brand {
  /* heading only — site logo already in header */
  grid-template-columns: 1fr;
  grid-template-areas: "title" "sub";
}
.auth-shell--mirror.auth-shell--centered .auth-card .brand-logo { display: none; }

@media (max-width: 900px) {
  .auth-shell--mirror.auth-shell--centered .auth-card--wide {
    padding: 1rem .9rem 1.05rem;
    border-radius: 12px;
  }
  .auth-shell--login .auth-card {
    padding: 1.25rem 1rem 1.15rem;
  }
}
@media (max-width: 640px) {
  .auth-shell--mirror.auth-shell--centered .apply-progress-label {
    display: none;
  }
  .auth-shell--mirror.auth-shell--centered .apply-progress {
    gap: .2rem;
    justify-content: space-between;
  }
  .auth-shell--mirror.auth-shell--centered .apply-progress-dot {
    width: 1.55rem;
    height: 1.55rem;
    font-size: .72rem;
  }
  .auth-shell--mirror.auth-shell--centered .apply-progress-rail {
    flex: 1 1 auto;
    min-width: 6px;
  }
  .auth-shell--login .brand-mark {
    font-size: 1.25rem;
  }
  .auth-shell--login .btn-lg {
    min-height: 48px;
  }
  .auth-row {
    flex-wrap: wrap;
    gap: .65rem;
  }
}
@media (max-width: 420px) {
  .auth-shell--mirror.auth-shell--centered .auth-card-brand {
    margin-bottom: .75rem;
    padding-bottom: .7rem;
  }
  .auth-shell--mirror .flash { font-size: .9rem; }
}

/* Admin shell — desktop collapse + mobile drawer */
.admin-shell {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 100vh;
  position: relative;
  transition: grid-template-columns .22s ease;
}
.admin-shell.is-pinned {
  grid-template-columns: 232px 1fr;
}
.admin-nav {
  background: linear-gradient(185deg, #6b2d96 0%, #3d6fb0 48%, #1f8fbf 100%);
  color: #fff;
  padding: .75rem .45rem;
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  overflow: hidden;
  z-index: 40;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.08);
}
.admin-nav .nav-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .4rem;
  margin-bottom: .45rem;
  flex-shrink: 0;
}
.admin-shell.is-pinned .admin-nav .nav-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.admin-nav .logo {
  margin: 0;
  line-height: 1;
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 10px;
  padding: .3rem .25rem;
  display: grid;
  place-items: center;
}
.admin-nav .logo img {
  display: block;
  width: 40px;
  height: auto;
  margin: 0 auto;
  filter: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  transition: width .2s ease;
}
.admin-shell.is-pinned .admin-nav .logo img {
  width: 96px;
}
.admin-nav .nav-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  display: none;
  place-items: center;
}
.admin-nav .nav-close:hover { background: rgba(255,255,255,.22); }
.admin-nav .nav-foot {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-top: .45rem;
  border-top: 1px solid rgba(255,255,255,.18);
}
.admin-nav .nav-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 100%;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  padding: .7rem .45rem;
  font: inherit;
  font-weight: 650;
}
.admin-shell.is-pinned .admin-nav .nav-pin {
  justify-content: flex-start;
  padding: .7rem .65rem;
  background: rgba(255,255,255,.18);
}
.admin-nav .nav-pin:hover { background: rgba(255,255,255,.22); }
.admin-nav .nav-pin-char {
  display: block;
  line-height: 1;
  font-size: 1.05rem;
  font-weight: 700;
}

.admin-nav .nav-links {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
}
.admin-nav .nav-priority-label {
  display: none;
  margin: .65rem .35rem .15rem;
  padding: 0 .3rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.admin-shell.is-pinned .admin-nav .nav-priority-label {
  display: block;
}
.admin-nav .nav-docs {
  margin: 0;
}
.admin-nav .nav-docs-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem .45rem;
  border-radius: 10px;
  color: rgba(255,255,255,.78);
  cursor: pointer;
  user-select: none;
  width: 100%;
  justify-content: center;
  position: relative;
}
.admin-shell.is-pinned .admin-nav .nav-docs-summary {
  justify-content: flex-start;
  padding: .7rem .65rem;
}
.admin-nav .nav-docs-summary::-webkit-details-marker { display: none; }
.admin-nav .nav-docs-summary::marker { content: ''; }
.admin-nav .nav-docs-summary:hover,
.admin-nav .nav-docs-summary.is-active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.admin-nav .nav-docs-summary .nav-txt {
  flex: 1;
  min-width: 0;
}
.admin-shell:not(.is-pinned) .admin-nav .nav-docs-summary .nav-txt,
.admin-shell:not(.is-pinned) .admin-nav .nav-docs-summary .nav-badge {
  display: none;
}
.admin-nav .nav-docs-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .15rem 0 .25rem .35rem;
  margin-left: .35rem;
  border-left: 2px solid rgba(255,255,255,.14);
}
.admin-shell:not(.is-pinned) .admin-nav .nav-docs-body {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.admin-nav .nav-others {
  margin-top: .35rem;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: .35rem;
}
.admin-nav .nav-others-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem .45rem;
  border-radius: 10px;
  color: rgba(255,255,255,.78);
  cursor: pointer;
  user-select: none;
  width: 100%;
  justify-content: center;
  position: relative;
}
.admin-shell.is-pinned .admin-nav .nav-others-summary {
  justify-content: flex-start;
  padding: .7rem .65rem;
}
.admin-nav .nav-others-summary::-webkit-details-marker { display: none; }
.admin-nav .nav-others-summary::marker { content: ''; }
.admin-nav .nav-others-summary:hover,
.admin-nav .nav-others-summary.is-active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.admin-nav .nav-others-summary .nav-txt {
  flex: 1;
  min-width: 0;
}
.admin-shell:not(.is-pinned) .admin-nav .nav-others-summary .nav-txt,
.admin-shell:not(.is-pinned) .admin-nav .nav-others-summary .nav-badge {
  display: none;
}
.admin-nav .nav-others-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .15rem 0 .25rem .35rem;
  margin-left: .35rem;
  border-left: 2px solid rgba(255,255,255,.14);
}
.admin-shell:not(.is-pinned) .admin-nav .nav-others-body {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.admin-nav .nav-section {
  display: none;
}
.admin-nav .nav-user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .35rem .45rem;
  border-radius: 10px;
  color: #eaffff;
  min-width: 0;
}
.admin-shell.is-pinned .admin-nav .nav-user {
  justify-content: flex-start;
  padding: .45rem .65rem;
  background: rgba(255,255,255,.1);
}
.admin-nav .nav-user-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.admin-nav .nav-user-meta {
  display: none;
  flex-direction: column;
  gap: .05rem;
  min-width: 0;
  line-height: 1.15;
}
.admin-shell.is-pinned .admin-nav .nav-user-meta {
  display: flex;
}
.admin-nav .nav-user-name {
  font-size: .82rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9.5rem;
}
.admin-nav .nav-user-role {
  font-size: .68rem;
  color: rgba(255,255,255,.72);
  text-transform: capitalize;
}
.admin-nav .nav-links::-webkit-scrollbar {
  width: 4px;
}
.admin-nav .nav-links::-webkit-scrollbar-track {
  background: transparent;
}
.admin-nav .nav-links::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.35);
  border-radius: 999px;
}
.admin-nav .nav-links::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.admin-nav a,
.admin-nav .nav-logout-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #eaffff;
  padding: .7rem .45rem;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.admin-nav .nav-pin {
  cursor: pointer;
}
.admin-shell.is-pinned .admin-nav a,
.admin-shell.is-pinned .admin-nav .nav-logout-btn {
  justify-content: flex-start;
  padding: .7rem .65rem;
}
.admin-nav a:hover,
.admin-nav a.active,
.admin-nav .nav-logout-btn:hover {
  background: rgba(255,255,255,.14);
  text-decoration: none;
  color: #fff;
}
.admin-nav .nav-ico {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
}
.admin-nav .nav-ico svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  display: block;
}
.admin-nav .nav-txt {
  display: none;
  overflow: hidden;
}
.admin-shell.is-pinned .admin-nav .nav-txt {
  display: inline;
}
.admin-nav .nav-logout {
  margin-top: 0;
  flex-shrink: 0;
  padding-top: 0;
  border-top: 0;
}
.admin-nav .nav-logout-btn {
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
}

.admin-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 36, .45);
  z-index: 35;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.admin-main {
  padding: 1.5rem;
  min-width: 0;
  /* Keep overflow visible so sticky headers work while scrolling */
  overflow: visible;
}
.admin-appbar { display: none; }
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 28;
  margin: -1.5rem -1.5rem 1.25rem;
  padding: .85rem 1.5rem;
  background: rgba(245, 246, 251, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.admin-top-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: .15rem;
  min-width: 0;
}
.admin-top h1 { margin: 0; font-family: var(--display); font-size: clamp(1.25rem, 3vw, 1.7rem); color: var(--ink); line-height: 1.15; }
.admin-top-context {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.35;
  max-width: 38rem;
}
.admin-top .help { margin-left: auto; }

.ops-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding: 1.15rem .35rem 1.35rem;
  text-align: left;
}
.ops-empty-row .ops-empty,
.ops-empty-cell .ops-empty {
  align-items: center;
  text-align: center;
  padding: 1.75rem 1rem;
  width: 100%;
}
.ops-empty-title {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
}
.ops-empty-body {
  margin: 0;
  max-width: 28rem;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.45;
}
.ops-empty .btn { margin-top: .35rem; }
.ops-empty-cell {
  border-bottom: none !important;
}

.kpi-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.75rem), 1fr));
  gap: .55rem;
  margin-bottom: .85rem;
}
.kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: .2rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
  min-width: 0;
  min-height: 0;
  text-decoration: none !important;
  color: inherit;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
a.kpi:hover {
  border-color: #9ec9d8;
  background: #f7fcfc;
  box-shadow: none;
  transform: none;
  text-decoration: none !important;
}
a.kpi:active { transform: none; }
.kpi .label {
  order: 1;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
  width: 100%;
}
.kpi .value {
  order: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  font-family: var(--font);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  width: 100%;
}
.kpi .kpi-unit {
  font-size: .55em;
  margin-left: .2rem;
  font-weight: 650;
  opacity: .75;
}
.kpi.kpi-warn .value { color: #b7791f; }
.kpi.kpi-alert .value { color: #c0392b; }
.kpi.kpi-warn { border-color: #f0d9a8; background: linear-gradient(180deg, #fffdf8, #fff); }
.kpi.kpi-alert { border-color: #f0c4c0; background: linear-gradient(180deg, #fff8f7, #fff); }

/* Professional tables */
.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  max-width: 100%;
  position: relative;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 18px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 18px), transparent 100%);
}
.table-wrap::-webkit-scrollbar { display: none; width: 0; height: 0; }
.table-wrap.is-at-end,
.table-wrap:not(.is-scrollable) {
  mask-image: none;
  -webkit-mask-image: none;
}
.table-wrap table {
  margin: 0;
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}
.card > .table-wrap {
  border: 0;
  border-radius: 0;
  margin: 0 -.15rem;
}
.card > .table-wrap table { min-width: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; }
thead th {
  /* Not sticky by default — sticky page headers float over later cards on mobile */
  position: static;
  background: #f7f5fb;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 750;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: bottom;
}
tbody td {
  padding: .58rem .6rem;
  border-bottom: 1px solid #eceef5;
  font-size: .86rem;
  vertical-align: middle;
  background: #fff;
  color: var(--ink);
  line-height: 1.35;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #faf8fd; }

/* Sticky first column only when table is intentionally wide/scrollable */
.table-wrap.table-wide tbody td:first-child,
.table-wrap.table-wide thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 4px 0 8px -6px rgba(40, 20, 70, .14);
}
.table-wrap.table-wide thead th:first-child { z-index: 3; background: #f7f5fb; }
.table-wrap.table-wide tbody td:first-child { background: #fff; font-weight: 600; }
.table-wrap.table-wide tbody tr:hover td:first-child { background: #faf8fd; }

/* Optional vertical scroll pocket (rare) — then sticky header is safe */
.table-wrap.table-scroll-y {
  max-height: min(70vh, 28rem);
  overflow: auto;
}
.table-wrap.table-scroll-y thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Column sizing helpers — short fields stay tight, names/subjects grow */
.col-tight,
.col-num,
.col-date,
.col-when,
.col-status,
.col-flag,
.col-hours,
.col-pay {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
.col-grow,
.col-name,
.col-subject,
.col-client,
.col-doc {
  width: auto;
  min-width: 7.5rem;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.col-num,
.col-hours,
.col-pay {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
thead th.col-num,
thead th.col-hours,
thead th.col-pay {
  text-align: right;
}
.col-status .badge,
.col-flag .badge {
  white-space: nowrap;
}

/* Wide tables (many columns) keep a soft horizontal scroll */
.table-wrap.table-wide table { min-width: 42rem; }
.table-wrap.table-wide tbody td { white-space: nowrap; }
.table-wrap.table-wide thead th { white-space: nowrap; }
.table-wrap.table-wide td.col-grow,
.table-wrap.table-wide td.col-name,
.table-wrap.table-wide td.col-subject,
.table-wrap.table-wide td.col-client,
.table-wrap.table-wide td.col-doc {
  white-space: normal;
}

.td-sub {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: .1rem;
}
.td-muted { color: var(--muted); font-weight: 500; }

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); }
}
@media (max-width: 980px) {
  .admin-shell,
  .admin-shell.is-pinned,
  .admin-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-menu-toggle { display: none; }
  .admin-nav-backdrop.is-open { display: block; }

  .admin-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(288px, 86vw) !important;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    padding: .85rem .75rem calc(.85rem + env(safe-area-inset-bottom));
    box-shadow: 8px 0 28px rgba(30, 10, 50, .25);
    overflow: hidden;
    z-index: 55;
  }
  .admin-shell.nav-open .admin-nav {
    transform: translateX(0);
  }

  .admin-nav .nav-pin { display: none !important; }
  .admin-nav .nav-close { display: inline-grid; width: 32px; height: 32px; }
  .admin-nav .logo img { width: 96px !important; }
  .admin-nav .nav-head {
    flex-direction: row;
    align-items: center;
  }
  .admin-nav .nav-txt {
    display: inline !important;
  }
  .admin-nav .nav-user {
    justify-content: flex-start;
    padding: .45rem .65rem;
    background: rgba(255,255,255,.1);
  }
  .admin-nav .nav-user-meta {
    display: flex !important;
  }
  .admin-nav a,
  .admin-nav .nav-logout-btn {
    justify-content: flex-start;
  }
  .admin-nav .nav-links {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: .1rem;
    padding-right: .15rem;
    mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 18px), transparent 100%);
  }
  .admin-nav a,
  .admin-nav .nav-logout-btn {
    padding: .58rem .6rem;
  }
  .admin-nav .nav-logout {
    margin-top: .35rem;
    width: 100%;
    padding-top: .65rem;
  }
  .admin-nav .nav-logout-btn { justify-content: flex-start; }

  .admin-main {
    padding-bottom: calc(var(--mobile-footer-clearance, 6.75rem) + env(safe-area-inset-bottom, 0px));
  }
  .admin-footer {
    display: grid !important;
  }

  .admin-appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    position: sticky;
    top: 0;
    z-index: 32;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: .4rem .75rem;
    min-height: 52px;
    margin: -1rem -.85rem 0;
  }
  .admin-appbar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
  }
  .admin-appbar-brand img {
    width: 72px;
    height: auto;
    display: block;
  }
  .admin-appbar-actions {
    display: flex;
    align-items: center;
    gap: .3rem;
  }
  .admin-appbar-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--brand-purple);
    background: #f5f6fb;
    border: 1px solid var(--line);
    cursor: pointer;
    padding: 0;
    font: inherit;
  }
  .admin-appbar-ico:hover {
    background: var(--teal-soft);
    text-decoration: none;
  }
  .admin-appbar-ico svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  a.admin-appbar-ico svg { fill: currentColor; stroke: none; }
  .admin-appbar-out { margin: 0; }
  .admin-appbar-out .btn,
  .admin-appbar-out button {
    background: var(--brand-blue);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .45rem .7rem;
    font-size: .85rem;
    font-weight: 700;
  }

  .admin-main {
    padding: 1rem .85rem calc(var(--mobile-footer-clearance, 6.75rem) + env(safe-area-inset-bottom, 0px));
  }
  .admin-top {
    position: sticky;
    top: 52px;
    z-index: 31;
    margin: 0 -.85rem .85rem;
    padding: .7rem .85rem;
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
    background: rgba(245, 246, 251, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .admin-top h1 {
    font-size: 1.45rem;
    color: var(--teal-dark);
  }
  .admin-top .help {
    width: 100%;
    margin-left: 0;
    order: 0;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: .45rem;
  }
  .kpi {
    align-items: flex-start;
    justify-content: flex-start;
    gap: .15rem;
    padding: .55rem .6rem;
    min-height: 0;
    border-radius: 11px;
    border: 1px solid var(--line);
    box-shadow: none;
    text-align: left;
  }
  .kpi .label {
    font-size: .62rem;
    flex: 0 0 auto;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 800;
  }
  .kpi .value {
    margin: 0;
    font-size: 1.15rem;
    text-align: left;
    white-space: nowrap;
  }

  .card { padding: .9rem; border-radius: 12px; }
  .form-grid.two { grid-template-columns: 1fr; }

  .table-wrap {
    margin: 0;
    border-radius: 10px;
  }
  thead th {
    padding: .45rem .4rem;
    font-size: .6rem;
    letter-spacing: .03em;
  }
  tbody td {
    padding: .5rem .4rem;
    font-size: .8rem;
  }
  .col-grow,
  .col-name,
  .col-subject,
  .col-client,
  .col-doc {
    min-width: 6.5rem;
  }
  .table-wrap.table-wide table { min-width: 34rem; }
  .btn { padding: .6rem .85rem; font-size: .9rem; }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr));
    gap: .4rem;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }
  .kpi {
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(60, 30, 90, 0.05);
    padding: .5rem .4rem .45rem;
    min-height: 3.75rem;
  }
  .kpi .label { font-size: .55rem; letter-spacing: .01em; text-transform: none; }
  .kpi .value { font-size: 1.2rem; text-align: center; }
  .kpi .kpi-unit { font-size: .5em; }
  .admin-main {
    padding: .85rem .7rem calc(var(--mobile-footer-clearance, 6.75rem) + env(safe-area-inset-bottom, 0px));
  }
  .admin-appbar {
    margin: -.85rem -.7rem 0;
  }
  .admin-top {
    top: 52px;
    margin: 0 -.7rem .75rem;
    padding: .65rem .7rem;
  }
  .admin-appbar-brand img { width: 64px; }
}

@media (min-width: 700px) and (max-width: 980px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
    gap: .65rem;
  }
  .kpi {
    padding: .7rem .7rem .65rem;
    min-height: 4.6rem;
  }
  .kpi .label { font-size: .65rem; }
  .kpi .value { font-size: 1.55rem; }
}

/* Care app shell */
.care-shell {
  max-width: none;
  width: 100%;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  box-shadow: none;
  display: block;
  position: relative;
}
body:has(.care-shell) {
  background: #eef2f4;
}
.care-side { display: none; }
.care-top-desk { display: none; }
.care-main { min-width: 0; }

@media (min-width: 900px) {
  .care-shell:not(.care-shell--wa-thread) {
    display: grid;
    grid-template-columns: 72px 1fr;
    background: #f4f6f8;
  }
  .care-shell.is-pinned:not(.care-shell--wa-thread) {
    grid-template-columns: 220px 1fr;
  }
  .care-side {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    background: linear-gradient(185deg, #6b2d96 0%, #3d6fb0 48%, #1f8fbf 100%);
    color: #fff;
    padding: .75rem .45rem;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 40;
  }
  .care-side-logo {
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 10px;
    padding: .35rem .3rem;
    margin-bottom: .25rem;
    flex-shrink: 0;
    text-decoration: none;
  }
  .care-side-logo img {
    display: block;
    width: 40px;
    height: auto;
    transition: width .2s ease;
  }
  .care-shell.is-pinned .care-side-logo img {
    width: 92px;
  }
  .care-side-links {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .care-nav-priority-label {
    display: none;
    margin: .45rem .45rem .1rem;
    padding: 0 .2rem;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
  }
  .care-shell.is-pinned .care-nav-priority-label {
    display: block;
  }
  .care-nav-others {
    margin-top: .3rem;
    border-top: 1px solid rgba(255,255,255,.14);
    padding-top: .3rem;
  }
  .care-nav-others-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    color: #eaffff;
    padding: .52rem .45rem;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    font-weight: 650;
  }
  .care-nav-others-summary::-webkit-details-marker { display: none; }
  .care-nav-others-summary::marker { content: ''; }
  .care-shell.is-pinned .care-nav-others-summary {
    justify-content: flex-start;
    padding: .62rem .6rem;
  }
  .care-nav-others-summary:hover,
  .care-nav-others-summary.is-active {
    background: rgba(255,255,255,.14);
    color: #fff;
  }
  .care-nav-others-body {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    padding: .1rem 0 .2rem .3rem;
    margin-left: .3rem;
    border-left: 2px solid rgba(255,255,255,.14);
  }
  .care-shell:not(.is-pinned) .care-nav-others-body {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .care-side-sep {
    display: block;
    height: 1px;
    margin: .35rem .55rem;
    background: rgba(255,255,255,.22);
    flex-shrink: 0;
  }
  .care-side-links a,
  .care-side-pin,
  .care-side-out {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    color: #eaffff;
    padding: .52rem .45rem;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    width: 100%;
    position: relative;
    z-index: 1;
    pointer-events: auto;
  }
  .care-shell.is-pinned .care-side-links a,
  .care-shell.is-pinned .care-side-pin,
  .care-shell.is-pinned .care-side-out {
    justify-content: flex-start;
    padding: .62rem .6rem;
  }
  .care-side-links a:hover,
  .care-side-links a.active,
  .care-side-pin:hover,
  .care-side-out:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
    text-decoration: none;
  }
  .care-side-ico {
    width: 1.35rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
  }
  .care-side-txt {
    display: none;
    font-size: .92rem;
    font-weight: 650;
  }
  .care-shell.is-pinned .care-side-txt {
    display: inline;
  }
  .care-side-badge {
    margin-left: auto;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 .28rem;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .care-side-badge[hidden] { display: none !important; }
  .care-shell:not(.is-pinned) .care-side-badge {
    position: absolute;
    top: .25rem;
    right: .15rem;
    margin: 0;
  }
  .care-side-foot {
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding-top: .45rem;
    border-top: 1px solid rgba(255,255,255,.18);
  }
  .care-side-logout { margin: 0; }
  .care-side-out,
  .care-side-pin {
    border: 1px solid rgba(255,255,255,.28) !important;
    border-radius: 10px;
    color: #fff;
  }
  .care-side a,
  .care-side button {
    cursor: pointer;
  }

  .care-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .care-top-user {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 650;
  }
  .care-top,
  .care-pwa-bar,
  .clocked-banner {
    max-width: none;
  }
  .care-body {
    max-width: none;
    margin: 0;
    padding: 1.15rem 1.35rem 1.5rem;
    flex: 1;
  }
  .care-bottom {
    display: none !important;
  }

  .care-dash {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
    gap: 1.15rem 1.35rem;
    align-items: start;
  }
  .care-dash-main .section-title:first-child { margin-top: 0; }
  .care-dash-rail {
    position: sticky;
    top: .75rem;
  }
  .care-dash-rail .section-title:first-child { margin-top: 0; }
  .care-shell .care-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }
  .care-shell .care-card-grid > .help,
  .care-shell .care-card-grid > .visit-card.help {
    grid-column: 1 / -1;
  }
  .care-dash-rail .qa-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }
  .care-dash-rail .qa-card {
    min-height: 0;
    padding: .65rem .7rem;
  }
  .care-dash-rail .qa-card-ico {
    width: 2rem;
    height: 2rem;
    font-size: .95rem;
  }
  .care-alerts .visit-card { margin-bottom: .55rem; }
}

@media (min-width: 1280px) {
  .care-dash {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .75fr);
    gap: 1.35rem 1.6rem;
  }
  .care-body {
    padding: 1.35rem 1.75rem 1.75rem;
  }
}

.care-top {
  background: rgba(255,255,255,.96);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: .4rem .75rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 52px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.care-top .care-brand {
  display: flex; align-items: center; min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.care-top .care-brand img {
  width: 72px; height: auto; flex-shrink: 0; display: block;
  filter: none;
}
.care-top .care-brand span { display: none; }
.care-top .nav-icons { display: flex; gap: .3rem; align-items: center; }
.care-top .nav-icons a:not(.admin-appbar-ico):not(.care-office-chip) {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink); background: #f3f4f6; border: 1px solid var(--line);
  position: relative; font-size: .8rem; font-weight: 700;
}
.care-top .nav-icons a:hover { text-decoration: none; background: #eef2f7; }
.care-top .nav-icons .btn:not(.admin-appbar-ico),
.care-top .nav-icons button:not(.admin-appbar-ico):not(.app-user-menu__btn) {
  background: var(--brand-blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .45rem .65rem;
  font-size: .85rem;
}

/* Desktop: sidebar owns logo + nav — strip duplicate header chrome */
@media (min-width: 900px) {
  .care-top .care-brand,
  .care-top .nav-icons {
    display: none !important;
  }
  .care-top-desk {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
    width: 100%;
    margin-left: auto;
  }
  .care-top-desk .care-search-launch,
  .care-top-desk .admin-search-launch {
    margin-right: auto;
    max-width: 22rem;
    flex: 1 1 14rem;
  }
  .care-top {
    justify-content: flex-end;
    min-height: 48px;
    padding: .35rem 1.15rem;
  }
}

@media (max-width: 480px) {
  .care-top .care-brand img { width: 64px; }
  .brand-logo { width: min(130px, 48%); }
}
.care-top .badge-count {
  position: absolute; top: -4px; right: -4px; background: #ff5a5a; color: #fff;
  border-radius: 999px; font-size: .65rem; min-width: 18px; height: 18px; display: grid; place-items: center;
}
.clocked-banner {
  background: #5a2d8e; color: #fff; padding: .55rem 1rem; font-size: .9rem; font-weight: 650;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  text-decoration: none;
  position: sticky;
  top: 0;
  z-index: 29;
}
@media (max-width: 899px) {
  .clocked-banner {
    /* care-top (~52px) + mobile PWA/status bar (~36px) */
    top: 88px;
  }
}
@media (min-width: 900px) {
  .clocked-banner {
    top: 52px; /* below desktop care-top */
  }
}
a.clocked-banner:hover { color: #fff; text-decoration: none; filter: brightness(1.05); }
.clocked-banner-cta {
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 700;
  opacity: .9;
  white-space: nowrap;
}
.care-body {
  padding: 1rem 1rem calc(var(--mobile-footer-clearance, 6.5rem) + env(safe-area-inset-bottom, 0px));
}
.section-title {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 1rem 0 .55rem; font-weight: 750;
}
.visit-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .65rem .75rem;
  margin-bottom: .55rem;
  background: #fff;
  height: auto;
  min-height: 0;
}
.visit-card h3 { margin: 0 0 .2rem; font-size: .98rem; line-height: 1.25; }
.visit-meta {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  margin: 0 0 .4rem;
}
.visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  margin: 0;
  padding: 0;
}
.visit-actions .btn,
.care-shell .visit-actions .btn,
.btn-sm {
  padding: .28rem .55rem !important;
  font-size: .75rem !important;
  font-weight: 650;
  border-radius: 7px;
  min-height: 0 !important;
  height: auto !important;
  line-height: 1.15;
}
@media (max-width: 899px) {
  .visit-actions .btn,
  .care-shell .visit-actions .btn,
  .guide-card .btn-sm,
  .care-shell .btn-sm,
  .weekly-hero-actions .btn-sm,
  .adl-toolbar .btn-sm,
  .mobile-card-actions .btn {
    min-height: 44px !important;
    padding: .55rem .85rem !important;
    font-size: .86rem !important;
    border-radius: 10px;
  }
  /* Keep Call/Maps compact beside shift rows — full 44px stack is too tall */
  .care-shell .wiw-shift-actions .btn-sm,
  .care-shell .wiw-route-stop .btn-sm {
    min-height: 0 !important;
    height: auto !important;
    padding: .32rem .55rem !important;
    font-size: .75rem !important;
    border-radius: 8px;
    line-height: 1.15;
  }
  .visit-actions { gap: .45rem; }
  .care-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.visit-actions form { display: inline-flex; margin: 0; }
.care-shell .visit-card .visit-actions { margin-top: 0; }
.progress-card { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.progress-row { margin-top: .65rem; }
.progress-row .top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .3rem; color: var(--muted); font-weight: 650; }
.bar { height: 8px; background: #e7efef; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue)); }

.hours-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .85rem .85rem;
  background: #fff;
  margin-bottom: .35rem;
}
.hours-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .15rem;
}
.hours-card-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 750;
}
.hours-card-goal {
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.15;
  margin-top: .15rem;
}
.hours-card-stats {
  display: flex;
  gap: .55rem;
}
.hours-stat {
  min-width: 3.6rem;
  text-align: right;
}
.hours-stat-val {
  display: block;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--teal-dark);
  line-height: 1.1;
}
.hours-stat-lbl {
  display: block;
  font-size: .65rem;
  color: var(--muted);
  font-weight: 650;
  margin-top: .1rem;
}

.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .35rem;
}
.visit-doc-grid {
  margin-bottom: 1.25rem;
}
@media (min-width: 720px) {
  .visit-doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .visit-doc-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.qa-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: .4rem;
  padding: .75rem .7rem .7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  min-height: 5.5rem;
  transition: border-color .15s ease, background .15s ease;
}
.qa-card:hover {
  text-decoration: none;
  border-color: #b9dede;
  background: #f7fcfc;
}
.qa-card-ico {
  flex: 0 0 2.1rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
  background: linear-gradient(145deg, #eef6f6, #e8eef8);
  color: var(--teal-dark);
  font-size: .9rem;
  font-weight: 800;
  margin: 0;
}
.qa-card-txt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .12rem;
  min-width: 0;
  width: 100%;
  text-align: left;
}
.qa-card-txt strong {
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.2;
}
.qa-card-txt small {
  font-size: .65rem;
  color: var(--muted);
  font-weight: 550;
  line-height: 1.2;
}

@media (max-width: 360px) {
  .hours-card-stats { flex-direction: column; align-items: flex-end; gap: .25rem; }
  .qa-card { min-height: 5.1rem; padding: .6rem .45rem .55rem; }
  .qa-card-txt strong { font-size: .72rem; }
}

.adl-group { margin-bottom: 1.1rem; }
.adl-group h3 { margin: 0 0 .55rem; font-size: 1rem; color: var(--teal-dark); }
.adl-item {
  display: grid; grid-template-columns: 24px 1fr; gap: .65rem; align-items: start;
  padding: .7rem 0; border-bottom: 1px solid var(--line);
}
.adl-item input[type=checkbox] { width: 20px; height: 20px; margin-top: .15rem; }
.adl-item--status {
  grid-template-columns: 1fr;
  gap: .55rem;
  padding: .75rem .15rem;
}
.adl-item-main strong { display: block; font-size: .95rem; }
.adl-status-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: .3rem;
  flex-shrink: 0;
}
.adl-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 .4rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  box-sizing: border-box;
  color: var(--muted);
  background: #f4f6fb;
  cursor: pointer;
  margin: 0;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .12s ease;
}
.adl-pill span { pointer-events: none; }
.adl-pill input { position: absolute; opacity: 0; pointer-events: none; }
.adl-pill:hover { border-color: #c5cae0; }
.adl-pill.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(100deg, var(--brand-purple), var(--brand-blue));
  transform: translateY(-1px);
}
.adl-pill--performed.is-active { background: #1f8a4c; }
.adl-pill--refused.is-active { background: #c47f17; }
.adl-pill--cancelled.is-active { background: #c0392b; }
.adl-pill--na.is-active { background: #5f6173; }

/* Smart ADL / IADL documentation page */
.adl-page { max-width: none; margin: 0 0 5.5rem; width: 100%; }
.adl-page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.adl-back {
  display: inline-block;
  font-size: .82rem;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: .25rem;
}
.adl-page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.3rem, 3.5vw, 1.65rem);
  line-height: 1.15;
  color: var(--ink);
}
.adl-page-stats {
  display: flex;
  gap: .5rem;
}
.adl-stat {
  min-width: 4.6rem;
  padding: .55rem .7rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}
.adl-stat--ok { border-color: #b7e4c7; background: #f3fbf6; }
.adl-stat-val {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink);
}
.adl-stat--ok .adl-stat-val { color: #1f8a4c; }
.adl-stat-lbl {
  display: block;
  margin-top: .25rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.adl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: .65rem .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(60, 30, 90, .04);
}
.adl-key-compact {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.adl-key-chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .28rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  background: #f4f6fb;
  color: var(--muted);
}
.adl-key-chip em {
  font-style: normal;
  font-weight: 800;
}
.adl-key-chip--p em { color: #1f8a4c; }
.adl-key-chip--r em { color: #c47f17; }
.adl-key-chip--c em { color: #c0392b; }
.adl-key-chip--na em { color: #5f6173; }
.adl-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.adl-section { margin-bottom: 1.25rem; }
.adl-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .15rem;
}
.adl-section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--teal-dark);
}
.adl-section-count {
  font-size: .78rem;
  font-weight: 750;
  color: var(--muted);
  background: #eef1f8;
  padding: .2rem .5rem;
  border-radius: 999px;
}
.adl-section-sub {
  margin: 0 0 .7rem;
  font-size: .8rem;
  color: var(--muted);
}

.adl-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
}
@media (min-width: 760px) {
  .adl-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.adl-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .8rem .85rem .75rem;
  box-shadow: 0 6px 16px rgba(40, 25, 70, .04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.adl-card--performed {
  border-color: #b7e4c7;
  background: linear-gradient(180deg, #f7fcf9, #fff);
}
.adl-card--refused {
  border-color: #f0d9a8;
  background: linear-gradient(180deg, #fffbf3, #fff);
}
.adl-card--cancelled {
  border-color: #f5c6c2;
  background: linear-gradient(180deg, #fff8f7, #fff);
}
.adl-card--na {
  border-color: #d5d8e4;
  background: linear-gradient(180deg, #f8f9fc, #fff);
}
.adl-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: .55rem;
}
.adl-card-top h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 750;
  line-height: 1.25;
  color: var(--ink);
  padding-top: .25rem;
}
.adl-note-wrap { display: block; margin: 0; }
.adl-note-wrap input {
  width: 100%;
  border: 1px solid #e4e7f1;
  background: #fafbfe;
  border-radius: 10px;
  padding: .55rem .7rem;
  font-size: .86rem;
}
.adl-note-wrap input:focus {
  outline: none;
  border-color: #b9c8ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 182, 232, .12);
}

.adl-savebar {
  position: sticky;
  bottom: calc(var(--mobile-footer-clearance, 4.5rem) + .35rem);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: .75rem .85rem;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(30, 20, 60, .12);
}
.adl-savebar .btn { min-width: 11rem; }
@media (min-width: 981px) {
  .adl-savebar { bottom: .85rem; }
}
@media (max-width: 520px) {
  .adl-card-top {
    flex-direction: column;
    align-items: stretch;
  }
  .adl-status-pills { justify-content: flex-start; }
  .adl-savebar { flex-direction: column; align-items: stretch; }
  .adl-savebar .btn { width: 100%; }
}

.doc-key {
  background: #f7f5fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .85rem;
  margin-bottom: 1rem;
}
.doc-key-codes {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .85rem;
  margin-top: .35rem;
  font-size: .86rem;
  color: var(--ink);
}
.doc-key-codes em {
  font-style: normal;
  font-weight: 800;
  color: var(--teal-dark);
  margin-right: .15rem;
}

.weekly-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem .85rem;
  margin-bottom: 1rem;
}
.weekly-meta .help { display: block; font-size: .72rem; margin-bottom: .1rem; }
.weekly-grid td.weekly-code { text-align: center; font-weight: 750; }
@media (min-width: 720px) {
  .weekly-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.weekly-hero {
  display: flex;
  justify-content: space-between;
  gap: .85rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.weekly-kicker {
  margin: 0 0 .15rem;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-purple);
}
.weekly-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  line-height: 1.2;
}
.weekly-hero-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.weekly-filters { margin-bottom: 1rem; }
.weekly-meta-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.weekly-meta-card .help { display: block; margin-bottom: .15rem; }
.weekly-meta-card input {
  margin-top: .15rem;
}
.weekly-hours { color: var(--brand-purple); }
.weekly-progress {
  height: 6px;
  background: #e8ebf5;
  border-radius: 999px;
  overflow: hidden;
  margin-top: .35rem;
}
.weekly-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
}
.weekly-quick-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .65rem;
}
.doc-key-codes .code-p em { color: #1f8a4c; }
.doc-key-codes .code-r em { color: #c47f17; }
.doc-key-codes .code-c em { color: #c0392b; }
.doc-key-codes .code-na em { color: #5f6173; }

.weekly-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .65rem;
}
.weekly-section-head h2 { margin: 0; }
.weekly-section-head input { max-width: 260px; }

.weekly-code-select {
  width: 100%;
  min-width: 3.1rem;
  padding: .28rem .2rem !important;
  text-align: center;
  font-weight: 800;
  font-size: .78rem;
  border-radius: 8px;
  appearance: auto;
}
.weekly-code-select.code-p { background: #e7f7ee; color: #1f8a4c; border-color: #b7e4c7; }
.weekly-code-select.code-r { background: #fff4d6; color: #c47f17; border-color: #f0d9a8; }
.weekly-code-select.code-c { background: #fdecea; color: #c0392b; border-color: #f5c6c2; }
.weekly-code-select.code-na { background: #eef0f5; color: #5f6173; border-color: #d5d8e4; }
.weekly-code-select.code-empty { background: #fff; }

.weekly-chip {
  display: inline-flex;
  min-width: 2rem;
  justify-content: center;
  padding: .2rem .35rem;
  border-radius: 7px;
  font-weight: 800;
  font-size: .78rem;
  background: #f3f4f8;
  color: var(--muted);
}
.weekly-chip.code-p { background: #e7f7ee; color: #1f8a4c; }
.weekly-chip.code-r { background: #fff4d6; color: #c47f17; }
.weekly-chip.code-c { background: #fdecea; color: #c0392b; }
.weekly-chip.code-na { background: #eef0f5; color: #5f6173; }

.weekly-grid tr.has-service td { background: #fbfaff; }
.weekly-notes-card h2 { margin-top: 1rem; }
.weekly-notes-card h2:first-child { margin-top: 0; }
.weekly-sync {
  display: flex !important;
  align-items: center;
  gap: .5rem;
  margin: .35rem 0 1rem;
  font-weight: 600 !important;
  color: var(--ink) !important;
}
.weekly-sync input { width: auto !important; }
.weekly-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1.25rem;
}
.weekly-sig-pad {
  width: 100%;
  max-width: 340px;
  height: 120px;
  border: 1.5px dashed #7aa2e8;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfcff 0%, #f4f7ff 100%);
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(26, 86, 219, .06);
}

.desk-weekly { display: block; }
.mob-weekly { display: none; }
.weekly-mob-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .65rem .7rem;
  margin-bottom: .45rem;
  background: #fff;
}
.weekly-mob-row strong { display: block; margin-bottom: .45rem; font-size: .92rem; }
.weekly-mob-days {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem;
}
.weekly-mob-day {
  display: grid;
  gap: .15rem;
  margin: 0;
  font-size: .68rem;
  font-weight: 750;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 899px) {
  .desk-weekly { display: none !important; }
  .mob-weekly { display: block; }
  .weekly-meta-card { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .weekly-mob-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ops-toolbar {
    flex-direction: column;
    align-items: stretch !important;
  }
  .ops-toolbar .ops-actions,
  .ops-toolbar .filter-chip-row {
    flex-wrap: wrap;
    width: 100%;
  }
  .ops-toolbar .ops-actions .btn,
  .filter-chip-row .btn {
    min-height: 44px;
  }
  .emp-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
    width: 100%;
  }
  .emp-hero-actions .btn,
  .emp-hero-actions form {
    width: 100%;
  }
  .emp-hero-actions .btn {
    min-height: 44px;
    justify-content: center;
  }
  .emp-hero-actions form .btn { width: 100%; }
  .admin-main .ops-panel .table-wrap.desk-only { display: none !important; }
  .mob-day-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
  }
  .mob-day-actions {
    display: flex;
    gap: .35rem;
  }
  .mob-day-actions .btn { min-height: 40px; }
  .weekly-mob-day em.weekly-chip {
    display: inline-flex;
    min-width: 2.4rem;
    min-height: 2.4rem;
    align-items: center;
    justify-content: center;
    font-style: normal;
  }
  .auth-mob-list.mob-only { display: grid !important; gap: .55rem; }
  .auth-mob-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .75rem .8rem;
    background: #fff;
  }
  .auth-mob-card-top {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    align-items: flex-start;
    margin-bottom: .45rem;
  }
  .auth-mob-card strong { display: block; font-size: .95rem; }
  .auth-mob-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .35rem .55rem;
    font-size: .82rem;
  }
  .auth-mob-meta span { color: var(--muted); display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
  .auth-mob-card .mobile-card-actions { margin-top: .65rem; }
  .status-callout {
    flex-direction: column;
    align-items: stretch;
  }
  .status-callout .btn { width: 100%; min-height: 44px; justify-content: center; }
  .form-grid.two { grid-template-columns: 1fr; }
  .kpi-grid.emp-kpi-grid { grid-template-columns: 1fr 1fr; }
  .doc-reader iframe { height: 360px !important; }
  .admin-main .ops-toolbar .ops-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .admin-main .ops-toolbar .ops-actions .btn {
    min-height: 44px;
  }
}
@media (max-width: 520px) {
  .weekly-meta-card { grid-template-columns: 1fr; }
  .emp-hero-actions { grid-template-columns: 1fr; }
  .kpi-grid.emp-kpi-grid { grid-template-columns: 1fr 1fr; }
  .doc-reader iframe { height: 280px !important; }
}
@media (min-width: 900px) {
  .weekly-meta-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.sig-pad {
  width: 100%;
  height: 180px;
  border: 1.5px dashed #7aa2e8;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #fbfcff 0%, #f4f7ff 100%);
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(26, 86, 219, .06);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sig-pad.is-signed,
.sig-box.is-signed .sig-pad,
.weekly-sig-pad.is-signed {
  border-style: solid;
  border-color: #1f7a4d;
  background: linear-gradient(180deg, #f3fbf6 0%, #eaf7f0 100%);
  box-shadow: inset 0 0 0 1px rgba(31, 122, 77, .12);
}
.sig-pad.sig-pad--need {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .15);
}
.sig-status {
  margin: .4rem 0 0;
  font-size: .86rem;
}
.sig-status--ok {
  color: #1f7a4d;
  font-weight: 700;
}
.sig-reuse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  margin: 0 0 .55rem;
  padding: .7rem .9rem;
  border: 1.5px solid #0d8a8a;
  border-radius: 10px;
  background: linear-gradient(180deg, #e8f7f7 0%, #dff3f3 100%);
  color: #0a6e6e;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  text-align: center;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.sig-reuse-btn:hover,
.sig-reuse-btn:focus-visible {
  background: linear-gradient(180deg, #d5f0f0 0%, #c8eaea 100%);
  border-color: #0a6e6e;
  outline: none;
}
.sig-reuse-btn:active {
  transform: scale(.99);
}
.sig-reuse-btn:disabled {
  opacity: .65;
  cursor: wait;
}
.sig-reuse-btn__ico {
  font-size: 1.05rem;
  line-height: 1;
}
.sig-reuse-btn__txt {
  line-height: 1.25;
}
.weekly-sig-pad {
  border-color: #7aa2e8;
  background: linear-gradient(180deg, #fbfcff 0%, #f4f7ff 100%);
  touch-action: none;
}
.doc-sign-panel .sig-pad,
.apply-sig {
  border-color: #7aa2e8;
  background: linear-gradient(180deg, #fbfcff 0%, #f4f7ff 100%);
}

.care-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  transform: none;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: .45rem .2rem calc(.45rem + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: none;
  box-shadow: 0 -4px 18px rgba(30, 20, 50, .06);
}
.care-bottom a,
.care-footer-more {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: center;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  padding: .35rem .1rem;
  position: relative;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.1;
  min-width: 0;
}
.care-bottom a.active,
.care-bottom a:hover,
.care-footer-more:hover,
.care-footer-more.active,
.care-footer-more[aria-expanded="true"] { color: var(--teal); text-decoration: none; }
.care-bottom .ico { display: block; font-size: 1.1rem; margin-bottom: .15rem; }
.care-bottom-office,
.care-bottom a.care-bottom-office {
  color: #fff !important;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  border-radius: 12px;
  margin: .1rem .15rem;
}
.care-office-chip {
  width: auto !important;
  min-width: 0;
  padding: 0 .7rem !important;
  height: 36px;
  border-radius: 10px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: .78rem !important;
  font-weight: 800;
  letter-spacing: .01em;
  color: #fff !important;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue)) !important;
  border: 0 !important;
  text-decoration: none !important;
}
.care-office-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  background: #3d2463;
  color: #fff;
  padding: .65rem .9rem;
  text-decoration: none;
  font-size: .9rem;
  position: sticky;
  top: 52px;
  z-index: 28;
}
.care-office-banner strong { font-weight: 800; }
.care-office-banner span { opacity: .92; }
.care-office-banner-cta {
  margin-left: auto;
  font-weight: 800;
  white-space: nowrap;
}
.care-office-banner:hover { color: #fff; text-decoration: none; filter: brightness(1.06); }
.care-side-office {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-purple) !important;
  font-weight: 800;
  text-decoration: none !important;
  border: 0;
}
.care-side-office:hover { filter: brightness(.97); }
.care-shell:not(.is-pinned) .care-side-office .care-side-txt { display: none; }
.care-shell:not(.is-pinned) .care-side-office { justify-content: center; padding: .55rem .4rem; }

.care-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.care-more-sheet[hidden] { display: none !important; }
.care-more-sheet.is-open { pointer-events: auto; }
.care-more-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 18, 40, .45);
  cursor: pointer;
}
.care-more-panel {
  position: relative;
  width: min(100%, 520px);
  max-height: min(78vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: .85rem .85rem calc(.95rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(20, 18, 40, .18);
  transform: translateY(108%);
  transition: transform .22s ease;
}
.care-more-sheet.is-open .care-more-panel { transform: translateY(0); }
.care-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.care-more-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
}
.care-more-grid a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fafbfd;
  color: var(--ink);
  text-decoration: none;
  min-height: 52px;
}
.care-more-grid a.is-active,
.care-more-grid a:hover {
  border-color: #9ec9d8;
  background: #f0f9fb;
}
.care-more-grid a.is-office-exit {
  background: #3d2463;
  color: #fff;
  border-color: #3d2463;
}
.care-more-grid a.is-office-exit small { color: rgba(255,255,255,.8); }
.care-more-grid a.is-office-exit:hover {
  background: #4a2d78;
  border-color: #4a2d78;
  color: #fff;
}
.care-more-grid strong { display: block; font-size: .95rem; }
.care-more-grid small { display: block; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.care-more-ico {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f4e9fb, #e8f7fc);
  color: var(--teal-dark);
  flex-shrink: 0;
  font-size: 1rem;
}

.visit-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 .75rem;
}

.mob-day-cards {
  display: grid;
  gap: .55rem;
}
.mob-day-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .75rem;
  background: #fff;
}
.mob-day-card.is-open,
.mob-day-card.timesheet-row--schedule { background: #fffaf0; }
.mob-day-card.has-service { background: #f7fbf8; }
.mob-day-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .55rem;
}
.mob-day-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}
.mob-day-card .mob-day-grid:has(> :nth-child(4)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mob-day-grid span {
  display: block;
  font-size: .68rem;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mob-day-grid strong {
  display: block;
  margin-top: .15rem;
  font-size: .95rem;
}
.mob-day-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem .8rem;
  border-radius: 12px;
  background: #eef7f4;
  border: 1px solid #c6e4d8;
  font-weight: 700;
}

.sig-status--need {
  color: #b42318;
  font-weight: 700;
}

/* Chat bubbles */
.chat-stream {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  max-height: min(55vh, 520px);
  overflow: auto;
  padding: .35rem .15rem;
  -webkit-overflow-scrolling: touch;
}
.care-chat-stream { max-height: min(48vh, 420px); }
.chat-bubble {
  max-width: min(92%, 520px);
  padding: .7rem .85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.chat-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, #f4e9fb, #e8f7fc);
  border-color: #d8c4ec;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: #fff;
}
.chat-who {
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: .25rem;
  font-weight: 650;
}
.chat-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .95rem;
}

/* Wound body diagram */
.wound-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin-bottom: .75rem;
}
.wound-view-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .55rem .8rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.wound-view-btn.active {
  background: linear-gradient(135deg, #f4e9fb, #e8f7fc);
  color: var(--teal-dark);
  border-color: #c9b0e0;
}
.wound-diagram-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .75rem .5rem .55rem;
  margin-bottom: 1rem;
  text-align: center;
}
.wound-svg {
  width: min(100%, 240px);
  height: auto;
  touch-action: manipulation;
  cursor: crosshair;
  display: block;
  margin: 0 auto;
}
.wound-hotspots rect:hover { fill: rgba(91, 58, 140, .08); }
.wound-marker {
  fill: var(--brand-purple, #6b3fa0);
  stroke: #fff;
  stroke-width: 2;
  pointer-events: none;
}
.wound-marker.draft { fill: var(--teal, #1aa6b8); }
.wound-marker.saved { fill: #c0392b; opacity: .9; }
.wound-hint { margin: .45rem 0 0; text-align: center; }
.wound-card-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: baseline;
  margin-bottom: .25rem;
}
.wound-mini-map {
  width: 56px;
  height: 110px;
  flex-shrink: 0;
}
.wound-row {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}

/* ========== WhatsApp-style Chat ========== */
.admin-main--wa {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  height: calc(100vh - 0px);
  max-height: 100dvh;
  overflow: hidden;
}
.admin-main--wa .admin-appbar { flex-shrink: 0; margin: 0; }
.admin-main--wa > .flash { margin: .5rem .75rem 0; flex-shrink: 0; }

.wa-app {
  --wa-teal: #008069;
  --wa-teal-deep: #075e54;
  --wa-teal-soft: #25d366;
  --wa-panel: #fff;
  --wa-bg: #efeae2;
  --wa-mine: #d9fdd3;
  --wa-border: #e9edef;
  --wa-muted: #667781;
  --wa-ink: #111b21;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 38%) 1fr;
  background: #f0f2f5;
  border-top: 1px solid var(--wa-border);
}

.wa-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--wa-panel);
  border-right: 1px solid var(--wa-border);
}
.wa-side-head, .wa-m-head, .wa-chat-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  background: #f0f2f5;
  border-bottom: 1px solid var(--wa-border);
  min-height: 60px;
}
.wa-side-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--wa-ink);
  font-size: 1.05rem;
}
.wa-icon-btn {
  border: 0;
  background: transparent;
  color: #54656f;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.wa-icon-btn:hover { background: rgba(0,0,0,.06); color: #54656f; text-decoration: none; }
.wa-icon-btn-light { color: #fff; }
.wa-icon-btn-light:hover { background: rgba(255,255,255,.12); color: #fff; }

.wa-avatar {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6b8f71, #008069);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.wa-avatar-self { background: linear-gradient(145deg, #53bdeb, #008069); width: 40px; height: 40px; font-size: .82rem; }

.wa-search {
  padding: .55rem .75rem;
  background: #fff;
  border-bottom: 1px solid var(--wa-border);
}
.wa-search input {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #f0f2f5;
  padding: .55rem .9rem;
  font: inherit;
  outline: none;
}
.wa-search-m { background: var(--wa-teal-deep); border: 0; padding: .35rem .75rem .75rem; }
.wa-search-m input { background: #fff; }

.wa-new {
  padding: .65rem .75rem;
  background: #f7f8fa;
  border-bottom: 1px solid var(--wa-border);
}
.wa-new-form { display: grid; gap: .45rem; }
.wa-new-form select,
.wa-new-form input,
.wa-new-form textarea {
  width: 100%;
  border: 1px solid var(--wa-border);
  border-radius: 8px;
  padding: .55rem .7rem;
  font: inherit;
  background: #fff;
}
.wa-send-pill {
  border: 0;
  border-radius: 24px;
  background: var(--wa-teal);
  color: #fff;
  font-weight: 700;
  padding: .55rem 1rem;
  cursor: pointer;
}
.wa-send-pill:hover { filter: brightness(1.05); }

.wa-list {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.wa-row {
  display: flex;
  gap: .75rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid #f0f2f5;
  text-decoration: none !important;
  color: inherit;
  align-items: center;
}
.wa-row:hover { background: #f5f6f6; }
.wa-row.is-active { background: #f0f2f5; }
.wa-row-main { flex: 1; min-width: 0; }
.wa-row-top, .wa-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}
.wa-row-name {
  font-weight: 650;
  color: var(--wa-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-row-time { color: var(--wa-muted); font-size: .75rem; flex-shrink: 0; }
.wa-row-preview {
  color: var(--wa-muted);
  font-size: .86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.wa-check { color: #53bdeb; margin-right: .15rem; }
.wa-unread {
  background: var(--wa-teal-soft);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .35rem;
  flex-shrink: 0;
}
.wa-empty-list {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--wa-muted);
  font-size: .92rem;
}

.wa-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--wa-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.35'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.wa-pane-empty {
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  background-image: none;
}
.wa-empty-state {
  text-align: center;
  max-width: 420px;
  padding: 2rem;
  color: var(--wa-muted);
}
.wa-empty-state h2 {
  margin: .5rem 0;
  color: #41525d;
  font-weight: 350;
  font-size: 1.8rem;
  font-family: var(--display), Georgia, serif;
}
.wa-empty-state p { margin: 0; line-height: 1.5; }
.wa-empty-icon { font-size: 3rem; opacity: .7; }

.wa-chat-head {
  background: #f0f2f5;
  flex-shrink: 0;
}
.wa-chat-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.wa-chat-meta strong {
  color: var(--wa-ink);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-chat-meta span {
  color: var(--wa-muted);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-back {
  display: none;
  color: #54656f;
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none !important;
  padding: 0 .15rem 0 0;
  font-weight: 300;
}

.wa-stream {
  flex: 1;
  overflow: auto;
  padding: 1rem 3.5% 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  -webkit-overflow-scrolling: touch;
}
.wa-day {
  align-self: center;
  background: #fff;
  color: var(--wa-muted);
  font-size: .78rem;
  padding: .35rem .7rem;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  margin: .5rem 0;
}
.wa-bubble {
  max-width: min(75%, 520px);
  padding: .35rem .55rem .2rem .65rem;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
  position: relative;
  margin-bottom: .15rem;
}
.wa-bubble.mine {
  align-self: flex-end;
  background: var(--wa-mine);
  border-top-right-radius: 0;
}
.wa-bubble.theirs {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 0;
}
.wa-bubble-who {
  font-size: .75rem;
  font-weight: 700;
  color: #06cf9c;
  margin-bottom: .1rem;
}
.wa-bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--wa-ink);
  font-size: .95rem;
  line-height: 1.4;
  padding-right: 3.2rem;
}
.wa-bubble-meta {
  float: right;
  margin: -.15rem 0 0 .5rem;
  color: var(--wa-muted);
  font-size: .68rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.wa-ticks { color: #53bdeb; letter-spacing: -.12em; }

.wa-composer {
  flex-shrink: 0;
  padding: .45rem .6rem .55rem;
  background: #f0f2f5;
  border-top: 1px solid var(--wa-border);
}
.wa-composer-inner {
  display: flex;
  align-items: flex-end;
  gap: .45rem;
}
.wa-composer textarea {
  flex: 1;
  resize: none;
  border: 0;
  border-radius: 24px;
  padding: .7rem 1rem;
  font: inherit;
  max-height: 120px;
  background: #fff;
  outline: none;
  line-height: 1.35;
  min-height: 44px;
}
.wa-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--wa-teal);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.wa-send:hover { filter: brightness(1.06); }

/* Care mobile WhatsApp */
.care-shell--wa .care-body--wa {
  padding: 0;
  background: #fff;
}
.care-shell--wa-thread {
  background: var(--wa-bg, #efeae2);
}
.care-shell--wa-thread .care-body--wa {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}
.wa-mobile {
  --wa-teal: #008069;
  --wa-teal-deep: #075e54;
  --wa-teal-soft: #25d366;
  --wa-mine: #d9fdd3;
  --wa-muted: #667781;
  --wa-ink: #111b21;
  --wa-bg: #efeae2;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  background: #fff;
}
.wa-mobile-thread {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--wa-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.35'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.wa-m-head {
  background: var(--wa-teal-deep);
  color: #fff;
  border-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.wa-m-head strong { flex: 1; font-size: 1.15rem; }
.wa-m-head-chat .wa-back { display: inline-block; color: #fff; }
.wa-m-head-chat .wa-chat-meta strong { color: #fff; }
.wa-m-head-chat .wa-chat-meta span { color: rgba(255,255,255,.8); }
.wa-m-head-chat .wa-avatar { width: 40px; height: 40px; font-size: .8rem; }
.wa-stream-m {
  flex: 1;
  padding: .75rem .7rem 1rem;
}
.wa-composer-m {
  position: sticky;
  bottom: 0;
  background: #f0f2f5;
}

@media (max-width: 900px) {
  .wa-app {
    grid-template-columns: 1fr;
  }
  .wa-app.is-thread-open .wa-sidebar { display: none; }
  .wa-app:not(.is-thread-open) .wa-pane { display: none; }
  .wa-back { display: inline-block; }
  .wa-chat-head { background: var(--wa-teal-deep); }
  .wa-chat-head .wa-back { color: #fff; }
  .wa-chat-head .wa-chat-meta strong { color: #fff; }
  .wa-chat-head .wa-chat-meta span { color: rgba(255,255,255,.8); }
  .admin-main--wa { height: auto; max-height: none; min-height: calc(100vh - 56px); }
  .wa-app { min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); }
}

/* ========== Responsive create modals ========== */
.page-toolbar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
.page-toolbar .spacer { flex: 1 1 auto; min-width: .5rem; }
.page-toolbar .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0 .4rem;
  margin-left: .3rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.35rem;
  background: rgba(15, 23, 42, .08);
  color: inherit;
}
.page-toolbar .btn-primary .filter-count {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}
.page-toolbar .filter-warn:not(.btn-primary) {
  color: #b42318;
  border-color: rgba(180, 35, 24, .25);
}
.page-toolbar .filter-warn:not(.btn-primary) .filter-count {
  background: rgba(180, 35, 24, .12);
  color: #b42318;
}

.abc-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}
.abc-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}
.abc-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(18, 12, 28, .48);
  opacity: 0;
  transition: opacity .2s ease;
  cursor: pointer;
}
.abc-modal.is-open .abc-modal-backdrop { opacity: 1; }
.abc-modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(92dvh, 920px);
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(20, 10, 40, .22);
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.abc-modal.is-open .abc-modal-panel { transform: translateY(0); }
.abc-modal-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.abc-modal-head h2 {
  margin: 0;
  flex: 1;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--teal-dark);
  line-height: 1.2;
}
.abc-modal-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f0f2f5;
  color: #41525d;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.abc-modal-x:hover { background: #e6e9ee; }
.abc-modal-body {
  padding: 1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.abc-modal-body .form-grid { margin: 0; }
.abc-modal-body .btn-primary,
.abc-modal-body .btn-danger {
  width: 100%;
  margin-top: .25rem;
}
.workforce-modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: .15rem;
}
.workforce-modal-actions .btn {
  width: auto;
  min-width: 8.5rem;
  margin-top: 0;
}
.workforce-impact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .15rem .7rem;
  align-items: baseline;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #fff8f7;
  border: 1px solid #f0c9c4;
  color: #6f2d26;
}
.workforce-impact strong {
  font-size: 1.55rem;
  line-height: 1;
  color: var(--danger);
}
.workforce-impact span { font-weight: 650; }
.workforce-impact p {
  grid-column: 1 / -1;
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}
.status-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1rem;
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.status-callout.is-danger {
  background: #fff8f7;
  border-color: #f0c9c4;
}
.status-callout.is-ok {
  background: #f3faf6;
  border-color: #cde8d8;
}
.status-callout.is-warn {
  background: #fffdf8;
  border-color: #f0d9a8;
}
.status-callout-copy {
  flex: 1 1 16rem;
  min-width: 0;
}
.status-callout-copy strong { display: block; }
.status-callout-copy p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.training-chip-row { margin-bottom: .75rem; }
@media (max-width: 719px) {
  .workforce-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .workforce-modal-actions .btn { width: 100%; min-width: 0; }
}
body.abc-modal-open { overflow: hidden; }

.abc-confirm .abc-confirm-panel {
  width: min(420px, 100%);
}
.abc-confirm-copy {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.45;
}
.abc-confirm-copy[hidden] { display: none; }
.abc-confirm-prompt {
  margin: 0 0 1rem;
}
.abc-confirm-prompt label {
  display: block;
  margin-bottom: .35rem;
  font-weight: 600;
}
.abc-confirm-prompt textarea {
  width: 100%;
  min-height: 5.5rem;
}
.abc-confirm-error { margin-top: .4rem; color: var(--danger); }
.abc-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}
.abc-confirm-actions .btn-primary,
.abc-confirm-actions .btn-danger {
  width: auto;
  min-width: 7.5rem;
  margin-top: 0;
}
@media (max-width: 719px) {
  .abc-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .abc-confirm-actions .btn { width: 100%; }
}

@media (min-width: 720px) {
  .abc-modal {
    align-items: center;
    padding: 1.25rem;
  }
  .abc-modal-panel {
    border-radius: 16px;
    transform: translateY(18px) scale(.98);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
    max-height: min(86vh, 860px);
    box-shadow: 0 18px 50px rgba(20, 10, 40, .28);
  }
  .abc-modal.is-open .abc-modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  .abc-modal-body { padding: 1.15rem 1.2rem 1.25rem; }
  .abc-modal-body .btn-primary { width: auto; min-width: 9rem; }
}

/* ========== Smart address picker ========== */
.addr-picker {
  margin-top: 1.15rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfafd 0%, #fff 42%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.addr-picker-head h3 {
  margin: 0 0 .2rem;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--teal-dark);
}
.addr-picker-head .help { margin: 0 0 .85rem; }
.addr-search-wrap { position: relative; margin-bottom: .85rem; }
.addr-search-row { position: relative; }
.addr-search-row input {
  width: 100%;
  padding-right: 2.4rem;
  border-radius: 12px;
  border: 1px solid #d7d0e4;
  background: #fff;
  font: inherit;
  padding: .75rem 2.4rem .75rem .9rem;
}
.addr-search-row input:focus {
  outline: 2px solid rgba(107, 63, 160, .25);
  border-color: #b79ad4;
}
.addr-search-ico {
  position: absolute;
  right: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  pointer-events: none;
}
.addr-suggestions {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + .35rem);
  z-index: 30;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(40, 20, 70, .14);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.addr-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: .7rem .85rem;
  cursor: pointer;
  border-bottom: 1px solid #f0eef5;
}
.addr-suggestion:last-child { border-bottom: 0; }
.addr-suggestion:hover,
.addr-suggestion:focus {
  background: #f7f2fb;
  outline: none;
}
.addr-suggestion strong {
  display: block;
  color: var(--ink);
  font-size: .92rem;
  margin-bottom: .15rem;
}
.addr-suggestion span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}
.addr-empty {
  padding: .8rem;
  color: var(--muted);
  font-size: .88rem;
}
.addr-status {
  min-height: 1.2rem;
  margin-top: .4rem;
  font-size: .8rem;
  color: var(--muted);
}
.addr-status.is-error { color: var(--danger); }
.addr-fields { margin-top: .25rem; }
.addr-map-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.addr-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
  background: #f7f5fb;
}
.addr-map-toolbar strong { font-size: .92rem; color: var(--ink); }
.addr-coords { margin: .1rem 0 0; font-variant-numeric: tabular-nums; }
.addr-map {
  height: 240px;
  width: 100%;
  background: #e8eef2;
}
.addr-map-hint {
  margin: 0;
  padding: .55rem .85rem .7rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.client-form-card { overflow: visible; }

@media (max-width: 720px) {
  .addr-picker { padding: .85rem; border-radius: 14px; }
  .addr-map { height: 210px; }
  .addr-map-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .addr-map-toolbar .btn { width: 100%; }
}

/* Name + phone polish */
.phone-split {
  display: grid;
  grid-template-columns: minmax(7.5rem, 9.5rem) 1fr;
  gap: .45rem;
  align-items: stretch;
}
.phone-split .phone-national {
  width: 100%;
  min-width: 0;
}
.phone-code-wrap {
  position: relative;
}
.phone-code-btn {
  width: 100%;
  height: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
}
.phone-code-btn:hover { border-color: #c9b0e0; }
.phone-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  flex-shrink: 0;
}
.phone-code-text { flex: 1; text-align: left; font-variant-numeric: tabular-nums; }
.phone-chevron { color: var(--muted); font-size: .75rem; }
.phone-code-menu {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + .35rem);
  z-index: 40;
  width: min(320px, 85vw);
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(40, 20, 70, .16);
  scrollbar-width: thin;
}
.phone-code-option {
  width: 100%;
  display: grid;
  grid-template-columns: 22px auto 1fr;
  align-items: center;
  gap: .55rem;
  border: 0;
  background: #fff;
  padding: .6rem .75rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-bottom: 1px solid #f0eef5;
}
.phone-code-option:last-child { border-bottom: 0; }
.phone-code-option:hover,
.phone-code-option.is-active {
  background: #f7f2fb;
}
.phone-opt-code {
  font-weight: 750;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 2.6rem;
}
.phone-opt-name {
  color: var(--muted);
  font-size: .86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-field label { display: block; margin-bottom: .35rem; }
.addr-state-select {
  font-weight: 600;
}
.addr-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  justify-content: flex-end;
}
.addr-layer-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.addr-layer-btn {
  border: 0;
  background: transparent;
  padding: .4rem .75rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.addr-layer-btn.is-active {
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  color: #fff;
}
.addr-map-frame {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #0f1720;
  padding: .55rem;
}
.addr-map {
  height: 300px !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.addr-pin {
  background: transparent;
  border: 0;
}
.addr-pin-dot {
  display: block;
  width: 18px;
  height: 18px;
  margin: 4px auto 0;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #e11d48;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.addr-flash {
  animation: addrFlash .9s ease;
}
@keyframes addrFlash {
  0% { box-shadow: 0 0 0 0 rgba(37, 166, 184, .55); border-color: #25a6b8; }
  100% { box-shadow: 0 0 0 10px rgba(37, 166, 184, 0); }
}
.addr-map-actions .btn[disabled] { opacity: .6; cursor: wait; }

@media (max-width: 720px) {
  .phone-split { grid-template-columns: minmax(6.75rem, 8rem) 1fr; }
  .addr-map { height: 240px !important; }
  .addr-map-actions { justify-content: stretch; }
  .addr-map-actions .btn,
  .addr-layer-toggle { width: 100%; justify-content: center; }
  .addr-layer-toggle { display: grid; grid-template-columns: 1fr 1fr; border-radius: 10px; }
}

/* Employee register / edit — compact mobile-first layout */
.emp-form-card { padding: 1rem; }
.emp-form-wrap { display: flex; flex-direction: column; gap: 0; }
.emp-form { display: flex; flex-direction: column; gap: .85rem; }
.emp-form-section {
  padding: .75rem .8rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfd;
}
.emp-form-title {
  margin: 0 0 .65rem;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: inherit;
}
.emp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem .55rem;
}
.emp-form-grid.emp-name-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.emp-form-grid > .emp-span-2 { grid-column: 1 / -1; }
.emp-addr-picker {
  margin-top: 0;
}
.emp-form .emp-addr-picker .addr-picker-head h3 {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: inherit;
  font-weight: 700;
  color: var(--teal-dark);
}
.emp-form .emp-addr-picker .phone-field { margin: 0; }
.emp-form-rates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.emp-form .phone-field { margin: 0; }
.emp-form label { margin-bottom: .28rem; font-size: .78rem; }
.emp-form input,
.emp-form select,
.emp-form textarea {
  padding: .58rem .7rem;
  border-radius: 9px;
  font-size: .92rem;
}
.emp-notes {
  min-height: 4.5rem;
  width: 100%;
  margin: 0;
}
.emp-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  margin-top: 1rem;
  padding-top: .15rem;
}
.emp-form-actions .btn {
  width: 100%;
  min-height: 2.75rem;
  font-size: .92rem;
}
.emp-form-actions .btn-primary { grid-column: 1 / -1; }
.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;
}

@media (min-width: 720px) {
  .emp-form-card { padding: 1.15rem 1.25rem; }
  .emp-form { gap: 1rem; }
  .emp-form-section { padding: .9rem 1rem 1rem; }
  .emp-form-actions {
    display: flex;
    justify-content: flex-start;
    gap: .55rem;
  }
  .emp-form-actions .btn {
    width: auto;
    min-width: 9.5rem;
  }
  .emp-form-actions .btn-primary { grid-column: auto; }
}

@media (max-width: 380px) {
  .emp-form-rates { grid-template-columns: 1fr 1fr; }
  .emp-form-rates > :last-child { grid-column: 1 / -1; }
  .emp-form-grid.emp-name-grid { grid-template-columns: 1fr; }
  .emp-form-section { padding: .65rem .7rem .75rem; }
  .emp-form input,
  .emp-form select { padding: .52rem .6rem; font-size: .88rem; }
}


/* Care PWA + geofence */
.care-pwa-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .85rem;
  background: #eef6f6;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
}
.care-pwa-bar--mobile {
  position: sticky;
  top: 52px;
  z-index: 28;
  background: rgba(238, 246, 246, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.care-pwa-bar--desk {
  background: transparent;
  border: 0;
  padding: 0;
  margin-right: .35rem;
}
@media (min-width: 900px) {
  .care-pwa-bar--mobile { display: none !important; }
}
@media (max-width: 899px) {
  .care-pwa-bar--desk { display: none !important; }
}
.care-conn-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 650;
  color: var(--muted);
}
.care-conn-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--ok);
}
.care-conn-pill.is-offline .care-conn-dot { background: var(--warn); }
.care-conn-pill.is-offline { color: #8a5a00; }
.care-sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
}
.care-sync-badge[hidden],
.nav-badge[hidden],
.admin-appbar-badge[hidden],
.badge-count[hidden],
.wa-unread[hidden],
.care-install-btn[hidden],
.care-pin-ico[hidden],
.nav-pin-ico[hidden],
[hidden] {
  display: none !important;
}
.care-install-btn {
  padding: .35rem .65rem !important;
  font-size: .75rem !important;
  min-height: 0;
}
.care-offline-toast {
  position: fixed;
  left: 50%;
  bottom: 4.5rem;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 360px);
  padding: .7rem 1rem;
  border-radius: 10px;
  background: #1c2b2b;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.care-offline-toast.is-error { background: var(--danger); }
.geo-status { margin: .55rem 0 .35rem; }
.geo-status-warn { color: #8a5a00; font-weight: 650; }
.geo-status-ok { color: var(--ok); font-weight: 650; }
.geo-override {
  margin: .55rem 0 .75rem;
  padding: .65rem .7rem;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
  background: #fff8eb;
}
.geo-override textarea {
  margin-top: .35rem;
  min-height: 3.2rem;
}
.geo-audit { line-height: 1.4; }

/* Chat read receipts + notification badges */
.wa-ticks.is-sent,
.wa-check.is-sent { color: #8696a0; }
.wa-ticks.is-read,
.wa-check.is-read { color: #53bdeb; }
.wa-ticks { letter-spacing: -.12em; }
.nav-badge,
.admin-appbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .3rem;
  margin-left: .35rem;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
}
.admin-nav .nav-links a { position: relative; }
.admin-nav.is-collapsed .nav-badge,
.admin-shell:not(.is-pinned) .nav-badge {
  position: absolute;
  top: .35rem;
  right: .2rem;
  margin: 0;
}
.admin-appbar-badge {
  position: absolute;
  top: .15rem;
  right: .1rem;
  margin: 0;
}

/* Type-to-search client picker */
.client-search { position: relative; }
.client-search-wrap { position: relative; }
.client-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem .8rem;
  font: inherit;
  background: #fff;
}
.client-search-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 40, 60, .12);
}
.client-search-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: .65rem .8rem;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}
.client-search-option:hover,
.client-search-option.is-active {
  background: #eef7f7;
}
.client-search-option.is-selected {
  font-weight: 700;
  color: var(--teal-dark);
}
.client-search-empty {
  padding: .75rem .8rem;
  color: var(--muted);
  font-size: .9rem;
}
.client-search .req { color: var(--danger); }
.care-shell .btn-ghost {
  padding: .35rem .7rem !important;
  font-size: .8rem !important;
  min-height: 0;
}

/* Smart location search (incident forms) */
.location-search { position: relative; }
.location-search-wrap { position: relative; }
.location-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem .8rem;
  font: inherit;
  background: #fff;
}
.location-search-menu {
  position: absolute;
  z-index: 45;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 40, 60, .12);
}
.location-search-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: .65rem .8rem;
  font: inherit;
  font-size: .9rem;
  line-height: 1.3;
  cursor: pointer;
  color: var(--ink);
}
.location-search-option:hover,
.location-search-option.is-active {
  background: #eef7f7;
}
.location-search-empty {
  padding: .75rem .8rem;
  color: var(--muted);
  font-size: .9rem;
}
.location-search-status.is-error { color: var(--danger); }

/* Admin mobile footer nav */
.admin-footer {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: #fff;
  border-top: 1px solid var(--line);
  padding: .35rem .1rem calc(.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(30, 20, 50, .06);
}
.admin-footer a,
.admin-footer-more {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: center;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 750;
  padding: .28rem .05rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.1;
  min-width: 0;
}
.admin-footer a.active,
.admin-footer a:hover,
.admin-footer-more:hover {
  color: var(--teal);
  text-decoration: none;
}
.admin-footer .ico {
  display: block;
  font-size: 1.05rem;
  margin-bottom: .1rem;
}
@media (min-width: 981px) {
  .admin-footer { display: none !important; }
}


/* Care form panels */
.care-form-page {
  max-width: none;
  width: 100%;
}
.care-form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .85rem;
  margin-bottom: 1rem;
}
.care-form-head h1 {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.care-form-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.35rem;
  box-shadow: 0 8px 24px rgba(30, 40, 60, .04);
}
.care-form-panel .visit-card {
  margin: 0;
}
.care-form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.25rem;
  align-items: center;
  padding: .15rem 0;
}
.care-form-checks label {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  margin: 0;
  font-weight: 550;
  color: var(--ink);
  font-size: .9rem;
}
.care-form-checks input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Care dashboard KPIs + earnings */
.care-kpi-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
@media (min-width: 900px) {
  .care-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.75rem), 1fr));
  }
}
.care-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .85rem;
}
.care-kpi-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 750;
}
.care-kpi-value {
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1.15;
  margin-top: .2rem;
  color: var(--ink);
}
.care-kpi-sub {
  margin-top: .25rem;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 550;
}
.care-panel-grid {
  display: grid;
  gap: .85rem;
  margin-bottom: .35rem;
  align-items: start;
}
@media (min-width: 980px) {
  .care-panel-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(240px, .85fr);
    align-items: start;
  }
}
.earnings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem .9rem;
}
.earnings-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .55rem;
}
.earnings-total-lbl {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 750;
}
.earnings-total strong {
  font-size: 1.45rem;
  color: var(--teal-dark);
}
.earnings-rows { display: grid; gap: .4rem; }
.earnings-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  font-size: .9rem;
  color: var(--ink);
}
.earnings-row strong { font-weight: 700; }
.earnings-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}
.care-banner-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin: .35rem 0 1rem;
  padding: .75rem .9rem;
  border-radius: 12px;
  background: #f3eef8;
  border: 1px solid #e0d4ef;
  color: var(--ink);
  text-decoration: none;
  font-size: .92rem;
}
.care-banner-link:hover { text-decoration: none; filter: brightness(.98); }
.care-banner-link span { color: var(--teal-dark); font-weight: 700; font-size: .85rem; }
.care-banner-link--onboard {
  background: linear-gradient(100deg, rgba(139, 61, 184, .1), rgba(46, 182, 232, .12));
  border-color: rgba(139, 61, 184, .2);
}

.onboard-card .onboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.onboard-pct {
  min-width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
  color: #6e2f9a;
  background: #f3e9fb;
  border: 2px solid rgba(139, 61, 184, .25);
}
.onboard-pct.is-done {
  color: #1f7a4d;
  background: #e7f7ee;
  border-color: rgba(31, 122, 77, .3);
}
.onboard-bar {
  height: 8px;
  border-radius: 99px;
  background: #e8eaf2;
  overflow: hidden;
  margin-top: .75rem;
}
.onboard-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b3db8, #2eb6e8);
  transition: width .25s ease;
}
.onboard-group {
  margin: 1rem 0 .45rem;
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #8b3db8;
}
.onboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .4rem;
}
.onboard-list li {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .65rem;
  border-radius: 10px;
  border: 1px solid #e6e8f0;
  background: #fbfafe;
}
.onboard-list li.is-done {
  background: #f3faf6;
  border-color: #d5ecdf;
}
.onboard-check {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  background: #fff;
  border: 1.5px solid #d5d8e6;
  color: #6b6f82;
}
.onboard-list li.is-done .onboard-check {
  background: #1f7a4d;
  border-color: #1f7a4d;
  color: #fff;
}
.onboard-item-main {
  flex: 1;
  min-width: 0;
}
.onboard-item-main strong {
  display: block;
  font-size: .92rem;
}
.onboard-waiting-pill {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #6b6f82;
  background: #f3f4f8;
  border: 1px solid #e2e4ee;
  border-radius: 999px;
  padding: .28rem .55rem;
  white-space: nowrap;
}
.onboard-list li.is-pending .onboard-item-main .help {
  color: #8a6a2b;
}

.dash-split {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 980px) {
  .dash-split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ========== Admin scheduling ========== */
.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem .85rem;
  align-items: center;
  margin-bottom: 1rem;
}
.schedule-week-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}
.schedule-week-label {
  font-size: .95rem;
  white-space: nowrap;
}
.schedule-range-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.schedule-range-presets .btn.is-active {
  background: rgba(107, 45, 150, .12);
  color: var(--brand-purple);
  border-color: rgba(107, 45, 150, .28);
  font-weight: 700;
}
.schedule-week-block {
  margin-bottom: 1.25rem;
}
.schedule-week-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin: .35rem 0 .65rem;
  padding: .45rem .15rem;
  border-bottom: 2px solid rgba(46, 182, 232, .35);
}
.schedule-week-block-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--brand-purple);
}
.schedule-day.is-empty {
  opacity: .78;
  padding: .75rem 1rem;
}
.schedule-day.is-today {
  box-shadow: 0 0 0 2px rgba(46, 182, 232, .28);
}
.care-week-block-head {
  margin: 1rem 0 .5rem;
}
.schedule-create-btn {
  flex: 0 0 auto;
}
.schedule-inline-form {
  display: flex;
  gap: .35rem;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}
.schedule-row-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.schedule-board {
  table-layout: fixed;
  width: 100%;
}
.schedule-board th,
.schedule-board td {
  padding: .55rem .55rem;
  vertical-align: middle;
}
.schedule-board .col-time { width: 11.5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.schedule-board .col-client { width: 18%; }
.schedule-board .col-service { width: 12%; }
.schedule-board .col-assign { width: auto; }
.schedule-inline-form select {
  width: auto;
  min-width: 7.5rem;
  max-width: 11rem;
  padding: .28rem .45rem;
  font-size: .8rem;
  border-radius: 7px;
  line-height: 1.2;
}
.schedule-inline-form .btn-sm,
.schedule-row-actions .btn-sm {
  padding: .28rem .55rem !important;
  font-size: .75rem !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto;
}
.schedule-del {
  color: var(--danger) !important;
  border-color: #f0c9c4 !important;
}
.schedule-filter {
  margin: 0;
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-width: 0;
}
.schedule-filter select {
  padding: .4rem .55rem;
  font-size: .85rem;
  border-radius: 8px;
  max-width: 12rem;
}
.schedule-pdf-form {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  flex: 0 0 auto;
}
.schedule-pdf-form select {
  padding: .4rem .55rem;
  font-size: .85rem;
  border-radius: 8px;
  max-width: 13.5rem;
}
.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;
}
.schedule-cards {
  display: none;
}
.schedule-day h2 {
  font-size: 1.05rem;
}

@media (min-width: 1100px) {
  .schedule-board .col-time { width: 12rem; }
  .schedule-board .col-client { width: 22%; }
  .schedule-inline-form select { max-width: 13rem; }
}

@media (max-width: 820px) {
  .schedule-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .schedule-week-nav {
    justify-content: space-between;
  }
  .schedule-week-label {
    flex: 1 1 auto;
    text-align: center;
    font-size: .88rem;
  }
  .schedule-week-nav .btn {
    padding: .5rem .7rem;
  }
  .schedule-filter,
  .schedule-create-btn {
    width: 100%;
  }
  .schedule-table {
    display: none !important;
  }
  .schedule-cards {
    display: grid;
    gap: .75rem;
  }
  .schedule-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfefe;
    padding: .85rem;
  }
  .schedule-card-top {
    display: flex;
    justify-content: space-between;
    gap: .65rem;
    align-items: flex-start;
  }
  .schedule-card-time {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .15rem;
  }
  .schedule-card-client {
    display: block;
    font-size: 1rem;
    line-height: 1.25;
  }
  .schedule-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    margin: .55rem 0 .75rem;
    font-size: .85rem;
    color: var(--muted);
  }
  .schedule-card-form {
    display: grid;
    gap: .55rem;
  }
  .schedule-card-form label {
    display: block;
    margin-bottom: .2rem;
    font-size: .75rem;
    color: var(--muted);
  }
  .schedule-card-form select,
  .schedule-card-form input {
    width: 100%;
  }
  .schedule-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-top: .15rem;
  }
  .schedule-card-actions .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .schedule-week-label {
    font-size: .8rem;
  }
  .schedule-day h2 {
    font-size: .98rem;
  }
}

/* ========== Smart pagination ========== */
.abc-pager {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}
.abc-pager--solo { border-top: 0; padding-top: 0; }
.abc-pager-meta {
  font-size: .85rem;
  color: var(--muted);
}
.abc-pager-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.abc-pager-list a,
.abc-pager-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 .55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
}
.abc-pager-list a:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  text-decoration: none;
}
.abc-pager-list .is-active span {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.abc-pager-list .is-disabled span {
  opacity: .45;
  background: #f3f6f6;
}
@media (max-width: 520px) {
  .abc-pager { flex-direction: column; align-items: stretch; }
  .abc-pager-list { justify-content: center; }
}

/* ========== Care schedule week ========== */
.care-schedule-head { margin-bottom: .75rem; }
.care-schedule-head h1 { margin: 0 0 .2rem; font-family: var(--display); font-size: 1.45rem; }
.care-schedule-toolbar { margin-bottom: .85rem; }
.care-schedule-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: 1rem;
}
.care-schedule-day {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .85rem .85rem;
  margin-bottom: .7rem;
}
.care-schedule-day.is-today {
  border-color: #c9b6e8;
  box-shadow: 0 0 0 1px rgba(139, 61, 184, .08);
}
.care-schedule-day.is-empty {
  opacity: .72;
  padding-bottom: .65rem;
}
.schedule-empty-toggle {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 .55rem;
}
.hours-card-glance {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  margin-top: .75rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
}
.hours-card-glance.mob-only {
  display: grid !important;
}
@media (min-width: 900px) {
  .hours-card-glance.mob-only { display: none !important; }
}
.hours-card-glance span {
  display: block;
  font-size: .68rem;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hours-card-glance strong {
  display: block;
  margin-top: .15rem;
  font-size: 1rem;
}
.mobile-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .8rem;
  background: #fff;
}
.mobile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .35rem;
}
.care-schedule-day-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-bottom: .55rem;
}
.care-schedule-day-head h2 {
  margin: 0;
  font-size: .98rem;
  font-family: var(--display);
  font-weight: 650;
}
.care-schedule-list { display: grid; gap: .55rem; }
.care-schedule-item {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: .65rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfefe;
}
.care-schedule-item.is-open {
  background: #fffaf0;
  border-color: #f0dfb0;
}
.care-schedule-time {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: .12rem;
}
.care-schedule-item-main { min-width: 0; flex: 1 1 12rem; }
.care-schedule-item-main strong { display: block; font-size: .95rem; line-height: 1.25; }
.care-schedule-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  flex: 0 0 auto;
}
.care-schedule-open-label {
  margin: .7rem 0 .4rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: .03em;
}
@media (min-width: 900px) {
  .care-schedule { max-width: 920px; }
  .care-schedule-item {
    align-items: center;
    flex-wrap: nowrap;
  }
  .care-schedule-item-side {
    flex-direction: row;
    align-items: center;
    gap: .55rem;
  }
}
@media (max-width: 560px) {
  .care-schedule-kpis { grid-template-columns: 1fr; }
  .care-schedule-item-side { align-items: stretch; width: 100%; }
  .care-schedule-item-side .visit-actions { justify-content: stretch; }
  .care-schedule-item-side .visit-actions .btn { flex: 1; }
}

/* ========== Care alerts inbox ========== */
.care-alert-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .85rem 0 1rem;
}
.care-alerts-list {
  display: grid;
  gap: .55rem;
}
.care-alert-row {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.care-alert-row.is-unread {
  border-color: #d9c4f0;
  background: linear-gradient(180deg, #fbf7ff, #fff);
}
.care-alert-row.is-read {
  opacity: .88;
}
.care-alert-main {
  flex: 1 1 14rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.care-alert-main:hover { text-decoration: none; }
.care-alert-top {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .2rem;
}
.care-alert-top strong,
.care-alert-title { font-size: .95rem; }
.care-alert-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: .28rem;
  color: #b45309;
  font-size: .92rem;
  line-height: 1;
  vertical-align: -0.05em;
}
.care-alert-when {
  margin-top: .35rem;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 650;
}
.care-alert-actions {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
}
@media (min-width: 900px) {
  .care-alert-row { align-items: center; flex-wrap: nowrap; }
}
@media (max-width: 560px) {
  .care-alert-actions { width: 100%; }
  .care-alert-actions .btn { flex: 1; }
}

/* ========== Admin list filters ========== */
.list-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.list-filter-bar input[type="search"],
.list-filter-bar select {
  width: auto;
  min-width: 0;
  flex: 1 1 10rem;
  max-width: 18rem;
  padding: .45rem .65rem;
  font-size: .88rem;
  border-radius: 8px;
}
.list-filter-bar .spacer { flex: 1 1 auto; min-width: .5rem; }
@media (max-width: 640px) {
  .list-filter-bar input[type="search"],
  .list-filter-bar select {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* ========== Attention / hire notices (compact pills, not full-width cards) ========== */
.attn-banner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .65rem;
  width: auto;
  max-width: 100%;
  margin: 0 .55rem .75rem 0;
  padding: .32rem .7rem .32rem .4rem;
  border-radius: 999px;
  border: 1px solid #e6d7b8;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 1px rgba(28, 26, 40, .05);
  vertical-align: top;
  line-height: 1.2;
  align-self: start;
  justify-self: start;
}
.attn-banner:hover {
  text-decoration: none;
  border-color: #d4b57a;
  background: #fffdf8;
}
.attn-banner__dot {
  flex: 0 0 auto;
  width: .52rem;
  height: .52rem;
  border-radius: 50%;
  background: #c47f17;
}
.attn-banner strong {
  color: var(--ink);
  font-size: .84rem;
  font-weight: 750;
  white-space: nowrap;
}
.attn-banner span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}
.attn-banner--alert { border-color: #f0c2bc; }
.attn-banner--alert .attn-banner__dot { background: #c0392b; }
.attn-banner--alert:hover { border-color: #e39a92; background: #fff8f7; }
.attn-banner--ok { border-color: #c5e6d1; }
.attn-banner--ok .attn-banner__dot { background: #1f8a4c; }
.attn-list { display: grid; gap: .55rem; }
.attn-row {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.attn-row:hover { text-decoration: none; border-color: #c9b6e8; }
.attn-row.severity-high {
  border-color: #f0b4ae;
  background: linear-gradient(180deg, #fff6f5, #fff);
}
.attn-row.severity-medium {
  border-color: #f0dfb0;
  background: linear-gradient(180deg, #fffaf0, #fff);
}
.attn-row-top {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .45rem;
  align-items: center;
  margin-bottom: .2rem;
}
.attn-row-main { flex: 1 1 16rem; min-width: 0; }
.attn-row-side {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex: 0 0 auto;
}
.care-cred-banner {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid #f0c9a0;
  background: #fff8ef;
}
.care-cred-banner ul {
  margin: .45rem 0 .65rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: .9rem;
}

/* Guided notification cards */
.guide-card {
  margin: 0 0 .85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 1px rgba(28, 26, 40, .04);
  overflow: hidden;
}
.guide-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: .9rem 1rem .75rem;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.guide-card__identity {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 12rem;
}
.guide-card__icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
  background: #f3f4f8;
  color: var(--muted);
}
.guide-card__titles { min-width: 0; }
.guide-card__title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink);
}
.guide-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 .4rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 750;
  line-height: 1;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
  background: rgba(28,26,40,.08);
  color: var(--ink);
}
.guide-card__body {
  margin: .28rem 0 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
  white-space: pre-wrap;
}
.guide-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  flex: 0 0 auto;
}
.guide-card__bullets {
  margin: 0;
  padding: .55rem 1rem .85rem 1.9rem;
  color: var(--muted);
  font-size: .9rem;
}
.guide-card__tasks {
  display: grid;
  gap: 0;
}
.guide-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-top: 1px solid rgba(0,0,0,.045);
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: background .15s ease;
}
.guide-task:first-child { border-top: 0; }
.guide-task:hover { background: #fafbfd; text-decoration: none; }
.guide-task:active { background: #f4f6fa; }
.guide-task__main { min-width: 0; flex: 1 1 auto; }
.guide-task__title {
  font-weight: 700;
  font-size: .93rem;
  color: var(--ink);
  line-height: 1.3;
}
.guide-task__meta {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .82rem;
}
.guide-task__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .4rem;
}
.guide-chip {
  display: inline-flex;
  align-items: center;
  padding: .18rem .45rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.2;
  background: #f3eef8;
  color: #6e2f9a;
  border: 1px solid #e4d5f2;
}
.guide-task__cta {
  flex: 0 0 auto;
  font-size: .82rem;
  font-weight: 750;
  color: var(--teal-dark, #0d7ea8);
  white-space: nowrap;
}
.guide-card__more {
  display: block;
  width: 100%;
  padding: .7rem 1rem;
  border: 0;
  border-top: 1px solid rgba(0,0,0,.05);
  background: #fafbfd;
  color: var(--teal-dark, #0d7ea8);
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.guide-card__more:hover { background: #f4f6fa; }

.guide-card--warn {
  border-color: #f0c9a0;
  background: linear-gradient(180deg, #fffaf3 0%, #fff 42%);
}
.guide-card--warn .guide-card__icon { background: #fff1df; color: #b06a14; }
.guide-card--warn .guide-card__count { background: #f7dfbf; }

.guide-card--error {
  border-color: #f0b6b0;
  background: linear-gradient(180deg, #fff5f4 0%, #fff 42%);
}
.guide-card--error .guide-card__icon { background: #fde3e0; color: #b42318; }
.guide-card--error .guide-card__count { background: #f8d0cb; }
.guide-card--error .guide-chip {
  background: #fdecea;
  border-color: #f5c6c2;
  color: #9b2c2c;
}

.guide-card--info {
  border-color: rgba(139, 61, 184, .22);
  background: linear-gradient(180deg, rgba(139,61,184,.06) 0%, #fff 48%);
}
.guide-card--info .guide-card__icon { background: #f3eef8; color: #6e2f9a; }
.guide-card--info .guide-card__count { background: #e8dff3; }

.guide-card--ok {
  border-color: #b7e4c7;
  background: linear-gradient(180deg, #eefaf2 0%, #fff 42%);
}
.guide-card--ok .guide-card__icon { background: #dff3e7; color: #1f7a4d; }
.guide-card--ok .guide-card__count { background: #cfe9d9; }

.guide-card--compact {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  margin: 0 .55rem .75rem 0;
  vertical-align: top;
  border-radius: 999px;
  box-shadow: 0 1px 1px rgba(28, 26, 40, .05);
  align-self: start;
  justify-self: start;
}
.guide-card--compact .guide-card__head {
  padding: .28rem .4rem .28rem .45rem;
  border-bottom: 0;
  align-items: center;
  gap: .45rem .65rem;
  flex-wrap: nowrap;
}
.guide-card--compact .guide-card__identity {
  flex: 1 1 auto;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.guide-card--compact .guide-card__icon {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
}
.guide-card--compact .guide-card__icon svg {
  width: 13px;
  height: 13px;
}
.guide-card--compact .guide-card__title {
  font-size: .84rem;
  font-weight: 750;
}
.guide-card--compact .guide-card__body {
  display: inline;
  margin: 0 0 0 .35rem;
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-card--compact .guide-card__actions {
  flex: 0 0 auto;
}
.guide-card--compact .guide-card__actions .btn {
  min-height: 1.85rem;
  padding: .2rem .65rem;
  font-size: .75rem;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .guide-card--compact,
  .attn-banner {
    display: flex;
    width: 100%;
    margin-right: 0;
    border-radius: 12px;
  }
  .guide-card--compact .guide-card__head { flex-wrap: wrap; }
  .guide-card--compact .guide-card__body { display: block; margin: .15rem 0 0; white-space: normal; }
}

/* Legacy alias kept for any leftover classes */
.guided-banner { display: none; }

@media (max-width: 640px) {
  .guide-card__head { padding: .8rem .85rem .65rem; }
  .guide-card__actions { width: 100%; }
  .guide-card__actions .btn { flex: 1 1 auto; justify-content: center; }
  .guide-task { align-items: flex-start; padding: .7rem .85rem; }
  .guide-task__cta { margin-top: .15rem; }
}

@media (min-width: 900px) {
  .attn-row { align-items: center; flex-wrap: nowrap; }
}

/* Care forms list polish */
.care-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  padding: .9rem 1rem;
}
.care-form-row__main { min-width: 0; flex: 1 1 auto; }
.care-form-row__title {
  font-weight: 720;
  font-size: .98rem;
  line-height: 1.3;
}
.care-form-row__help {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .84rem;
}
.care-form-row__side {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .care-form-row {
    flex-direction: column;
    align-items: stretch;
  }
  .care-form-row__side {
    width: 100%;
    justify-content: space-between;
  }
  .care-form-row__side .btn { flex: 1 1 auto; text-align: center; }
}
.client-profile { max-width: none; width: 100%; }
.client-profile-hero {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1.25rem;
  justify-content: space-between;
  align-items: flex-end;
  margin: -.15rem 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 180px at 0% 0%, rgba(139,61,184,.08), transparent 60%),
    linear-gradient(165deg, #fff, #f7fbff);
  position: sticky;
  top: 0;
  z-index: 26;
  box-shadow: 0 8px 20px rgba(60, 30, 90, 0.06);
}
.admin-shell:has(.admin-top) .client-profile-hero {
  top: 4.5rem;
}
@media (max-width: 980px) {
  .client-profile-hero {
    top: 52px;
  }
  .admin-shell:has(.admin-top) .client-profile-hero {
    top: calc(52px + 4rem);
  }
}
.client-back {
  display: inline-block;
  font-size: .8rem;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: .35rem;
}
.client-profile-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .65rem;
  align-items: center;
}
.client-profile-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  line-height: 1.15;
  color: var(--ink);
}
.client-profile-sub {
  margin-top: .35rem;
  color: var(--muted);
  font-size: .9rem;
}
.client-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.client-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}
@media (min-width: 860px) {
  .client-profile-grid {
    grid-template-columns: 1fr 1fr;
  }
  .client-panel-span { grid-column: 1 / -1; }
}
.client-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .95rem 1rem;
  box-shadow: var(--shadow);
}
.client-panel h3 {
  margin: 0 0 .75rem;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 650;
}
.client-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: .75rem;
}
.client-panel-head h2,
.client-panel-head h3 { margin: 0; }
.client-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem .85rem;
  margin: 0;
}
.client-dl-full { grid-column: 1 / -1; }
.client-dl dt {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .15rem;
}
.client-dl dd {
  margin: 0;
  font-size: .95rem;
  line-height: 1.35;
  word-break: break-word;
}

/* Employee profile */
.emp-profile .emp-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem 1.25rem;
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line, #e1e5ef);
  border-radius: 14px;
  box-shadow: var(--shadow, 0 1px 2px rgba(28, 32, 48, .04));
}
.emp-hero-meta,
.emp-hero-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .55rem;
  color: var(--muted, #5f6173);
  font-size: .9rem;
}
.emp-hero-meta { margin-bottom: .45rem; color: var(--ink, #1c2030); font-weight: 600; }
.emp-hero-contacts a { color: #6e2f9a; text-decoration: none; font-weight: 600; }
.emp-hero-contacts a:hover { text-decoration: underline; }
.emp-dot { color: #b4b8c7; font-weight: 400; }
.emp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.emp-hero-actions form { display: inline; margin: 0; }
.emp-kpi-grid .emp-kpi-bar {
  margin-top: .45rem;
  height: 5px;
  border-radius: 999px;
  background: #eceff5;
  overflow: hidden;
}
.emp-kpi-grid .emp-kpi-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #26aae1, #8c378e);
}
.emp-sections { margin-bottom: 1rem; }
.emp-empty {
  color: #9aa3b5;
  font-style: italic;
  font-weight: 500;
  font-size: .88rem;
}
@media (max-width: 720px) {
  .emp-profile .client-dl { grid-template-columns: 1fr; }
}

.client-plan-text {
  margin: 0;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
}
.client-ec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .55rem;
}
.client-ec {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem .7rem;
  background: #fbfefe;
}
.client-ec strong { display: block; margin-bottom: .25rem; }
.client-section h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
}
.auth-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .9rem;
  margin: .75rem 0;
  background: #fbfefe;
}
.auth-block-top {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .55rem;
}
.auth-meter {
  height: 7px;
  border-radius: 999px;
  background: #e8eef5;
  overflow: hidden;
  margin-bottom: .7rem;
}
.auth-meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
}
.client-mini-kpis {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: .45rem;
  margin-bottom: .85rem;
}
.client-mini-kpis > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .5rem;
  background: #fff;
  text-align: center;
}
.client-mini-kpis .lbl {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.client-mini-kpis .val {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 650;
  margin-top: .1rem;
}
.auth-edit-form { margin: 0; }
.auth-edit-host { margin-top: .65rem; }
.auth-edit-panel[hidden] { display: none !important; }
.auth-edit-panel:not([hidden]) {
  margin-top: .65rem;
  border: 1px solid rgba(59, 130, 246, .45);
}
.auth-edit-actions {
  display: flex;
  align-items: flex-end;
  gap: .4rem;
  flex-wrap: wrap;
}
.client-add-panel {
  margin-top: .85rem;
  border-top: 1px dashed var(--line);
  padding-top: .65rem;
}
.client-add-panel summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--teal-dark);
  font-size: .9rem;
}
.client-lower-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 980px) {
  .client-lower-grid {
    grid-template-columns: minmax(240px, .85fr) minmax(0, 1.4fr);
    align-items: start;
  }
}
.client-doc-list {
  display: grid;
  gap: .4rem;
}
.client-doc-row {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: baseline;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfefe;
  color: inherit;
  text-decoration: none;
}
.client-doc-row:hover { text-decoration: none; border-color: #c9b6e8; }
.client-compact-table th,
.client-compact-table td {
  padding: .5rem .55rem;
  font-size: .88rem;
}
@media (max-width: 640px) {
  .client-dl { grid-template-columns: 1fr; }
  .client-mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-profile-hero { align-items: stretch; }
  .client-profile-actions { width: 100%; }
  .client-profile-actions .btn { flex: 1; }
}

/* Keep page actions clear of fixed mobile footers */
:root {
  --mobile-footer-clearance: 6.75rem;
}
@media (max-width: 980px) {
  .admin-main .page-toolbar,
  .admin-main .list-filter-bar,
  .admin-main .card:last-child,
  .admin-main .client-profile,
  .admin-main .dash-split,
  .admin-main .kpi-grid:last-of-type,
  .care-body .visit-card:last-child,
  .care-body .care-form-panel:last-child,
  .care-body .card:last-child,
  .care-body .care-schedule,
  .care-body .care-alerts-page {
    scroll-margin-bottom: calc(var(--mobile-footer-clearance, 6.75rem) + 1rem);
  }
  /* Forms ending with primary actions get extra room */
  .admin-main form .btn-primary:last-child,
  .care-body form .btn-primary:last-child,
  .admin-main .auth-edit-actions,
  .admin-main .form-actions-row,
  .care-body .visit-actions,
  .care-body .schedule-card-actions,
  .care-body .care-alert-actions {
    position: relative;
    z-index: 1;
    margin-bottom: .35rem;
  }
}
@media (min-width: 900px) {
  .care-body {
    /* desktop override keeps normal bottom padding (footer hidden) */
    padding-bottom: 1.5rem;
  }
}
@media (min-width: 981px) {
  :root { --mobile-footer-clearance: 0px; }
}

/* ========== US polish phase: mobile lists + filter chips ========== */
.desk-only { display: block; }
.mob-only { display: none !important; }
.mobile-card-list { display: none; }

.page-toolbar--chips {
  align-items: stretch;
}
.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}
.page-toolbar-cta {
  flex: 0 0 auto;
}

.mobile-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfefe;
  padding: .85rem;
}
.mobile-card-top {
  display: flex;
  justify-content: space-between;
  gap: .65rem;
  align-items: flex-start;
}
.mobile-card-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
}
a.mobile-card-title:hover { color: var(--teal-dark); }
.mobile-card-sub {
  margin-top: .15rem;
  font-size: .82rem;
  color: var(--muted);
}
.mobile-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  margin: .55rem 0 .65rem;
  font-size: .84rem;
  color: var(--muted);
}
.mobile-card-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .7rem;
  padding: .55rem .65rem;
  border-radius: 10px;
  background: #f3f1f8;
  font-size: .84rem;
}
.mobile-card-callout.is-warn {
  background: #fef3f2;
  color: #b42318;
}
.mobile-card-callout.is-ok {
  background: #ecfdf3;
  color: #067647;
}
.mobile-card-actions {
  display: flex;
  gap: .5rem;
}
.mobile-card-actions .btn { flex: 1; justify-content: center; }

.empty-state {
  text-align: left;
  padding: 1rem 1.05rem;
  border: 1px dashed #c8d0de;
  border-radius: 12px;
  background: #f6f8fb;
}
.empty-state strong { display: block; margin-bottom: .35rem; }
.empty-state p {
  margin: 0 0 .85rem;
  color: var(--muted);
  font-size: .9rem;
}

.care-quick-strip {
  display: none;
  gap: .45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: .15rem 0 .35rem;
  margin: 0 0 .85rem;
  scrollbar-width: none;
}
.care-quick-strip::-webkit-scrollbar { display: none; }
.care-quick-strip a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(40, 20, 70, .05);
}
.care-quick-strip a:active { background: #f5f3fa; }

@media (max-width: 899px) {
  .desk-only { display: none !important; }
  .mob-only { display: block !important; }
  .mobile-card-list.mob-only,
  .mobile-card-list {
    display: grid !important;
    gap: .75rem;
  }

  .page-toolbar--chips {
    flex-direction: column;
  }
  .filter-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .15rem;
    scrollbar-width: none;
  }
  .filter-chip-row::-webkit-scrollbar { display: none; }
  .filter-chip-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .page-toolbar-cta {
    width: 100%;
  }

  .care-quick-strip.mob-only {
    display: flex !important;
  }

  .admin-main .card form .btn-primary {
    margin-bottom: .25rem;
  }

  .weekly-mob-days {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .weekly-mob-days select {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .kpi .label {
    font-size: .58rem;
    line-height: 1.15;
  }
  .kpi .value { font-size: 1.15rem; }
  .mobile-card { padding: .75rem; }
}

/* Employee time-sheet (paper form alignment) */
.timesheet-grid th {
  background: #2eb6e8;
  color: #fff;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .03em;
}
.timesheet-grid tfoot td {
  border-top: 2px solid var(--border, #d5d8e4);
  background: #f7fbfe;
}
.timesheet-card h2,
.timesheet-cert h2 {
  margin-top: 0;
}
.timesheet-cert {
  margin-top: 1rem;
}
.timesheet-src {
  display: inline-block;
  margin-left: .35rem;
  padding: .08rem .35rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: #eef6fb;
  color: #2a8fbf;
  vertical-align: middle;
}
.timesheet-src--open {
  background: #fff4d6;
  color: #c47f17;
}
.ts-office-clock {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: flex-start;
  min-width: 11rem;
}
.ts-clock-panel {
  display: grid;
  gap: .4rem;
  width: min(100%, 16rem);
  margin-top: .35rem;
  padding: .55rem .65rem;
  background: #f7f4fb;
  border: 1px solid #e4d7f0;
  border-radius: 8px;
}
.ts-clock-panel[hidden] { display: none !important; }
.ts-clock-panel label {
  display: grid;
  gap: .2rem;
  font-size: .72rem;
  font-weight: 600;
  color: #5f6173;
}
.ts-clock-panel input {
  font-size: .82rem;
  padding: .35rem .45rem;
  border-radius: 6px;
  border: 1px solid #cfd5e2;
  width: 100%;
}
.ts-clock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.missed-assign select {
  max-width: 12rem;
  font-size: .82rem;
}
.timesheet-row--schedule td { color: #5f6173; }
.timesheet-row--empty td { color: #9aa0b5; }
.timesheet-row.is-open td { background: #fffaf0; }

/* ========== When I Work–inspired staff schedule / clock ========== */
.wiw-schedule { max-width: none; margin: 0; width: 100%; padding-bottom: 1rem; }

/* Care member dashboard */
.mdash { width: 100%; max-width: none; }
.mdash-top { margin-bottom: .85rem; }
.mdash-back {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: .45rem;
}
.mdash-back:hover { color: var(--teal-dark); text-decoration: none; }
.mdash-top-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem 1rem;
}
.mdash-identity h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
  font-family: var(--font);
}
.mdash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .45rem;
  align-items: center;
}
.mdash-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}
.mdash-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.mdash-alert {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: baseline;
  margin: 0 0 .85rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  background: #fdecea;
  border: 1px solid #f0c2bc;
  color: #8a1f18;
  font-size: .9rem;
}
.mdash-alert strong { font-weight: 800; }
.mdash-kpis {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: .55rem;
  margin-bottom: .85rem;
}
@media (min-width: 900px) {
  .mdash-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.75rem), 1fr)); }
}
.mdash-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .8rem;
  min-height: 4.6rem;
}
.mdash-kpi--accent {
  border-color: #9ec9d8;
  background: linear-gradient(165deg, #fff, #f0f9fd);
}
.mdash-kpi-label {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}
.mdash-kpi strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}
.mdash-kpi small {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
}
.mdash-kpi a { color: inherit; font-weight: 800; }
.mdash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  align-items: start;
}
@media (min-width: 980px) {
  .mdash-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, 300px);
    gap: 1rem 1.15rem;
  }
  .mdash-side {
    position: sticky;
    top: .75rem;
  }
}
.mdash-side {
  display: grid;
  gap: .75rem;
}
.mdash-panel,
.mdash-main {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem .9rem;
}
.mdash-main { padding: .85rem .65rem .75rem; }
.mdash-panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: .65rem;
}
.mdash-panel-h--flush {
  padding: 0 .4rem;
  margin-bottom: .45rem;
}
.mdash-panel-h h2 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.01em;
  font-family: var(--font);
}
.mdash-panel-h a {
  font-size: .8rem;
  font-weight: 750;
  text-decoration: none;
}
.mdash-count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
}
.mdash-addr {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
}
.mdash-muted { margin: 0; color: var(--muted); font-size: .88rem; }
.mdash-side-note {
  margin: .55rem 0 0;
  font-size: .84rem;
  display: grid;
  gap: .1rem;
}
.mdash-side-note span {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.mdash-facts {
  margin: 0;
  display: grid;
  gap: .65rem;
}
.mdash-facts > div { min-width: 0; }
.mdash-facts dt {
  margin: 0 0 .12rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.mdash-facts dd {
  margin: 0;
  font-size: .88rem;
  line-height: 1.4;
  color: var(--ink);
}
.mdash-pre { white-space: pre-wrap; }
.mdash-empty {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.mdash-empty .ops-empty {
  padding: 1.15rem .35rem 1.35rem;
}
.mdash-empty p {
  margin: 0 0 .65rem;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.4;
}
.mdash-empty--wide { margin: 0 .4rem .4rem; }
.mdash-empty-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.mdash-foot {
  margin: .65rem 0 0;
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.35;
}
.mdash-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mdash-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 560px;
}
.mdash-col-when { width: 28%; }
.mdash-col-svc { width: 28%; }
.mdash-col-status { width: 18%; }
.mdash-col-act { width: 26%; }
.mdash-table th {
  text-align: left;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .5rem .65rem;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}
.mdash-table td {
  padding: .72rem .65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: .9rem;
}
.mdash-table tr:last-child td { border-bottom: 0; }
.mdash-table tr.is-next { background: #eef8fd; }
.mdash-table tr.is-live { background: #f3fcf7; }
.mdash-day {
  display: block;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.2;
}
.mdash-time {
  display: block;
  margin-top: .12rem;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 650;
}
.mdash-col-actions {
  text-align: right;
  white-space: nowrap;
}
.mdash-col-actions .btn { margin-left: .25rem; }
.mdash-table--compact td { padding: .55rem .65rem; }

.mem-client-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.mem-client-card:hover {
  text-decoration: none;
  border-color: #9ec9d8;
  background: #f7fcfc;
}
.mem-client-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  font-family: var(--font);
}
.mem-client-meta { color: var(--muted); font-size: .84rem; }
.mem-client-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .15rem;
}
.mem-client-next {
  margin-top: .25rem;
  font-size: .84rem;
  font-weight: 700;
  color: var(--teal-dark);
}
.mem-empty-card {
  background: #f7f9fc;
  border: 1px dashed #c9d2e0;
  border-radius: 14px;
  padding: 1rem 1.05rem;
}
.mem-empty-card strong { display: block; font-size: .98rem; margin-bottom: .35rem; }
.mem-empty-card p {
  margin: 0 0 .75rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}
.mem-contact {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
@media (max-width: 720px) {
  .mdash-top-actions { width: 100%; }
  .mdash-top-actions .btn { flex: 1 1 auto; justify-content: center; }
  .mdash-main { padding: .75rem .35rem; }
  .mdash-col-actions .btn-sm { padding: .35rem .5rem; }
}

/* Shared ops dashboard (Care + Admin) */
.ops { width: 100%; max-width: none; }
.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: flex-end;
  margin-bottom: .85rem;
  padding: .75rem .85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ops-toolbar .ops-field { flex: 1 1 12rem; min-width: 0; }
.ops-toolbar label {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .25rem;
}
.ops-toolbar input,
.ops-toolbar select { width: 100%; }
.ops-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.ops-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem .65rem .75rem;
  margin-bottom: .85rem;
}
.ops-panel > h2,
.ops-panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin: 0 0 .55rem;
  padding: 0 .25rem;
}
.ops-panel > h2,
.ops-panel-h h2 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.01em;
  font-family: var(--font);
}
.ops-panel .table-wrap,
.ops-panel > .mdash-table-wrap { border: 0; border-radius: 0; mask-image: none; -webkit-mask-image: none; }
.ops-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ops-table th {
  text-align: left;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .5rem .65rem;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}
.ops-table td {
  padding: .72rem .65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: .9rem;
}
.ops-table tr:last-child td { border-bottom: 0; }
.ops-table .col-actions,
.ops-table td.col-actions,
.table-wrap td.col-actions,
.table-wrap th.col-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.ops-table .col-actions .btn,
.table-wrap td.col-actions .btn { margin-left: .2rem; }
.ops-day { display: block; font-weight: 800; line-height: 1.2; }
.ops-sub { display: block; margin-top: .12rem; font-size: .8rem; color: var(--muted); font-weight: 650; }
.ops-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  align-items: start;
}
@media (min-width: 980px) {
  .ops-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, 300px);
    gap: 1rem 1.15rem;
  }
  .ops-rail { position: sticky; top: .75rem; display: grid; gap: .75rem; }
}
.ops-rail { display: grid; gap: .75rem; }
.admin-main > .ops,
.admin-main .client-profile,
.admin-main .kpi-grid,
.admin-main .dash-split { max-width: none; width: 100%; }

/* Care pages fill the content pane (no centered narrow column) */
.care-body > .adl-page,
.care-body > .care-form-page,
.care-body > .care-alerts-page,
.care-body > .mdash,
.care-body > .ops,
.care-body .wiw-ts-overview,
.care-body .wiw-schedule {
  max-width: none !important;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}
.care-alerts-page {
  max-width: none;
  width: 100%;
}
.wiw-sched-head { margin-bottom: .65rem; }
.wiw-sched-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.wiw-sched-head h1 {
  margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
  font-family: var(--font);
}
.wiw-week-nav { display: inline-flex; align-items: center; gap: .35rem; }
.wiw-week-nav strong { font-size: .92rem; min-width: 7.5rem; text-align: center; }
.wiw-icon-btn {
  width: 2rem; height: 2rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; box-sizing: border-box;
  background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 1.25rem;
  text-decoration: none; font-weight: 700;
}
.wiw-icon-btn:hover { background: var(--teal-soft); text-decoration: none; }
.wiw-range-pills { display: flex; gap: .35rem; margin-top: .55rem; flex-wrap: wrap; }
.wiw-range-pills a {
  padding: .28rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: #fff; border: 1px solid var(--line); color: var(--muted); text-decoration: none;
}
.wiw-range-pills a.is-on {
  background: var(--teal); border-color: var(--teal); color: #fff;
}
.wiw-active-banner {
  display: flex; align-items: center; gap: .65rem; padding: .75rem .9rem; margin: .75rem 0;
  background: linear-gradient(135deg, #e8f9ef, #f3fcf7); border: 1px solid #b7e4c7;
  border-radius: 14px; text-decoration: none; color: inherit;
}
.wiw-active-banner:hover { text-decoration: none; }
.wiw-active-banner strong { display: block; font-size: .95rem; }
.wiw-active-banner small { color: var(--muted); font-size: .8rem; }
.wiw-active-dot {
  width: .7rem; height: .7rem; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 4px rgba(31,138,76,.18); flex: 0 0 auto;
}
.wiw-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: .85rem 0 .55rem;
  background: #eef0f6; border-radius: 12px; padding: .25rem;
}
.wiw-tabs--scroll {
  display: flex;
  grid-template-columns: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: .25rem;
}
.wiw-tabs--scroll::-webkit-scrollbar { display: none; }
.wiw-tabs--scroll a {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: .55rem .75rem;
}
.wiw-tabs a {
  text-align: center; padding: .55rem .4rem; border-radius: 10px; font-weight: 750; font-size: .9rem;
  color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
}
.wiw-tabs a.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(30,20,50,.08); }
.wiw-tabs em {
  font-style: normal; font-size: .72rem; background: var(--teal-soft); color: var(--teal-dark);
  border-radius: 999px; padding: .05rem .4rem; font-weight: 800;
}
.wiw-tabs a.is-active em { background: var(--teal); color: #fff; }
.wiw-day-strip {
  display: flex; gap: .35rem; overflow-x: auto; padding: .35rem .15rem .55rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: .5rem;
}
.wiw-day-strip::-webkit-scrollbar { display: none; }
.wiw-day {
  flex: 1 0 3rem; min-width: 3rem; max-width: 3.6rem; text-align: center; padding: .45rem .2rem .55rem;
  border-radius: 14px; text-decoration: none; color: var(--ink); position: relative; background: transparent;
  scroll-snap-align: center;
}
.wiw-day:hover { text-decoration: none; background: #f0f2f8; }
.wiw-day-dow { display: block; font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.wiw-day-num {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  margin-top: .1rem;
  line-height: 1;
  min-height: 1.2em;
  font-variant-numeric: tabular-nums;
}
.wiw-day.is-today .wiw-day-num { color: var(--teal-dark); }
.wiw-day.is-selected {
  background: var(--teal); color: #fff;
}
.wiw-day.is-selected .wiw-day-dow,
.wiw-day.is-selected .wiw-day-num { color: #fff; }
.wiw-day-dot {
  width: .35rem; height: .35rem; border-radius: 50%; background: var(--teal);
  display: inline-block; margin-top: .2rem;
}
.wiw-day.is-selected .wiw-day-dot { background: #fff; }
.wiw-day-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  margin: .25rem 0 .65rem; padding: 0 .15rem;
}
.wiw-day-label strong { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.wiw-day-label span,
.wiw-day-label a { color: var(--muted); font-size: .85rem; font-weight: 650; }
.wiw-day-label a:hover { color: var(--teal-dark); text-decoration: none; }
.wiw-shift-list { display: grid; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.wiw-shift {
  display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; background: #fff;
}
.wiw-shift:last-child { border-bottom: 0; }
.wiw-shift:hover { background: #fafbfe; text-decoration: none; }
.wiw-shift.is-live { background: #f3fcf7; }
.wiw-shift.is-open { background: #fbf8ff; }
.wiw-shift-time {
  flex: 0 0 4.2rem; text-align: left;
}
.wiw-shift-time strong { display: block; font-size: 1rem; font-weight: 800; }
.wiw-shift-time span { color: var(--muted); font-size: .82rem; font-weight: 650; }
.wiw-shift-body { flex: 1; min-width: 0; }
.wiw-shift-body > strong { display: block; font-size: .98rem; line-height: 1.25; }
.wiw-shift-meta, .wiw-shift-status { display: block; font-size: .8rem; color: var(--muted); margin-top: .12rem; }
.wiw-shift-status { font-weight: 650; }
.wiw-chevron { color: #b0b4c6; font-size: 1.35rem; font-weight: 400; }
.wiw-empty { padding: 1.5rem 1rem; text-align: center; color: var(--muted); }
.wiw-empty strong { display: block; color: var(--ink); margin-bottom: .25rem; }
.wiw-hours-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .75rem; padding: .7rem 1rem; background: #eef0f6; border-radius: 12px;
  font-size: .88rem; font-weight: 700; color: var(--muted);
}
.wiw-hours-bar strong { color: var(--ink); font-size: 1.05rem; }
.wiw-doc-nudge {
  margin-top: .85rem; padding: .9rem 1rem; border-radius: 14px;
  background: #fff7ed; border: 1px solid #f0d2a8;
}
.wiw-doc-nudge strong { display: block; margin-bottom: .2rem; }
.wiw-doc-nudge p { margin: 0 0 .65rem; color: var(--muted); font-size: .88rem; }

.wiw-next-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 1rem 1.05rem 1.1rem; margin-bottom: 1rem;
  box-shadow: 0 10px 28px rgba(40, 30, 70, .06);
}
.wiw-next-kicker {
  font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-dark);
}
.wiw-next-time {
  font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: .25rem 0 .65rem; color: var(--ink);
}
.wiw-next-details {
  display: grid; gap: .45rem; margin-bottom: .9rem;
}
.wiw-next-details span { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wiw-next-details strong { font-size: .95rem; }
.wiw-next-actions { display: grid; gap: .45rem; }
.wiw-clock-btn {
  border-radius: 14px !important;
  font-size: 1.08rem !important;
  padding: 1.05rem 1.2rem !important;
  letter-spacing: .02em;
}
.wiw-shift-detail {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 1rem 1.05rem 1.1rem; margin-bottom: .75rem;
}
.wiw-shift-detail-kicker {
  font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-dark);
}
.wiw-shift-detail-time {
  margin: .2rem 0 .15rem; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em;
  font-family: var(--font);
}
.wiw-shift-detail-client {
  margin: 0 0 .75rem; font-size: 1.1rem; font-weight: 750; color: var(--ink);
  font-family: var(--font);
}
.wiw-shift-detail-grid {
  display: grid; gap: .55rem;
}
.wiw-shift-detail-grid span {
  display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.wiw-clock-card { margin-top: 0; }
.adl-page-head h1 { font-family: var(--font); font-weight: 800; }

/* Home top menu — client priorities */
.wiw-home-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  margin: 0 0 .85rem;
}
.wiw-home-hello {
  margin: 0; font-size: .85rem; font-weight: 700; color: var(--muted);
}
.wiw-home-title {
  margin: .1rem 0 0; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em;
  font-family: var(--font); color: var(--ink);
}
.wiw-home-glance {
  display: flex; gap: .75rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); font-weight: 650;
}
.wiw-home-glance strong { color: var(--ink); font-weight: 800; }
.wiw-home-menu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin: 0 0 1rem;
}
.wiw-home-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  padding: .85rem .75rem .8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  min-height: 5.6rem;
  box-shadow: 0 6px 18px rgba(40, 30, 70, .05);
  transition: border-color .15s ease, transform .15s ease;
}
.wiw-home-tile:hover { text-decoration: none; border-color: #9ec9d8; transform: translateY(-1px); }
.wiw-home-tile-ico {
  width: 1.85rem; height: 1.85rem; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; box-sizing: border-box;
  background: var(--teal-soft); color: var(--teal-dark);
  font-size: .95rem; margin-bottom: .35rem;
}
.wiw-home-tile strong { font-size: .92rem; font-weight: 800; line-height: 1.2; }
.wiw-home-tile small { font-size: .72rem; color: var(--muted); font-weight: 650; line-height: 1.25; }
.wiw-home-tile.is-live {
  border-color: #8fd0a8; background: linear-gradient(180deg, #f3fcf7, #fff);
}
.wiw-home-tile.is-live .wiw-home-tile-ico { background: #d9f5e4; color: var(--ok); }
.wiw-home-tile.is-ready {
  border-color: #7ec8e8; background: linear-gradient(180deg, #eef8fd, #fff);
}
.wiw-home-tile.is-warn {
  border-color: #f0d2a8; background: linear-gradient(180deg, #fff8ee, #fff);
}
.wiw-home-tile.is-warn .wiw-home-tile-ico { background: #ffe8c7; color: #c47f17; }
@media (max-width: 720px) {
  .wiw-home-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiw-home-tile { min-height: 5.2rem; }
}
@media (min-width: 900px) {
  .wiw-day { flex: 1 1 0; max-width: none; }
}

/* Daily docs checklist (WiW task list) */
.wiw-task-progress {
  height: 6px;
  border-radius: 999px;
  background: #e8ebf3;
  overflow: hidden;
  margin: 0 0 .65rem;
}
.wiw-task-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #5a9bb8);
  border-radius: 999px;
  transition: width .25s ease;
}
.wiw-task-list {
  display: grid;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: .85rem;
}
.wiw-task {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.wiw-task:last-child { border-bottom: 0; }
.wiw-task:hover { background: #fafbfe; text-decoration: none; }
.wiw-task-check {
  flex: 0 0 1.55rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 2px solid #c5cad8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  color: #fff;
  background: #fff;
}
.wiw-task.is-done .wiw-task-check {
  border-color: var(--teal);
  background: var(--teal);
}
.wiw-task.is-todo .wiw-task-check { background: #fff; }
.wiw-task-body { flex: 1; min-width: 0; }
.wiw-task-body strong { display: block; font-size: .95rem; font-weight: 800; }
.wiw-task-body small { display: block; color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.wiw-task.is-done .wiw-task-body strong { color: var(--ink); }
.wiw-more-tools {
  margin: .25rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: .35rem .85rem .85rem;
}
.wiw-more-tools > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 750;
  font-size: .88rem;
  color: var(--muted);
  padding: .55rem 0;
}
.wiw-more-tools > summary::-webkit-details-marker { display: none; }
.wiw-more-tools[open] > summary { color: var(--ink); }

/* Open-shift claim row */
.wiw-shift.wiw-shift--claim,
.wiw-shift.wiw-shift--actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .75rem 0 0;
}
.wiw-shift--claim .wiw-shift-link,
.wiw-shift--actions .wiw-shift-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex: 1;
  min-width: 0;
  padding: .9rem 0 .9rem 1rem;
  color: inherit;
  text-decoration: none;
}
.wiw-shift--claim .wiw-shift-link:hover,
.wiw-shift--actions .wiw-shift-link:hover { text-decoration: none; }
.wiw-claim-form { flex: 0 0 auto; margin: 0; }
.wiw-shift-actions {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 0 0 auto;
}
@media (min-width: 520px) {
  .wiw-shift-actions { flex-direction: row; }
}

/* Timesheet overview */
.wiw-ts-overview { max-width: none; margin: 0; width: 100%; }
.wiw-ts-week {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

/* Activity date row */
.wiw-act-dates {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .65rem 0 .85rem;
  flex-wrap: wrap;
}
.wiw-act-dates input[type="date"] {
  flex: 1 1 8rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .7rem;
  font: inherit;
  background: #fff;
}
.wiw-shift.is-docs { background: #fff8ee; }
.wiw-shift.is-docs .wiw-shift-status { color: #c47f17; font-weight: 750; }

/* Visit documentation wizard */
.wiw-doc-wizard { margin: 0 0 1rem; }
.wiw-doc-wizard-track {
  height: 4px;
  border-radius: 999px;
  background: #e8ebf3;
  overflow: hidden;
  margin-bottom: .55rem;
}
.wiw-doc-wizard-track > span {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}
.wiw-doc-wizard-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem;
}
.wiw-doc-wizard-steps li a,
.wiw-doc-wizard-steps li > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  padding: .35rem .15rem;
  border-radius: 10px;
}
.wiw-doc-wizard-steps li a:hover { text-decoration: none; background: #f4f7fb; }
.wiw-doc-wizard-steps em {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 2px solid #c5cad8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
  background: #fff;
}
.wiw-doc-wizard-steps .is-done em {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}
.wiw-doc-wizard-steps .is-current em {
  border-color: var(--teal-dark);
  color: var(--teal-dark);
}
.wiw-doc-wizard-steps .is-current a,
.wiw-doc-wizard-steps .is-current > span { color: var(--ink); }
.wiw-doc-wizard-steps .is-done a { color: var(--teal-dark); }

[data-live-timer] {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: .02em;
}

/* Care plan snapshot + ADL guidance */
.wiw-care-plan {
  margin: .75rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: .2rem .9rem .85rem;
}
.wiw-care-plan > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 750;
  font-size: .9rem;
  padding: .55rem 0;
  color: var(--ink);
}
.wiw-care-plan > summary::-webkit-details-marker { display: none; }
.wiw-care-plan-body p { margin: 0 0 .45rem; white-space: pre-wrap; font-size: .92rem; }
.wiw-care-plan-flags {
  margin: 0 0 .55rem;
  padding-left: 1.1rem;
  color: var(--danger);
  font-weight: 700;
  font-size: .88rem;
}
.adl-card--suggest {
  border-color: #9ec9d8;
  background: linear-gradient(180deg, #f3fafd, #fff);
}
.adl-suggest {
  display: inline-block;
  margin-left: .35rem;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--teal-dark);
  background: var(--teal-soft);
  padding: .1rem .35rem;
  border-radius: 6px;
  vertical-align: middle;
}

/* Today’s route strip */
.wiw-route { margin: .85rem 0 1.1rem; }
.wiw-route-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.wiw-route-stop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: .65rem;
  row-gap: .35rem;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
}
.wiw-route-stop:last-child { border-bottom: 0; }
.wiw-route-stop.is-next { background: #eef8fd; }
.wiw-route-stop.is-live { background: #f3fcf7; }
.wiw-route-stop.is-done { opacity: .62; }
.wiw-route-num {
  grid-row: 1;
  grid-column: 1;
  box-sizing: border-box;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #eef1f7;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.wiw-route-stop.is-next .wiw-route-num {
  background: var(--teal);
  color: #fff;
}
.wiw-route-main {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.wiw-route-main:hover { text-decoration: none; }
.wiw-route-main strong { display: block; font-size: .92rem; line-height: 1.25; }
.wiw-route-main small { display: block; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.wiw-route-stop > .btn {
  grid-row: 1;
  grid-column: 3;
  justify-self: end;
  align-self: center;
}

/* Under Clock in / Finish — always centered like the button */
.wiw-clock-cue {
  display: block;
  margin: .55rem 0 0;
  padding: .5rem .75rem;
  border-radius: 10px;
  text-align: center;
  font-size: .85rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--muted);
}
.wiw-clock-cue.is-late,
.wiw-clock-cue.wiw-late-tone {
  background: #fff4e8;
  border: 1px solid #f0d2a8;
  color: #9a5b10;
  font-weight: 750;
}
.wiw-clock-cue.is-early,
.wiw-clock-cue.wiw-early-tone {
  background: #f3f6fb;
  border: 1px solid var(--line);
  color: var(--muted);
}
.wiw-next-actions .wiw-clock-cue { margin-top: .35rem; }

/* Care-wide: secondary copy under full-width CTAs matches button centering */
.care-shell .btn-block + .help,
.care-shell .btn-block + p,
.care-shell .wiw-clock-btn + .help,
.care-shell .wiw-clock-btn + p,
.care-shell .geo-form > .help,
.care-shell .form-span-full > .btn.btn-primary.btn-lg + .help {
  text-align: center;
}
.care-shell .btn.btn-block,
.care-shell .wiw-clock-btn,
.care-shell .adl-savebar .btn {
  text-align: center;
  justify-content: center;
}

/* Harden circular counters / unread pills in care shell */
.care-shell .badge-count,
.care-shell .wa-unread,
.care-shell .wiw-tabs em,
.care-shell .guide-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}
.care-shell .guide-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.care-shell .guide-card__actions .btn {
  justify-content: center;
  text-align: center;
}
.care-shell .guide-card--compact .guide-card__icon {
  width: 1.45rem;
  height: 1.45rem;
}
.care-shell .guide-card--compact .guide-card__actions .btn {
  min-height: 1.85rem;
  padding: .2rem .65rem;
}
.care-shell .care-kpi {
  text-align: left;
}
.care-shell .care-kpi-value {
  line-height: 1.15;
}

.wiw-late-cue {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: baseline;
  justify-content: flex-start;
  margin: .45rem 0 0;
  padding: .45rem .65rem;
  border-radius: 10px;
  background: #fff4e8;
  border: 1px solid #f0d2a8;
  font-size: .85rem;
  font-weight: 750;
  color: #9a5b10;
  text-align: left;
}
.wiw-late-cue .help { margin: 0; font-weight: 600; color: var(--muted); }
[data-countdown].is-soon { color: var(--teal-dark); font-weight: 800; }
[data-countdown].is-late { color: #9a5b10; font-weight: 800; }

.wiw-sticky-clock {
  display: none;
  position: fixed;
  left: .65rem;
  right: .65rem;
  bottom: calc(3.9rem + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  align-items: center;
  gap: .65rem;
  padding: .7rem .85rem;
  border-radius: 14px;
  background: #12353a;
  color: #fff;
  text-decoration: none;
  border: 1px solid #1e4d54;
}
.wiw-sticky-clock:hover { text-decoration: none; color: #fff; }
.wiw-sticky-clock-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: #3dd68c;
  flex: 0 0 auto;
}
.wiw-sticky-clock-txt { flex: 1; min-width: 0; }
.wiw-sticky-clock-txt strong { display: block; font-size: .9rem; line-height: 1.2; }
.wiw-sticky-clock-txt small { display: block; opacity: .8; font-size: .75rem; margin-top: .1rem; }
.wiw-sticky-clock-cta {
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: .9;
}
@media (max-width: 899px) {
  .wiw-sticky-clock { display: flex; }
  .care-bottom.has-sticky-clock { box-shadow: none; }
  html.has-sticky-clock .care-body {
    padding-bottom: calc(var(--mobile-footer-clearance, 8.5rem) + env(safe-area-inset-bottom, 0px));
  }
}

/* ========== Staff UI responsivity polish ========== */
.care-shell,
.care-body {
  overflow-x: clip;
  max-width: 100%;
}

@media (max-width: 899px) {
  .care-dash-rail {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }
  .care-dash-rail-more {
    margin-top: .35rem;
  }
  .wiw-sched-head h1 { font-size: 1.35rem; }
  .wiw-week-nav strong { min-width: 0; font-size: .85rem; }
  .wiw-next-time,
  .wiw-shift-detail-time { font-size: 1.35rem; }
  .wiw-shift {
    padding: .75rem .8rem;
    gap: .55rem;
  }
  .wiw-shift-time { flex: 0 0 3.6rem; }
  .wiw-shift-time strong { font-size: .92rem; }
  .wiw-shift--actions,
  .wiw-shift--claim {
    align-items: stretch;
  }
  .wiw-shift--actions .wiw-shift-link,
  .wiw-shift--claim .wiw-shift-link {
    padding: .75rem 0 .75rem .8rem;
  }
  .wiw-shift-actions {
    padding-right: .65rem;
    align-self: center;
  }
  .wiw-route-stop {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .wiw-route-stop > .btn {
    grid-row: 2;
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
  }
  .wiw-doc-wizard-steps li a,
  .wiw-doc-wizard-steps li > span {
    font-size: .68rem;
    padding: .25rem .1rem;
  }
  .wiw-doc-wizard-steps em {
    width: 1.4rem;
    height: 1.4rem;
    font-size: .72rem;
  }
  .visit-page-nav { gap: .35rem; }
  .visit-page-nav .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .wiw-clock-btn {
    font-size: 1rem !important;
    padding: .95rem 1rem !important;
  }
  .mob-day-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .wiw-home-menu { gap: .45rem; }
  .wiw-home-tile { padding: .7rem .65rem; min-height: 4.8rem; }
  .wiw-home-tile strong { font-size: .85rem; }
  .wiw-day {
    flex: 0 0 2.75rem;
    min-width: 2.75rem;
    max-width: 2.9rem;
    padding: .4rem .1rem .5rem;
  }
  .wiw-day-num { font-size: 1rem; }
  .wiw-shift--actions {
    flex-wrap: wrap;
  }
  .wiw-shift--actions .wiw-shift-link {
    flex: 1 1 100%;
    padding-right: .8rem;
  }
  .wiw-shift-actions {
    flex-direction: row;
    width: 100%;
    padding: 0 .8rem .7rem;
    justify-content: flex-end;
  }
  .wiw-doc-wizard-steps {
    gap: .2rem;
  }
  .wiw-doc-wizard-steps li a,
  .wiw-doc-wizard-steps li > span {
    font-size: .62rem;
    letter-spacing: -.01em;
  }
  .wiw-doc-wizard-steps em {
    width: 1.25rem;
    height: 1.25rem;
    font-size: .65rem;
  }
  .wiw-tabs a { font-size: .82rem; padding: .5rem .3rem; }
  .wiw-range-pills a { font-size: .72rem; padding: .25rem .55rem; }
}

@media (min-width: 900px) {
  .care-dash-rail-more {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
  }
  .care-dash-rail-more > summary { display: none; }
}

/* ========== Admin weekly schedule matrix (PDF-style) ========== */
.general-week-schedule {
  --gst-member-w: 10rem;
  --gst-staff-w: 9rem;
  margin-bottom: 1.25rem;
}
.general-week-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .65rem;
}
.general-week-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}
.general-week-sub { margin: .2rem 0 0; }
.general-week-legend { margin: 0; max-width: 22rem; text-align: right; }

.general-schedule-shell { position: relative; }
.general-schedule-hint {
  display: none;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .45rem;
  font-weight: 650;
}
.general-schedule-hint-ico {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: .75rem;
  font-weight: 800;
}

/* Own scroll surface — do NOT inherit hidden table-wrap scrollbars / fade-mask */
.general-schedule-wrap.table-wrap,
.general-schedule-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid #1f1f1f;
  border-radius: 10px;
  background: #fff;
  max-height: min(70vh, 820px);
  max-width: 100%;
  position: relative;
  scrollbar-width: thin; /* Firefox — visible cue */
  scrollbar-color: #9aa3b5 #eef1f6;
  -ms-overflow-style: auto;
  mask-image: none !important;
  -webkit-mask-image: none !important;
}
.general-schedule-wrap::-webkit-scrollbar {
  display: block !important;
  width: 8px;
  height: 8px;
}
.general-schedule-wrap::-webkit-scrollbar-thumb {
  background: #9aa3b5;
  border-radius: 999px;
}
.general-schedule-wrap::-webkit-scrollbar-track {
  background: #eef1f6;
}

.general-schedule-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.general-schedule-table th,
.general-schedule-table td {
  border: 1px solid #222;
  border-top: 0;
  border-left: 0;
  padding: .42rem .5rem;
  vertical-align: middle;
}
.general-schedule-table tr > *:first-child { border-left: 1px solid #222; }
.general-schedule-table thead th { border-top: 1px solid #222; }
.general-schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: #5b1f4a;
  background: #fff;
}
.general-schedule-table .gst-sticky {
  position: sticky;
  z-index: 2;
  background: #fff;
}
.general-schedule-table thead .gst-sticky { z-index: 6; background: #fff; }
.general-schedule-table tbody td.gst-member {
  vertical-align: middle;
  background: #fff;
  box-shadow: 4px 0 8px -6px rgba(20, 24, 40, .35);
}
.general-schedule-table .gst-member {
  left: 0;
  width: var(--gst-member-w);
  min-width: var(--gst-member-w);
  max-width: var(--gst-member-w);
  font-weight: 750;
  text-align: left;
}
.general-schedule-table .gst-member .gst-link-member {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.general-schedule-table .gst-member .gst-continuing {
  display: block;
  margin-top: .15rem;
  font-size: .68rem;
  font-weight: 600;
  color: #5a6478;
  white-space: normal;
  line-height: 1.25;
}
.general-schedule-table .gst-member .gst-status-badge,
.mobile-card .gst-status-badge {
  display: inline-block;
  margin-top: .28rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}
.general-schedule-table tbody td.gst-member.is-inactive-member {
  background: #fbf6f6;
}
.mobile-card.is-inactive-member {
  border-color: #f0c9c9;
  background: #fffafa;
}
.general-schedule-table .gst-staff {
  left: var(--gst-member-w);
  width: var(--gst-staff-w);
  min-width: var(--gst-staff-w);
  max-width: var(--gst-staff-w);
  font-weight: 650;
  text-align: left;
  border-right: 2px solid #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 4px 0 8px -6px rgba(20, 24, 40, .28);
}
.general-schedule-table thead .gst-staff { left: var(--gst-member-w); }
.general-schedule-table .gst-staff .gst-link-staff {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.general-schedule-table .gst-day {
  text-align: center;
  min-width: 5.4rem;
  line-height: 1.2;
}
.gst-day-label { display: block; }
.gst-day-date { display: none; }
.gst-day-date-full {
  display: block;
  font-size: .65rem;
  font-weight: 650;
  letter-spacing: 0;
  color: #6a5670;
  margin-top: .12rem;
}
.general-schedule-table .gst-day.is-today,
.general-schedule-table .gst-cell.is-today {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  z-index: 1;
}
.general-schedule-table .gst-day.is-today .gst-day-label::after {
  content: ' · today';
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--teal-dark);
}
.general-schedule-table .gst-cell {
  text-align: center;
  white-space: nowrap;
  font-weight: 650;
  font-size: .78rem;
}
.general-schedule-table .gst-cell.is-off {
  font-weight: 800;
  color: #6b6f80;
  letter-spacing: .04em;
}
.general-schedule-table .gst-cell.is-open-cell {
  color: #0f766e;
  font-weight: 800;
}
.general-schedule-table .gst-cell.is-on { color: var(--ink); }
.general-schedule-table .gst-cell.is-clickable {
  padding: 0;
  cursor: pointer;
}
.general-schedule-table .gst-cell-link {
  display: block;
  padding: .45rem .35rem;
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  border-radius: 6px;
}
.general-schedule-table .gst-cell.is-clickable:hover .gst-cell-link,
.general-schedule-table .gst-cell.is-clickable:focus-within .gst-cell-link {
  background: rgba(124, 58, 237, 0.12);
  outline: 2px solid rgba(124, 58, 237, 0.45);
  outline-offset: -2px;
}
.schedule-edit-release { color: #0f766e; font-weight: 700; }
.schedule-edit-day.is-release {
  outline: 1px solid rgba(13, 148, 136, 0.45);
  border-radius: 8px;
}
.general-schedule-table .gst-actions {
  text-align: center;
  white-space: nowrap;
  min-width: 4.5rem;
  position: sticky;
  right: 0;
  z-index: 3;
  background: #fff;
  border-left: 2px solid #222;
  box-shadow: -4px 0 8px -6px rgba(20, 24, 40, .35);
}
.general-schedule-table thead .gst-actions {
  z-index: 6;
  background: #fff;
}
.gst-edit-btn {
  min-height: 0 !important;
  padding: .28rem .55rem !important;
  font-size: .75rem !important;
}
.gst-link { text-decoration: none; font-weight: 750; }
.gst-link:hover { text-decoration: underline; }
.gst-link-member { color: #1f7a3f; }
.gst-link-staff { color: #2a6fdb; }
.gst-open { color: var(--muted); font-weight: 700; }
.general-schedule-table tbody tr:hover .gst-staff,
.general-schedule-table tbody tr:hover .gst-actions,
.general-schedule-table tbody tr:hover .gst-cell {
  filter: brightness(0.985);
}
.general-schedule-table .gst-empty {
  text-align: center;
  padding: 1rem;
}

/* Legacy mobile cards kept hidden */
.mob-schedule { display: none !important; }

@media (max-width: 899px) {
  .general-week-schedule {
    --gst-member-w: 7.25rem;
    --gst-staff-w: 7rem;
  }
  .general-week-legend { display: none; }
  .general-schedule-hint { display: inline-flex; }
  .schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
  }
  .schedule-week-nav {
    width: 100%;
    justify-content: space-between;
  }
  .schedule-week-label { font-size: .9rem; text-align: center; flex: 1; }
  .schedule-range-presets {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .15rem;
  }
  .schedule-filter { flex: 1 1 10rem; min-width: 0; }
  .schedule-filter select { width: auto; flex: 1 1 9rem; max-width: none; min-width: 0; }

  .general-schedule-wrap {
    max-height: none; /* page scrolls vertically; table scrolls horizontally */
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 8px;
  }
  .general-schedule-table {
    font-size: .74rem;
  }
  /* Only pin MEMBER + ACTION on phones so day columns stay visible */
  .general-schedule-table .gst-staff,
  .general-schedule-table thead .gst-staff {
    position: static;
    left: auto;
    box-shadow: none;
    border-right: 1px solid #222;
    width: var(--gst-staff-w);
    min-width: var(--gst-staff-w);
    max-width: var(--gst-staff-w);
  }
  .general-schedule-table .gst-day {
    min-width: 4.35rem;
    padding: .35rem .28rem;
  }
  .gst-day-date { display: block; font-size: .62rem; font-weight: 650; color: #6a5670; margin-top: .1rem; }
  .gst-day-date-full { display: none; }
  .general-schedule-table .gst-day.is-today .gst-day-label::after { content: ''; }
  .general-schedule-table .gst-day.is-today .gst-day-date::after {
    content: ' · today';
    color: var(--teal-dark);
  }
  .general-schedule-table .gst-cell { font-size: .7rem; padding: .35rem .25rem; }
  .general-schedule-table .gst-actions { min-width: 3.6rem; padding: .3rem .25rem; }
  .gst-edit-btn {
    padding: .42rem .5rem !important;
    font-size: .72rem !important;
    min-height: 36px !important;
  }
}

@media (max-width: 480px) {
  .general-week-schedule {
    --gst-member-w: 5.75rem;
    --gst-staff-w: 6.25rem;
  }
  .general-week-title { font-size: 1.02rem; }
  .general-schedule-table .gst-day { min-width: 3.85rem; }
  .general-schedule-table .gst-member,
  .general-schedule-table .gst-staff {
    font-size: .72rem;
    padding: .35rem .3rem;
  }
}

/* Edit week overlay */
.schedule-edit-summary {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .15rem;
}
.schedule-edit-days {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.schedule-edit-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .65rem .65rem;
  background: var(--day-bg, #fff);
  min-width: 0;
  overflow: hidden;
}
.schedule-edit-day.is-locked { opacity: .72; }
.schedule-edit-day.is-off .schedule-edit-times,
.schedule-edit-day.is-off .schedule-edit-staff-label { opacity: .45; }
.schedule-edit-day-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.schedule-edit-off {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  margin: 0;
}
.schedule-edit-day-head .schedule-edit-off:first-of-type {
  margin-left: auto;
}
.schedule-edit-release {
  color: #0f766e;
  font-weight: 700;
}
.schedule-edit-staff-label {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin: 0 0 .45rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}
.schedule-edit-staff-label select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 2.15rem;
  font-size: .82rem;
  padding: .35rem .45rem;
}
.schedule-edit-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .4rem;
  min-width: 0;
}
.schedule-edit-times label {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}
.schedule-edit-times input[type="time"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 2.2rem;
  font-size: .82rem;
  padding: .3rem .35rem;
}

@media (max-width: 520px) {
  .schedule-edit-days { grid-template-columns: minmax(0, 1fr); }
  .schedule-edit-times { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 720px) {
  .schedule-edit-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .schedule-edit-days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .schedule-edit-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}



/* ========== Admin global search ========== */
.admin-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 420px) auto;
  align-items: center;
  gap: .75rem;
}
.admin-top .help,
.admin-top-user {
  margin-left: 0;
  justify-self: end;
  white-space: nowrap;
}
.admin-search-launch {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.admin-search-launch:hover,
.admin-search-launch:focus-visible {
  border-color: #9bb7d8;
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(61, 111, 176, .12);
  outline: none;
}
.admin-search-launch-ico {
  display: inline-grid;
  place-items: center;
  color: #3d6fb0;
  flex-shrink: 0;
}
.admin-search-launch-txt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.admin-search-launch-kbd {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .18rem .4rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f4f6fa;
  color: var(--muted);
}
body.abc-search-open { overflow: hidden; }
.admin-search {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: max(12vh, 2rem) 1rem 2rem;
}
.admin-search.is-open { display: flex; }
.admin-search-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(18, 22, 36, .48);
  cursor: pointer;
}
.admin-search-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 24px 64px rgba(20, 16, 40, .28);
  overflow: hidden;
  z-index: 1;
}
.admin-search-bar {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.admin-search-ico {
  color: #3d6fb0;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.admin-search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  outline: none;
  padding: .15rem 0;
}
.admin-search-bar input::-webkit-search-cancel-button { appearance: none; }
.admin-search-esc {
  border: 1px solid var(--line);
  background: #f4f6fa;
  color: var(--muted);
  border-radius: 8px;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  padding: .28rem .45rem;
  cursor: pointer;
}
.admin-search-results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: .45rem;
}
.admin-search-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
}
.admin-search-empty p { margin: 0 0 .45rem; }
.admin-search-kbd { font-size: .85rem; }
.admin-search-kbd kbd,
.admin-search-foot-keys kbd {
  display: inline-block;
  min-width: 1.2rem;
  padding: .1rem .35rem;
  margin: 0 .1rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f4f6fa;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
}
.admin-search-group { margin-bottom: .35rem; }
.admin-search-group-label {
  padding: .45rem .65rem .25rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-search-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .7rem;
  border-radius: 10px;
  text-decoration: none !important;
  color: inherit;
}
.admin-search-item:hover,
.admin-search-item.is-active {
  background: #eef4fb;
}
.admin-search-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .12rem;
}
.admin-search-item-title {
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-search-item-meta {
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-search-item-type {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #3d6fb0;
  background: rgba(61, 111, 176, .1);
  border-radius: 999px;
  padding: .22rem .5rem;
}
.admin-search-foot {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  padding: .55rem .9rem;
  border-top: 1px solid var(--line);
  background: #fafbfd;
  color: var(--muted);
  font-size: .75rem;
}
.admin-search-foot-keys {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 980px) {
  .admin-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .admin-search-launch {
    grid-column: 1 / -1;
    order: 3;
    border-radius: 12px;
  }
  .admin-search-launch-kbd { display: none; }
  .admin-top-user { display: none; }
  .admin-search {
    padding: max(8vh, 1rem) .65rem 1rem;
  }
  .admin-search-foot-keys { display: none; }
}

/* ========== UI polish: flash, badges, sticky actions, focus ========== */
.flash-dismissible {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  transition: opacity .28s ease, transform .28s ease, max-height .28s ease, margin .28s ease, padding .28s ease;
  max-height: 12rem;
  overflow: hidden;
}
.flash-dismissible .flash-body { flex: 1; min-width: 0; }
.flash-dismissible.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}
.flash-close {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 8px;
  background: rgba(0,0,0,.06);
  color: inherit;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  opacity: .75;
}
.flash-close:hover { opacity: 1; background: rgba(0,0,0,.1); }
.flash-info {
  background: #eef4fb;
  color: #24558f;
  border-color: #c5d8ef;
}
.badge-muted {
  background: #eef0f4;
  color: #5b6472;
}

/* Sticky Actions column while scrolling wide tables */
.table-wrap th.col-actions,
.table-wrap td.col-actions,
.ops-table th.col-actions,
.ops-table td.col-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -8px 0 12px -10px rgba(40, 20, 70, .22);
}
.table-wrap thead th.col-actions,
.ops-table thead th.col-actions {
  z-index: 5;
  background: #fafbfd;
}
.table-wrap.table-wide thead th.col-actions { background: #f7f5fb; }
.table-wrap tbody tr:hover td.col-actions,
.ops-table tbody tr:hover td.col-actions {
  background: #faf8fd;
}

/* Clearer keyboard focus */
:focus-visible {
  outline: 2px solid #3d6fb0;
  outline-offset: 2px;
}
.btn:focus-visible,
.admin-search-launch:focus-visible,
.admin-appbar-ico:focus-visible,
.admin-nav a:focus-visible {
  outline: 2px solid #3d6fb0;
  outline-offset: 2px;
}
.admin-nav a:focus-visible {
  outline-color: #fff;
}

/* Empty table row cue */
.ops-table td[colspan] {
  color: var(--muted);
  font-size: .9rem;
  padding: 1.1rem .65rem;
}

/* ==========================================================================
   Phone pass — loaded last so it settles the earlier conflicting rules.
   ========================================================================== */

/* Checkboxes and radios must never inherit the full-width field rule. */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  accent-color: var(--brand-purple);
}

/* Modal actions have to clear the iPhone home indicator. */
.abc-modal-body {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 899px) {
  /* --- Office tables: scroll instead of squashing -----------------------
     `.ops-table` is `table-layout: fixed; width: 100%`, so the overflow on
     `.table-wrap` never had anything to scroll and `.col-actions` (width:1%)
     spilled over its neighbour. Sizing to content with a 100% floor keeps
     narrow tables full-width and lets wide ones scroll. */
  .table-wrap .ops-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }
  /* Bound runaway free-text columns so max-content stays sane. */
  .table-wrap .ops-table th,
  .table-wrap .ops-table td {
    max-width: 14rem;
    font-size: .82rem;
    padding: .6rem .55rem;
  }
  .table-wrap .ops-table th {
    font-size: .62rem;
    white-space: nowrap;
  }
  .table-wrap .ops-table td.col-actions,
  .table-wrap .ops-table th.col-actions {
    max-width: none;
    width: 1%;
  }
  .table-wrap .ops-table td[colspan] { max-width: none; }

  /* Restore the swipe cue that `.ops-panel` was cancelling. */
  .ops-panel .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ops-panel .table-wrap.is-scrollable:not(.is-at-end) {
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 24px), transparent 100%);
  }
  .table-wrap.is-scrollable { scrollbar-width: thin; }
  .table-wrap.is-scrollable::-webkit-scrollbar { display: block; height: 4px; }
  .table-wrap.is-scrollable::-webkit-scrollbar-thumb {
    background: #ccd4e2;
    border-radius: 999px;
  }
  /* Text cue above any table that actually overflows. */
  .ops-panel-h .table-swipe-hint { display: inline-flex; }

  /* --- Tap targets in the office shell ---------------------------------
     The 44px correction above only ever matched `.care-shell`. */
  .admin-main .btn {
    min-height: 44px !important;
    padding: .55rem .85rem !important;
    font-size: .85rem !important;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Rows would grow far too tall at 44px, so table actions get a smaller
     but still thumb-sized target. */
  .admin-main .ops-table .btn,
  .admin-main .mdash-table .btn,
  .admin-main td .btn {
    min-height: 36px !important;
    padding: .4rem .65rem !important;
    font-size: .78rem !important;
    border-radius: 9px;
  }
  .admin-nav .nav-close { width: 40px; height: 40px; }
  .admin-main .ops-toolbar input,
  .admin-main .ops-toolbar select,
  .admin-main .ops-field input,
  .admin-main .ops-field select {
    min-height: 44px;
  }

  /* --- Nothing may push the page sideways -------------------------------
     Grid/flex items default to `min-width: auto`, so a content-sized table
     stretches its whole column. `clip` is the backstop; unlike `hidden` it
     does not create a scrollport, so sticky headers keep working. */
  .admin-main { overflow-x: clip; }
  .ops-grid,
  .ops-grid > *,
  .ops-panel,
  .ops-rail,
  .ops-rail > * { min-width: 0; }

  /* A column flex container that also wraps sizes its line to the widest
     item, so `stretch` never clamps the chip row to the screen. */
  .page-toolbar--chips {
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .page-toolbar--chips > .filter-chip-row {
    width: 100%;
    max-width: 100%;
  }

  /* --- Toolbars stack instead of shrinking into slivers ----------------- */
  .ops-toolbar {
    padding: .65rem .7rem;
    gap: .5rem;
  }
  .ops-toolbar .ops-field { flex: 1 1 100%; }
  .ops-toolbar .ops-actions { flex: 1 1 100%; }
  .ops-toolbar .ops-actions .btn { flex: 1 1 auto; justify-content: center; }
  /* A long run of week/range buttons scrolls sideways rather than stacking
     into five rows. */
  .ops-actions.filter-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .15rem;
  }
  .ops-actions.filter-chip-row::-webkit-scrollbar { display: none; }
  .ops-toolbar .ops-actions.filter-chip-row > * { flex: 0 0 auto; white-space: nowrap; }
  .ops-toolbar .schedule-week-label { font-size: .88rem; }
  .ops-toolbar .schedule-filter { flex: 1 1 100%; min-width: 0; }
  .ops-toolbar .schedule-filter select { width: auto; flex: 1 1 9rem; max-width: none; min-width: 0; }
  .ops-toolbar .schedule-pdf-form { display: flex; flex: 1 1 100%; gap: .4rem; align-items: center; }
  .ops-toolbar .schedule-pdf-form select { flex: 1 1 auto; min-width: 0; }
  .ops-toolbar .ops-actions .schedule-create-btn { flex: 1 1 100%; justify-content: center; }

  /* --- Modals ----------------------------------------------------------- */
  .abc-modal-x { width: 44px; height: 44px; }
  .abc-modal-panel { max-height: min(94dvh, 920px); }

  /* Default 13px checkboxes are too small to hit reliably with a thumb. */
  input[type="checkbox"],
  input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
  }
}

@media (max-width: 980px) {
  /* --- Drawer must own the screen while open --------------------------- */
  .admin-nav-backdrop { z-index: 50; }
  .admin-shell.nav-open .admin-footer { display: none !important; }

  /* --- Sticky chrome condenses once you start scrolling -----------------
     Full heading + context at the top of the page, a slim title bar after. */
  .admin-top {
    transition: padding .16s ease;
    gap: .15rem;
  }
  .admin-top-context {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-size: .82rem;
    line-height: 1.35;
  }
  .admin-shell.is-scrolled .admin-top {
    padding-top: .3rem;
    padding-bottom: .3rem;
  }
  .admin-shell.is-scrolled .admin-top-context,
  .admin-shell.is-scrolled .admin-top-user,
  .admin-shell.is-scrolled .admin-top .admin-search-launch { display: none; }
  .admin-shell.is-scrolled .admin-top h1 { font-size: 1.05rem; }
}

@media (max-width: 640px) {
  /* --- Appbar sheds what the bottom nav already offers -------------------
     Dashboard/Attention/Chat are duplicated in the footer nav, and Sign out
     lives in the drawer. Dropping them buys real width for the rest. */
  .admin-shell.has-mobile-footer .admin-appbar-ico--dup { display: none; }
  .admin-appbar-out { display: none; }
  .admin-appbar-actions { gap: .35rem; }
  .admin-appbar-ico { width: 42px; height: 42px; }
  .admin-appbar-ico svg { width: 20px; height: 20px; }
}

@media (max-width: 520px) {
  /* Two-up on phones when two fit; a single leftover card still stretches full width. */
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr));
    gap: .5rem;
  }
  .kpi { padding: .6rem .65rem .55rem; min-height: 4rem; }
  .kpi .label { font-size: .68rem; }
  .kpi .value { font-size: 1.35rem; text-align: left; }
  .admin-footer a,
  .admin-footer-more { font-size: .66rem; }
}

/* ---- Phone tap targets ------------------------------------------------ */
@media (max-width: 899px) {
  /* The caregiver top bar mixed 29px, 36px and 44x29 controls. */
  .care-top .nav-icons a,
  .care-top .nav-icons .btn,
  .care-top .nav-icons button {
    min-width: 44px;
    min-height: 44px;
  }
  .care-top .nav-icons .btn,
  .care-top .nav-icons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Card titles are the primary way into a record, so give the anchor a
     thumb-sized hit area without changing how it looks. */
  .mobile-card-title {
    display: inline-block;
    padding: .3rem 0;
  }
}

/* ---- Phone day-at-a-time schedule ------------------------------------- */
.sched-day-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 0 .5rem;
  margin: 0 0 .35rem;
}
.sched-day-tabs::-webkit-scrollbar { display: none; }
.sched-day-tab {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: .05rem;
  min-width: 3.35rem;
  min-height: 44px;
  padding: .4rem .35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.sched-day-tab-lbl { font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sched-day-tab-date { font-size: .78rem; font-weight: 700; color: var(--ink); }
.sched-day-tab-count {
  font-size: .62rem;
  font-weight: 800;
  color: var(--muted);
}
.sched-day-tab.is-today { border-color: var(--teal); }
.sched-day-tab.is-active {
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  border-color: transparent;
  color: #fff;
}
.sched-day-tab.is-active .sched-day-tab-date,
.sched-day-tab.is-active .sched-day-tab-count { color: #fff; }
.sched-day-tab.is-locked,
.sched-day-tab:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: #eceff4;
  color: var(--muted);
}
.general-schedule-table .gst-day.is-locked,
.general-schedule-table .gst-cell.is-locked {
  color: var(--muted);
  opacity: .72;
}
.general-schedule-table .gst-day-locked {
  display: block;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: .15rem;
  color: #8a5a12;
}
.schedule-edit-day.is-locked {
  opacity: .55;
  pointer-events: none;
  background: #eceff4;
}
.sched-day-heading { margin: 0 .1rem .5rem; font-weight: 700; }
.sched-day-panel { display: grid; gap: .6rem; }
.sched-day-time { font-size: .85rem; white-space: nowrap; }
.mobile-card.is-open-shift { border-color: #f0c4c0; background: #fff8f7; }
.sched-grid-toggle { margin-top: .75rem; width: 100%; justify-content: center; }

@media (max-width: 899px) {
  /* The wide matrix stays available, but only when explicitly asked for. */
  .general-week-schedule .general-schedule-shell { display: none; }
  .general-week-schedule.show-week-grid .general-schedule-shell { display: block; }
}

@media (max-width: 480px) {
  /* Long staff names must not push the frozen columns wider than the phone. */
  .general-schedule-table .gst-staff .gst-link,
  .general-schedule-table .gst-staff .gst-open {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Swipe hint chip, shown by JS only when a table really overflows. */
.table-swipe-hint {
  display: none;
  align-items: center;
  gap: .25rem;
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* Care shell: pin the sticky clock to the measured nav height rather than a
   hardcoded 3.9rem that left a ~5px gap. */
@media (max-width: 899px) {
  /* The measured height already includes the nav's safe-area padding, so the
     inset is only re-added in the pre-JS fallback. */
  .wiw-sticky-clock {
    bottom: calc(var(--mobile-nav-height, calc(3.9rem + env(safe-area-inset-bottom, 0px))) + .45rem);
  }
}

/* Staff job-flow: office help, geo chips, visit finish — phone first */
.care-office-help {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .55rem;
}
.mdash-top-actions .care-office-help,
.care-office-help.is-compact {
  display: contents;
}
.care-job-cue {
  margin: -.35rem 0 1rem;
  font-size: .82rem;
  line-height: 1.35;
  color: var(--muted);
}
.geo-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .45rem 0 .55rem;
}
.geo-reason-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .45rem .7rem;
  font-size: .78rem;
  font-weight: 650;
  min-height: 2.5rem;
  cursor: pointer;
}
.geo-reason-chip:active,
.geo-reason-chip:focus {
  border-color: var(--teal, #1a7a8c);
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 182, 232, .18);
}
.daily-doc-clockout {
  margin: .85rem 0 calc(var(--mobile-footer-clearance, 4.5rem) + .5rem);
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.flash .care-office-help {
  margin-top: .65rem;
}
@media (max-width: 720px) {
  .mdash-top-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
  }
  .mdash-top-actions .btn,
  .mdash-top-actions .care-office-help .btn {
    flex: 1 1 calc(50% - .4rem);
    min-height: 2.75rem;
    justify-content: center;
    text-align: center;
  }
  .adl-toolbar-actions {
    width: 100%;
  }
  .adl-toolbar-actions .btn {
    flex: 1 1 calc(50% - .35rem);
    min-height: 2.75rem;
  }
  .daily-doc-meta {
    grid-template-columns: 1fr 1fr;
  }
  .daily-doc-block {
    padding: .75rem;
  }
  .daily-doc-clockout .wiw-clock-btn {
    width: 100%;
    min-height: 3.1rem;
  }
  .care-bottom a,
  .care-bottom button {
    min-width: 0;
    font-size: .68rem;
  }
}
@media (max-width: 420px) {
  .daily-doc-meta {
    grid-template-columns: 1fr;
  }
  .adl-page-head h1 {
    font-size: 1.2rem;
  }
}

/* ========== Standalone staff auth (login / forgot / reset) ========== */
body.abc-auth-body {
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(46, 182, 232, .14), transparent 55%),
    radial-gradient(720px 420px at 100% 0%, rgba(139, 61, 184, .10), transparent 50%),
    linear-gradient(180deg, #eef3f8 0%, #f5f7fb 48%, #eef1f6 100%);
  -webkit-font-smoothing: antialiased;
}
body.abc-auth-body.login-page {
  display: block !important;
  position: static !important;
  overflow: visible !important;
  padding: 0 !important;
  place-items: unset !important;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(46, 182, 232, .14), transparent 55%),
    radial-gradient(720px 420px at 100% 0%, rgba(139, 61, 184, .10), transparent 50%),
    linear-gradient(180deg, #eef3f8 0%, #f5f7fb 48%, #eef1f6 100%) !important;
}

.abc-auth-stage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
}

.abc-auth-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid rgba(217, 220, 235, .9);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(40, 30, 70, .10);
  padding: 1.75rem 1.55rem 1.55rem;
  text-align: center;
}

.abc-auth-brand { margin: 0 0 1.15rem; }
.abc-auth-logo {
  display: block;
  width: min(148px, 46%);
  height: auto;
  margin: 0 auto .85rem;
}
.abc-auth-title {
  margin: 0 0 .3rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 4.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.015em;
  color: #1c1a28;
  line-height: 1.2;
}
.abc-auth-sub {
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
  font-weight: 500;
}

.abc-auth-body-form { text-align: left; }

.abc-auth-form {
  display: grid;
  gap: .95rem;
}

.abc-auth-field label {
  display: block;
  margin: 0 0 .35rem;
  font-size: .85rem;
  font-weight: 700;
  color: #3d3a4d;
}

.abc-auth-form input[type="email"],
.abc-auth-form input[type="password"],
.abc-auth-form input[type="text"],
.abc-auth-field .password-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7dbe8;
  border-radius: 12px;
  padding: .75rem .9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #f4f8fc;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.abc-auth-field .password-field input { padding-right: 2.85rem; }
.abc-auth-form input:focus,
.abc-auth-field .password-field input:focus {
  outline: none;
  background: #fff;
  border-color: #8bb8e8;
  box-shadow: 0 0 0 3px rgba(46, 182, 232, .18);
}

.abc-auth-field .password-field { position: relative; }
.abc-auth-field .password-toggle {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.abc-auth-field .password-toggle:hover,
.abc-auth-field .password-toggle:focus-visible {
  color: var(--brand-purple);
  background: #f3e9fb;
  outline: none;
}

.abc-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.abc-auth-remember {
  display: inline-flex !important;
  align-items: center;
  gap: .45rem;
  margin: 0 !important;
  font-size: .9rem !important;
  font-weight: 500 !important;
  color: var(--ink) !important;
  cursor: pointer;
}
.abc-auth-remember input {
  width: 1.05rem !important;
  height: 1.05rem !important;
  min-height: 0 !important;
  margin: 0 !important;
  accent-color: var(--brand-purple);
}

.abc-auth-link {
  color: var(--brand-purple);
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
}
.abc-auth-link:hover { text-decoration: underline; }

.abc-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: .15rem;
  border: 0;
  border-radius: 12px;
  padding: .9rem 1.1rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(100deg, var(--brand-purple) 0%, #4a8fd4 55%, var(--brand-blue) 100%);
  box-shadow: 0 12px 24px rgba(74, 100, 180, .24);
}
.abc-auth-submit:hover { filter: brightness(1.04); }
.abc-auth-submit:active { transform: translateY(1px); }

.abc-auth-footer {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.abc-auth-footer-kicker {
  margin: 0 0 .65rem;
  font-size: .88rem;
  font-weight: 650;
  color: var(--ink);
}
.abc-auth-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(139, 61, 184, .35);
  background: #fff;
  color: var(--brand-purple);
  font-weight: 700;
  text-decoration: none;
}
.abc-auth-apply:hover {
  background: #f7eefb;
  text-decoration: none;
}
.abc-auth-home {
  margin: .85rem 0 0;
  font-size: .88rem;
  color: var(--muted);
}
.abc-auth-home a {
  color: var(--brand-purple);
  font-weight: 650;
}
.abc-auth-help {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.4;
}
.abc-auth-alt {
  margin: 1rem 0 0;
  text-align: center;
}

.abc-auth-card .flash { text-align: left; margin-bottom: .9rem; }

@media (max-width: 480px) {
  .abc-auth-stage { padding: 1rem .75rem 1.25rem; align-items: flex-start; padding-top: 1.5rem; }
  .abc-auth-card { padding: 1.35rem 1.05rem 1.2rem; border-radius: 16px; }
  .abc-auth-logo { width: min(132px, 48%); }
  .abc-auth-title { font-size: 1.35rem; }
  .abc-auth-row { gap: .55rem; }
  .abc-auth-submit { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .abc-auth-submit:active { transform: none; }
}

/* ========== US ops dashboard: tokens, chrome, density, responsive ========== */
.admin-shell,
.care-shell {
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: none;
  --display: var(--font);
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --teal-soft: #f3f4f6;
}

body:has(.admin-shell),
body:has(.care-shell) {
  background: #f3f4f6;
  color: var(--ink);
}

.admin-shell .btn,
.care-shell .btn {
  border-radius: var(--radius-sm);
  font-weight: 650;
  letter-spacing: 0;
}
.admin-shell .btn-primary,
.care-shell .btn-primary {
  background: var(--brand-blue);
  color: #fff;
}
.admin-shell .btn-primary:hover,
.care-shell .btn-primary:hover {
  background: #1a8bb8;
  color: #fff;
}
.admin-shell .btn-ghost,
.care-shell .btn-ghost {
  color: #374151;
  border-color: var(--line);
  background: #fff;
}
.admin-shell .btn-ghost:hover,
.care-shell .btn-ghost:hover {
  background: #f9fafb;
  color: var(--ink);
}

.admin-shell .card,
.care-shell .card,
.admin-shell .ops-panel,
.care-shell .ops-panel,
.admin-shell .mdash-panel,
.admin-shell .mdash-main,
.care-shell .mdash-panel,
.care-shell .mdash-main,
.admin-shell .visit-card,
.care-shell .visit-card,
.admin-shell .mobile-card,
.care-shell .mobile-card {
  border-radius: var(--radius);
  box-shadow: none;
  border-color: var(--line);
}

.admin-shell .admin-top h1,
.admin-shell .ops-empty-title,
.care-shell .wiw-home-title {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -.02em;
}
.admin-shell .admin-top h1 {
  font-size: 1.25rem;
  color: var(--ink);
}
.admin-shell .admin-top {
  background: rgba(243, 244, 246, .96);
  box-shadow: none;
}
.admin-shell .admin-top-end {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-self: end;
  min-width: 0;
}
.admin-shell .admin-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.admin-shell .admin-top-user {
  color: inherit;
  white-space: nowrap;
}
.admin-shell .admin-search-launch {
  border-radius: var(--radius);
  box-shadow: none;
  background: #fff;
}
.admin-shell .section-title {
  font-size: .72rem;
  letter-spacing: .06em;
  font-weight: 700;
  color: #6b7280;
  margin: .85rem 0 .4rem;
}

.admin-shell .kpi,
.care-shell .mdash-kpi {
  border-radius: var(--radius);
  box-shadow: none;
  background: #fff;
}
.admin-shell .kpi .label,
.care-shell .mdash-kpi-label {
  font-weight: 700;
  letter-spacing: .04em;
}
.admin-shell .kpi-hint {
  order: 3;
  margin-top: .1rem;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
}
.admin-shell .kpi.kpi-warn,
.admin-shell .kpi.kpi-alert {
  background: #fff;
}
.care-shell .mdash-kpi--accent {
  border-color: var(--line);
  background: #fff;
}
.care-shell .mdash-kpi strong {
  font-size: 1.25rem;
}
.admin-shell .kpi-grid--hero {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: .85rem;
}

.dash-queue {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: .85rem;
}
.dash-queue a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  min-height: 2.75rem;
  padding: .45rem .8rem;
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 650;
}
.dash-queue a:hover {
  background: #f9fafb;
  text-decoration: none;
}
.dash-queue b {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--ink);
}
.dash-queue .is-warn { color: var(--warn); }
.dash-queue .is-alert { color: var(--danger); }

.admin-shell thead th,
.admin-shell .ops-table th {
  background: #f9fafb;
  font-weight: 700;
}
.admin-shell tbody tr:hover td,
.admin-shell .ops-table tbody tr:hover td {
  background: #f9fafb;
}
.admin-shell .badge,
.care-shell .badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .12rem .45rem;
  letter-spacing: .01em;
}

.admin-appbar-ico {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm, 6px);
  display: grid;
  place-items: center;
  color: #374151;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
  font: inherit;
  flex-shrink: 0;
}
.admin-appbar-ico:hover {
  background: #f3f4f6;
  text-decoration: none;
  color: var(--ink);
}
.admin-appbar-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
a.admin-appbar-ico svg { fill: currentColor; stroke: none; }

.app-user-menu {
  position: relative;
  flex-shrink: 0;
}
.app-user-menu > summary {
  list-style: none;
}
.app-user-menu > summary::-webkit-details-marker { display: none; }
.app-user-menu__btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  max-width: 14rem;
}
.app-user-menu__btn:hover { background: #f9fafb; }
.app-user-menu[open] > .app-user-menu__btn { border-color: #c5cdd8; }
.app-user-menu__avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: #374151;
  font-size: .68rem;
  font-weight: 800;
  flex-shrink: 0;
}
.app-user-menu__meta {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding-right: .55rem;
  line-height: 1.15;
}
.app-user-menu__name {
  font-size: .8rem;
  font-weight: 700;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-user-menu__role {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
}
.app-user-menu__panel {
  position: absolute;
  top: calc(100% + .35rem);
  right: 0;
  z-index: 60;
  width: min(16.5rem, calc(100vw - 1.5rem));
  padding: .35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
}
.app-user-menu__who {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .45rem .6rem .55rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .25rem;
}
.app-user-menu__who strong { font-size: .88rem; }
.app-user-menu__who span { font-size: .75rem; color: var(--muted); }
.app-user-menu__panel a,
.app-user-menu__panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  margin: 0;
  padding: .5rem .6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .88rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.app-user-menu__panel a:hover,
.app-user-menu__panel button:hover {
  background: #f3f4f6;
  text-decoration: none;
}
.app-user-menu__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
}

@media (min-width: 720px) {
  .dash-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .dash-queue {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .dash-queue a {
    gap: .4rem;
    padding: .45rem .65rem;
  }
}

@media (min-width: 981px) {
  .admin-shell .admin-top-user .app-user-menu__meta { display: flex; }
  .admin-shell .admin-top h1 { font-size: 1.35rem; }
  .care-shell .care-top-desk .app-user-menu__meta { display: flex; }
  .care-shell .care-top-desk .admin-appbar-ico {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 980px) {
  .admin-shell .admin-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .admin-shell .admin-top .admin-search-launch {
    display: none !important;
  }
  .admin-shell .admin-top-end:not(:has(.admin-top-actions)) {
    display: none;
  }
  .admin-shell .admin-top h1 {
    font-size: 1.2rem;
    color: var(--ink);
  }
  .admin-shell .kpi-grid--hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-appbar .app-user-menu__btn,
  .care-top .nav-icons .app-user-menu__btn {
    padding: .1rem;
    border-radius: 999px;
  }
  .admin-appbar .app-user-menu__meta,
  .care-top .nav-icons .app-user-menu__meta {
    display: none;
  }
  .admin-appbar-ico,
  .care-top .nav-icons .admin-appbar-ico {
    width: 40px;
    height: 40px;
  }
  .dash-queue a { min-height: 44px; }
  .admin-shell .admin-top-actions .btn {
    min-height: 36px;
  }
}

@media (max-width: 640px) {
  .admin-shell .kpi-grid--hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
  }
  .admin-shell .kpi .value { font-size: 1.2rem; }
  .admin-shell .kpi-hint {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .dash-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .care-shell .wiw-home-title { font-size: 1.35rem; }
  .admin-appbar-ico {
    width: 44px;
    height: 44px;
  }
  .admin-appbar .app-user-menu__btn {
    width: 44px;
    height: 44px;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .dash-queue { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .care-office-chip { display: none; }
}

@media (max-width: 899px) {
  .care-top .nav-icons .admin-appbar-ico,
  .care-top .nav-icons .app-user-menu__btn {
    min-width: 44px;
    min-height: 44px;
  }
  .care-top .nav-icons .app-user-menu__btn {
    width: 44px;
    justify-content: center;
  }
  .care-shell .mdash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .care-shell .mdash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ========== US ops sidebar (dark rail, not brand gradient) ========== */
.admin-nav,
.care-side {
  background: #16141f;
  color: #e5e7eb;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
  padding: .65rem .4rem;
}
.admin-nav .logo,
.care-side-logo {
  background: #fff;
  border-radius: 8px;
  padding: .28rem .22rem;
}
.admin-nav .nav-priority-label,
.care-nav-priority-label {
  color: #9ca3af;
  letter-spacing: .07em;
  font-weight: 700;
}
.admin-nav a,
.admin-nav .nav-logout-btn,
.admin-nav .nav-others-summary,
.admin-nav .nav-docs-summary,
.care-side-links a,
.care-nav-others-summary,
.care-side-pin,
.care-side-out,
.care-side-office {
  color: #d1d5db;
  border-radius: 8px;
  padding: .48rem .5rem;
}
.admin-shell.is-pinned .admin-nav a,
.admin-shell.is-pinned .admin-nav .nav-logout-btn,
.admin-shell.is-pinned .admin-nav .nav-others-summary,
.admin-shell.is-pinned .admin-nav .nav-docs-summary,
.care-shell.is-pinned .care-side-links a,
.care-shell.is-pinned .care-nav-others-summary,
.care-shell.is-pinned .care-side-pin,
.care-shell.is-pinned .care-side-out {
  padding: .48rem .65rem;
}
.admin-nav a:hover,
.admin-nav .nav-logout-btn:hover,
.admin-nav .nav-others-summary:hover,
.admin-nav .nav-docs-summary:hover,
.care-side-links a:hover,
.care-nav-others-summary:hover,
.care-side-pin:hover,
.care-side-out:hover,
.care-side-office:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  text-decoration: none;
  filter: none;
}
.admin-nav a.active,
.admin-nav .nav-others-summary.is-active,
.admin-nav .nav-docs-summary.is-active,
.care-side-links a.active,
.care-nav-others-summary.is-active {
  background: rgba(46, 182, 232, .14);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-blue);
}
.admin-nav .nav-ico,
.care-side-ico {
  color: inherit;
  opacity: .92;
}
.admin-nav .nav-badge,
.care-side-badge {
  background: #e11d48;
}
.admin-nav .nav-others,
.care-nav-others {
  border-top-color: rgba(255, 255, 255, .08);
}
.admin-nav .nav-others-body,
.admin-nav .nav-docs-body,
.care-nav-others-body {
  border-left-color: rgba(255, 255, 255, .1);
}
.admin-nav .nav-foot,
.care-side-foot {
  border-top-color: rgba(255, 255, 255, .08);
}
.admin-nav .nav-pin,
.admin-nav .nav-logout-btn,
.care-side-pin,
.care-side-out {
  border: 0 !important;
  background: transparent !important;
  color: #d1d5db !important;
  border-radius: 8px;
}
.admin-nav .nav-pin:hover,
.admin-nav .nav-logout-btn:hover,
.care-side-pin:hover,
.care-side-out:hover {
  background: rgba(255, 255, 255, .06) !important;
  color: #fff !important;
}
.admin-nav .nav-user {
  color: #e5e7eb;
  border-radius: 8px;
}
.admin-shell.is-pinned .admin-nav .nav-user {
  background: rgba(255, 255, 255, .05);
}
.admin-nav .nav-user-avatar {
  background: rgba(46, 182, 232, .2);
  color: #e5e7eb;
}
.admin-nav .nav-user-role {
  color: #9ca3af;
}
.admin-nav .nav-close {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
}

@media (min-width: 981px) {
  .admin-nav .nav-user,
  .admin-nav .nav-logout {
    display: none;
  }
}
@media (min-width: 900px) {
  .care-side-logout {
    display: none;
  }
}

@media (max-width: 980px) {
  .admin-nav {
    background: #16141f;
    box-shadow: 8px 0 28px rgba(17, 24, 39, .35);
  }
  .admin-nav a,
  .admin-nav .nav-logout-btn,
  .admin-nav .nav-others-summary {
    min-height: 44px;
  }
}

.nav-foot-ico {
  display: grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 auto .12rem;
}
.nav-foot-ico svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
  display: block;
}
.admin-footer .nav-foot-ico,
.care-bottom .nav-foot-ico { color: inherit; }

.admin-shell .page-toolbar,
.admin-shell .list-filter-bar,
.admin-shell .ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .85rem;
  padding: .65rem .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.admin-shell .ops-toolbar {
  align-items: flex-end;
}
.admin-shell .filter-chip-row .btn-primary,
.admin-shell .page-toolbar--chips > a.btn-primary,
.admin-shell .page-toolbar .btn-sm.btn-primary:not(.page-toolbar-cta) {
  background: #eef2f7;
  color: #111827;
  border: 1px solid #111827;
  box-shadow: none;
}
.admin-shell .filter-chip-row .btn-primary:hover,
.admin-shell .page-toolbar--chips > a.btn-primary:hover {
  background: #e5e7eb;
  color: #111827;
}

.row-more { position: relative; display: inline-flex; margin-left: .25rem; }
.row-more-btn {
  list-style: none;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #374151;
}
.row-more-btn::-webkit-details-marker { display: none; }
.row-more[open] > .row-more-btn { border-color: #9ca3af; }
.row-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .25rem);
  z-index: 20;
  min-width: 10rem;
  padding: .3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.row-more-panel a,
.row-more-panel button {
  display: block;
  width: 100%;
  margin: 0;
  padding: .45rem .6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.row-more-panel a:hover,
.row-more-panel button:hover { background: #f3f4f6; }
.col-actions { display: flex; align-items: center; justify-content: flex-end; gap: .25rem; }
.mobile-card-actions { align-items: center; }

.timesheet-row.is-open td { background: #f9fafb !important; }
.care-bottom-office,
.care-bottom a.care-bottom-office {
  background: #111827 !important;
  color: #fff !important;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .row-more-btn { width: 44px; height: 44px; }
}

/* KPI / summary cards: always fill the row, any count (3, 4, 8…) */
.admin-shell .kpi-grid,
.admin-shell .kpi-grid.emp-kpi-grid,
.admin-shell .kpi-grid--hero,
.care-shell .mdash-kpis,
.care-kpi-grid,
.client-mini-kpis {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.75rem), 1fr));
}
@media (max-width: 980px) {
  .admin-shell .kpi-grid,
  .admin-shell .kpi-grid.emp-kpi-grid,
  .admin-shell .kpi-grid--hero,
  .care-shell .mdash-kpis,
  .care-kpi-grid,
  .client-mini-kpis {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.25rem), 1fr));
  }
}
@media (max-width: 640px) {
  .admin-shell .kpi-grid,
  .admin-shell .kpi-grid.emp-kpi-grid,
  .admin-shell .kpi-grid--hero,
  .care-shell .mdash-kpis,
  .care-kpi-grid,
  .client-mini-kpis {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr));
  }
}

.weekly-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  margin-bottom: .85rem;
  align-items: start;
}
.weekly-split > .ops-panel,
.weekly-split > .card,
.weekly-split > .weekly-service-card,
.weekly-split > .weekly-notes-card {
  margin-bottom: 0;
  min-width: 0;
  overflow: hidden;
}
.weekly-split .table-wrap {
  max-width: 100%;
  mask-image: none !important;
  -webkit-mask-image: none !important;
}
.weekly-split .table-wrap.table-wide table,
.weekly-split .weekly-grid {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}
.weekly-split .table-wrap:not(.table-wide) .weekly-grid th:nth-child(1),
.weekly-split .table-wrap:not(.table-wide) .weekly-grid td:nth-child(1) {
  width: 24%;
  white-space: nowrap;
}
.weekly-split .table-wrap:not(.table-wide) .weekly-grid th:nth-child(2),
.weekly-split .table-wrap:not(.table-wide) .weekly-grid td:nth-child(2) {
  width: 36%;
  white-space: nowrap;
}
.weekly-split .table-wrap.table-wide thead th:first-child,
.weekly-split .table-wrap.table-wide tbody td:first-child {
  position: static;
  box-shadow: none;
}
.weekly-split .weekly-grid th,
.weekly-split .weekly-grid td {
  font-size: .78rem;
  padding: .38rem .28rem;
  vertical-align: middle;
}
.weekly-split .weekly-grid th.col-name,
.weekly-split .weekly-grid td.col-name {
  width: 26%;
  max-width: 8.5rem;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: .76rem;
  line-height: 1.25;
  font-weight: 650;
}
.weekly-split .weekly-grid th.col-tight,
.weekly-split .weekly-grid td.col-tight {
  width: auto;
  padding: .32rem .08rem;
  text-align: center;
  white-space: nowrap;
}
.weekly-split .weekly-chip {
  min-width: 1.45rem;
  padding: .12rem .1rem;
  font-size: .7rem;
}
.weekly-split .weekly-code-select {
  min-width: 0;
  width: 100%;
  padding: .18rem 0 !important;
  font-size: .7rem;
}
.weekly-split .weekly-grid th.col-actions,
.weekly-split .weekly-grid td.col-actions {
  display: table-cell;
  position: static;
  box-shadow: none;
  width: 28%;
  white-space: nowrap;
  text-align: right;
  padding-right: .15rem;
}
.weekly-split .weekly-grid td.col-actions .btn {
  display: inline-block;
  margin: 0 0 0 .2rem;
  padding: .22rem .42rem;
  font-size: .7rem;
  line-height: 1.2;
}
.weekly-split .weekly-grid td.col-num,
.weekly-split .weekly-grid th.col-num {
  width: 12%;
  padding-left: .15rem;
  padding-right: .15rem;
}
@media (min-width: 1100px) {
  .weekly-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

