/* ========== YektaBar admin panel (admin.html, js/admin*.js) ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn[wght].woff2") format("woff2-variations"),
    url("/fonts/Vazirmatn[wght].woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #039952;
  --green-dark: #028047;
  --green-soft: #e8f7ee;
  --text: #18191b;
  --muted: #8f8f8f;
  --muted-2: #6b6b6b;
  --bg: #ffffff;
  --bg-soft: #f4f6f3;
  --bg-page: #f3f4f2;
  --surface: #ffffff;
  --line: #ebecea;
  --line-2: #dfe1de;
  --red: #d93b3b;
  --red-soft: #fdeeee;
  --orange: #d9822b;
  --orange-soft: #fff4e8;
  --orange-text: #a8600f;
  --blue: #2f80ed;
  --blue-soft: #ebf3fd;
  --purple: #7b5cff;
  --purple-soft: #f1edff;
  --star: #f5a623;
  --backdrop: rgba(0, 0, 0, 0.32);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.16);
  --radius: 14px;
  --side: 256px;
  --top: 64px;
  --chart-bar: #039952;
  --chart-grid: #ebecea;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --green: #0aa25a;
  --green-dark: #34c77b;
  --green-soft: #22282a;
  --text: #ececee;
  --muted: #8e8e93;
  --muted-2: #b1b1b6;
  --bg: #121212;
  --bg-soft: #232325;
  --bg-page: #0e0e0f;
  --surface: #1a1a1c;
  --line: #2a2a2d;
  --line-2: #3a3a3c;
  --red: #f0625f;
  --red-soft: #332222;
  --orange: #f0a35a;
  --orange-soft: #2d261d;
  --orange-text: #f0a35a;
  --blue: #6aa8f7;
  --blue-soft: #1d2430;
  --purple: #a795ff;
  --purple-soft: #262335;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  --chart-bar: #0aa25a;
  --chart-grid: #2a2a2d;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--bg-page);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  overflow: visible;
}

.icon--sm {
  width: 17px;
  height: 17px;
}

.icon--xs {
  width: 14px;
  height: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- layout */

.adm {
  min-height: 100dvh;
}

.adm-side {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(300px, 86vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.adm.is-nav-open .adm-side {
  transform: none;
}

.adm-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.adm.is-nav-open .adm-scrim {
  opacity: 1;
  pointer-events: auto;
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}

.adm-brand strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.adm-brand small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.adm-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--green);
  color: #fff;
}

.adm-side__close {
  margin-inline-start: auto;
}

.adm-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
}

.adm-nav__group {
  margin: 14px 10px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.adm-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--muted-2);
  font-size: 13.5px;
  font-weight: 600;
}

.adm-nav a .icon {
  width: 19px;
  height: 19px;
}

.adm-nav a.is-active {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.adm-nav__count {
  margin-inline-start: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.adm-side__foot {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.adm-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg-soft);
}

.adm-me div {
  flex: 1;
  min-width: 0;
}

.adm-me strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-me small {
  color: var(--muted);
  font-size: 11.5px;
}

.adm-main {
  min-width: 0;
}

.adm-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--top);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.adm-top__title {
  flex: 1;
  min-width: 0;
}

.adm-top__title h1 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-top__title small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-demo {
  display: none;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--orange-soft);
  color: var(--orange-text);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.adm-iconbtn {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text);
}

.adm-page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 14px 48px;
  outline: none;
}

@media (min-width: 640px) {
  .adm-demo {
    display: inline-block;
  }

  .adm-page {
    padding: 20px 20px 56px;
  }
}

@media (min-width: 1100px) {
  .adm {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
  }

  .adm-side {
    position: sticky;
    top: 0;
    height: 100dvh;
    width: auto;
    transform: none;
    transition: none;
  }

  .adm-scrim,
  .adm-side__close,
  .adm-top__menu {
    display: none;
  }

  .adm-top {
    padding: 0 28px;
  }

  .adm-page {
    padding: 24px 28px 64px;
  }
}

/* --------------------------------------------------------------- basics */

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card + .card {
  margin-top: 16px;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.card--flush .card__head {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.card__title {
  font-size: 15px;
  font-weight: 800;
}

.card__title small {
  margin-inline-start: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.card__head .grow {
  flex: 1;
}

.grid2 {
  display: grid;
  gap: 16px;
}

.grid3 {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .grid2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid2 > .card + .card,
  .grid3 > .card + .card {
    margin-top: 0;
  }

  .span2 {
    grid-column: span 2;
  }
}

.stack {
  display: grid;
  gap: 16px;
}

.stack > .card + .card {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.link {
  color: var(--green);
  font-weight: 700;
}

.hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.8;
}

.hint .icon {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--green);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
  color: var(--muted);
  text-align: center;
}

.empty .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  color: var(--line-2);
}

.empty strong {
  color: var(--text);
  font-size: 14px;
}

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--green);
  color: #fff;
}

