@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --brand: #0f766e;
  --brand-soft: #e6f4f2;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #667085;
  --line: #e3e6ec;
  --danger: #b42318;
  --warn-bg: #fff6e0;
  --warn-line: #f2d48a;
  --ok: #067647;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-soft: #123a37;
    --bg: #11151c;
    --surface: #1b212b;
    --text: #e8ecf3;
    --muted: #98a2b3;
    --line: #2b3340;
    --danger: #f97066;
    --warn-bg: #3a2f12;
    --warn-line: #7a6320;
    --ok: #47cd89;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, "Segoe UI", Tahoma, "Noto Naskh Arabic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.5; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); font-size: .92rem; }
.error { color: var(--danger); font-size: .92rem; }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: .5rem 1rem; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:disabled { opacity: .55; cursor: default; }
button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button.small { padding: .2rem .7rem; font-size: .88rem; }

input, textarea, select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* جلوگیری از زوم iOS */
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 5.5rem; resize: vertical; }
label { display: block; margin-bottom: 1rem; }
label > span { display: block; font-weight: 600; margin-bottom: .25rem; }
label > small { display: block; color: var(--muted); margin-top: .2rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }

/* ورود */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(420px, 100%); }
.login-card button { width: 100%; margin-top: .4rem; }

/* قالب پنل */
.app { min-height: 100vh; padding-bottom: 5rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand select { width: auto; max-width: 12rem; }
.tabs { display: flex; gap: .25rem; padding: .5rem 1rem 0; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: .6rem .9rem; white-space: nowrap; }
.tab[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand); font-weight: 700; }
.content { max-width: 760px; margin: 1rem auto; padding: 0 1rem; }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: .6rem .9rem; margin-bottom: 1rem; }

/* انتخاب نوع کسب‌وکار */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.type { text-align: center; padding: .6rem .4rem; }
.type[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.hint { background: var(--brand-soft); border-radius: 10px; padding: .6rem .9rem; font-size: .93rem; margin-bottom: 1rem; }

/* کامل بودن اطلاعات */
.meter { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin: .4rem 0 .6rem; }
.meter > div { height: 100%; background: var(--brand); transition: width .25s; }
.todo { margin: 0; padding-inline-start: 1.2rem; color: var(--muted); font-size: .93rem; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.ltr { direction: ltr; text-align: left; }

/* پرسش‌های متداول */
.faq-item { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin-bottom: .75rem; background: var(--surface); }
.faq-item label { margin-bottom: .6rem; }
.faq-item .bar { display: flex; justify-content: space-between; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.chip { border-radius: 99px; padding: .15rem .8rem; font-size: .9rem; background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.chip:disabled { opacity: .5; cursor: default; }

/* کانال‌ها */
.kv { display: flex; gap: .5rem; align-items: center; }
.kv code { flex: 1; direction: ltr; text-align: left; padding: .45rem .7rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; white-space: pre; font-size: .85rem; }
.badge { display: inline-block; border-radius: 99px; padding: 0 .6rem; font-size: .8rem; margin-inline-start: .4rem; background: var(--line); }
.badge.on { background: var(--brand-soft); color: var(--ok); }

/* نوار ذخیره */
.savebar { position: fixed; inset-inline: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.07); }
.savebar > div { display: flex; gap: .5rem; }

.toast { position: fixed; top: 1rem; inset-inline: 1rem; margin-inline: auto; width: fit-content; max-width: 92vw; background: #1c2330; color: #fff; padding: .55rem 1rem; border-radius: 10px; z-index: 10; }
.toast.err { background: var(--danger); }

input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin-inline-end: .4rem; vertical-align: middle; }
input[type="color"] { width: 4rem; height: 2.4rem; padding: .15rem; }
label > span > input[type="checkbox"] + * { vertical-align: middle; }
.tablewrap { overflow-x: auto; margin: .6rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
details { margin: .7rem 0; }
summary { cursor: pointer; font-weight: 600; margin-bottom: .4rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.okbox { background: var(--brand-soft); border-color: var(--ok); color: var(--ok); }
.uq { border-top: 1px solid var(--line); padding: .7rem 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.statv { font-size: 1.4rem; font-weight: 700; }
.col { flex: 1; display: grid; gap: .4rem; }

/* ---------- بهبود ظاهر (پنل مشتری و مدیر) ---------- */
.brand-logo { height: 30px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px; }
.logo-preview { display: block; max-height: 72px; max-width: 200px; object-fit: contain; margin: .4rem 0 .8rem; padding: .4rem; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); }
.top { position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 var(--line), 0 4px 14px rgb(16 24 40 / 5%); }
.tabs { display: flex; gap: .15rem; overflow-x: auto; padding: 0 .75rem; background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab { transition: color .15s, background .15s; border-radius: 10px 10px 0 0; }
.tab:hover { background: var(--brand-soft); }
.card { box-shadow: 0 1px 2px rgb(16 24 40 / 4%); }
.card h2 { margin-top: 0; font-size: 1.1rem; }
.card h3 { margin: 0 0 .6rem; font-size: 1rem; }
.content { max-width: 960px; margin-inline: auto; padding: 1rem; }
label > span { display: block; margin-bottom: .25rem; font-size: .88rem; color: var(--muted); }
input[type="text"], input[type="tel"], select, textarea { width: 100%; box-sizing: border-box; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px; }
button.primary { box-shadow: 0 1px 2px rgb(16 24 40 / 12%); }
th { text-align: start; font-weight: 600; color: var(--muted); font-size: .85rem; white-space: nowrap; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--bg); }
.toast { box-shadow: 0 8px 24px rgb(16 24 40 / 18%); }
@media (max-width: 600px) {
  .content { padding: .6rem; }
  .card { padding: .9rem; border-radius: 12px; }
  .top { padding: .6rem .75rem; }
  .brand select { max-width: 8rem; }
}

/* ---------- ویزارد راه‌اندازی و کارت کانال ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; list-style: none; padding: 0; margin: .8rem 0 0; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muted); text-align: center; border-top: 3px solid var(--line); padding-top: .5rem; }
.steps li.done { border-top-color: var(--brand); color: var(--text); }
.steps li.now { border-top-color: var(--brand); color: var(--brand); font-weight: 700; }
.steps .dot { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; }
.steps li.done .dot, .steps li.now .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; margin: .6rem 0 1rem; }
.chcard { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; text-align: start; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; color: inherit; }
.chcard span.muted { font-size: .82rem; }
button.chcard { cursor: pointer; }
button.chcard[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
button.chcard:disabled { cursor: default; opacity: .75; }
@media (max-width: 480px) { .steps .lbl { font-size: .7rem; } }
