:root {
  color-scheme: dark;
  --page-bg-a: #05070a;
  --page-bg-b: #111922;
  --page-radial: rgba(34, 48, 58, .33);

  --phone-bg-a: rgba(18, 24, 32, .96);
  --phone-bg-b: rgba(7, 10, 14, .99);
  --phone-border: rgba(255, 255, 255, .18);

  --text: #f6f7fb;
  --text-strong: #ffffff;
  --muted: #99a2ad;
  --muted-2: #707985;

  --card: rgba(18, 24, 32, .78);
  --card-solid: #121820;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .18);

  --nav-bg: rgba(10, 14, 19, .97);
  --sheet-bg-a: rgba(24, 31, 39, .98);
  --sheet-bg-b: rgba(14, 19, 25, .99);

  --red: #ff5046;
  --red-2: #d83732;
  --red-soft: rgba(255, 72, 58, .14);

  --orange: #ff9f14;
  --orange-soft: rgba(255, 159, 20, .13);

  --yellow: #ffc400;
  --yellow-soft: rgba(255, 196, 0, .12);

  --green: #52d44a;

  --shadow: rgba(0, 0, 0, .72);
  --inner-glow: rgba(255, 255, 255, .06);

  /* Subtle inset overlay used by nested form blocks (e.g.
     .admin-form-fieldset). On dark themes a faint white wash reads as
     "raised"; on light themes the inverse — see body[data-theme="light"]
     below. */
  --surface-subtle: rgba(255, 255, 255, .015);
}

body[data-theme="light"] {
  color-scheme: light;
  --page-bg-a: #eef3f7;
  --page-bg-b: #f8fbfd;
  --page-radial: rgba(255, 92, 70, .12);

  --phone-bg-a: rgba(250, 252, 255, .99);
  --phone-bg-b: rgba(235, 241, 247, .98);
  --phone-border: rgba(32, 42, 54, .13);

  --text: #171d25;
  --text-strong: #0d1218;
  --muted: #637080;
  --muted-2: #8a95a3;

  --card: rgba(255, 255, 255, .82);
  --card-solid: #ffffff;
  --line: rgba(22, 32, 45, .10);
  --line-strong: rgba(22, 32, 45, .15);

  --nav-bg: rgba(255, 255, 255, .95);
  --sheet-bg-a: rgba(255, 255, 255, .98);
  --sheet-bg-b: rgba(245, 249, 252, .98);

  --shadow: rgba(31, 43, 56, .18);
  --inner-glow: rgba(255, 255, 255, .75);

  /* Subtle overlay; on light themes it renders as a soft slate tint so
     nested form blocks read as recessed against the lighter card surface. */
  --surface-subtle: rgba(22, 32, 45, .025);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 30%, var(--page-radial), transparent 42%),
    linear-gradient(135deg, var(--page-bg-a), var(--page-bg-b) 55%, var(--page-bg-a));
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--card);
  box-shadow: 0 14px 35px var(--shadow);
  cursor: pointer;
  font-weight: 800;
}

.theme-icon {
  font-size: 16px;
}

.theme-label {
  font-size: 13px;
}

.stage {
  min-height: 100vh;
  display: flex;
  gap: 70px;
  align-items: center;
  justify-content: center;
  padding: 76px 22px 22px;
}

.phone {
  position: relative;
  width: 390px;
  height: 840px;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--phone-border);
  background: linear-gradient(180deg, var(--phone-bg-a), var(--phone-bg-b));
  box-shadow: 0 44px 100px var(--shadow), inset 0 0 0 1px rgba(255,255,255,.06);
}

.statusbar {
  height: 31px;
  padding: 12px 21px 0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-strong);
}

.statusbar span {
  font-size: 10px;
  color: var(--muted);
}

.topbar {
  height: 62px;
  padding: 15px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

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

.logo {
  width: 39px;
  height: 39px;
  filter: drop-shadow(0 0 14px rgba(255, 80, 70, .34));
}

.logo svg {
  width: 100%;
  height: 100%;
}

.logo rect,
.logo path {
  fill: none;
  stroke: var(--red);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -.5px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 11px;
}

.bell {
  position: relative;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 24px;
}

.bell i {
  position: absolute;
  right: 0;
  top: -3px;
  width: 15px;
  height: 15px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-style: normal;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 35%, #efc19f 0 17%, transparent 18%),
    radial-gradient(circle at 50% 72%, #244336 0 34%, transparent 35%),
    linear-gradient(#37414b, #171b20);
}

.hello {
  height: 57px;
  padding: 20px 20px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hello h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.danger-pill {
  height: 25px;
  padding: 0 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 16px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(255, 72, 58, .22);
  font-size: 11px;
  font-weight: 800;
}

.danger-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 13px rgba(255, 81, 71, .6);
}

.earn {
  position: relative;
  height: 117px;
  margin: 0 20px 12px;
  padding: 23px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 38%, rgba(255, 77, 54, .27), transparent 25%),
    linear-gradient(105deg, color-mix(in srgb, var(--card-solid), #1d242b 30%), color-mix(in srgb, var(--red), transparent 80%));
  box-shadow: inset 0 1px 0 var(--inner-glow);
}

body[data-theme="light"] .earn {
  background:
    radial-gradient(circle at 88% 38%, rgba(255, 80, 70, .18), transparent 25%),
    linear-gradient(105deg, #ffffff, #fff0ed);
}

.earn p {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 14px;
}

.earn strong {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--text-strong);
  font-size: 44px;
  line-height: .95;
  letter-spacing: -1.7px;
}

.earn em {
  display: block;
  margin-top: 10px;
  color: var(--orange);
  font-style: normal;
  font-size: 13px;
  font-weight: 850;
}

.chart {
  position: absolute;
  right: 6px;
  bottom: 7px;
  width: 185px;
  height: 110px;
}

.chart rect {
  fill: rgba(255, 97, 74, .52);
}

.chart polyline {
  fill: none;
  stroke: var(--red);
  stroke-width: 4;
  stroke-linecap: round;
}

.chart circle {
  fill: var(--red);
}

.chart text {
  font-size: 42px;
  font-weight: 900;
  fill: var(--red);
}

.card {
  margin: 0 20px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--inner-glow);
}

.plan {
  height: 150px;
  padding: 14px 13px 12px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.title-row h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

.title-row span {
  height: 24px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border-radius: 14px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 11px;
  font-weight: 850;
}

.row {
  display: grid;
  grid-template-columns: 24px 88px 1fr 48px;
  align-items: center;
  gap: 10px;
  margin: 9px 0;
  font-size: 11px;
  font-weight: 800;
}

.row p {
  margin: 0;
  color: var(--text);
}

.row b {
  font-size: 18px;
}

.row em {
  font-style: normal;
  text-align: right;
  color: var(--muted);
}

.row.red b,
.row.red em {
  color: var(--red);
}

.row.orange b,
.row.orange em {
  color: var(--orange);
}

.row.yellow b,
.row.yellow em {
  color: var(--yellow);
}

.bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(128, 139, 150, .18);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  box-shadow: 0 0 9px rgba(255, 81, 71, .42);
}

.orange .bar i {
  background: var(--orange);
}

.yellow .bar i {
  background: var(--yellow);
}

.warning {
  height: 55px;
  margin: 0 20px 10px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 35px 1fr 16px;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 92, 54, .32);
  background: linear-gradient(90deg, rgba(255, 89, 42, .16), rgba(255, 89, 42, .05));
}

.warning b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid var(--orange);
  color: var(--orange);
}

.warning strong {
  color: var(--red);
  font-size: 12px;
}

.warning p {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 11px;
}

.warning span {
  color: var(--muted);
  font-size: 24px;
}

.buttons {
  height: 58px;
  margin: 0 20px 12px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}

.buttons button {
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.start {
  color: var(--orange);
  background: var(--orange-soft);
  border-color: rgba(255, 159, 20, .22);
}

.pause {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: rgba(255, 196, 0, .2);
}

.finish {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(255, 72, 58, .28);
}

.bottom-cards {
  margin: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.calendar,
.pay {
  height: 112px;
  margin: 0;
  padding: 11px;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.mini-head h3,
.pay h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

.mini-head a {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.week,
.dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

.week {
  color: var(--muted);
  font-size: 10px;
}

.dates {
  margin-top: 6px;
}

.dates b {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: rgba(128, 139, 150, .18);
  font-size: 10px;
}

.dates .bad {
  color: #fff;
  background: rgba(255, 81, 71, .66);
}

.dates .warn {
  color: #111;
  background: var(--orange);
}

.legend {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.g { background: var(--green); }
.y { background: var(--orange); }
.r { background: var(--red); }

.pay {
  text-align: center;
}

.pay p {
  margin: 6px 0 3px;
  color: var(--muted);
  font-size: 10px;
}

.pay strong {
  display: block;
  margin-bottom: 9px;
  color: var(--text-strong);
  font-size: 25px;
}

.pay button {
  width: 100%;
  height: 31px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(var(--red), var(--red-2));
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

/* Bare `.nav` selector is too greedy — it matches Pagy 9's
   `<nav class="pagy nav">` and rips the pagination chip out of the
   normal flow with `position: absolute; bottom: 0; left: 0`. The views
   use `.bottom-nav`, so scope the mockup mobile-tabbar styles to that
   class and leave generic `<nav>` elements alone. */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 59px;
  padding: 4px 14px 7px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
}

.bottom-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 20px;
  text-decoration: none;
}

.bottom-nav a span {
  font-size: 10px;
  font-weight: 800;
}

.bottom-nav .active {
  color: var(--orange);
}

.bottom-nav .active::before {
  content: "";
  position: absolute;
  top: -6px;
  width: 34px;
  height: 2px;
  border-radius: 5px;
  background: var(--orange);
}

.dim {
  opacity: .45;
}

.with-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(1px);
}

body[data-theme="light"] .with-menu::before {
  background: rgba(24, 32, 44, .18);
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 59px;
  z-index: 3;
  min-height: 575px;
  padding: 11px 14px 18px;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  background: linear-gradient(var(--sheet-bg-a), var(--sheet-bg-b));
  box-shadow: 0 -30px 70px var(--shadow);
}

.handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: var(--line-strong);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sheet-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 19px;
}

.sheet-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

.sheet ul {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border-radius: 11px;
  border: 1px solid var(--line);
}

.sheet li {
  height: 43px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 25px 1fr 15px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.sheet li:last-child {
  border-bottom: 0;
}

.sheet li b {
  color: var(--red);
  font-size: 17px;
}

.sheet li span {
  color: var(--muted);
  font-size: 21px;
}

@media (max-width: 940px) {
  .stage {
    flex-direction: column;
    gap: 26px;
    padding: 76px 18px 18px;
  }
}

@media (max-width: 430px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
    height: 36px;
    padding: 0 10px;
  }

  .theme-label {
    display: none;
  }

  .stage {
    padding: 54px 0 0;
  }

  .phone {
    width: 100vw;
    height: calc(100vh - 54px);
    border: 0;
    border-radius: 0;
  }
}
/* app/assets/stylesheets/about.css */
/* Public «about / services» landing (/about). Standalone light layout; reuses
   design tokens. Mirrors the full-bleed treatment of the referral page. */

.about {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 20px 72px;
  color: var(--text);
}

.about__hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 12px;
}

.about__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(82, 212, 74, 0.14);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about__title {
  margin: 14px 0 10px;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 900;
  color: var(--text-strong);
}

.about__subtitle { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; font-weight: 600; }

.about__hero-art { display: block; width: 100%; }
.about__hero-art img { display: block; width: 100%; height: auto; }

.about__shot {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px var(--shadow);
}

.about__cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.about__btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: filter 0.15s, background 0.15s;
}
.about__btn--primary { background: linear-gradient(var(--green), #3cae34); color: #04140a; }
.about__btn--primary:hover { filter: brightness(1.05); }
/* Secondary CTA — green outline so it reads as a button (not a neutral chip). */
.about__btn--ghost { border: 2px solid var(--green); color: var(--green); background: transparent; }
.about__btn--ghost:hover { background: color-mix(in srgb, var(--green), transparent 88%); }
.about__btn--lg { padding: 18px 32px; font-size: 17px; }

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}
/* Passive fact chips — neutral grey fill, no border, green tick. Deliberately
   NOT button-shaped so they don't read as clickable next to the CTAs. */
.about__stat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text), transparent 95%);
  text-align: left;
}
.about__stat::before {
  content: "✓";
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 900;
  font-size: 14px;
}
.about__stat strong { color: var(--muted); font-size: 13.5px; font-weight: 700; }

.about__block { margin-top: 40px; }
.about__h2 { font-size: 24px; font-weight: 900; color: var(--text-strong); margin: 0 0 12px; line-height: 1.2; }
.about__lead { margin: 0; color: var(--text); font-size: 16px; line-height: 1.55; }
.about__muted { margin: 8px 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.about__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.about__card {
  position: relative;
  padding: 18px 18px 18px 22px;
  border-radius: 16px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  overflow: hidden;
}
/* Green accent bar instead of a per-card icon. */
.about__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--green);
}
.about__card-title { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--text-strong); }
.about__card-desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.about__stack { margin: 0 0 8px; color: var(--green); font-size: 12.5px; font-weight: 700; }

.about__why { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.about__why li {
  position: relative;
  padding-left: 28px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.about__why li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 900;
}

.about__refer {
  margin-top: 44px;
  padding: 28px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--green), transparent 86%), transparent 60%),
    var(--card-solid);
  border: 1px solid color-mix(in srgb, var(--green), transparent 55%);
  text-align: center;
}
.about__refer .about__lead { max-width: 560px; margin: 0 auto 18px; color: var(--muted); }

/* Tablet / phone: stack the hero, single-column cards, comfy spacing. */
@media (max-width: 720px) {
  .about__hero { grid-template-columns: 1fr; }
  .about__hero-art { max-width: 320px; margin: 6px auto 0; }
  .about__title { font-size: 27px; }
  .about__stats { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .about__btn { width: 100%; }
}
/*
 * app/assets/stylesheets/admin.css
 *
 * Desktop admin chrome for owners / admins / managers / platform admins.
 * Renders under app/views/layouts/admin.html.erb. The mobile layout
 * (application.html.erb + bottom_nav) is unaffected — these styles only
 * activate when `body.admin-body` is present.
 *
 * Design tokens are sourced from design_tokens.css. Do NOT redefine colors —
 * use --page-bg-a/b, --card, --card-solid, --line, --line-strong, --text,
 * --text-strong, --muted, --nav-bg, --red, --green, --orange, --shadow,
 * --inner-glow.
 */

/* =========================================================================
   Body / shell
   ========================================================================= */
body.admin-body {
  /* Single source of truth for the topbar height. Consumed by every sticky
     element below the topbar (e.g. table headers) so a future topbar resize
     only touches one number. Kept on `body.admin-body` rather than `:root`
     so the public-facing layouts (devise, mailer) are unaffected. */
  --admin-topbar-h: 56px;
  margin: 0;
  padding: 0;
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  color: var(--text);
}

body.admin-body * {
  box-sizing: border-box;
}

/* =========================================================================
   Sidebar
   ========================================================================= */
.admin-sidebar {
  width: 240px;
  flex: 0 0 240px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
  overflow-y: auto;
  z-index: 50;
}

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: background-color 0.12s ease;
}

.admin-sidebar__brand:hover,
.admin-sidebar__brand:focus-visible {
  background: var(--card);
  text-decoration: none;
}

.admin-sidebar__brand:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-sidebar__brand-logo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: block;
}

.admin-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-sidebar__brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-sidebar__brand-name {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0.4px;
  color: var(--text-strong);
}

.admin-sidebar__brand-tag {
  display: inline-block;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.7px;
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--red);
  text-transform: uppercase;
}

.admin-sidebar__brand-tenant {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.admin-sidebar__section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 6px 10px 4px;
}

.admin-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.admin-sidebar__item:hover {
  background: var(--card);
  color: var(--text-strong);
}

.admin-sidebar__item--active {
  background: var(--card-solid);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.admin-sidebar__item-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  opacity: 0.8;
}