.btn--ghost {
  border-color: var(--line-2);
  background: var(--surface);
}

.btn--soft {
  background: var(--bg-soft);
}

.btn--danger {
  background: var(--red);
  color: #fff;
}

.btn--danger-ghost {
  border-color: var(--line-2);
  background: var(--surface);
  color: var(--red);
}

.btn--sm {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- badges ---- */

.bdg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--bg-soft);
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.bdg::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.bdg--plain::before {
  display: none;
}

.bdg--good {
  background: var(--green-soft);
  color: var(--green);
}

.bdg--warn {
  background: var(--orange-soft);
  color: var(--orange-text);
}

.bdg--bad {
  background: var(--red-soft);
  color: var(--red);
}

.bdg--info {
  background: var(--blue-soft);
  color: var(--blue);
}

.bdg--purple {
  background: var(--purple-soft);
  color: var(--purple);
}

/* ---- avatars ---- */

.av {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--av, var(--green));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  object-fit: cover;
}

.av--lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.who > span {
  min-width: 0;
}

.who strong {
  display: block;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.who small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

/* ---- forms ---- */

.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
}

.fld > label,
.fld__label {
  font-size: 12.5px;
  font-weight: 700;
}

.fld input,
.fld select,
.fld textarea,
.inp {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13.5px;
  outline: none;
}

.fld textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.8;
}

.fld input:focus,
.fld select:focus,
.fld textarea:focus,
.inp:focus {
  border-color: var(--green);
}

.fld small {
  color: var(--muted);
  font-size: 11.5px;
}

.fld-row {
  display: grid;
  gap: 0 12px;
}

@media (min-width: 560px) {
  .fld-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fld-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.switch:last-child {
  border-bottom: 0;
}

.switch strong {
  display: block;
  font-size: 13.5px;
}

.switch small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--line-2);
  cursor: pointer;
  transition: background 0.15s ease;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.switch input:checked {
  background: var(--green);
}

.switch input:checked::after {
  transform: translateX(-18px);
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.chk input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.days label {
  position: relative;
}

.days input {
  position: absolute;
  opacity: 0;
}

.days span {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
}

.days input:checked + span {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
}

.days input:focus-visible + span {
  outline: 2px solid var(--green);
}

/* ---- toolbar ---- */

.tb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.tb .grow {
  flex: 1;
}

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 360px;
}

.search .icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13.5px;
  outline: none;
}

.search input:focus {
  border-color: var(--green);
}

.tb select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-soft);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.seg::-webkit-scrollbar,
.tabs::-webkit-scrollbar,
.tk-quick::-webkit-scrollbar {
  display: none;
}

.tabs,
.tk-quick {
  scrollbar-width: none;
}

.seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.seg button[aria-pressed="true"],
.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.seg b {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--line-2);
  color: var(--text);
  font-size: 11px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs button {
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted-2);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] {
  border-bottom-color: var(--green);
  color: var(--green);
}

/* ---- table ---- */

.dt-wrap {
  overflow-x: auto;
}

.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dt th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.dt td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.dt tr:last-child td {
  border-bottom: 0;
}

.dt tr[data-open] {
  cursor: pointer;
}

.dt .end {
  text-align: left;
}

.dt .nowrap {
  white-space: nowrap;
}

.dt-more {
  display: flex;
  justify-content: center;
  padding: 12px;
  border-top: 1px solid var(--line);
}

@media (hover: hover) and (min-width: 768px) {
  .dt tr[data-open]:hover td {
    background: var(--bg-soft);
  }

  .btn--ghost:hover,
  .btn--soft:hover,
  .btn--danger-ghost:hover {
    border-color: var(--line-2);
    background: var(--bg-soft);
  }

  .btn--primary:hover {
    background: var(--green-dark);
  }

  html[data-theme="dark"] .btn--primary:hover {
    background: #07894b;
  }

  .adm-nav a:not(.is-active):hover,
  .adm-iconbtn:hover {
    background: var(--bg-soft);
    color: var(--text);
  }

  .link:hover {
    text-decoration: underline;
  }
}

