/* ============================================================================
   מערכת ניהול שירותים — mobile-first, RTL, dark theme.
   Palette echoes the parent "Altman Kernel" command center (near-black + cyan)
   but tuned for legibility on a phone in daily business use.
   ========================================================================== */

:root {
  --bg: #04080d;
  --bg-2: #07101a;
  --panel: #0b1721;
  --panel-2: #0f1f2b;
  --line: rgba(140, 200, 220, 0.14);
  --line-strong: rgba(140, 200, 220, 0.28);
  --cyan: #54f4f0;
  --cyan-dim: rgba(84, 244, 240, 0.16);
  --blue: #9fd3ff;
  --green: #4fdca0;
  --green-dim: rgba(79, 220, 160, 0.16);
  --amber: #f5c451;
  --amber-dim: rgba(245, 196, 81, 0.16);
  --red: #ff5d6c;
  --red-dim: rgba(255, 93, 108, 0.16);
  --gold: #daa542;
  --gold-dim: rgba(218, 165, 66, 0.16);
  --text: #eaf4fa;
  --muted: #8a97a6;
  --radius: 16px;
  --radius-sm: 11px;
  --nav-h: 64px;
  --header-h: 54px;
  --maxw: 520px;
  --sans: "Heebo", "Assistant", "Rubik", -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overscroll-behavior-y: none; }