/* Numeric counter pill rendered next to an .admin-sidebar__item label
   (e.g. pending referral leads next to «Компании»). Brand-green tint to
   match the «Реферал» row chip, so the visual association is one click
   wide. `margin-left: auto` pushes it to the right edge of the item. */
.admin-sidebar__item .admin-nav__badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border-radius: 999px;
  color: var(--green);
  background: rgba(82, 212, 74, 0.16);
  border: 1px solid rgba(82, 212, 74, 0.35);
}

.admin-sidebar__bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Sidebar bottom user block: avatar + stacked name/email. */
.admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
  min-width: 0;
  /* Now a link to /profile — strip the default <a> styling and add a subtle
     hover so the chip reads as clickable. */
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.admin-sidebar__user:hover { background: rgba(128, 139, 150, 0.08); text-decoration: none; }

.admin-sidebar__user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.admin-sidebar__user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__user-email {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__sign-out {
  display: block;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.admin-sidebar__sign-out:hover {
  background: var(--red-soft);
}

.admin-sidebar__sign-out-form {
  margin: 0;
}

/* =========================================================================
   Main column
   ========================================================================= */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================================================================
   Topbar
   ========================================================================= */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--admin-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.admin-topbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  max-width: 240px;
  /* Now a link to /profile — strip default <a> styling, add subtle hover. */
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.admin-topbar__user:hover { background: rgba(128, 139, 150, 0.12); color: var(--text); text-decoration: none; }

.admin-topbar__user-name {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar__tenant-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-topbar__tenant-button {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.admin-topbar__tenant-button--current {
  background: var(--card-solid);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.admin-topbar__theme-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.admin-topbar__theme-toggle:hover {
  background: var(--card);
  color: var(--text-strong);
  border-color: var(--line);
}

.admin-topbar__theme-toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-topbar__theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.admin-topbar__theme-toggle-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* =========================================================================
   Avatar — round initials chip used in sidebar bottom & topbar user blocks.
   Default size is 32×32; `--sm` (28×28) sits in the topbar, `--lg` (36×36)
   sits in the sidebar bottom.
   ========================================================================= */
.admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

.admin-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.admin-avatar--lg {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

/* =========================================================================
   Pill tabs: quick-switch filter bar with a per-tab count badge. Used by
   /email_templates (channel filter), reused elsewhere. NOT to be confused
   with the deprecated bare `.admin-tabs` text-link variant.
   ========================================================================= */
.admin-pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  font-size: 13px;
}

.admin-pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.admin-pill-tab:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(82, 212, 74, 0.06);
  text-decoration: none;
}
.admin-pill-tab:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.admin-pill-tab__label { letter-spacing: 0.02em; }
.admin-pill-tab__count {
  display: inline-flex;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(128, 139, 150, 0.18);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  justify-content: center;
}

.admin-pill-tab--active {
  color: #04140a;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 1px 3px rgba(82, 212, 74, 0.25);
}
.admin-pill-tab--active:hover {
  color: #04140a;
  background: var(--green);
  border-color: var(--green);
}
.admin-pill-tab--active .admin-pill-tab__count {
  background: rgba(4, 20, 10, 0.18);
  color: #04140a;
}

.admin-pill-tab--empty { opacity: 0.55; }
.admin-pill-tab--empty:hover { opacity: 1; }

/* When the user has uploaded an avatar via /profile, the helper emits an <img>
   inside the .admin-avatar circle. Cover the full circle, hide the inherited
   initials background so the image owns the visual. */
.admin-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.admin-avatar:has(.admin-avatar__img) { background: transparent; }

/* Wrapper link making the avatar chip clickable on both admin chrome and the
   mobile employee statusbar. Keeps the chip look (no underline, no link
   colour shift) and adds a hover indication so it reads as clickable. */
.avatar-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
}
.avatar-link:hover { filter: brightness(1.05); box-shadow: 0 0 0 3px rgba(82, 212, 74, 0.18); text-decoration: none; }
.avatar-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* =========================================================================
   Content
   ========================================================================= */
.admin-content {
  padding: 28px 32px 48px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  /* Flex column so a child with `flex: 1` (e.g. `.companies-index`)
     can stretch to the full available height instead of leaving
     white space below the page footer. Pages that don't opt in keep
     their natural top-aligned block flow because they don't grow. */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-content > h1 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 850;
  color: var(--text-strong);
}

/* =========================================================================
   Toolbar (above tables / content)
   ========================================================================= */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 10px;
  flex-wrap: wrap;
}

.admin-toolbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-toolbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Mobile: collapse the toolbar to a single row.
   - "Компании · 84" subtitle is hidden (topbar already shows the page
     title; the bare count duplicated chrome).
   - Buttons get 26px height, 11px font, ⚙ stays icon-only.
   - Primary "Создать +" loses the inline word "компанию" via i18n
     so it fits next to the secondary actions. */
@media (max-width: 1023px) {
  .admin-toolbar {
    gap: 4px 6px;
    padding: 4px 0 6px;
  }
  .admin-toolbar__left,
  .admin-toolbar__right {
    gap: 4px 6px;
  }
  .admin-toolbar__right .btn {
    height: 26px;
    padding: 0 7px;
    font-size: 11px;
    line-height: 1.1;
    gap: 4px;
    border-radius: 6px;
  }
  .admin-toolbar__right .btn--primary {
    padding: 0 9px;
  }
  .admin-toolbar__right .admin-form-icon {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 720px) {
  .admin-toolbar__left {
    display: none;
  }
  .admin-toolbar__right {
    width: 100%;
  }
  .admin-toolbar__right .admin-table-config .btn .admin-form-label-text {
    display: none;
  }
  .admin-toolbar__right .admin-table-config .btn {
    padding: 0 6px;
  }
}

.admin-toolbar__search {
  height: 36px;
  padding: 0 12px;
  min-width: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 13px;
}

.admin-toolbar__search:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn,
.admin-btn,
.btn:link,
.btn:visited,
.admin-btn:link,
.admin-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  height: 36px;
  padding: 0 14px;
  /* Inherit page font so a `<input type="submit">` doesn't fall back
     to the OS-button face — UA stylesheets give submit inputs their
     own font/line-height, which made the primary action visually
     taller than the sibling `<a class="btn btn--ghost">`. */
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-solid);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}

.btn:hover,
.admin-btn:hover {
  background: var(--card);
  border-color: var(--text);
}

.btn:active,
.admin-btn:active {
  transform: translateY(1px);
}

.btn--primary,
.admin-btn--primary {
  background: linear-gradient(var(--red), var(--red-2));
  border-color: var(--red-2);
  color: #fff;
}

.btn--primary:hover,
.admin-btn--primary:hover {
  filter: brightness(1.05);
  border-color: var(--red);
}

.btn--ghost,
.admin-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn--ghost:hover,
.admin-btn--ghost:hover {
  color: var(--text-strong);
  background: var(--card);
}

.btn--danger,
.admin-btn--danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}

.btn--danger:hover,
.admin-btn--danger:hover {
  background: var(--red-soft);
}

.btn--small,
.admin-btn--small {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* =========================================================================
   Cards
   ========================================================================= */
.admin-card {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 8px 24px var(--shadow);
  margin-bottom: 18px;
}

.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-strong);
}

.admin-card__subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.admin-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Breadcrumb-style "К списку" link rendered above an admin-card on
   show pages. Sits flush left, has a leading ← arrow, and is styled
   ghost-quiet so it does not compete with the primary action button
   inside the card header. */
.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px 10px 6px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
  cursor: pointer;
}
.admin-back-link:hover,
.admin-back-link:focus-visible {
  color: var(--text);
  background: var(--card-solid);
  text-decoration: none;
}
.admin-back-link__arrow {
  font-size: 16px;
  line-height: 1;
}

/* Inline copy-button affordance next to the address `<dd>` value.
   Two-column flex: address text on the left, 📋 button anchored top-
   right. Lets the operator copy the full Yandex-canonical address in
   one click — same UX as INN / website / contact email/phone. */
.admin-show-address__wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.admin-show-address__body {
  flex: 1 1 auto;
  min-width: 0;
}

/* Inline counter rendered inside `.admin-card__title` so the heading
   reads as a single line "Контакты · 4" instead of breaking the
   number onto a separate subtitle row. */
.admin-card__title-count {
  font-weight: 500;
  margin-left: 4px;
}

/* Embedded Yandex Maps view on `/companies/:id`. The canvas is hidden
   on first paint and only revealed once the Stimulus controller has
   resolved the address through Yandex's geocoder. The status paragraph
   carries the loading / error message until the canvas takes over. */
.company-map {
  position: relative;
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card-solid);
  min-height: 320px;
}

.company-map__canvas {
  height: 320px;
  width: 100%;
  background: var(--card);
}

/* Dark-mode treatment for the Yandex map. The 2.1 JS API ships only
   a light schematic style — there's no `yandex#mapDark` we can pass
   to `new ymaps.Map`. Invert + hue-rotate the rendered tiles so the
   map matches the rest of the dark admin chrome. The placemark
   inside the tile canvas inherits the same filter (red → cyan-ish);
   that's an accepted tradeoff for getting a dark map without pulling
   in custom tiles. */
[data-theme="dark"] .company-map__canvas {
  filter: invert(0.92) hue-rotate(180deg) saturate(0.85);
}

.company-map__status {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  margin: 0;
}

/* Breadcrumbs above an admin-card show page. Section name is a link
   back to the index, separated by an arrow from the current record's
   name. Both crumbs share the same 18px/font-weight-700 type so they
   read as one continuous heading; only the colour differentiates the
   active link from the static current page. */
.admin-breadcrumbs {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--muted);
}
.admin-breadcrumbs__crumb {
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  padding: 2px 6px;
  margin: 0 -6px;
  transition: color 0.12s ease, background 0.12s ease;
}
.admin-breadcrumbs__crumb:hover,
.admin-breadcrumbs__crumb:focus-visible {
  color: var(--text);
  background: var(--card-solid);
  text-decoration: none;
}
.admin-breadcrumbs__sep {
  color: var(--muted);
  font-weight: 500;
  opacity: 0.7;
}
.admin-breadcrumbs__current {
  color: var(--text-strong);
  font-weight: 800;
}

.admin-card dl {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 10px 18px;
  margin: 0;
}

.admin-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.admin-card dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

/* =========================================================================
   Table
   ========================================================================= */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  /* `overflow: hidden` would clip the sticky `thead th` cells below as soon
     as their offsetParent (the table) scrolled past, defeating the sticky
     header. We rely on `border-radius` + cell backgrounds to keep the
     rounded silhouette without clipping. */
  overflow: visible;
  box-shadow: 0 8px 24px var(--shadow);
}

/* Optional internal scroll wrapper. When `.admin-table--scroll` wraps the
   table, the `<tbody>` rows scroll inside the wrapper while the `<thead>`
   row stays pinned to the top of the visible viewport. Without the wrapper
   class the sticky offset still works against the page scroll. */
.admin-table-scroll {
  position: relative;
  overflow-y: auto;
  overflow-x: auto;
  /* Reserve enough room for the toolbar (~60), the bulk footer with
     action buttons visible (~60), per-page selector + pagy nav on a
     wrapped row (~50), and a small breathing buffer (~30). The previous
     160px was tight when the bulk-actions panel was visible — the
     footer ended up squeezed against the viewport edge and overlapped
     by the last table row that bled past the scroll container. */
  max-height: calc(100vh - var(--admin-topbar-h) - 240px);
  border-radius: 12px;
}

/* Inline variant for tables that live inside a `.admin-card` (e.g. the
   contacts list on `/companies/:id`). Drops the page-level vertical
   max-height so the card grows with its content; only horizontal
   scroll kicks in if a row is wider than the card. */
.admin-table-scroll--inline {
  max-height: none;
  overflow-y: visible;
}

/* When the table has its own scroll container, sticky `<th>` should
   stick to the TOP of that container, not below the page-level
   topbar (the container already lives below the topbar, so the
   default `top: var(--admin-topbar-h)` opens an empty 56px gap where
   `<tbody>` rows bleed through). */
.admin-table-scroll .admin-table thead th,
.admin-table-scroll .admin-table__th {
  top: 0;
}

/* The cells (not the row) carry `position: sticky`. Sticking the row breaks
   in some browsers because `<tr>` has no offsetParent in CSS layout. Each
   `<th>` sticks individually, anchored just below the admin topbar. */
.admin-table thead th,
.admin-table__th {
  position: sticky;
  top: var(--admin-topbar-h);
  z-index: 5;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  /* Solid background — translucent backgrounds bleed table-body content
     through the sticky header during scroll. */
  background: var(--nav-bg);
  white-space: nowrap;
}

.admin-table td,
.admin-table__td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  /* Keep every cell on one line. Long emails / addresses overflow
     the table horizontally and the surrounding `.admin-table-scroll`
     wrapper handles the horizontal scroll instead of breaking text
     in unsightly places. To opt out (free-flowing description columns),
     add the `admin-table__td--wrap` modifier. */
  white-space: nowrap;
}

.admin-table td.admin-table__td--wrap,
.admin-table__td--wrap {
  white-space: normal;
}

.admin-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.014);
}

.admin-table tbody tr:hover td {
  background: var(--card);
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table__actions,
.admin-table td.admin-table__actions {
  text-align: right;
  white-space: nowrap;
}

.admin-table__actions a,
.admin-table__actions form {
  margin-left: 6px;
  display: inline-block;
}

.admin-table__link {
  color: var(--text-strong);
  font-weight: 700;
  text-decoration: none;
}

.admin-table__link:hover {
  text-decoration: underline;
}

.admin-table__muted {
  color: var(--muted);
  font-size: 12px;
}

/* Scrape-state badge — single-glyph indicator in /companies row.
   ✓ when SiteCrawler has run, otherwise a clickable ⟲ that posts
   to companies#scrape and enqueues the SiteCrawler job. */
.admin-table__td--badge,
.admin-table__th--badge {
  width: 56px;
  text-align: center;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: default;
  background: transparent;
  line-height: 1;
}

.admin-badge--ok {
  color: var(--green);
  background: rgba(82, 212, 74, 0.12);
  border-color: rgba(82, 212, 74, 0.3);
}

.admin-badge--action {
  cursor: pointer;
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: rgba(255, 196, 0, 0.4);
  transition: background 120ms ease, transform 120ms ease;
}

.admin-badge--action:hover {
  background: rgba(255, 196, 0, 0.25);
}

.admin-badge--action:active {
  transform: scale(0.94);
}

/* Text-pill badges (status / channel). The base .admin-badge is a 28px icon
   circle, which clips a word like «Активен»; these variants expand to a
   rounded pill that fits the label. */
.admin-badge--active,
.admin-badge--draft,
.admin-badge--channel,
.admin-badge--referral {
  width: auto;
  height: auto;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 999px;
}

.admin-badge--active {
  color: var(--green);
  background: rgba(82, 212, 74, 0.14);
  border-color: rgba(82, 212, 74, 0.3);
}

/* «Реферал» chip next to the company name when the row originated from the
   public /refer funnel. Brand-green like the landing's eyebrow + a margin so
   it doesn't collide with the company-name link. */
.admin-badge--referral {
  margin-left: 8px;
  color: var(--green);
  background: rgba(82, 212, 74, 0.14);
  border-color: rgba(82, 212, 74, 0.3);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Whole-row tint for referral leads — subtle green background + a 3px
   left-accent on the first cell. Specificity is bumped (.admin-table) so the
   row's odd/even striping doesn't outrank us. */
.admin-table .admin-table__tr--referral > td {
  background: rgba(82, 212, 74, 0.08);
}
.admin-table .admin-table__tr--referral:hover > td {
  background: rgba(82, 212, 74, 0.14);
}
.admin-table .admin-table__tr--referral > td:first-child {
  box-shadow: inset 3px 0 0 var(--green);
}

.admin-badge--draft {
  color: var(--muted);
  background: rgba(128, 139, 150, 0.16);
}

.admin-badge--channel {
  color: var(--text);
  background: rgba(128, 139, 150, 0.14);
}

/* Page header: title on the left, controls (badge + buttons) on the right,
   wrapping cleanly on narrow widths. Was unstyled, so the H1 and the controls
   collapsed onto each other (clipped badge + overlapping button). */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-page-header > h1 {
  margin: 0;
}

.admin-page-header > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* The Rails `button_to` helper wraps the button in a <form>. Strip
   the form's block-level box so the badge sits inline inside the
   <td>. */
.admin-table__td--badge form {
  display: inline;
  margin: 0;
}

/* SMS-reachability pill rendered next to a contact's phone
   (ContactsHelper#contact_sms_badge). Mobile = green (texts land),
   landline = muted (texts drop). Tooltip carries the full explanation. */
.contact-sms-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: default;
}

.contact-sms-badge--mobile {
  color: var(--green);
  background: rgba(82, 212, 74, 0.12);
  border-color: rgba(82, 212, 74, 0.3);
}

.contact-sms-badge--landline {
  color: var(--text-muted, #8a8f98);
  background: rgba(138, 143, 152, 0.12);
  border-color: rgba(138, 143, 152, 0.3);
}

/* Pending-invite acceptance link: a readonly URL field + copy button the
   admin hands to the invitee. Constrained width so the long token URL
   doesn't stretch the invite row. */
.tenant-invites__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.5rem;
}

.tenant-invites__link-input {
  width: 16rem;
  max-width: 40vw;
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text, inherit);
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(138, 143, 152, 0.3);
  border-radius: 6px;
  cursor: text;
}