/* Phones: every row becomes a small card. */
@media (max-width: 759.98px) {
  .dt thead {
    display: none;
  }

  .dt,
  .dt tbody,
  .dt tr,
  .dt td {
    display: block;
    width: 100%;
  }

  .dt tr {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }

  .dt tr:last-child {
    border-bottom: 0;
  }

  .dt td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border: 0;
    text-align: left;
  }

  .dt td::before {
    content: attr(data-label);
    flex-shrink: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: right;
  }

  .dt td[data-label=""]::before {
    display: none;
  }

  .dt td.dt-lead {
    justify-content: flex-start;
    padding-bottom: 8px;
    text-align: right;
  }

  .dt td.dt-lead::before {
    display: none;
  }

  .dt .end {
    justify-content: flex-start;
  }
}

/* ---- key/value ---- */

.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.kv > div:last-child {
  border-bottom: 0;
}

.kv dt {
  flex-shrink: 0;
  color: var(--muted-2);
}

.kv dd {
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}

/* ---- KPI tiles ---- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.kpi__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 12.5px;
  font-weight: 600;
}

.kpi__label .icon {
  color: var(--green);
}

.kpi__value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
}

.kpi__value small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
}

.kpi__delta {
  color: var(--muted);
  font-size: 12px;
}

.kpi__delta b {
  font-weight: 800;
}

.kpi__delta .up {
  color: var(--green);
}

.kpi__delta .down {
  color: var(--red);
}

/* ---- charts ---- */

.chart {
  position: relative;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart .axis text {
  fill: var(--muted);
  font-size: 10.5px;
  font-family: inherit;
}

.chart .bar {
  fill: var(--chart-bar);
  transition: opacity 0.12s ease;
}

.chart .bar.is-today {
  fill: var(--chart-bar);
}

.chart .hit {
  fill: transparent;
  cursor: default;
  outline: none;
}

.chart .slot {
  outline: none;
}

.chart .slot:hover .bar,
.chart .slot:focus .bar {
  opacity: 0.72;
}

.chart .slot .cross,
.chart .slot .hdot {
  opacity: 0;
}

.chart .slot:hover .cross,
.chart .slot:focus .cross,
.chart .slot:hover .hdot,
.chart .slot:focus .hdot {
  opacity: 1;
}

.chart .slot:focus-visible .hit {
  stroke: var(--green);
  stroke-width: 2;
}

.chart .line {
  fill: none;
  stroke: var(--chart-bar);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .area {
  fill: var(--chart-bar);
  opacity: 0.1;
}

.chart .dot {
  fill: var(--chart-bar);
  stroke: var(--surface);
  stroke-width: 2;
}

.chart .cross {
  stroke: var(--line-2);
  stroke-width: 1;
}

.chart-table {
  margin-top: 10px;
  font-size: 12.5px;
}

.chart-table summary {
  color: var(--muted-2);
  cursor: pointer;
  font-weight: 600;
}

.chart-table table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
}

.chart-table td,
.chart-table th {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.adm-tip {
  position: fixed;
  z-index: 90;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}

.adm-tip strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.adm-tip span {
  color: var(--muted-2);
}

/* ---- to-do list (dashboard) ---- */

.todo {
  display: grid;
  gap: 8px;
}

.todo a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.todo__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--muted-2);
}

.todo a.is-hot .todo__icon {
  background: var(--orange-soft);
  color: var(--orange-text);
}

.todo span:not(.todo__icon) {
  flex: 1;
  min-width: 0;
}

.todo strong {
  display: block;
  font-size: 13.5px;
}

.todo small {
  color: var(--muted);
  font-size: 12px;
}

.todo b {
  font-size: 18px;
  font-weight: 800;
}

.feed {
  list-style: none;
}

.feed li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.feed li:last-child {
  border-bottom: 0;
}

.feed time {
  margin-inline-start: auto;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.feed .dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--green);
}

/* ---------------------------------------------------- drawer and dialog */

.drw-scrim,
.mdl-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--backdrop);
  animation: fade-in 0.15s ease;
}