body.modal-open { overflow: hidden; }
body.auth-pending { overflow: hidden; }
body.auth-pending .app-shell,
body.auth-pending .fab,
body.auth-pending .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Subtle ambient background glow, like the parent dashboard. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 60% at 80% -10%, rgba(84, 244, 240, 0.10), transparent 60%),
    radial-gradient(120% 60% at 0% 110%, rgba(159, 211, 255, 0.06), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ------------------------------- shell ---------------------------------- */

.app-shell {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(180deg, rgba(7, 16, 26, 0.96), rgba(7, 16, 26, 0.82));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-header__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
/* Small brand logo, centered in the header regardless of the title width. */
.app-header__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 48px;
  width: auto;
  pointer-events: none;
  user-select: none;
}
.app-header__title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.app-header__title h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header__crown { color: var(--gold); font-size: 14px; }
.app-header__brand {
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 13px;
  color: var(--cyan);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 3px 8px;
}
.app-header__back {
  font-size: 26px;
  line-height: 1;
  color: var(--cyan);
}

.app-screen {
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}

.screen-pad { padding: 16px 14px 8px; }

/* ----------------------------- bottom nav ------------------------------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  max-width: var(--maxw);
  margin: 0 auto;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: linear-gradient(0deg, rgba(6, 13, 21, 0.98), rgba(8, 18, 28, 0.92));
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.15s;
}
.bottom-nav__icon { font-size: 19px; line-height: 1; }
.bottom-nav__item.is-active { color: var(--cyan); }
.bottom-nav__item.is-active .bottom-nav__icon {
  filter: drop-shadow(0 0 6px var(--cyan-dim));
}

/* -------------------------------- FAB ----------------------------------- */

.fab {
  position: fixed;
  z-index: 41;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  left: 50%;
  transform: translateX(calc(-1 * (var(--maxw) / 2) + 30px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 30px;
  font-weight: 300;
  color: #03252b;
  background: linear-gradient(160deg, var(--cyan), #2bbfbb);
  box-shadow: 0 8px 26px rgba(84, 244, 240, 0.35);
}
@media (max-width: 540px) {
  .fab { left: auto; right: 18px; transform: none; }
}

/* ------------------------------ headings -------------------------------- */

.welcome { padding: 6px 2px 14px; }
.welcome__hello { margin: 0; color: var(--muted); font-size: 14px; }
.welcome__name { margin: 2px 0 0; font-size: 22px; font-weight: 800; }

.section-block { margin-bottom: 22px; }
.block-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin: 0 2px 10px;
  text-transform: none;
}
.lead-text, .paragraph { line-height: 1.6; }
.lead-text { color: var(--muted); margin: 4px 2px 16px; }
.paragraph { margin: 6px 0 0; white-space: pre-wrap; }
.muted-line { color: var(--muted); font-size: 14px; margin: 6px 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-header h2 { font-size: 15px; font-weight: 700; margin: 0; }
.link { color: var(--cyan); font-size: 13px; font-weight: 600; }

/* ------------------------------ stat cards ------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--muted);
}
.stat-card__value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card__label { font-size: 13px; color: var(--muted); }
.stat-card__sub { font-size: 12px; color: var(--muted); }
.stat-card--info::before { background: var(--blue); }
.stat-card--info .stat-card__value { color: var(--blue); }
.stat-card--ok::before { background: var(--green); }
.stat-card--ok .stat-card__value { color: var(--green); }
.stat-card--accent::before { background: var(--cyan); }
.stat-card--accent .stat-card__value { color: var(--cyan); }
.stat-card--warn::before { background: var(--amber); }
.stat-card--warn .stat-card__value { color: var(--amber); }
.stat-card--danger::before { background: var(--red); }
.stat-card--danger .stat-card__value { color: var(--red); }
.stat-card--gold::before { background: var(--gold); }
.stat-card--gold .stat-card__value { color: var(--gold); }

/* ---------------------------- quick actions ----------------------------- */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 6px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.15s, transform 0.1s;
}
.quick-action:active { transform: scale(0.97); }
.quick-action__icon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--cyan-dim);
  color: var(--cyan);
}

/* ------------------------------ list cards ------------------------------ */

.card-list { display: flex; flex-direction: column; gap: 10px; }

.list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: start;
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s;
}
.list-card:active { transform: scale(0.99); }
.list-card__leading { flex-shrink: 0; }
.list-card__body { flex: 1; min-width: 0; }
.list-card__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.list-card__title { font-weight: 700; font-size: 15.5px; }
.list-card__meta { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.list-card__subtitle { font-size: 13px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid var(--line);
}

/* -------------------------------- badges -------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--muted { color: var(--muted); background: rgba(138, 151, 166, 0.12); border-color: var(--line); }
.badge--info { color: var(--blue); background: rgba(159, 211, 255, 0.13); }
.badge--accent { color: var(--cyan); background: var(--cyan-dim); }
.badge--ok { color: var(--green); background: var(--green-dim); }
.badge--warn { color: var(--amber); background: var(--amber-dim); }
.badge--danger { color: var(--red); background: var(--red-dim); }
.badge--gold { color: var(--gold); background: var(--gold-dim); }

/* ------------------------------- chips ---------------------------------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip--active { color: var(--bg); background: var(--cyan); border-color: var(--cyan); }

/* ------------------------------ search bar ------------------------------ */

.search-bar { margin-bottom: 10px; }
.search-input, input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.search-input { background: var(--panel); }
input::placeholder, textarea::placeholder { color: #5e6b78; }
input:focus, select:focus, textarea:focus, .search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(0% + 16px) 50%, calc(0% + 21px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ----------------------------- auth gate -------------------------------- */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(90% 45% at 80% 0%, rgba(84, 244, 240, 0.12), transparent 65%),
    var(--bg);
}
.auth-card {
  width: min(100%, 420px);
  padding: 26px 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(7, 16, 26, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}
.auth-card__logo {
  display: block;
  width: 74px;
  height: auto;
  margin: 0 auto 8px;
}
.auth-card__eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.auth-card h1 {
  margin: 4px 0 8px;
  font-size: 24px;
  text-align: center;
}
.auth-card__text {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}
.auth-form {
  display: grid;
  gap: 12px;
}
.auth-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.auth-submit { width: 100%; margin-top: 2px; }

/* ----------------------------- empty state ------------------------------ */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state__icon {
  font-size: 40px;
  width: 78px; height: 78px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--cyan);
}
.empty-state__title { font-size: 16px; font-weight: 700; color: var(--text); }
.empty-state__subtitle { font-size: 14px; margin-top: 6px; }
.empty-state__action { margin-top: 18px; }

/* -------------------------------- cards --------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.detail-hero { padding: 4px 2px 14px; }
.detail-hero__title { display: flex; align-items: center; gap: 12px; }
.detail-hero h2 { font-size: 22px; font-weight: 800; margin: 0; }
.detail-hero__badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row__label { color: var(--muted); flex-shrink: 0; }
.detail-row__value { text-align: end; font-weight: 600; }

.totals-row { display: flex; gap: 10px; margin-bottom: 14px; }
.totals-cell {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.totals-cell span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.totals-cell strong { font-size: 19px; font-weight: 800; color: var(--green); }
.totals-cell--danger strong { color: var(--red); }

.detail-footer { margin-top: 8px; text-align: center; }

/* ------------------------------- mini row ------------------------------- */

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.mini-row:last-child { border-bottom: none; }
.mini-row__main { min-width: 0; }
.mini-row__title { display: block; font-weight: 600; font-size: 14px; }
.mini-row__sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.mini-row__end { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mini-row__amount { font-weight: 700; font-size: 14px; }

/* ------------------------------ timeline -------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item {
  position: relative;
  padding: 0 18px 14px;
  border-inline-start: 1px solid var(--line-strong);
  margin-inline-start: 4px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  inset-inline-start: -4px;
  top: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
}
.timeline__item time { display: block; font-size: 12px; color: var(--muted); }
.timeline__item span { font-size: 14px; }

/* ------------------------------- notes ---------------------------------- */

.note-list { list-style: none; margin: 0; padding: 0; }
.note-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.note-item:last-child { border-bottom: none; }
.note-item p { margin: 0 0 4px; font-size: 14px; line-height: 1.5; }
.note-item time { font-size: 12px; color: var(--muted); }

.bullet-list { margin: 8px 0; padding-inline-start: 20px; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* ------------------------------- buttons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--text);
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: linear-gradient(160deg, var(--cyan), #2bbfbb); color: #03252b; }
.btn--ok { background: var(--green-dim); color: var(--green); border-color: rgba(79, 220, 160, 0.4); }
.btn--danger { background: var(--red); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--danger-ghost { background: transparent; border-color: rgba(255, 93, 108, 0.4); color: var(--red); }
.btn--sm { padding: 8px 12px; font-size: 13px; }
.btn--xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.action-grid .btn { width: 100%; }

/* --------------------------- contact buttons ---------------------------- */

.contact-row { display: flex; gap: 10px; margin-bottom: 16px; }
.contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
}
.contact-btn--call { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(84, 244, 240, 0.35); }
.contact-btn--wa { background: var(--green-dim); color: var(--green); border: 1px solid rgba(79, 220, 160, 0.35); }

/* ------------------------------- banners -------------------------------- */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 14px;
}
.banner strong { font-size: 20px; font-weight: 800; }
.banner--warn { background: var(--amber-dim); border: 1px solid rgba(245, 196, 81, 0.3); color: var(--amber); }
.banner--danger { background: var(--red-dim); border: 1px solid rgba(255, 93, 108, 0.3); color: var(--red); }

/* ------------------------------ pay cards ------------------------------- */

.pay-card, .debt-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.pay-card__head, .debt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pay-card__customer, .debt-card__name { font-weight: 700; font-size: 16px; }
.pay-card__job { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pay-card__amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pay-card__amounts > div { text-align: center; }
.pay-card__amounts span { display: block; font-size: 11px; color: var(--muted); }
.pay-card__amounts strong { font-size: 15px; }
.pay-card__amounts .is-danger strong { color: var(--red); }
.pay-card__meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pay-card__actions, .debt-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ------------------------------ debt cards ------------------------------ */

.debt-card { margin-bottom: 10px; }
.debt-card__sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.debt-card__amount { font-size: 20px; font-weight: 800; color: var(--red); white-space: nowrap; }
.debt-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 12px; }
.debt-card__date { font-size: 12px; color: var(--muted); }
.debt-card__notes { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.debt-card__notes p { margin: 2px 0; }

/* ------------------------------ more / list ----------------------------- */

.more-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.more-row__icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--cyan-dim);
  color: var(--cyan);
  font-size: 20px;
}
.more-row__text { flex: 1; display: flex; flex-direction: column; }
.more-row__text strong { font-size: 15.5px; }
.more-row__text small { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.more-row__chev { color: var(--muted); font-size: 22px; }

.notif-card { margin-top: 14px; }
.about { text-align: center; color: var(--muted); margin-top: 24px; font-size: 13px; line-height: 1.7; }

/* ------------------------------- export --------------------------------- */

.export-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: start;
  padding: 16px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}
.export-row__icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--green-dim);
  color: var(--green);
  font-size: 18px;
}
.export-row__label { flex: 1; font-weight: 700; font-size: 15.5px; }
.export-row__cta { font-size: 12.5px; color: var(--cyan); font-weight: 600; }