/* Status pills inside tables / cards */
.admin-status {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
}

.admin-status--active,
.admin-status--success,
.admin-status--green {
  background: rgba(82, 212, 74, 0.12);
  color: var(--green);
  border-color: rgba(82, 212, 74, 0.3);
}

.admin-status--pending,
.admin-status--warning,
.admin-status--yellow {
  background: var(--yellow-soft);
  color: var(--yellow);
  border-color: rgba(255, 196, 0, 0.3);
}

.admin-status--suspended,
.admin-status--danger,
.admin-status--red {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(255, 80, 70, 0.3);
}

.admin-status--neutral,
.admin-status--muted,
.admin-status--cancelled,
.admin-status--draft,
.admin-status--expired {
  background: var(--card);
  color: var(--muted);
  border-color: var(--line-strong);
}

/*
   Domain-specific status modifiers. Map AASM states to one of the four
   visual buckets (green/yellow/red/muted). Defined here so views can write
   `admin-status--<%= record.status %>` without a per-domain helper.
*/
.admin-status--done,
.admin-status--approved,
.admin-status--completed,
.admin-status--reactivated {
  background: rgba(82, 212, 74, 0.12);
  color: var(--green);
  border-color: rgba(82, 212, 74, 0.3);
}

.admin-status--submitted {
  background: var(--yellow-soft);
  color: var(--yellow);
  border-color: rgba(255, 196, 0, 0.3);
}

.admin-status--rejected {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(255, 80, 70, 0.3);
}

/*
   Active/work-in-progress accent. Uses --orange because the design palette
   reserves blue tones for links only; orange reads as "attention, ongoing"
   and matches the start/pause buttons in the mobile design tokens.
   NB: `--active` is already green above (tenants/companies/employees use it
   for healthy/active state); orange is reserved for the "task is being
   worked on right now" / "force-review reopened" semantics.
*/
.admin-status--in_progress,
.admin-status--force_review {
  background: var(--orange-soft);
  color: var(--orange);
  border-color: rgba(255, 159, 20, 0.3);
}

/* =========================================================================
   Forms
   ========================================================================= */
.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 560px);
  gap: 14px 24px;
  align-items: start;
  margin-bottom: 18px;
}

.admin-form-grid > label,
.admin-form-grid > .admin-form-grid__label {
  padding-top: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-form-grid input[type="text"],
.admin-form-grid input[type="email"],
.admin-form-grid input[type="password"],
.admin-form-grid input[type="url"],
.admin-form-grid input[type="number"],
.admin-form-grid input[type="tel"],
.admin-form-grid input[type="date"],
.admin-form-grid input[type="datetime-local"],
.admin-form-grid input[type="search"],
.admin-form-grid select,
.admin-form-grid textarea,
.admin-form-row input[type="text"],
.admin-form-row input[type="email"],
.admin-form-row input[type="password"],
.admin-form-row input[type="url"],
.admin-form-row select,
.admin-form-row textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.admin-form-grid textarea,
.admin-form-row textarea {
  min-height: 84px;
  resize: vertical;
}

.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-form-grid textarea:focus,
.admin-form-row input:focus,
.admin-form-row select:focus,
.admin-form-row textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

/* Placeholder text in admin inputs/textareas. Browser default sits at
   ~50% of the input's `color`, which on the dark theme renders as a
   washed-out grey that's borderline-illegible. Pin to `--muted-2` so
   the example values stay visible without competing with the user's
   real input. */
.admin-form-grid input::placeholder,
.admin-form-grid textarea::placeholder,
.admin-form-row input::placeholder,
.admin-form-row textarea::placeholder {
  color: var(--muted-2);
  opacity: 1;
}

.admin-form-grid input:focus::placeholder,
.admin-form-grid textarea:focus::placeholder,
.admin-form-row input:focus::placeholder,
.admin-form-row textarea:focus::placeholder {
  color: var(--muted);
}

.admin-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.admin-form-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-form-help {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* Inline 16×16 SVG glyph rendered at the start of a form-field label.
   Inherits the label's text colour through `currentColor`, so the icon
   tints with the surrounding label. */
.admin-form-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: -3px;
  color: var(--muted);
}

/* Keep the icon and label text on a single baseline-aligned row. The
   `.admin-form-label-text` span makes it possible to truncate or
   restyle the wording without affecting the icon. */
.admin-form-grid > label,
.admin-form-row > label {
  display: inline-flex;
  align-items: center;
}

.admin-form-label-text {
  display: inline-block;
}

/* Stack the input + help/hint inside a single grid cell so the
   `.admin-form-grid` two-column layout still aligns the label to the
   first row. Without this wrapper the help text would steal a third
   column. */
.admin-form-grid__field {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

/* Required-field marker. Decorative — actual required-ness is conveyed to
   assistive tech via the `<input required>` attribute and `speak: never`
   tells screen readers to skip the visual asterisk. */
.admin-form-grid > label.admin-form-required::after {
  content: ' *';
  color: var(--red);
  font-weight: 800;
  margin-left: 2px;
  speak: never;
}

/* One-line legend that explains the meaning of `*` once per form. */
.admin-form-required-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

/* Native <select> styling — matches input height/border, drops the
   browser caret in favour of a chevron drawn as a background-image. */
.admin-form-grid select,
.admin-form-row select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2393a4b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding-right: 32px;
  cursor: pointer;
}

.admin-form-grid select:focus,
.admin-form-row select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23ff5046' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* HTML5 :invalid styling — lights up the field once the user has
   touched it and left it empty (or in a wrong format). Only kicks in
   after a focus pass to avoid screaming red on first paint. */
.admin-form-grid input:user-invalid,
.admin-form-grid select:user-invalid,
.admin-form-grid textarea:user-invalid,
.admin-form-row input:user-invalid,
.admin-form-row select:user-invalid,
.admin-form-row textarea:user-invalid {
  border-color: var(--red);
  background-color: var(--red-soft);
}

.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-form-errors {
  list-style: none;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}

.admin-form-errors li + li {
  margin-top: 4px;
}

/* Sub-section inside an admin form (e.g. nested-attributes contacts on
   the Company form). Visually a soft-bordered block so the operator
   reads it as a related-but-detachable group without a hard rule. */
.admin-form-fieldset {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.admin-form-fieldset__legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-strong);
  text-transform: uppercase;
}

.admin-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 16px;
}

.admin-contact-row {
  position: relative;
  padding: 14px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-solid);
}

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

.admin-contact-row__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

@media (max-width: 720px) {
  .admin-contact-row__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-contact-row__destroy-flag {
  display: none;
}

.admin-contact-row__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.admin-contact-row__remove:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

/* Address suggester (Yandex Geocoder proxy). The wrapper is `position:
   relative` so the dropdown anchors to the input below it. */
.address-suggest {
  position: relative;
}

/* `.address-block` carries `data-controller="address-suggest"` and wraps
   BOTH the search input and the structured sub-fields (postal_code, city,
   street, house, office) so Stimulus targets resolve. `display: contents`
   makes the wrapper invisible to the layout so its label + field children
   stay direct grid items of the parent `.admin-form-grid` (label | field). */
.address-block {
  display: contents;
}

/* Sub-field collapsible. Spans both columns of the parent admin-form-grid
   and re-establishes its own grid for the label/input pairs inside, so
   the dense form layout stays consistent. Hidden by default — revealed
   either by a successful suggestion pick OR by clicking the toggle. */
.address-block__details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 560px);
  gap: 14px 24px;
  align-items: start;
  margin-top: 6px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

/* "Без квартиры" checkbox row + the greyed flat field it controls. */
.address-block__no-flat {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.address-block__no-flat input {
  cursor: pointer;
}

.address-block .is-muted {
  opacity: 0.5;
}

.address-block__details[hidden] {
  display: none;
}

.address-block__details > label {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Readonly sub-fields look quieter than active inputs so the operator
   sees at a glance "this came from the geocoder". `enableEdit` flips
   readOnly off; the muted style fades back to normal once the attribute
   is gone. */
.address-block__details input[readonly] {
  background: var(--card-solid);
  color: var(--muted);
  cursor: not-allowed;
}

/* Container for the toggle button under the address search input. Sits
   inside the field column so it aligns with the input, not the label. */
.address-block__toggles {
  display: flex;
  margin-top: 6px;
}

.address-block__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.address-block__toggle:hover {
  color: var(--accent-strong, var(--accent));
}

.address-block--expanded .address-block__toggle-arrow {
  transform: rotate(180deg);
}

.address-block__toggle-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}

/* "Изменить вручную" sits at the end of the details panel, spans both
   columns, and is right-aligned so it reads as a footer action. */
.address-block__edit-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.address-block__edit-toggle {
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.address-block__edit-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.address-suggest__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 12px 24px var(--shadow);
}

.address-suggest__list[hidden] {
  display: none;
}

.address-suggest__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.address-suggest__item:hover,
.address-suggest__item:focus {
  background: var(--card);
  color: var(--text-strong);
}

.address-suggest__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-suggest__meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Show pages — read-only details for `companies/show`, `tasks/show`, etc.
   ========================================================================= */

/* Inline 16×16 icon at the start of a `<dt>` label. Mirrors the
   `.admin-form-icon` baseline tweak so icon + text align on the same row. */
.admin-card dt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-card dt .admin-form-icon {
  margin-right: 0;
  color: var(--muted);
}

/* Numeric values that benefit from monospaced digits (INN, postal code,
   phone). `<code>`-like font so 10/12-digit strings line up cleanly. */
.admin-show-mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* Inline copy-to-clipboard button. Lives next to a value (INN, email,
   phone) inside an `<dd>` — kept small + ghost so it does not compete
   with the value itself. `is-copied` is added by the Stimulus
   `copy-button` controller for ~1.2s. */
.admin-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 22px;
  padding: 0 6px;
  margin-left: 8px;
  font-size: 11px;
  line-height: 1;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.admin-copy-btn:hover {
  background: var(--card-solid);
  color: var(--text-strong);
  border-color: var(--text);
}

.admin-copy-btn.is-copied {
  background: rgba(82, 212, 74, 0.12);
  color: var(--green);
  border-color: rgba(82, 212, 74, 0.3);
}

/* Structured address block on `companies/show`. One `<dd>` value per line
   with the postal_code muted-and-monospaced ahead of the locality block. */
.admin-show-address {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.admin-show-address__postal {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
}

/* Highlighted card for free-form prose inside a show page (task
   instructions, result notes). Reads as a separate panel rather than a
   flat `<dd>` line. */
.admin-show-card {
  margin: 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* =========================================================================
   Empty state
   ========================================================================= */
.admin-empty-state {
  background: var(--card-solid);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  margin: 18px 0;
}

.admin-empty-state__icon {
  font-size: 30px;
  margin-bottom: 8px;
  color: var(--muted);
}

.admin-empty-state__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.admin-empty-state__body {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================================
   Pagination (kaminari / will_paginate friendly)
   ========================================================================= */
.admin-pagination,
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.admin-pagination a,
.admin-pagination span,
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card-solid);
  text-decoration: none;
  cursor: pointer;
}

.admin-pagination a:hover,
.pagination a:hover {
  border-color: var(--text);
}

.admin-pagination .current,
.pagination .current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 800;
  cursor: default;
}

/* =========================================================================
   Flash messages (admin layout)
   ========================================================================= */
.admin-body .flash {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
}

.admin-body .flash--notice {
  background: rgba(82, 212, 74, 0.10);
  border-color: rgba(82, 212, 74, 0.4);
  color: var(--green);
}

.admin-body .flash--alert {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}

/* =========================================================================
   Devise pre-auth screens
   ========================================================================= */
body.devise-body {
  margin: 0;
  padding: 0;
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.devise-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.devise-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-strong);
}

.devise-brand__name {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0.4px;
}

.devise-brand__tagline {
  font-size: 12px;
  color: var(--muted);
}

.devise-card {
  width: 100%;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px;
  box-shadow: 0 18px 40px var(--shadow);
}

.devise-card__title {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-strong);
}

.devise-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.devise-card .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.devise-card label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.devise-card input[type="text"],
.devise-card input[type="email"],
.devise-card input[type="password"] {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg-a);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.devise-card input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

.devise-card .field-hint {
  font-size: 11px;
  color: var(--muted);
}

.devise-card .actions {
  margin-top: 6px;
}

.devise-card input[type="submit"],
.devise-card button[type="submit"] {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(var(--red), var(--red-2));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.devise-card input[type="submit"]:hover,
.devise-card button[type="submit"]:hover {
  filter: brightness(1.05);
}

.devise-card .remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.devise-card .remember-me input[type="checkbox"] {
  cursor: pointer;
}

.devise-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.devise-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.devise-links a:hover {
  color: var(--text-strong);
  text-decoration: underline;
}

.devise-card .field_with_errors {
  display: contents;
}

.devise-card .field_with_errors input {
  border-color: var(--red);
}

/* =========================================================================
   Daily-plan progress bars (used inside .admin-card on
   `app/views/daily_plans/show.html.erb`). The base `.daily-plan__bars`
   class lives in components.css; this block adds row layout for each
   `<li>` so the label / progress / percentage line up.
   ========================================================================= */
.daily-plan__bars {
  list-style: none;
  padding: 0;
  margin: 0;
  height: auto;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.daily-plan__bar {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
}

.daily-plan__bar-label {
  font-weight: 700;
  color: var(--text-strong);
}

.daily-plan__bar progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 99px;
  border: 0;
  background: rgba(128, 139, 150, 0.18);
  overflow: hidden;
}

.daily-plan__bar progress::-webkit-progress-bar {
  background: rgba(128, 139, 150, 0.18);
  border-radius: 99px;
}

.daily-plan__bar progress::-webkit-progress-value {
  background: linear-gradient(var(--red), var(--red-2));
  border-radius: 99px;
}

.daily-plan__bar progress::-moz-progress-bar {
  background: var(--red);
  border-radius: 99px;
}

.daily-plan__bar-value {
  text-align: right;
  font-weight: 700;
  color: var(--muted);
}

/* =========================================================================
   Evidence file list (used inside `.admin-card` on
   `app/views/evidences/show.html.erb`). One row per attached file —
   plain link with hover underline; the muted block below replaces a
   bullet so the list reads cleanly inside the dark card.
   ========================================================================= */
.evidence-show__files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evidence-show__file {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
}

.evidence-show__reject-reason {
  color: var(--red);
  font-weight: 600;
}

/*
   Tenant tab strip (used inside `.admin-card` on
   `app/views/tenants/show.html.erb`). Pure layout — links inside use
   `.btn .btn--ghost` so they automatically pick up the design-system
   focus / hover states; this rule only spaces them and gives the
   `tenant-tabs` container an underline so it still reads as a "tab
   strip" against the rest of the card.
*/
.tenant-show__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.tenant-show__billing-placeholder {
  margin: 0;
  padding: 18px 0;
  font-size: 13px;
}

/* Tenant suspended banner (`app/views/tenants/_suspended_banner.html.erb`).
   Keeps the legacy `.tenant-banner--<status>` BEM modifier so any
   request specs that select on the status data attribute keep working;
   visually it is a flash-like callout pinned above the tenant header. */
.tenant-banner {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card-solid);
}