.drw {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 71;
  display: flex;
  flex-direction: column;
  width: min(620px, 100vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: drw-in 0.2s ease;
}

.drw--wide {
  width: min(820px, 100vw);
}

.drw__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.drw__head h2 {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drw__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 24px;
}

.drw__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.drw__foot .grow {
  flex: 1;
}

.drw section + section {
  margin-top: 22px;
}

.drw h3 {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
}

.mdl {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 81;
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
  animation: mdl-in 0.16s ease;
}

.mdl-scrim {
  z-index: 80;
}

.mdl h2 {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 800;
}

.mdl p {
  margin-bottom: 14px;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.9;
}

.mdl__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.reasons {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.reasons button {
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 13px;
  text-align: right;
}

.reasons button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes drw-in {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
}

@keyframes mdl-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- toast ---- */

.adm-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 95;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #222;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.adm-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

html[data-theme="dark"] .adm-toast {
  border: 1px solid var(--line-2);
  background: #2c2c2e;
}

/* ---------------------------------------------------------------- login */

.adm-login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
}

.login-card {
  width: min(400px, 100%);
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.login-card .adm-logo {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 14px;
}

.login-card h1 {
  font-size: 19px;
  font-weight: 800;
}

.login-card > p {
  margin: 4px 0 20px;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.9;
}

.login-demo {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--orange-soft);
  color: var(--orange-text);
  font-size: 12.5px;
  line-height: 1.9;
}

.login-demo b {
  font-weight: 800;
}

.login-err {
  margin: -6px 0 12px;
  color: var(--red);
  font-size: 12.5px;
}

.otp-input {
  letter-spacing: 8px;
  text-align: center;
  font-size: 20px !important;
  font-weight: 800;
}

/* ----------------------------------------------------------- users page */

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
}

.profile small {
  color: var(--muted);
}

.profile .btn-row {
  margin-top: 6px;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 13px;
  line-height: 1.8;
}

.banner .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.banner--bad {
  background: var(--red-soft);
  color: var(--red);
}

.banner--warn {
  background: var(--orange-soft);
  color: var(--orange-text);
}

.banner--info {
  background: var(--blue-soft);
  color: var(--blue);
}

.banner p {
  color: var(--text);
}

.docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.doc {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: right;
}

.doc img,
.doc .doc__none {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-soft);
}