/* ------------------------------ settings -------------------------------- */

.tag-list { display: flex; flex-direction: column; gap: 8px; }
.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.toggle-list { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle-pill {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.toggle-pill--on { color: var(--cyan); background: var(--cyan-dim); border-color: rgba(84, 244, 240, 0.4); }
.danger-zone { border-color: rgba(255, 93, 108, 0.25); }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
}
.icon-btn--sm { width: 28px; height: 28px; color: var(--muted); font-size: 13px; }

/* -------------------------------- modal --------------------------------- */

.modal-host { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 11, 0.72);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}
.modal {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 22px 22px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.modal--sm { animation: slideUp 0.2s ease; }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.modal__header h2 { font-size: 18px; font-weight: 800; margin: 0; }
.modal__body { padding: 6px 16px 12px; overflow-y: auto; }
.modal__footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.modal__footer .btn { flex: 1; }
.confirm-message { font-size: 15px; line-height: 1.6; color: var(--text); margin: 4px 0 8px; }

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* -------------------------------- forms --------------------------------- */

.app-form__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field__hint { font-size: 11.5px; color: var(--muted); }
.field .req { color: var(--red); }
.field .invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }

/* -------------------------------- toast --------------------------------- */

.toast-host {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  max-width: var(--maxw);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s, transform 0.22s;
}
.toast--in { opacity: 1; transform: translateY(0); }
.toast--ok { border-inline-start: 4px solid var(--green); }
.toast--warn { border-inline-start: 4px solid var(--amber); }
.toast--danger { border-inline-start: 4px solid var(--red); }

/* ------------------------------ desktop --------------------------------- */

@media (min-width: 540px) {
  .app-shell {
    border-inline-start: 1px solid var(--line);
    border-inline-end: 1px solid var(--line);
    min-height: 100vh;
  }
}