.tenant-banner__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
}

.tenant-banner__body {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.tenant-banner--suspended {
  border-color: var(--red);
  background: var(--red-soft);
}

.tenant-banner--suspended .tenant-banner__title {
  color: var(--red);
}

.tenant-banner--pending {
  border-color: rgba(255, 196, 0, 0.4);
  background: var(--yellow-soft);
}

.tenant-banner--pending .tenant-banner__title {
  color: var(--yellow);
}

.tenant-banner--deleted {
  border-color: var(--line-strong);
  background: var(--card);
}

/* =========================================================================
   Topbar hamburger (mobile only — hidden by default at >= 1024px)
   ========================================================================= */
.admin-topbar__menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.admin-topbar__menu-toggle:hover {
  background: var(--card);
  border-color: var(--line);
}

.admin-topbar__menu-toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-topbar__menu-toggle-icon {
  font-size: 22px;
  line-height: 1;
}

/* =========================================================================
   Off-canvas drawer backdrop (mobile only — sibling of the sidebar)
   ========================================================================= */
.admin-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1023px) {
  .admin-topbar__menu-toggle {
    display: inline-flex;
  }

  .admin-topbar {
    padding: 0 16px;
    gap: 12px;
  }

  /* Off-canvas drawer: sidebar slides in from the left over a backdrop. */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    flex: 0 0 auto;
    height: 100vh;
    height: 100dvh;
    padding: 18px 14px 14px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 12px 32px var(--shadow);
  }

  .admin-drawer-backdrop {
    display: block;
  }

  /* Tap-friendly nav items (>= 44px per Apple HIG). */
  .admin-sidebar__item {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .admin-sidebar__sign-out {
    min-height: 44px;
    padding: 10px 12px;
  }

  .admin-sidebar__brand {
    min-height: 44px;
  }

  /* Drawer-open state: slide sidebar in, fade backdrop in, lock body scroll. */
  body.admin-body.admin-body--drawer-open {
    overflow: hidden;
  }

  body.admin-body--drawer-open .admin-sidebar {
    transform: translateX(0);
  }

  body.admin-body--drawer-open .admin-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 767px) {
  .admin-topbar {
    height: 50px;
    padding: 0 12px;
    gap: 8px;
  }

  .admin-topbar__title {
    font-size: 15px;
  }

  /* On phones the tenant switcher would steal the topbar; current tenant is
     still visible inside the drawer (admin-sidebar__brand-tenant). Hide
     until the user reaches a wider viewport. */
  .admin-topbar__tenant-switcher {
    display: none;
  }

  .admin-topbar__user-name {
    display: none;
  }

  .admin-content {
    padding: 16px 12px 32px;
  }

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

  .admin-form-grid > label {
    padding-top: 0;
  }

  .admin-card dl {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }

  .admin-card dt {
    margin-top: 8px;
  }

  /* Tables — let them scroll horizontally */
  .admin-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* =========================================================================
   Light theme overrides
   ========================================================================= */
body.admin-body[data-theme="light"] .admin-sidebar {
  border-right-color: var(--line-strong);
}

body.admin-body[data-theme="light"] .admin-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.018);
}

/* =========================================================================
   /companies index — filters + sortable headers + bulk actions + pagy
   ========================================================================= */
.admin-table__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-table__filters-spacer {
  flex: 1 1 auto;
}

.admin-toolbar__select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.admin-table__per-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
  margin: 0;
}

.admin-table__per-page label {
  margin: 0;
  line-height: 28px;
}

.admin-table__per-page select {
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  margin: 0;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background-color: var(--card-solid);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%2399a2ad' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: var(--text);
  font-size: 12px;
  line-height: 26px;
  cursor: pointer;
  align-self: center;
  appearance: none;
  -webkit-appearance: none;
}

.admin-table__sort {
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-table__sort.is-active {
  color: var(--text);
}

.admin-table__sort:hover {
  color: var(--text);
}

.admin-table__th--checkbox,
.admin-table__td--checkbox {
  width: 56px;
  text-align: left;
  padding-left: 8px;
  padding-right: 4px;
}
.admin-table__th--checkbox {
  width: 56px;
  padding-left: 8px;
  padding-right: 4px;
}

.admin-table__th--checkbox input,
.admin-table__td--checkbox input {
  cursor: pointer;
}

/* Combined checkbox + row-menu cell. Checkbox on the left, `⋮` trigger
   to its right — replaces the dedicated trailing "Действия" column.
   Tightened gap from 6px → 2px so the column reads as a compact
   "selectable + actions" gutter, not a half-width column of empty space. */
.admin-table__row-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* The `<td>` containing the row-menu trigger needs `position: relative`
   so the absolutely-positioned `.row-menu__panel` anchors to it. */
.admin-table td.admin-table__td--checkbox[data-controller~="row-menu"] {
  position: relative;
}

/* =========================================================================
   Per-column filter popovers (rendered inside `<th>` cells)
   ========================================================================= */
.admin-table__th--filterable {
  /* Anchor for the absolutely-positioned popover. The cell is already
     `position: sticky`; `position: relative` inside the same rule has no
     effect on sticky behaviour, but DOES create a containing block for
     the popover's `position: absolute`. */
  position: sticky;
}

.admin-table__col-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-table__filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.admin-table__filter-trigger:hover {
  background: var(--card);
  color: var(--text-strong);
}

.admin-table__filter-trigger.is-active {
  color: var(--red);
  border-color: var(--line-strong);
  background: var(--card);
}

.admin-table__filter-trigger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-table__filter-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  max-width: 280px;
  padding: 12px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 16px 32px var(--shadow);
}

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

.admin-table__filter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-table__filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0;
}

.admin-table__filter-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 13px;
}

.admin-table__filter-input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.admin-table__filter-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}

.admin-table__filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.admin-table__filter-check input {
  cursor: pointer;
}

/* =========================================================================
   Bottom bulk + per-page + pagy footer
   ========================================================================= */
/* Single bordered card. Mobile: rows stack vertically (column).
   Desktop (≥768px): rows on one line — bulk grows to push nav right. */
.companies-bulk__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.companies-bulk__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.companies-bulk__row--nav {
  justify-content: space-between;
}

.companies-bulk__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.companies-bulk__actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.companies-bulk__actions[hidden] {
  display: none;
}

.companies-bulk__footer .admin-table__pagination {
  margin: 0;
  padding: 0;
  border: 0;
}

@media (min-width: 768px) {
  .companies-bulk__footer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }
  /* `flex: 1 1 auto` on bulk + `flex: 0 0 auto` on nav makes the
     bulk row absorb leftover horizontal space, which naturally pushes
     the nav row to the right edge — no `margin-left: auto` trick. */
  .companies-bulk__row--bulk {
    flex: 1 1 auto;
  }
  .companies-bulk__row--nav {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
  }
}

/* Sentinel row for `?items=all` infinite scroll. Centred status text
   doubles as a "loading" indicator while the IntersectionObserver
   waits for the next page to land. */
.companies-infinite__sentinel,
.admin-infinite__sentinel {
  text-align: center;
  font-size: 12px;
  padding: 14px 12px;
}

/* Generic shared variants of the .companies-bulk__* / .companies-index
   classes so every admin index can opt into the same standard chrome
   without duplicating CSS. */
.admin-bulk-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.admin-bulk-footer__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-bulk-footer__row--nav { justify-content: space-between; }
.admin-bulk-footer__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.admin-bulk-footer__actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-bulk-footer__actions[hidden] { display: none; }
.admin-bulk-footer .admin-table__pagination {
  margin: 0; padding: 0; border: 0;
}
@media (min-width: 768px) {
  .admin-bulk-footer { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .admin-bulk-footer__row--bulk { flex: 1 1 auto; }
  .admin-bulk-footer__row--nav  { flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
}

/* Make admin index pages fill the viewport vertically: toolbar +
   table-scroll + footer take the full height of `.admin-content`,
   the table-scroll grows to fill the gap, and the bulk/pagy footer
   sticks at the bottom edge instead of leaving white space below.
   `.companies-index` and `.admin-index--fill` both opt in by setting
   `flex: 1`; other admin pages keep their natural top-aligned layout
   because they don't grow. */
.companies-index,
.admin-index--fill {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.companies-index .admin-table-scroll,
.admin-index--fill .admin-table-scroll {
  flex: 1 1 0;
  min-height: 200px;
  /* Override the conservative global `max-height` cap (computed
     against `100vh` minus a fudge factor) — inside this flex column
     the parent already constrains us, and the cap was clipping the
     table to roughly half the viewport. */
  max-height: none;
}

/* =========================================================================
   "Настроить таблицу" modal
   ========================================================================= */
.admin-table-config {
  position: relative;
  display: inline-block;
}

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

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.admin-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px 22px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 64px var(--shadow);
}

.admin-modal__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.admin-modal__hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.admin-modal__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-modal__check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.admin-modal__check input {
  cursor: pointer;
}

.admin-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

body.admin-modal--open {
  overflow: hidden;
}

/* =========================================================================
   Per-row "⋮" action menu
   ========================================================================= */
.admin-table td.admin-table__actions[data-controller~="row-menu"] {
  position: relative;
}

.row-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.row-menu__trigger:hover {
  background: var(--card);
  color: var(--text-strong);
  border-color: var(--line);
}

.row-menu__trigger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.row-menu__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 8px;
  z-index: 15;
  min-width: 180px;
  padding: 6px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 16px 32px var(--shadow);
  display: flex;
  flex-direction: column;
}

.row-menu__panel[hidden] {
  display: none;
}

.row-menu__item {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
}

.row-menu__item:hover,
.row-menu__item:focus {
  background: var(--card);
  color: var(--text-strong);
  outline: none;
}

.row-menu__item--danger {
  color: var(--red);
}

.row-menu__item--danger:hover,
.row-menu__item--danger:focus {
  background: var(--red);
  color: #fff;
}

.admin-table__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.admin-table__pagination .pagy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Pagy 9 emits plain `<a>` for prev/next/page links — disabled prev/next
   omit the `href` and add `aria-disabled="true"`. Background is
   transparent so the chip doesn't merge into the parent card (which
   itself uses `--card-solid`); border + text colour carry the shape. */
.admin-table__pagination .pagy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.admin-table__pagination .pagy a:hover {
  background: var(--card);
  border-color: var(--text);
}

.admin-table__pagination .pagy a.current,
.admin-table__pagination .pagy .current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: default;
}

.admin-table__pagination .pagy a[aria-disabled="true"]:not(.current),
.admin-table__pagination .pagy .gap,
.admin-table__pagination .pagy .disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
}
/* Minimal component layer — Phase 0 gap-fill until proper design system.
   Uses tokens from design_tokens.css. */

html, body {
  background: linear-gradient(180deg, var(--page-bg-a) 0%, var(--page-bg-b) 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.45;
}
* { box-sizing: border-box; }

body {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 96px;
}

h1, h2, h3, h4 { color: var(--text-strong); margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }

p, ul, ol { margin: 0 0 12px; }

a {
  color: #6aa9ff;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #6aa9ff;
  box-shadow: 0 0 0 3px rgba(106,169,255,.18);
}

/* Mobile-only button defaults. The `body:not(.admin-body)` guard keeps these
   from cascading into the desktop admin chrome, where admin.css owns the
   `.btn` family and uses the red-gradient primary / ghost / danger variants
   defined under `body.admin-body`. Without the guard, this block would beat
   admin.css purely on source order (require_tree . loads alphabetically:
   admin → components). */
body:not(.admin-body) button,
body:not(.admin-body) input[type="submit"],
body:not(.admin-body) .btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: #6aa9ff;
  color: #04101f;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  font-family: inherit;
}
body:not(.admin-body) button:hover,
body:not(.admin-body) input[type="submit"]:hover,
body:not(.admin-body) .btn:hover { filter: brightness(1.08); text-decoration: none; }

body:not(.admin-body) .btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
body:not(.admin-body) .btn--danger { background: var(--red); color: #fff; }

input[type="checkbox"], input[type="radio"] {
  width: 16px; height: 16px; vertical-align: middle; margin-right: 6px; accent-color: #6aa9ff;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }

form > div, form > p { margin-bottom: 10px; }

.flash, .errors {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 200ms ease, transform 200ms ease;
}
.flash__text { flex: 1; min-width: 0; }
.flash__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.flash__close:hover { opacity: 1; }
.flash--leaving { opacity: 0; transform: translateY(-6px); }
.flash--notice { border-color: var(--green); }
.flash--alert  { border-color: var(--red); background: var(--red-soft); }
.errors { border-color: var(--red); background: var(--red-soft); }

/* Cards & lists */
.card,
.company,
.contact,
.daily-plan,
.employee-profile,
.calendar,
.approval-detail,
.approval-queue,
.billing-tab,
.companies,
.contacts,
.daily-plans,
.csv-import,
.earn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
}

/* Bottom nav (mobile-first) */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
  padding: 8px 4px env(safe-area-inset-bottom);
  z-index: 50;
  backdrop-filter: blur(14px);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); text-decoration: none; }
.nav-item--active { color: var(--text-strong); }
.nav-item--disabled { opacity: 0.5; pointer-events: none; }
.nav-icon { font-size: 18px; line-height: 1; }
.nav-label { font-size: 11px; }

/* Brand / status bar */
.brand, .brand-text {
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-strong);
  margin-bottom: 8px;
}

/* More-menu sheet */
.more-menu {
  background: var(--sheet-bg-a);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--line);
}
.more-menu__list { display: flex; flex-direction: column; gap: 6px; padding: 0; margin: 0; list-style: none; }

/* Status pills */
.companies__status,
.daily-plans__status,
.employees-table__status,
.contacts__email,
.company__status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* Generic table-ish blocks */
.employees-table,
.approval-queue__row { padding: 12px 0; border-bottom: 1px solid var(--line); }

/* Forms within cards spacing */
form { margin: 0; }
form input, form select, form textarea, form button { margin-bottom: 6px; }

/* Calendar (basic legibility) */
.calendar__cell { display: inline-block; width: 26px; height: 26px; margin: 2px; border-radius: 6px; background: var(--card-solid); }
.calendar__cell--green  { background: var(--green); }
.calendar__cell--yellow { background: var(--yellow); }
.calendar__cell--red    { background: var(--red); }
.calendar__cell--muted  { background: var(--card-solid); }
.calendar__legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.calendar__legend-item { display: inline-flex; align-items: center; gap: 6px; }

/* Daily plan bars */
.daily-plan__bars { display: flex; gap: 8px; align-items: flex-end; height: 60px; }

/* Earn widget */
.earn { font-size: 18px; font-weight: 600; }

/* Responsive */
@media (max-width: 600px) {
  body { padding: 16px 12px 96px; }
  h1 { font-size: 24px; }
}

/* EmailTemplate post-image preview (form + show). */
.email-template__image-preview {
  display: block;
  max-width: 240px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* EmailTemplate body on the show page — a <pre> defaults to no-wrap, so long
   lines (e.g. the «Сайт, который приводит клиентов…» sentence) overflowed the
   card to the right. Keep the newlines, but wrap long lines. */
.email-template__body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}
/*
 * app/assets/stylesheets/employee_dashboard.css
 *
 * Employee mobile dashboard, ported 1:1 from doc/design/mockup/styles.css and
 * the design screenshots (doc/design/dark.png / light.png / second_menu.png).
 *
 * SCOPING: every selector is prefixed with `body[data-ui="employee"]` so the
 * bare mockup classes (.earn, .card, .row, .plan, .warning, .bottom-nav,
 * .sheet, ...) cannot leak into the desktop admin chrome (admin.css, which
 * uses the same design tokens). The data-ui attribute lives only on
 * application.html.erb (the employee layout). Design tokens themselves are NOT
 * redefined here — they come from design_tokens.css; we only add the active
 * (green) accents the mockup HTML omitted and a few new components (success
 * pill, per-second line, Задачи cards).
 *
 * The desktop preview frame (.stage / .phone) and the @media phone-takeover
 * from the mockup are intentionally dropped — the app is already full-screen
 * mobile.
 */