.doc .doc__none {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.doc strong {
  font-size: 12.5px;
}

.plate {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 2px solid #222;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 800;
  direction: ltr;
}

.plate span {
  padding: 2px 8px;
}

.plate__main {
  display: inline-flex;
  gap: 6px;
}

.plate__main b {
  display: inline-block;
  font-weight: 800;
  unicode-bidi: isolate;
}

.plate .plate__ir {
  border-left: 2px solid #222;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.plate .plate__flag {
  width: 12px;
  padding: 0;
  background: linear-gradient(#239f40 33%, #fff 33% 66%, #da0000 66%);
}

.txs {
  list-style: none;
}

.txs li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.txs li:last-child {
  border-bottom: 0;
}

.txs span {
  flex: 1;
  min-width: 0;
}

.txs small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.amt-in {
  color: var(--green);
  font-weight: 800;
}

.amt-out {
  font-weight: 800;
}

/* ------------------------------------------------------ drivers queue */

.queue {
  display: grid;
  gap: 16px;
}

.qcard__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.qcard__head .who {
  flex: 1;
}

.qcard__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.qcard__meta b {
  color: var(--text);
}

.qcard .btn-row {
  margin-top: 14px;
}

.lightbox img {
  width: 100%;
  border-radius: 10px;
}

/* ------------------------------------------------------- tickets page */

.tk {
  display: grid;
  gap: 16px;
}

@media (min-width: 1000px) {
  .tk {
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
  }
}

.tk-list {
  max-height: calc(100dvh - 210px);
  overflow-y: auto;
}

.tk-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.tk-item.is-active {
  background: var(--green-soft);
}

.tk-item__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tk-item__top strong {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-item p {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-item small {
  color: var(--muted);
  font-size: 11.5px;
}

.tk-unread {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.tk-conv {
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.tk-msgs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100dvh - 330px);
  min-height: 280px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-soft);
}

.tk-msg {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tk-msg small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.tk-msg--user {
  align-self: flex-start;
  border-top-right-radius: 4px;
}

.tk-msg--support {
  align-self: flex-end;
  border-top-left-radius: 4px;
  background: var(--green);
  color: #fff;
}

.tk-msg--support small {
  color: rgba(255, 255, 255, 0.8);
}

.tk-msg--system {
  align-self: center;
  max-width: 90%;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.tk-msg img {
  max-width: 220px;
  margin-top: 6px;
  border-radius: 8px;
}

.tk-reply {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.tk-quick {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
}

.tk-quick button {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  font-size: 12px;
}

.tk-reply form {
  display: flex;
  gap: 8px;
}

.tk-reply textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  resize: vertical;
  outline: none;
  line-height: 1.8;
}

.tk-reply textarea:focus {
  border-color: var(--green);
}

/* ------------------------------------------------------- map editor */

.pl {
  display: grid;
  gap: 16px;
}

@media (min-width: 1000px) {
  .pl {
    grid-template-columns: 380px minmax(0, 1fr);
    align-items: start;
  }
}

.pl-map {
  position: relative;
  height: 46vh;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

@media (min-width: 1000px) {
  .pl-map {
    position: sticky;
    top: calc(var(--top) + 16px);
    height: calc(100dvh - var(--top) - 150px);
    order: 2;
  }
}

.pl-map__canvas {
  position: absolute;
  inset: 0;
}

.pl-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  white-space: nowrap;
}

.pl-banner button {
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
}

.pl-list {
  max-height: none;
}

@media (min-width: 1000px) {
  .pl-list {
    max-height: calc(100dvh - var(--top) - 150px);
    overflow-y: auto;
  }
}

.pl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.pl-item.is-active {
  background: var(--green-soft);
}

.pl-item.is-hidden {
  opacity: 0.6;
}

.pl-item span:not(.pl-dot) {
  flex: 1;
  min-width: 0;
}

.pl-item strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-item small {
  color: var(--muted);
  font-size: 11.5px;
}

.pl-dot {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--c, #5b6770);
  color: #fff;
}

.pl-dot .icon {
  width: 17px;
  height: 17px;
}

.pl-mk {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--c, #5b6770);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.pl-mk .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.pl-mk.is-hidden {
  opacity: 0.55;
}

.pl-mk.is-active {
  width: 40px;
  height: 40px;
  border-width: 3px;
  z-index: 3;
}

.pl-mk.is-draft {
  background: var(--text);
}

.svc-rows {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.svc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 80px 36px;
  gap: 6px;
  align-items: center;
}

.svc-row input {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
  width: 100%;
}

@media (max-width: 520px) {
  .svc-row {
    grid-template-columns: minmax(0, 1fr) 96px 36px;
  }

  .svc-row .svc-min {
    display: none;
  }
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--bg-soft);
  cursor: pointer;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo input {
  position: absolute;
  opacity: 0;
}

.photo:has(input:checked) {
  border-color: var(--green);
}

.photo i {
  position: absolute;
  top: 4px;
  left: 4px;
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
}

.photo:has(input:checked) i {
  display: block;
}

.photo--add {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

/* ---------------------------------------------------- products page */

.art-mini {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--green);
}

.art-mini svg {
  width: 26px;
  height: 26px;
}

.stock-low {
  color: var(--orange-text);
  font-weight: 800;
}

.stock-out {
  color: var(--red);
  font-weight: 800;
}

.specs {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.spec-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 36px;
  gap: 6px;
}

.spec-row input {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
  width: 100%;
}

.fits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* ------------------------------------------------ settings: vehicles */

.vtable input {
  width: 130px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  text-align: left;
  outline: none;
}

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.save-bar .grow {
  flex: 1;
  color: var(--muted-2);
  font-size: 12.5px;
}

/* ---------------------------------------------- map (js/map.js) parts */

.maplibregl-map,
.maplibregl-ctrl-attrib {
  font-family: inherit;
}

.ymap-theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: right;
}

.ymap-theme-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.ymap-theme-menu button[aria-checked="true"] {
  background: var(--green-soft);
  color: var(--green);
}

.ymap-theme-menu small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.ymap-theme__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ymap-theme {
  position: relative;
}

.ymap-theme__btn {
  display: grid !important;
  place-items: center;
}

.ymap-status {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  font-weight: 600;
  transform: translateX(-50%);
}

.ymap-status svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ymap-status--loading svg,
.ymap-status--slow svg {
  animation: ymap-spin 0.9s linear infinite;
}

.ymap-status button {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--green);
  color: #fff;
  font-size: 11.5px;
}

.ymap--dark .ymap-status {
  background: rgba(30, 30, 32, 0.95);
  color: #eee;
}

@keyframes ymap-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------- misc */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12.5px;
}

.star-f {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--star);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.rv-text {
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.8;
  max-width: 460px;
}

.steps {
  list-style: none;
}

.steps li {
  position: relative;
  padding: 0 22px 14px 0;
  font-size: 13px;
}

.steps li::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-2);
}

.steps li::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 0;
  right: 7px;
  width: 1px;
  background: var(--line-2);
}

.steps li:last-child::after {
  display: none;
}

.steps li.is-done::before {
  background: var(--green);
}

.steps small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}