/* ---- Shell: undo the components.css desktop centering for employees ----- */
body[data-ui="employee"] {
  max-width: none;
  margin: 0;
  padding: 0 0 76px;
}

/* =========================================================================
   Topbar (shared/_statusbar.html.erb)
   ========================================================================= */
body[data-ui="employee"] .topbar {
  height: 62px;
  padding: 15px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

body[data-ui="employee"] .topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

body[data-ui="employee"] .topbar .logo {
  width: 39px;
  height: 39px;
  filter: drop-shadow(0 0 14px rgba(255, 80, 70, .34));
}

body[data-ui="employee"] .topbar .logo svg { width: 100%; height: 100%; }

body[data-ui="employee"] .topbar .logo rect,
body[data-ui="employee"] .topbar .logo path {
  fill: none;
  stroke: var(--red);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-ui="employee"] .topbar h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -.5px;
}

body[data-ui="employee"] .topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

body[data-ui="employee"] .userbox {
  display: flex;
  align-items: center;
  gap: 11px;
}

body[data-ui="employee"] .bell {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
}

body[data-ui="employee"] .bell svg {
  width: 23px;
  height: 23px;
}

/* Notification indicator — a small green dot (matches doc/design/*.png),
   not a count badge. */
body[data-ui="employee"] .bell .bell-dot {
  position: absolute;
  right: 1px;
  top: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--page-bg-a);
}

body[data-ui="employee"] .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 35%, #efc19f 0 17%, transparent 18%),
    radial-gradient(circle at 50% 72%, #244336 0 34%, transparent 35%),
    linear-gradient(#37414b, #171b20);
}

/* =========================================================================
   Hello + pace pills
   ========================================================================= */
body[data-ui="employee"] .hello {
  /* min-height (not fixed) so a long greeting can grow instead of clipping;
     gap keeps the pill clear of the heading. */
  min-height: 57px;
  padding: 20px 20px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

body[data-ui="employee"] .hello h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  min-width: 0;
}

body[data-ui="employee"] .danger-pill,
body[data-ui="employee"] .success-pill,
body[data-ui="employee"] .warning-pill,
body[data-ui="employee"] .muted-pill {
  min-height: 25px;
  padding: 4px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 800;
  /* keep the pill on one line and never let the heading squeeze it */
  white-space: nowrap;
  flex-shrink: 0;
}

body[data-ui="employee"] .warning-pill {
  color: var(--yellow);
  background: var(--yellow-soft);
  border: 1px solid rgba(255, 196, 0, .24);
}

body[data-ui="employee"] .muted-pill {
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
}

body[data-ui="employee"] .warning-pill i,
body[data-ui="employee"] .muted-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

body[data-ui="employee"] .warning-pill i { background: var(--yellow); box-shadow: 0 0 13px rgba(255, 196, 0, .6); }
body[data-ui="employee"] .muted-pill i { background: var(--muted); }

body[data-ui="employee"] .danger-pill {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(255, 72, 58, .22);
}

body[data-ui="employee"] .success-pill {
  color: var(--green);
  background: rgba(82, 212, 74, .14);
  border: 1px solid rgba(82, 212, 74, .26);
}

body[data-ui="employee"] .danger-pill i,
body[data-ui="employee"] .success-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

body[data-ui="employee"] .danger-pill i {
  background: var(--red);
  box-shadow: 0 0 13px rgba(255, 81, 71, .6);
}

body[data-ui="employee"] .success-pill i {
  background: var(--green);
  box-shadow: 0 0 13px rgba(82, 212, 74, .6);
}

/* =========================================================================
   Earn card — red (behind) keeps the design_tokens look; green (active) here
   ========================================================================= */
body[data-ui="employee"] .earn {
  position: relative;
  /* height:auto overrides the unscoped `.earn{height:117px}` in
     design_tokens.css; min-height keeps the card from collapsing. Together
     they let the footer rate/frozen line grow instead of being clipped.
     The chart is absolutely positioned, so vertical growth is safe. */
  height: auto;
  min-height: 117px;
  margin: 0 20px 12px;
  padding: 23px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 var(--inner-glow);
  font-weight: normal;
}

body[data-ui="employee"] .earn.danger-glow {
  background:
    radial-gradient(circle at 88% 38%, rgba(255, 77, 54, .27), transparent 25%),
    linear-gradient(105deg, color-mix(in srgb, var(--card-solid), #1d242b 30%), color-mix(in srgb, var(--red), transparent 80%));
}

body[data-ui="employee"] .earn.active-glow {
  background:
    radial-gradient(circle at 88% 38%, rgba(82, 212, 74, .27), transparent 25%),
    linear-gradient(105deg, color-mix(in srgb, var(--card-solid), #1d242b 30%), color-mix(in srgb, var(--green), transparent 82%));
}

body[data-ui="employee"][data-theme="light"] .earn.danger-glow {
  background:
    radial-gradient(circle at 88% 38%, rgba(255, 80, 70, .18), transparent 25%),
    linear-gradient(105deg, #ffffff, #fff0ed);
}

body[data-ui="employee"][data-theme="light"] .earn.active-glow {
  background:
    radial-gradient(circle at 88% 38%, rgba(82, 212, 74, .18), transparent 25%),
    linear-gradient(105deg, #ffffff, #eefdec);
}

/* Idle/gated earnings card — untrained worker; neutral grey, no green verdict. */
body[data-ui="employee"] .earn.idle-glow {
  background:
    radial-gradient(circle at 88% 38%, rgba(128, 139, 150, .2), transparent 25%),
    linear-gradient(105deg, color-mix(in srgb, var(--card-solid), #1d242b 30%), color-mix(in srgb, var(--muted), transparent 85%));
}

body[data-ui="employee"][data-theme="light"] .earn.idle-glow {
  background:
    radial-gradient(circle at 88% 38%, rgba(128, 139, 150, .14), transparent 25%),
    linear-gradient(105deg, #ffffff, #f3f5f7);
}

body[data-ui="employee"] .earn p {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 14px;
}

body[data-ui="employee"] .earn strong {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--text-strong);
  font-size: 44px;
  line-height: .95;
  letter-spacing: -1.7px;
}

body[data-ui="employee"] .earn em {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 13px;
  font-weight: 850;
}

body[data-ui="employee"] .earn .earn-rate { color: var(--green); }
body[data-ui="employee"] .earn .earn-frozen { color: var(--orange); }
body[data-ui="employee"] .earn .earn-timer {
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: .5px;
}

/* Chart — red points down (behind), green points up (active). */
body[data-ui="employee"] .chart {
  position: absolute;
  right: 6px;
  bottom: 7px;
  width: 185px;
  height: 110px;
}

body[data-ui="employee"] .earn.danger-glow .chart rect { fill: rgba(255, 97, 74, .52); }
body[data-ui="employee"] .earn.danger-glow .chart polyline { stroke: var(--red); }
body[data-ui="employee"] .earn.danger-glow .chart circle,
body[data-ui="employee"] .earn.danger-glow .chart text { fill: var(--red); }

body[data-ui="employee"] .earn.active-glow .chart rect { fill: rgba(82, 212, 74, .5); }
body[data-ui="employee"] .earn.active-glow .chart polyline { stroke: var(--green); }
body[data-ui="employee"] .earn.active-glow .chart circle,
body[data-ui="employee"] .earn.active-glow .chart text { fill: var(--green); }

body[data-ui="employee"] .earn.idle-glow .chart rect { fill: rgba(128, 139, 150, .4); }
body[data-ui="employee"] .earn.idle-glow .chart polyline { stroke: var(--muted); }
body[data-ui="employee"] .earn.idle-glow .chart circle,
body[data-ui="employee"] .earn.idle-glow .chart text { fill: var(--muted); }

body[data-ui="employee"] .chart polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

body[data-ui="employee"] .chart text { font-size: 42px; font-weight: 900; }

/* =========================================================================
   Cards / План дня
   ========================================================================= */
body[data-ui="employee"] .card {
  margin: 0 20px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--inner-glow);
  padding: 0;
}

body[data-ui="employee"] .plan {
  /* height:auto overrides the fixed `.plan{height:150px}` in
     design_tokens.css — with 4 metric rows (email/sms/calls/posts) the
     card must grow or the last row overlaps the Задачи section below. */
  height: auto;
  padding: 14px 13px 12px;
}

body[data-ui="employee"] .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

body[data-ui="employee"] .title-row h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

body[data-ui="employee"] .title-row span {
  height: 24px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 850;
}

body[data-ui="employee"] .title-row .pace-behind {
  color: var(--red);
  background: var(--red-soft);
}

body[data-ui="employee"] .title-row .pace-active {
  color: var(--green);
  background: rgba(82, 212, 74, .14);
}

/* Idle/gated pace — untrained worker; neutral grey, no red/green verdict. */
body[data-ui="employee"] .title-row .pace-idle {
  color: var(--muted);
  background: rgba(128, 139, 150, .16);
}

body[data-ui="employee"] .row {
  display: grid;
  grid-template-columns: 24px 100px 1fr 56px;
  align-items: center;
  gap: 10px;
  margin: 9px 0;
  font-size: 11px;
  font-weight: 800;
}

body[data-ui="employee"] .row p { margin: 0; color: var(--text); }
body[data-ui="employee"] .row b { font-size: 18px; }
body[data-ui="employee"] .row em { font-style: normal; text-align: right; color: var(--muted); }

body[data-ui="employee"] .row.red b,
body[data-ui="employee"] .row.red em { color: var(--red); }
body[data-ui="employee"] .row.orange b,
body[data-ui="employee"] .row.orange em { color: var(--orange); }
body[data-ui="employee"] .row.yellow b,
body[data-ui="employee"] .row.yellow em { color: var(--yellow); }
body[data-ui="employee"] .row.green b,
body[data-ui="employee"] .row.green em { color: var(--green); }
body[data-ui="employee"] .row.muted b,
body[data-ui="employee"] .row.muted p,
body[data-ui="employee"] .row.muted em { color: var(--muted); }

body[data-ui="employee"] .bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(128, 139, 150, .18);
}

body[data-ui="employee"] .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

body[data-ui="employee"] .row.red .bar i {
  background: var(--red);
  box-shadow: 0 0 9px rgba(255, 81, 71, .42);
}
body[data-ui="employee"] .row.orange .bar i { background: var(--orange); }
body[data-ui="employee"] .row.yellow .bar i { background: var(--yellow); }
body[data-ui="employee"] .row.green .bar i {
  background: var(--green);
  box-shadow: 0 0 9px rgba(82, 212, 74, .42);
}
body[data-ui="employee"] .row.muted .bar i { background: var(--muted); }

body[data-ui="employee"] .plan-empty {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* =========================================================================
   Warning (behind state)
   ========================================================================= */
body[data-ui="employee"] .warning {
  margin: 0 20px 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 92, 54, .32);
  background: linear-gradient(90deg, rgba(255, 89, 42, .16), rgba(255, 89, 42, .05));
}

body[data-ui="employee"] .warning b {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid var(--orange);
  color: var(--orange);
  font-weight: 800;
}

/* Text block takes the middle; the × sits flush right (all vertically centered). */
body[data-ui="employee"] .warning > div { flex: 1 1 auto; min-width: 0; }
body[data-ui="employee"] .warning strong { color: var(--red); font-size: 12px; }
body[data-ui="employee"] .warning p { margin: 3px 0 0; color: var(--text); font-size: 11px; }

/* × that dismisses the behind-plan warning (no auto-timeout). */
body[data-ui="employee"] .warning__close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
body[data-ui="employee"] .warning__close:hover { color: var(--text-strong); background: rgba(128, 139, 150, .14); }

/* =========================================================================
   Задачи cards row (active state)
   ========================================================================= */
body[data-ui="employee"] .emp-tasks { margin: 0 20px 12px; }

body[data-ui="employee"] .emp-tasks__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

body[data-ui="employee"] .emp-tasks__head h3 { margin: 0; color: var(--text-strong); font-size: 16px; }

body[data-ui="employee"] .emp-tasks__all {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

body[data-ui="employee"] .emp-tasks__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

body[data-ui="employee"] .emp-task-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px 30px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  min-height: 120px;
}

body[data-ui="employee"] .emp-task-card:hover { border-color: var(--line-strong); text-decoration: none; }

/* Training gate: inert task tile for a locked (untrained) worker. */
body[data-ui="employee"] .emp-task-card.locked {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Coloured icon square (matches doc/design/dark.png). */
body[data-ui="employee"] .emp-task-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(82, 212, 74, .14);
  color: var(--green);
}
body[data-ui="employee"] .emp-task-card__icon svg { width: 22px; height: 22px; }

/* Per-kind accent colours. */
body[data-ui="employee"] .emp-task-card--sms .emp-task-card__icon {
  background: rgba(74, 158, 255, .15);
  color: #4a9eff;
}
body[data-ui="employee"] .emp-task-card--post .emp-task-card__icon {
  background: rgba(167, 124, 255, .16);
  color: #a77cff;
}

body[data-ui="employee"] .emp-task-card__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-strong);
}

body[data-ui="employee"] .emp-task-card__chevron {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

/* Count badge — how many tasks of this kind are queued today (× N). */
body[data-ui="employee"] .emp-task-card__count {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(128, 139, 150, .18);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

body[data-ui="employee"] .emp-tasks__empty { color: var(--muted); font-size: 12px; margin: 0; }

/* =========================================================================
   Shift controls
   ========================================================================= */
body[data-ui="employee"] .buttons {
  margin: 0 20px 12px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}

/* `button_to` wraps each control in a <form>; let the form be the grid cell
   and the button fill it so the layout matches the plain-button mockup. */
body[data-ui="employee"] .buttons form.button_to { margin: 0; display: flex; }

body[data-ui="employee"] .buttons button {
  width: 100%;
  padding: 11px 0;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

body[data-ui="employee"] .buttons .start {
  color: var(--green);
  background: rgba(82, 212, 74, .13);
  border-color: rgba(82, 212, 74, .24);
}

body[data-ui="employee"] .buttons .pause {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: rgba(255, 196, 0, .2);
}

body[data-ui="employee"] .buttons .finish {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(255, 72, 58, .28);
}

/* =========================================================================
   Bottom cards (Календарь + Выплаты)
   ========================================================================= */
body[data-ui="employee"] .bottom-cards {
  margin: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

body[data-ui="employee"] .calendar,
body[data-ui="employee"] .pay {
  /* display:block + height:auto override the unscoped `.calendar{display:grid}`
     from quality_calendar.css and the fixed `height:112px` from
     design_tokens.css (both load after / alongside this file and would
     otherwise collapse the card content). */
  display: block;
  height: auto;
  margin: 0;
  padding: 11px;
}

body[data-ui="employee"] .mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

body[data-ui="employee"] .mini-head h3,
body[data-ui="employee"] .pay h3 { margin: 0; color: var(--text-strong); font-size: 16px; }

body[data-ui="employee"] .mini-head a { color: var(--green); font-size: 11px; font-weight: 800; text-decoration: none; }
/* Training gate: inert «Сегодня» label for a locked worker. */
body[data-ui="employee"] .mini-head__locked { color: var(--muted); font-size: 11px; font-weight: 800; }

body[data-ui="employee"] .week,
body[data-ui="employee"] .dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

body[data-ui="employee"] .week { color: var(--muted); font-size: 10px; }
body[data-ui="employee"] .week span { display: block; }
body[data-ui="employee"] .dates { margin-top: 6px; }

body[data-ui="employee"] .dates b {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: rgba(128, 139, 150, .18);
  font-size: 12px;
}

body[data-ui="employee"] .dates .good { color: #04140a; background: var(--green); }
body[data-ui="employee"] .dates .warn { color: #111; background: var(--orange); }
body[data-ui="employee"] .dates .bad { color: #fff; background: rgba(255, 81, 71, .66); }

body[data-ui="employee"] .legend {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
}

body[data-ui="employee"] .legend span { display: flex; align-items: center; gap: 4px; }
body[data-ui="employee"] .legend i { width: 6px; height: 6px; border-radius: 50%; }
body[data-ui="employee"] .legend .g { background: var(--green); }
body[data-ui="employee"] .legend .y { background: var(--orange); }
body[data-ui="employee"] .legend .r { background: var(--red); }

body[data-ui="employee"] .pay { text-align: center; }
body[data-ui="employee"] .pay p { margin: 6px 0 3px; color: var(--muted); font-size: 10px; }
body[data-ui="employee"] .pay strong { display: block; margin-bottom: 9px; color: var(--text-strong); font-size: 25px; white-space: nowrap; }

body[data-ui="employee"] .pay form { margin: 0; }

body[data-ui="employee"] .pay button {
  width: 100%;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(var(--green), #3cae34);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

body[data-ui="employee"] .pay button:disabled {
  opacity: .4;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

body[data-ui="employee"][data-shift="behind"] .pay button {
  background: linear-gradient(var(--red), var(--red-2));
}

/* =========================================================================
   Bottom navigation (shared/_bottom_nav.html.erb) — 5-item tab bar
   ========================================================================= */
body[data-ui="employee"] .bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  padding: 7px 14px 9px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  z-index: 50;
}

body[data-ui="employee"] .bottom-nav .nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 20px;
  text-decoration: none;
  cursor: pointer;
}

body[data-ui="employee"] .bottom-nav .nav-ico {
  width: 26px;
  height: 26px;
}
body[data-ui="employee"] .bottom-nav .nav-item span:last-child { font-size: 11px; font-weight: 800; }
body[data-ui="employee"] .bottom-nav .nav-item:hover { color: var(--text); text-decoration: none; }
body[data-ui="employee"] .bottom-nav .nav-item.active { color: var(--green); }

/* Training gate: inert, greyed tab for an untrained worker (Задачи/Контент/Выплаты). */
body[data-ui="employee"] .bottom-nav .nav-item.locked {
  opacity: .38;
  cursor: not-allowed;
  pointer-events: none;
}
body[data-ui="employee"] .bottom-nav .nav-item.locked:hover { color: var(--muted); }

body[data-ui="employee"] .bottom-nav .nav-item.active::before {
  content: "";
  position: absolute;
  top: -6px;
  width: 34px;
  height: 2px;
  border-radius: 5px;
  background: var(--green);
}

/* Post-training «done» mark on the «Обучение» tab: a tiny green ✓ overlay in
   the top-right of the tab, so the worker reads the slot as «уже пройдено,
   сюда захожу за скриптами», not as an unfinished gate. */
body[data-ui="employee"] .bottom-nav .nav-item--done { position: relative; }
body[data-ui="employee"] .bottom-nav .nav-item__check {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--green);
  color: #04140a;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  font-style: normal;
}

/* Compact «passed» chip on /me/training when the worker has already passed —
   collapses the old full-width «card» to a single line so the lessons-library
   below it gets the real estate. */
body[data-ui="employee"] .me-training__passed--compact {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body[data-ui="employee"] .me-training__passed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(82, 212, 74, 0.14);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
body[data-ui="employee"] .me-training__passed-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================================
   "Ещё" sheet (shared/_more_menu.html.erb)
   ========================================================================= */
body[data-ui="employee"] .sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 59px;
  z-index: 60;
  padding: 11px 14px 18px;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  background: linear-gradient(var(--sheet-bg-a), var(--sheet-bg-b));
  box-shadow: 0 -30px 70px var(--shadow);
}

body[data-ui="employee"] .sheet[hidden] { display: none; }

body[data-ui="employee"] .handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: var(--line-strong);
}

body[data-ui="employee"] .sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

body[data-ui="employee"] .sheet-head h2 { margin: 0; color: var(--text-strong); font-size: 19px; }

body[data-ui="employee"] .sheet-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

body[data-ui="employee"] .sheet ul {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border-radius: 11px;
  border: 1px solid var(--line);
}

body[data-ui="employee"] .sheet li {
  height: 43px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 25px 1fr 15px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

body[data-ui="employee"] .sheet li:last-child { border-bottom: 0; }
body[data-ui="employee"] .sheet li b { color: var(--red); font-size: 17px; }
body[data-ui="employee"] .sheet li a { color: var(--text); text-decoration: none; cursor: pointer; }
body[data-ui="employee"] .sheet li a:hover { color: var(--text-strong); text-decoration: none; }
/* Chevron is the last span in each row; scope to :last-child so an inert label
   span (locked state) keeps normal menu-text styling, not the chevron's. */
body[data-ui="employee"] .sheet li span:last-child { color: var(--muted); font-size: 21px; text-align: right; }

/* Training gate: while locked the whole "Ещё" list is inert + greyed. */
body[data-ui="employee"] .sheet.locked ul { opacity: .4; pointer-events: none; }
body[data-ui="employee"] .sheet-locked-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(128, 139, 150, .14);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* The Компании index (/companies, still rendered in the employee layout)
   opts into a flex-fill layout (.companies-index) that stretches the scroll
   container to fill the desktop admin shell (.admin-content is a flex column).
   The employee mobile layout has NO such flex shell, so the container's
   `flex: 1 1 0` collapsed it to its 200px min-height — a few-row strip. Fall
   back to natural block flow so the page scrolls full-height. (The Задачи
   table is no longer shown to employees — they get the mobile screen below —
   so its admin-index--fill / admin-table-scroll override was removed.) */
body[data-ui="employee"] .companies-index {
  display: block;
}

/* =========================================================================
   Mobile "Задачи" screen (Me::TasksController — index + show)
   ========================================================================= */

/* Sticky title bar: stays put while the card list scrolls under it. The 62px
   offset clears the topbar (shared/_statusbar.html.erb). */
body[data-ui="employee"] .me-tasks__bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 12px;
  background: var(--card-solid);
  border-bottom: 1px solid var(--line);
}

body[data-ui="employee"] .me-tasks__bar h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.3px;
}

body[data-ui="employee"] .me-tasks__back,
body[data-ui="employee"] .me-task-show__back {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

body[data-ui="employee"] .me-tasks__back:hover,
body[data-ui="employee"] .me-task-show__back:hover { color: var(--text-strong); }

body[data-ui="employee"] .me-tasks__empty {
  margin: 24px 20px;
  color: var(--muted);
  font-size: 14px;
}

body[data-ui="employee"] .me-tasks__list {
  list-style: none;
  margin: 0;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-ui="employee"] .me-task-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--inner-glow);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}

body[data-ui="employee"] .me-task-card:hover { border-color: var(--green); }

body[data-ui="employee"] .me-task-card--done { opacity: .58; }

body[data-ui="employee"] .me-task-card__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(128, 139, 150, .14);
  color: var(--text-strong);
  font-size: 20px;
}

body[data-ui="employee"] .me-task-card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

body[data-ui="employee"] .me-task-card__kind {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 800;
}

/* Small channel label under the headline (the headline is the template name,
   so the worker tells letters apart at a glance; the channel is secondary). */
body[data-ui="employee"] .me-task-card__channel {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* "просрочено N дн." — carried-over task marker (list + detail). */
body[data-ui="employee"] .me-task-card__overdue,
body[data-ui="employee"] .me-overdue-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--yellow-soft);
  border: 1px solid rgba(255, 196, 0, .28);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
}
body[data-ui="employee"] .me-overdue-pill { margin: 0 0 0 8px; }

body[data-ui="employee"] .me-task-card__company {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui="employee"] .me-task-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

body[data-ui="employee"] .me-task-card__due { color: var(--muted); font-size: 11px; }

/* Status pill — reused on index cards and the show facts. */
body[data-ui="employee"] .status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 850;
}

body[data-ui="employee"] .status-pill--pending {
  color: var(--muted);
  background: rgba(128, 139, 150, .16);
}
body[data-ui="employee"] .status-pill--in_progress {
  color: var(--orange);
  background: rgba(255, 92, 54, .16);
}
body[data-ui="employee"] .status-pill--done {
  color: var(--green);
  background: rgba(82, 212, 74, .14);
}
body[data-ui="employee"] .status-pill--cancelled {
  color: var(--red);
  background: var(--red-soft);
}

/* ---- show ---- */
body[data-ui="employee"] .me-task-show__card { margin: 14px 16px 12px; padding: 14px 16px; }

body[data-ui="employee"] .me-task-show__facts {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
}

body[data-ui="employee"] .me-task-show__facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

body[data-ui="employee"] .me-task-show__facts dd {
  margin: 0;
  color: var(--text-strong);
  font-size: 13px;
  word-break: break-word;
}

body[data-ui="employee"] .me-task-show__actions { margin: 0 16px 28px; }

body[data-ui="employee"] .me-task-compose {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body[data-ui="employee"] .me-task-compose__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body[data-ui="employee"] .me-task-compose__field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

body[data-ui="employee"] .me-task-compose__field input,
body[data-ui="employee"] .me-task-compose__input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-strong);
  font: inherit;
}

body[data-ui="employee"] .me-task-compose__field input[readonly] {
  color: var(--muted);
  cursor: not-allowed;
}

body[data-ui="employee"] .me-task-btn {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}

body[data-ui="employee"] .me-task-btn--primary {
  color: #07140a;
  background: var(--green);
  box-shadow: 0 6px 18px rgba(82, 212, 74, .28);
}

body[data-ui="employee"] .me-task-btn--primary:hover { filter: brightness(1.05); }

/* ---- enrich (Заполнение базы) lead form ---- */
body[data-ui="employee"] .me-enrich-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body[data-ui="employee"] .me-enrich-form__hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

body[data-ui="employee"] .me-enrich-form__errors {
  margin: 0;
  padding: 10px 12px 10px 28px;
  border-radius: 10px;
  background: rgba(229, 72, 77, .12);
  color: var(--red, #e5484d);
  font-size: 13px;
}

body[data-ui="employee"] .me-enrich-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body[data-ui="employee"] .me-enrich-form__field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

body[data-ui="employee"] .me-enrich-form__field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-strong);
  font: inherit;
}

body[data-ui="employee"] .me-enrich-form__contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

body[data-ui="employee"] .me-enrich-form__contact legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

/* ---- training (Phase 1a) ---- */
body[data-ui="employee"] .me-training__heading {
  margin: 18px 16px 8px;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 800;
}

body[data-ui="employee"] .me-training__lesson,
body[data-ui="employee"] .me-training__question,
body[data-ui="employee"] .me-training__passed {
  margin: 0 16px 12px;
  padding: 14px 16px;
}

body[data-ui="employee"] .me-training__lesson h4 {
  margin: 0 0 6px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 800;
}

body[data-ui="employee"] .me-training__lesson p,
body[data-ui="employee"] .me-training__passed p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

body[data-ui="employee"] .me-training__passed h3 {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 16px;
  font-weight: 850;
}

body[data-ui="employee"] .me-training__question {
  border: 1px solid var(--line);
}

body[data-ui="employee"] .me-training__question legend {
  padding: 0;
  margin-bottom: 10px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
}

body[data-ui="employee"] .me-training__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

body[data-ui="employee"] .me-training__option input { cursor: pointer; }

body[data-ui="employee"] .me-training__actions { margin: 4px 16px 28px; }

/* Dashboard training CTA shown to untrained field workers in place of the
   shift controls. */
body[data-ui="employee"] .emp-train-gate {
  margin: 0 20px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Full-width green CTA — «Пройти обучение» for an untrained worker. */
body[data-ui="employee"] .emp-train-cta {
  display: block;
  margin: 0 20px 12px;
  padding: 15px;
  border-radius: 12px;
  background: linear-gradient(var(--green), #3cae34);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
body[data-ui="employee"] .emp-train-cta:hover { filter: brightness(1.05); text-decoration: none; }
/* app/assets/stylesheets/product.css */
/* Public «About MarketPult» product page (/about). Standalone light layout. */

.product {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 20px 72px;
  color: var(--text);
}

.product__hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: center;
}

.product__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(82, 212, 74, 0.14);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product__title {
  margin: 14px 0 10px;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 900;
  color: var(--text-strong);
}

.product__subtitle { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; font-weight: 600; }

.product__hero-art { display: block; width: 100%; }
.product__hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px var(--shadow);
}

.product__cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.product__cta-row--center { justify-content: center; }

.product__btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: filter 0.15s, background 0.15s;
}
.product__btn--primary { background: linear-gradient(var(--green), #3cae34); color: #04140a; }
.product__btn--primary:hover { filter: brightness(1.05); }
.product__btn--ghost { border: 2px solid var(--green); color: var(--green); background: transparent; }
.product__btn--ghost:hover { background: color-mix(in srgb, var(--green), transparent 88%); }
.product__btn--lg { padding: 18px 32px; font-size: 17px; }

.product__block { margin-top: 44px; }
.product__h2 { font-size: 24px; font-weight: 900; color: var(--text-strong); margin: 0 0 12px; line-height: 1.2; }
.product__lead { margin: 0; color: var(--text); font-size: 16px; line-height: 1.55; }

.product__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.product__card {
  position: relative;
  padding: 18px 18px 18px 22px;
  border-radius: 16px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  overflow: hidden;
}
.product__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--green);
}
.product__card-title { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--text-strong); }
.product__card-desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.product__steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 12px;
}
.product__steps li {
  position: relative;
  padding: 14px 16px 14px 56px;
  border-radius: 14px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  counter-increment: step;
}
.product__steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #04140a;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product__why { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.product__why li { position: relative; padding-left: 28px; color: var(--text); font-size: 15px; line-height: 1.5; }
.product__why li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 900; }

.product__cta {
  margin-top: 48px;
  padding: 30px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--green), transparent 86%), transparent 60%),
    var(--card-solid);
  border: 1px solid color-mix(in srgb, var(--green), transparent 55%);
  text-align: center;
}
.product__cta .product__lead { max-width: 600px; margin: 0 auto 18px; color: var(--muted); }

@media (max-width: 720px) {
  .product__hero { grid-template-columns: 1fr; }
  .product__title { font-size: 27px; }
  .product__grid { grid-template-columns: 1fr; }
  .product__btn { width: 100%; }
}
/* app/assets/stylesheets/profile.css
 *
 * Profile page (/profile). Mobile-first card column, max 720px on desktop.
 * Picked up automatically by `*= require_tree` in application.css. Component
 * styles mirror the admin token palette (var(--card), var(--red), etc.). */

.profile {
  max-width: 720px;
  margin: 0 auto;
  /* Bottom padding clears the 64-pixel fixed `.bottom-nav` that sits on top of
     the mobile employee layout — without it the last cards (sign-out / danger
     zone) end up scrolled UNDER the nav and looked «hidden» on mobile. */
  padding: 1rem 1rem calc(64px + env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Desktop admin chrome has no bottom-nav; trim the extra padding back to
   normal so the danger card isn't floating in a giant white space. */
body.admin-body .profile { padding-bottom: 1rem; }

.profile__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile__title {
  font-size: 1.5rem;
  margin: 0;
}

.profile__subtitle {
  margin: 0;
  color: var(--text-muted, #888);
  font-size: 0.95rem;
}

.profile__alert {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--red, #dc3545);
  color: var(--red, #dc3545);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.profile-card {
  background: var(--card, #1b1c20);
  border: 1px solid var(--line, #2a2b30);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-card__title {
  font-size: 1.1rem;
  margin: 0;
}

.profile-card__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-card__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-card__label {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
}

.profile-card__field input[type="text"],
.profile-card__field input[type="email"],
.profile-card__field input[type="tel"],
.profile-card__field input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 16px; /* prevent iOS zoom on focus */
  border: 1px solid var(--line, #2a2b30);
  border-radius: 8px;
  background: var(--page-bg-a, #0f1014);
  color: var(--text, #eaeaea);
}

.profile-card__field input[aria-invalid="true"] {
  border-color: var(--red, #dc3545);
}

.profile-card__req {
  color: var(--red, #dc3545);
  font-style: normal;
  margin-left: 0.15rem;
}

.profile-card__required-hint,
.profile-card__hint {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin: 0;
}

.profile-card__current {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-card__chip {
  display: inline-block;
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.profile-card__chip--success {
  background: rgba(40, 167, 69, 0.15);
  color: var(--green, #28a745);
  border: 1px solid var(--green, #28a745);
}

.profile-card__chip--muted {
  background: rgba(120, 120, 120, 0.12);
  color: var(--muted, #888);
  border: 1px solid rgba(120, 120, 120, 0.35);
}

.profile-card__chip--warning {
  background: rgba(255, 168, 0, 0.12);
  color: var(--orange, #d97706);
  border: 1px solid var(--orange, #d97706);
}

.profile-card__verify-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.profile-card__verify-code {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--line, #2a2b30);
  border-radius: 8px;
}

.profile-card__verify-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-card__error {
  color: var(--red, #dc3545);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.profile-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.profile-card__file-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--line, #2a2b30);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.profile-card__file-label input[type="file"] {
  cursor: pointer;
}

.profile-card__remove {
  align-self: flex-start;
  margin-top: 0.5rem;
  cursor: pointer;
}

.profile-avatar {
  display: flex;
  justify-content: center;
}

.profile-avatar__img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--page-bg-a, #0f1014);
  border: 2px solid var(--line, #2a2b30);
}

.profile-avatar__img--empty {
  object-fit: contain;
  padding: 28px;
  opacity: 0.6;
}

.profile-avatar__error {
  display: block;
  color: var(--red, #dc3545);
  font-size: 0.85rem;
  text-align: center;
}

/* Inline field errors emitted by form_validation_controller.js — keep red so
   the user spots them even with a desktop-admin theme override. */
.profile-card__field .field-error,
.profile-card .field-error {
  display: block;
  color: var(--red, #dc3545);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Buttons get pointer cursors everywhere on this page. */
.profile button,
.profile .btn,
.profile input[type="submit"] {
  cursor: pointer;
}

/* ── Avatar crop modal ─────────────────────────────────────────────
   Opened by avatar_cropper_controller.js after a successful file pick.
   The backdrop catches clicks → controller#cancel. The panel uses the
   shared design tokens so it themes correctly under BOTH the mobile
   application layout AND the desktop admin chrome. */
.profile-avatar__modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.profile-avatar__modal[hidden] {
  display: none;
}

.profile-avatar__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.profile-avatar__modal-panel {
  position: relative;
  background: var(--card, #1b1c20);
  color: var(--text, #eaeaea);
  border: 1px solid var(--line, #2a2b30);
  border-radius: 12px;
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.profile-avatar__modal-title {
  margin: 0;
  font-size: 1.05rem;
}

.profile-avatar__cropper {
  max-height: 60vh;
  background: var(--page-bg-a, #0f1014);
  border-radius: 8px;
  overflow: hidden;
}

/* Cropper.js measures the host element to fit its canvas — `display: block`
   on the <img> avoids the inline-baseline gap that throws off the math. */
.profile-avatar__cropper img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
}

.profile-avatar__modal-loading {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  text-align: center;
}

.profile-avatar__modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.profile-avatar__modal-actions .btn {
  cursor: pointer;
}

.profile-avatar__modal-actions .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Light-theme override: admin chrome flips background tokens to white but the
   modal needs to keep enough contrast against the dimmed page underneath. */
body.admin-body .profile-avatar__modal-panel {
  background: var(--card, #ffffff);
  color: var(--text, #1a1a1a);
  border-color: var(--line, #e1e4eb);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

body.admin-body .profile-avatar__cropper {
  background: var(--page-bg-a, #f5f6f8);
}

/* Lock body scroll while the cropper is open. */
body.profile-avatar__modal--lock {
  overflow: hidden;
}

@media (min-width: 768px) {
  .profile {
    padding: 2rem 1rem;
  }
}
/* app/assets/stylesheets/quality_calendar.css */
/* Stream-V — Quality calendar (heatmap) widget styles using design tokens. */

.quality-calendar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Scoped under `.quality-days-index` so these win over the generic `.calendar`
   used by the MOBILE dashboard mini-card: design_tokens.css sets
   `.calendar{height:112px}` and components.css adds card chrome — unscoped, the
   31-day admin grid was clamped to 112px and overflowed onto the legend. The
   reset neutralizes that inherited box; the mobile `.calendar` is untouched. */
.quality-days-index .calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: 480px;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.quality-days-index .calendar__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text);
  background: var(--card-solid);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.quality-days-index .calendar__cell:hover,
.quality-days-index .calendar__cell:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--line-strong);
  outline: none;
}

.quality-days-index .calendar__cell--green  { background: var(--green);    color: #05070a; }
.quality-days-index .calendar__cell--yellow { background: var(--yellow);   color: #05070a; }
.quality-days-index .calendar__cell--red    { background: var(--red);      color: var(--text-strong); }
.quality-days-index .calendar__cell--muted  { background: var(--card);     color: var(--muted); }

.quality-days-index .calendar__legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 1rem 0 0;
}

.quality-days-index .calendar__summary {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.calendar__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.calendar__legend-item::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.calendar__legend-item--green::before  { background: var(--green); }
.calendar__legend-item--yellow::before { background: var(--yellow); }
.calendar__legend-item--red::before    { background: var(--red); }
.calendar__legend-item--muted::before  { background: var(--card); }

.calendar__today-link {
  align-self: flex-start;
  color: var(--text);
  text-decoration: underline;
  cursor: pointer;
}

.calendar__today-link:hover { color: var(--text-strong); }

.quality-day__score--green  { color: var(--green); }
.quality-day__score--yellow { color: var(--yellow); }
.quality-day__score--red    { color: var(--red); }
.quality-day__score--muted  { color: var(--muted); }

/* Evidence form / list / detail */
.evidence-new .field {
  margin-bottom: 1rem;
}

.evidence__status,
.evidences__status {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 0.875rem;
}

.btn {
  cursor: pointer;
}
/* app/assets/stylesheets/referrals.css */
/* Public referral landing (/refer) — offer + live probability/reward meter +
   quiz + lead form. Uses design tokens; standalone (no app chrome). */

/* The shared app body is capped at 760px + centered (components.css) for the
   mobile field-worker view. That leaves the body's light background framed by
   the unstyled (dark) <html> canvas on this full-bleed marketing page. Let the
   body fill the viewport so the light theme covers edge-to-edge; .ref still
   centers the content column at 640px. */
body.ref-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

.ref {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  color: var(--text);
}

.ref__hero { text-align: center; margin-bottom: 24px; }

.ref__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(82, 212, 74, 0.14);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ref__title {
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
  color: var(--text-strong);
}

.ref__subtitle { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; font-weight: 700; }
.ref__about-link { margin: 12px 0 0; }
.ref__about-link a { color: var(--green); font-weight: 800; font-size: 14px; text-decoration: none; cursor: pointer; }
.ref__about-link a:hover { text-decoration: underline; }

.ref__form { display: flex; flex-direction: column; gap: 18px; }

.ref__alert {
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--red-soft, rgba(255, 81, 71, 0.16));
  color: var(--red);
  font-size: 13px;
}

/* ---- Live meter ---------------------------------------------------------- */
.ref__meter {
  padding: 18px;
  border-radius: 16px;
  background: var(--card-solid);
  border: 1px solid color-mix(in srgb, var(--green), transparent 60%);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.ref__meter-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ref__meter-reward { text-align: right; }
.ref__meter-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.ref__probability { display: block; margin-top: 2px; font-size: 34px; font-weight: 900; color: var(--green); line-height: 1; }
.ref__reward { display: block; margin-top: 2px; font-size: 24px; font-weight: 900; color: var(--text-strong); line-height: 1; }
.ref__meter-hint { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.ref__bar { margin-top: 14px; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(128, 139, 150, 0.2); }
.ref__bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); box-shadow: 0 0 12px rgba(82, 212, 74, 0.45); transition: width 220ms ease; }

/* ---- Quiz + form fieldsets ----------------------------------------------- */
.ref__quiz,
.ref__lead {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* `display: flex` above outranks the UA `[hidden]` rule, so the form would
   stay visible before opt-in. Re-assert hidden at matching specificity. */
.ref__lead[hidden] {
  display: none;
}

.ref__section-title {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.ref__q {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--card-solid);
  border: 1.5px solid var(--line);
  cursor: pointer;
  font-size: 15px;
  line-height: 1.35;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ref__q input { width: 26px; height: 26px; flex: 0 0 auto; cursor: pointer; accent-color: var(--green); }
.ref__q:hover { border-color: var(--line-strong); }
/* A ticked answer reads as "selected" — green tint + ring. */
.ref__q:has(input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(82, 212, 74, 0.15);
  background: rgba(82, 212, 74, 0.06);
}

.ref__field { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.ref__field > span { color: var(--text); font-weight: 700; }
.ref__field small { color: var(--muted); font-size: 12px; }

.ref__field input,
.ref__field select {
  width: 100%;
  min-height: 56px;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card-solid);
  color: var(--text-strong);
  font-size: 16px; /* >=16px so iOS Safari doesn't zoom on focus */
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Bigger, prettier dropdowns: native chrome off + a roomy custom chevron, and
   a comfortable tap target on touch. */
.ref__field select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23637080' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.ref__field input:focus,
.ref__field select:focus,
.ref__field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(82, 212, 74, 0.18);
}

/* Red ring once the user has actually interacted and left a field invalid
   (:user-invalid fires after blur/submit, not on first paint — so the form
   doesn't look angry before it's touched). */
.ref__field input:user-invalid,
.ref__field textarea:user-invalid {
  border-color: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.16);
}

/* Inline per-field error message under an invalid field (form-validation
   controller, inline mode). Scoped to .ref__field so it OUTRANKS the
   `.ref__field > span` label-title rule (which would otherwise paint it dark). */
.ref__field .field-error {
  display: block;
  margin-top: 6px;
  color: #e5484d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.ref__required-hint { margin: -4px 0 4px; color: var(--muted); font-size: 13px; }
.ref__req { color: #e5484d; font-style: normal; font-weight: 900; }

/* Phones: stretch tap targets + text a touch larger so it's easy to thumb. */
@media (max-width: 560px) {
  .ref__q {
    min-height: 64px;
    padding: 16px;
    font-size: 16px;
  }
  .ref__q input { width: 28px; height: 28px; }

  .ref__field input,
  .ref__field select {
    min-height: 60px;
    padding: 17px 16px;
    font-size: 17px;
  }
  .ref__field select { padding-right: 48px; }
}

.ref__submit {
  display: block;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(var(--green), #3cae34);
  color: #04140a;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.ref__submit:hover { filter: brightness(1.05); }
.ref__submit--link { background: transparent; color: var(--green); border: 1px solid var(--green); }

.ref__thanks { text-align: center; padding: 48px 0; }
.flatpickr-calendar {
  background: transparent;
  opacity: 0;
  display: none;
  text-align: center;
  visibility: hidden;
  padding: 0;
  -webkit-animation: none;
          animation: none;
  direction: ltr;
  border: 0;
  font-size: 14px;
  line-height: 24px;
  border-radius: 5px;
  position: absolute;
  width: 307.875px;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  -ms-touch-action: manipulation;
      touch-action: manipulation;
  background: #fff;
  -webkit-box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);
          box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);
}
.flatpickr-calendar.open,
.flatpickr-calendar.inline {
  opacity: 1;
  max-height: 640px;
  visibility: visible;
}
.flatpickr-calendar.open {
  display: inline-block;
  z-index: 99999;
}
.flatpickr-calendar.animate.open {
  -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
          animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
.flatpickr-calendar.inline {
  display: block;
  position: relative;
  top: 2px;
}
.flatpickr-calendar.static {
  position: absolute;
  top: calc(100% + 2px);
}
.flatpickr-calendar.static.open {
  z-index: 999;
  display: block;
}
.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) {
  -webkit-box-shadow: none !important;
          box-shadow: none !important;
}
.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {
  -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
          box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
}
.flatpickr-calendar .hasWeeks .dayContainer,
.flatpickr-calendar .hasTime .dayContainer {
  border-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}
.flatpickr-calendar .hasWeeks .dayContainer {
  border-left: 0;
}
.flatpickr-calendar.hasTime .flatpickr-time {
  height: 40px;
  border-top: 1px solid #e6e6e6;
}
.flatpickr-calendar.noCalendar.hasTime .flatpickr-time {
  height: auto;
}
.flatpickr-calendar:before,
.flatpickr-calendar:after {
  position: absolute;
  display: block;
  pointer-events: none;
  border: solid transparent;
  content: '';
  height: 0;
  width: 0;
  left: 22px;
}
.flatpickr-calendar.rightMost:before,
.flatpickr-calendar.arrowRight:before,
.flatpickr-calendar.rightMost:after,
.flatpickr-calendar.arrowRight:after {
  left: auto;
  right: 22px;
}
.flatpickr-calendar.arrowCenter:before,
.flatpickr-calendar.arrowCenter:after {
  left: 50%;
  right: 50%;
}
.flatpickr-calendar:before {
  border-width: 5px;
  margin: 0 -5px;
}
.flatpickr-calendar:after {
  border-width: 4px;
  margin: 0 -4px;
}
.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
  bottom: 100%;
}
.flatpickr-calendar.arrowTop:before {
  border-bottom-color: #e6e6e6;
}
.flatpickr-calendar.arrowTop:after {
  border-bottom-color: #fff;
}
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
  top: 100%;
}
.flatpickr-calendar.arrowBottom:before {
  border-top-color: #e6e6e6;
}
.flatpickr-calendar.arrowBottom:after {
  border-top-color: #fff;
}
.flatpickr-calendar:focus {
  outline: 0;
}
.flatpickr-wrapper {
  position: relative;
  display: inline-block;
}
.flatpickr-months {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}
.flatpickr-months .flatpickr-month {
  background: transparent;
  color: rgba(0,0,0,0.9);
  fill: rgba(0,0,0,0.9);
  height: 34px;
  line-height: 1;
  text-align: center;
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  overflow: hidden;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
      -ms-flex: 1;
          flex: 1;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  text-decoration: none;
  cursor: pointer;
  position: absolute;
  top: 0;
  height: 34px;
  padding: 10px;
  z-index: 3;
  color: rgba(0,0,0,0.9);
  fill: rgba(0,0,0,0.9);
}
.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,
.flatpickr-months .flatpickr-next-month.flatpickr-disabled {
  display: none;
}
.flatpickr-months .flatpickr-prev-month i,
.flatpickr-months .flatpickr-next-month i {
  position: relative;
}
.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month.flatpickr-prev-month {
/*
      /*rtl:begin:ignore*/
/*
      */
  left: 0;
/*
      /*rtl:end:ignore*/
/*
      */
}
/*
      /*rtl:begin:ignore*/
/*
      /*rtl:end:ignore*/
.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,
.flatpickr-months .flatpickr-next-month.flatpickr-next-month {
/*
      /*rtl:begin:ignore*/
/*
      */
  right: 0;
/*
      /*rtl:end:ignore*/
/*
      */
}
/*
      /*rtl:begin:ignore*/
/*
      /*rtl:end:ignore*/
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: #959ea9;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: #f64747;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
  width: 14px;
  height: 14px;
}
.flatpickr-months .flatpickr-prev-month svg path,
.flatpickr-months .flatpickr-next-month svg path {
  -webkit-transition: fill 0.1s;
  transition: fill 0.1s;
  fill: inherit;
}
.numInputWrapper {
  position: relative;
  height: auto;
}
.numInputWrapper input,
.numInputWrapper span {
  display: inline-block;
}
.numInputWrapper input {
  width: 100%;
}
.numInputWrapper input::-ms-clear {
  display: none;
}
.numInputWrapper input::-webkit-outer-spin-button,
.numInputWrapper input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
.numInputWrapper span {
  position: absolute;
  right: 0;
  width: 14px;
  padding: 0 4px 0 2px;
  height: 50%;
  line-height: 50%;
  opacity: 0;
  cursor: pointer;
  border: 1px solid rgba(57,57,57,0.15);
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}
.numInputWrapper span:hover {
  background: rgba(0,0,0,0.1);
}
.numInputWrapper span:active {
  background: rgba(0,0,0,0.2);
}
.numInputWrapper span:after {
  display: block;
  content: "";
  position: absolute;
}
.numInputWrapper span.arrowUp {
  top: 0;
  border-bottom: 0;
}
.numInputWrapper span.arrowUp:after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid rgba(57,57,57,0.6);
  top: 26%;
}
.numInputWrapper span.arrowDown {
  top: 50%;
}
.numInputWrapper span.arrowDown:after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(57,57,57,0.6);
  top: 40%;
}
.numInputWrapper span svg {
  width: inherit;
  height: auto;
}
.numInputWrapper span svg path {
  fill: rgba(0,0,0,0.5);
}
.numInputWrapper:hover {
  background: rgba(0,0,0,0.05);
}
.numInputWrapper:hover span {
  opacity: 1;
}
.flatpickr-current-month {
  font-size: 135%;
  line-height: inherit;
  font-weight: 300;
  color: inherit;
  position: absolute;
  width: 75%;
  left: 12.5%;
  padding: 7.48px 0 0 0;
  line-height: 1;
  height: 34px;
  display: inline-block;
  text-align: center;
  -webkit-transform: translate3d(0px, 0px, 0px);
          transform: translate3d(0px, 0px, 0px);
}
.flatpickr-current-month span.cur-month {
  font-family: inherit;
  font-weight: 700;
  color: inherit;
  display: inline-block;
  margin-left: 0.5ch;
  padding: 0;
}
.flatpickr-current-month span.cur-month:hover {
  background: rgba(0,0,0,0.05);
}
.flatpickr-current-month .numInputWrapper {
  width: 6ch;
  width: 7ch\0;
  display: inline-block;
}
.flatpickr-current-month .numInputWrapper span.arrowUp:after {
  border-bottom-color: rgba(0,0,0,0.9);
}
.flatpickr-current-month .numInputWrapper span.arrowDown:after {
  border-top-color: rgba(0,0,0,0.9);
}
.flatpickr-current-month input.cur-year {
  background: transparent;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  color: inherit;
  cursor: text;
  padding: 0 0 0 0.5ch;
  margin: 0;
  display: inline-block;
  font-size: inherit;
  font-family: inherit;
  font-weight: 300;
  line-height: inherit;
  height: auto;
  border: 0;
  border-radius: 0;
  vertical-align: initial;
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}
.flatpickr-current-month input.cur-year:focus {
  outline: 0;
}
.flatpickr-current-month input.cur-year[disabled],
.flatpickr-current-month input.cur-year[disabled]:hover {
  font-size: 100%;
  color: rgba(0,0,0,0.5);
  background: transparent;
  pointer-events: none;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  appearance: menulist;
  background: transparent;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  font-weight: 300;
  height: auto;
  line-height: inherit;
  margin: -1px 0 0 0;
  outline: none;
  padding: 0 0 0 0.5ch;
  position: relative;
  vertical-align: initial;
  -webkit-box-sizing: border-box;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  width: auto;
}
.flatpickr-current-month .flatpickr-monthDropdown-months:focus,
.flatpickr-current-month .flatpickr-monthDropdown-months:active {
  outline: none;
}
.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
  background: rgba(0,0,0,0.05);
}
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
  background-color: transparent;
  outline: none;
  padding: 0;
}
.flatpickr-weekdays {
  background: transparent;
  text-align: center;
  overflow: hidden;
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  height: 28px;
}
.flatpickr-weekdays .flatpickr-weekdaycontainer {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
      -ms-flex: 1;
          flex: 1;
}
span.flatpickr-weekday {
  cursor: default;
  font-size: 90%;
  background: transparent;
  color: rgba(0,0,0,0.54);
  line-height: 1;
  margin: 0;
  text-align: center;
  display: block;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
      -ms-flex: 1;
          flex: 1;
  font-weight: bolder;
}
.dayContainer,
.flatpickr-weeks {
  padding: 1px 0 0 0;
}
.flatpickr-days {
  position: relative;
  overflow: hidden;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
      -ms-flex-align: start;
          align-items: flex-start;
  width: 307.875px;
}
.flatpickr-days:focus {
  outline: 0;
}
.dayContainer {
  padding: 0;
  outline: 0;
  text-align: left;
  width: 307.875px;
  min-width: 307.875px;
  max-width: 307.875px;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  display: inline-block;
  display: -ms-flexbox;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  -ms-flex-pack: justify;
  -webkit-justify-content: space-around;
          justify-content: space-around;
  -webkit-transform: translate3d(0px, 0px, 0px);
          transform: translate3d(0px, 0px, 0px);
  opacity: 1;
}
.dayContainer + .dayContainer {
  -webkit-box-shadow: -1px 0 0 #e6e6e6;
          box-shadow: -1px 0 0 #e6e6e6;
}
.flatpickr-day {
  background: none;
  border: 1px solid transparent;
  border-radius: 150px;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  color: #393939;
  cursor: pointer;
  font-weight: 400;
  width: 14.2857143%;
  -webkit-flex-basis: 14.2857143%;
      -ms-flex-preferred-size: 14.2857143%;
          flex-basis: 14.2857143%;
  max-width: 39px;
  height: 39px;
  line-height: 39px;
  margin: 0;
  display: inline-block;
  position: relative;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  text-align: center;
}
.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange,
.flatpickr-day.prevMonthDay.today.inRange,
.flatpickr-day.nextMonthDay.today.inRange,
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus {
  cursor: pointer;
  outline: 0;
  background: #e6e6e6;
  border-color: #e6e6e6;
}
.flatpickr-day.today {
  border-color: #959ea9;
}
.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  border-color: #959ea9;
  background: #959ea9;
  color: #fff;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
  background: #569ff7;
  -webkit-box-shadow: none;
          box-shadow: none;
  color: #fff;
  border-color: #569ff7;
}
.flatpickr-day.selected.startRange,
.flatpickr-day.startRange.startRange,
.flatpickr-day.endRange.startRange {
  border-radius: 50px 0 0 50px;
}
.flatpickr-day.selected.endRange,
.flatpickr-day.startRange.endRange,
.flatpickr-day.endRange.endRange {
  border-radius: 0 50px 50px 0;
}
.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
  -webkit-box-shadow: -10px 0 0 #569ff7;
          box-shadow: -10px 0 0 #569ff7;
}
.flatpickr-day.selected.startRange.endRange,
.flatpickr-day.startRange.startRange.endRange,
.flatpickr-day.endRange.startRange.endRange {
  border-radius: 50px;
}
.flatpickr-day.inRange {
  border-radius: 0;
  -webkit-box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
          box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.notAllowed,
.flatpickr-day.notAllowed.prevMonthDay,
.flatpickr-day.notAllowed.nextMonthDay {
  color: rgba(57,57,57,0.3);
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  cursor: not-allowed;
  color: rgba(57,57,57,0.1);
}
.flatpickr-day.week.selected {
  border-radius: 0;
  -webkit-box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;
          box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;
}
.flatpickr-day.hidden {
  visibility: hidden;
}
.rangeMode .flatpickr-day {
  margin-top: 1px;
}
.flatpickr-weekwrapper {
  float: left;
}
.flatpickr-weekwrapper .flatpickr-weeks {
  padding: 0 12px;
  -webkit-box-shadow: 1px 0 0 #e6e6e6;
          box-shadow: 1px 0 0 #e6e6e6;
}
.flatpickr-weekwrapper .flatpickr-weekday {
  float: none;
  width: 100%;
  line-height: 28px;
}
.flatpickr-weekwrapper span.flatpickr-day,
.flatpickr-weekwrapper span.flatpickr-day:hover {
  display: block;
  width: 100%;
  max-width: none;
  color: rgba(57,57,57,0.3);
  background: transparent;
  cursor: default;
  border: none;
}
.flatpickr-innerContainer {
  display: block;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  overflow: hidden;
}
.flatpickr-rContainer {
  display: inline-block;
  padding: 0;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}
.flatpickr-time {
  text-align: center;
  outline: 0;
  display: block;
  height: 0;
  line-height: 40px;
  max-height: 40px;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  overflow: hidden;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}
.flatpickr-time:after {
  content: "";
  display: table;
  clear: both;
}
.flatpickr-time .numInputWrapper {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
      -ms-flex: 1;
          flex: 1;
  width: 40%;
  height: 40px;
  float: left;
}
.flatpickr-time .numInputWrapper span.arrowUp:after {
  border-bottom-color: #393939;
}
.flatpickr-time .numInputWrapper span.arrowDown:after {
  border-top-color: #393939;
}
.flatpickr-time.hasSeconds .numInputWrapper {
  width: 26%;
}
.flatpickr-time.time24hr .numInputWrapper {
  width: 49%;
}
.flatpickr-time input {
  background: transparent;
  -webkit-box-shadow: none;
          box-shadow: none;
  border: 0;
  border-radius: 0;
  text-align: center;
  margin: 0;
  padding: 0;
  height: inherit;
  line-height: inherit;
  color: #393939;
  font-size: 14px;
  position: relative;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}
.flatpickr-time input.flatpickr-hour {
  font-weight: bold;
}
.flatpickr-time input.flatpickr-minute,
.flatpickr-time input.flatpickr-second {
  font-weight: 400;
}
.flatpickr-time input:focus {
  outline: 0;
  border: 0;
}
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
  height: inherit;
  float: left;
  line-height: inherit;
  color: #393939;
  font-weight: bold;
  width: 2%;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-align-self: center;
      -ms-flex-item-align: center;
          align-self: center;
}
.flatpickr-time .flatpickr-am-pm {
  outline: 0;
  width: 18%;
  cursor: pointer;
  text-align: center;
  font-weight: 400;
}
.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
  background: #eee;
}
.flatpickr-input[readonly] {
  cursor: pointer;
}
@-webkit-keyframes fpFadeInDown {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, -20px, 0);
            transform: translate3d(0, -20px, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
}
@keyframes fpFadeInDown {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, -20px, 0);
            transform: translate3d(0, -20px, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
}
/*!
 * Cropper.js v1.6.2
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2024-04-21T07:43:02.731Z
 */

.cropper-container {
  direction: ltr;
  font-size: 0;
  line-height: 0;
  position: relative;
  -ms-touch-action: none;
      touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

.cropper-container img {
    backface-visibility: hidden;
    display: block;
    height: 100%;
    image-orientation: 0deg;
    max-height: none !important;
    max-width: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.cropper-wrap-box,
.cropper-canvas {
  overflow: hidden;
}

.cropper-drag-box {
  background-color: #fff;
  opacity: 0;
}

.cropper-modal {
  background-color: #000;
  opacity: 0.5;
}

.cropper-view-box {
  display: block;
  height: 100%;
  outline: 1px solid #39f;
  outline-color: rgba(51, 153, 255, 0.75);
  overflow: hidden;
  width: 100%;
}

.cropper-dashed {
  border: 0 dashed #eee;
  display: block;
  opacity: 0.5;
  position: absolute;
}

.cropper-dashed.dashed-h {
    border-bottom-width: 1px;
    border-top-width: 1px;
    height: calc(100% / 3);
    left: 0;
    top: calc(100% / 3);
    width: 100%;
  }

.cropper-dashed.dashed-v {
    border-left-width: 1px;
    border-right-width: 1px;
    height: 100%;
    left: calc(100% / 3);
    top: 0;
    width: calc(100% / 3);
  }

.cropper-center {
  display: block;
  height: 0;
  left: 50%;
  opacity: 0.75;
  position: absolute;
  top: 50%;
  width: 0;
}

.cropper-center::before,
  .cropper-center::after {
    background-color: #eee;
    content: ' ';
    display: block;
    position: absolute;
  }

.cropper-center::before {
    height: 1px;
    left: -3px;
    top: 0;
    width: 7px;
  }

.cropper-center::after {
    height: 7px;
    left: 0;
    top: -3px;
    width: 1px;
  }

.cropper-face,
.cropper-line,
.cropper-point {
  display: block;
  height: 100%;
  opacity: 0.1;
  position: absolute;
  width: 100%;
}

.cropper-face {
  background-color: #fff;
  left: 0;
  top: 0;
}

.cropper-line {
  background-color: #39f;
}

.cropper-line.line-e {
    cursor: ew-resize;
    right: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-n {
    cursor: ns-resize;
    height: 5px;
    left: 0;
    top: -3px;
  }

.cropper-line.line-w {
    cursor: ew-resize;
    left: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-s {
    bottom: -3px;
    cursor: ns-resize;
    height: 5px;
    left: 0;
  }

.cropper-point {
  background-color: #39f;
  height: 5px;
  opacity: 0.75;
  width: 5px;
}

.cropper-point.point-e {
    cursor: ew-resize;
    margin-top: -3px;
    right: -3px;
    top: 50%;
  }

.cropper-point.point-n {
    cursor: ns-resize;
    left: 50%;
    margin-left: -3px;
    top: -3px;
  }

.cropper-point.point-w {
    cursor: ew-resize;
    left: -3px;
    margin-top: -3px;
    top: 50%;
  }

.cropper-point.point-s {
    bottom: -3px;
    cursor: s-resize;
    left: 50%;
    margin-left: -3px;
  }

.cropper-point.point-ne {
    cursor: nesw-resize;
    right: -3px;
    top: -3px;
  }

.cropper-point.point-nw {
    cursor: nwse-resize;
    left: -3px;
    top: -3px;
  }

.cropper-point.point-sw {
    bottom: -3px;
    cursor: nesw-resize;
    left: -3px;
  }

.cropper-point.point-se {
    bottom: -3px;
    cursor: nwse-resize;
    height: 20px;
    opacity: 1;
    right: -3px;
    width: 20px;
  }

@media (min-width: 768px) {

.cropper-point.point-se {
      height: 15px;
      width: 15px;
  }
    }

@media (min-width: 992px) {

.cropper-point.point-se {
      height: 10px;
      width: 10px;
  }
    }

@media (min-width: 1200px) {

.cropper-point.point-se {
      height: 5px;
      opacity: 0.75;
      width: 5px;
  }
    }

.cropper-point.point-se::before {
    background-color: #39f;
    bottom: -50%;
    content: ' ';
    display: block;
    height: 200%;
    opacity: 0;
    position: absolute;
    right: -50%;
    width: 200%;
  }

.cropper-invisible {
  opacity: 0;
}

.cropper-bg {
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
}

.cropper-hide {
  display: block;
  height: 0;
  position: absolute;
  width: 0;
}

.cropper-hidden {
  display: none !important;
}

.cropper-move {
  cursor: move;
}

.cropper-crop {
  cursor: crosshair;
}

.cropper-disabled .cropper-drag-box,
.cropper-disabled .cropper-face,
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
  cursor: not-allowed;
}
/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * design_tokens.css MUST be loaded first because every other stylesheet —
 * including components.css and admin.css — references the CSS variables it
 * publishes (--page-bg-a, --text, --card, --line, --red, etc.).
 *
 * After design_tokens, require_tree picks up:
 *   * components.css (mobile body sizing + base components),
 *   * admin.css      (desktop chrome gated by `body.admin-body`),
 *   * quality_calendar.css.
 *
 * `body.admin-body` rules in admin.css override the bare `body` rules in
 * components.css thanks to specificity (one class + one element > one
 * element), so source order between admin.css and components.css is
 * non-load-bearing.
 *
 * flatpickr.css is the vendored calendar theme for the datepicker Stimulus
 * controller (birth date / passport issue date). It comes from
 * node_modules/flatpickr/dist (added to the asset path in
 * config/initializers/assets.rb).
 *





 */
