@font-face {
  font-family: "IRANSans";
  src: url("/fonts/IRANSansWeb.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Shabnam";
  src: url("/fonts/Shabnam-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f3f5fb;
  --card: #fff;
  --card2: #f6f7fd;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e4e8f2;
  --p1: #6d5dfc;
  --p2: #4f8cff;
  --grad: linear-gradient(135deg, #6d5dfc 0%, #4f8cff 100%);
  --ok: #059669;
  --okbg: #d1fae5;
  --warn: #d97706;
  --warnbg: #fef3c7;
  --bad: #dc2626;
  --badbg: #fee2e2;
  --shadow: 0 12px 32px rgba(40, 50, 110, 0.1);
  --shadow-sm: 0 2px 10px rgba(40, 50, 110, 0.07);
  --r: 20px;
  --topbar: rgba(243, 245, 251, 0.85);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #090d1b;
  --card: #121930;
  --card2: #19213e;
  --text: #eef2ff;
  --muted: #93a1c6;
  --line: #232d52;
  --ok: #34d399;
  --okbg: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warnbg: rgba(251, 191, 36, 0.14);
  --bad: #f87171;
  --badbg: rgba(248, 113, 113, 0.14);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --topbar: rgba(9, 13, 27, 0.82);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
html {
  font-size: 15px;
}
body {
  font-family: "IRANSans", "Shabnam", Tahoma, sans-serif;
  direction: rtl;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  background:
    radial-gradient(
      900px 420px at 95% -8%,
      rgba(109, 93, 252, 0.16),
      transparent 60%
    ),
    radial-gradient(
      800px 420px at -5% 8%,
      rgba(79, 140, 255, 0.14),
      transparent 55%
    ),
    var(--bg);
  background-attachment: fixed;
}
body.lock {
  overflow: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
}

/* ===== نوار بالا ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-in {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}
.logo-mini {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  box-shadow: 0 6px 16px rgba(109, 93, 252, 0.35);
  flex-shrink: 0;
}
.tb-title {
  flex: 1;
  min-width: 0;
}
.tb-title h1 {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-title small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  transition: 0.18s;
  flex-shrink: 0;
}
.icon-btn:active {
  transform: scale(0.93);
}
.icon-btn.sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 12px;
}
.icon-btn.danger {
  color: var(--bad);
  background: var(--badbg);
  border-color: transparent;
}
.topbar form {
  display: contents;
}

.pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.pill.on {
  color: var(--ok);
  background: var(--okbg);
  border-color: transparent;
}
.pill.on .dot {
  background: var(--ok);
  animation: pulse 1.8s infinite;
}
.pill.off {
  color: var(--warn);
  background: var(--warnbg);
  border-color: transparent;
}
.pill.off .dot {
  background: var(--warn);
}
.pill.net {
  color: var(--bad);
  background: var(--badbg);
  border-color: transparent;
}
.pill.net .dot {
  background: var(--bad);
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ===== ساختار ===== */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.card + .card {
  margin-top: 14px;
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-h h3 {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-h h3 i {
  color: var(--p1);
}

/* ===== آمار ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.stat .ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  margin-bottom: 8px;
}
.ico.p {
  background: var(--grad);
}
.ico.g {
  background: linear-gradient(135deg, #10b981, #34d399);
}
.ico.r {
  background: linear-gradient(135deg, #ef4444, #fb7185);
}
.stat .val {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat .lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== ورودی‌ها ===== */
.input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  transition: 0.2s;
}
.input:focus-within {
  border-color: var(--p1);
  box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.14);
}
.input i {
  color: var(--muted);
}
.input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 14px 0;
  font: inherit;
  font-size: 14px;
  color: var(--text);
}
.input.lg input {
  padding: 16px 0;
  font-size: 15px;
}
.input input::placeholder {
  color: var(--muted);
}
.field-plain input {
  width: 100%;
  background: var(--card2);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  outline: 0;
  transition: 0.2s;
}
.field-plain input:focus {
  border-color: var(--p1);
  box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.14);
}
.lbl {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin: 14px 0 6px;
}
.hint {
  font-size: 12px;
  color: var(--p1);
  font-weight: 800;
  margin-top: 6px;
}
.calc {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card2);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.calc b {
  color: var(--ok);
  font-size: 16px;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.18s;
}
.chip.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(109, 93, 252, 0.3);
}

/* ===== دکمه‌ها ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 14px;
  transition: 0.18s;
  color: var(--text);
  background: var(--card2);
}
.btn.primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(109, 93, 252, 0.35);
}
.btn.ghost {
  background: var(--card2);
  border: 1px solid var(--line);
}
.btn.warn {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.32);
}
.btn.block {
  width: 100%;
}
.btn.lg {
  padding: 15px 20px;
  font-size: 15px;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.center {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.fab {
  position: fixed;
  left: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
  border-radius: 99px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 14px 30px rgba(109, 93, 252, 0.45);
}
.fab:active {
  transform: scale(0.95);
}

/* ===== نشان‌ها و بنر ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.ok {
  background: var(--okbg);
  color: var(--ok);
}
.badge.warn {
  background: var(--warnbg);
  color: var(--warn);
}
.badge.bad {
  background: var(--badbg);
  color: var(--bad);
}
.badge.info {
  background: rgba(109, 93, 252, 0.12);
  color: var(--p1);
}

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  font-size: 13px;
}
.banner > i {
  font-size: 18px;
}
.banner.warn {
  background: var(--warnbg);
  color: var(--warn);
}
.banner.bad {
  background: var(--badbg);
  color: var(--bad);
}
.banner .b-body {
  flex: 1;
  min-width: 0;
}
.banner .b-body b {
  display: block;
  font-size: 13px;
}
.banner .b-body span {
  display: block;
  opacity: 0.9;
  font-size: 12px;
  margin-top: 2px;
}

.src-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 2px 4px 12px;
}
.src-note.live {
  color: var(--ok);
}
.src-note.cache {
  color: var(--warn);
}

/* ===== لیست فاکتورها ===== */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: 0.18s;
  animation: in 0.35s ease both;
}
.fcard:active {
  transform: scale(0.98);
}
.fc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.fid {
  font-weight: 800;
  font-size: 13px;
  color: var(--p1);
  background: rgba(109, 93, 252, 0.1);
  padding: 4px 12px;
  border-radius: 99px;
}
.fc-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.fc-name {
  font-weight: 800;
  font-size: 14px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-name i {
  color: var(--muted);
  margin-left: 6px;
  font-size: 12px;
}
.fc-price {
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}
.fc-price small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.fc-bot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.fc-bot i {
  margin-left: 5px;
}
@keyframes in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.skel {
  height: 104px;
  border-radius: 18px;
  background: linear-gradient(
    90deg,
    var(--card) 25%,
    var(--card2) 50%,
    var(--card) 75%
  );
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border: 1px solid var(--line);
}
@keyframes sk {
  to {
    background-position: -200% 0;
  }
}
.empty {
  text-align: center;
  padding: 44px 16px;
  color: var(--muted);
  font-weight: 700;
}
.empty i {
  display: block;
  font-size: 38px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty.sm {
  padding: 20px;
}

/* ===== شیت (پنجره پایین‌آمده) ===== */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.sheet.open {
  display: block;
}
.sheet-back {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 25, 0.55);
  backdrop-filter: blur(4px);
  animation: fade 0.2s;
}
.sheet-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.25);
  animation: up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.grab {
  width: 42px;
  height: 4px;
  border-radius: 9px;
  background: var(--line);
  margin: 10px auto 2px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 10px;
}
.sheet-head h3 {
  font-size: 16px;
  font-weight: 800;
}
.sheet-body {
  padding: 4px 18px 16px;
  overflow-y: auto;
  flex: 1;
}
.sheet-foot {
  display: flex;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}
.sheet-foot .btn {
  flex: 1;
}
@keyframes up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (min-width: 720px) {
  .sheet-panel {
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    width: 500px;
    transform: translate(-50%, -50%);
    border-radius: 26px;
    animation: pop 0.22s ease;
  }
  .grab {
    display: none;
  }
  @keyframes pop {
    from {
      opacity: 0;
      transform: translate(-50%, -46%);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }
}

/* ===== توست ===== */
.toast-wrap {
  position: fixed;
  top: calc(74px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow);
  animation: in 0.3s ease;
  pointer-events: auto;
}
.toast.success {
  background: linear-gradient(135deg, #059669, #10b981);
}
.toast.error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}
.toast.info {
  background: var(--grad);
}

/* ===== جزئیات فاکتور ===== */
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.kv span {
  color: var(--muted);
  font-weight: 700;
}
.kv b {
  font-weight: 800;
  text-align: left;
}
.kv.total b {
  color: var(--ok);
  font-size: 17px;
}
.sec-t {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin: 18px 0 8px;
}
.irow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card2);
  margin-bottom: 8px;
}
.irow .n {
  font-weight: 800;
  font-size: 13px;
}
.irow .m {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.irow .t {
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

/* ===== فاکتور جدید ===== */
.hintline {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 4px 0;
}
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.pcard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  text-align: right;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  color: var(--text);
  transition: 0.18s;
  animation: in 0.25s ease both;
}
.pcard:active {
  transform: scale(0.96);
}
.pcard b {
  font-size: 13px;
  line-height: 1.5;
}
.pcard .pp {
  font-weight: 800;
  color: var(--p1);
  font-size: 14px;
}
.pcard .pp small {
  font-size: 10px;
  color: var(--muted);
}

.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card2);
  margin-bottom: 10px;
  animation: in 0.25s ease both;
}
.l-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.l-name {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.5;
}
.l-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.l-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.l-total {
  font-weight: 800;
  font-size: 15px;
  color: var(--p1);
}
.stepper {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stepper button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.stepper button:active {
  background: var(--card2);
}
.stepper b {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
}

.kvb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
}
.kvb .c {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  min-width: 0;
}
.kvb .c i {
  color: var(--p1);
}
.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  font-size: 13px;
}
.sum-row span {
  color: var(--muted);
  font-weight: 700;
}
.sum-row b {
  font-weight: 800;
}
.disc {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 2px 12px;
  width: 110px;
}
.disc input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: 0;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 8px 0;
  color: var(--text);
  text-align: left;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--card2);
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-top: 8px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.seg button.active {
  background: var(--card);
  color: var(--p1);
  box-shadow: var(--shadow-sm);
}
.seg button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--warnbg);
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}
.cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  background: var(--topbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.cta-in {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}
.cta-total {
  flex: 1;
  min-width: 0;
}
.cta-total small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.cta-total b {
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
}
.cta .btn {
  padding: 14px 26px;
  font-size: 15px;
}

.clist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.citem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card2);
  cursor: pointer;
  color: var(--text);
}
.citem:active {
  transform: scale(0.98);
}
.av {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}
.citem .c-b {
  flex: 1;
  min-width: 0;
}
.citem .c-b b {
  display: block;
  font-size: 14px;
}
.citem .c-b small {
  color: var(--muted);
  font-size: 12px;
}
.wchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.wchips button {
  flex: 1;
  min-width: 72px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.result {
  text-align: center;
  padding: 16px 0;
}
.result i {
  font-size: 56px;
  margin-bottom: 12px;
}
.result.ok i {
  color: var(--ok);
}
.result.warn i {
  color: var(--warn);
}
.result h3 {
  font-size: 17px;
  margin-bottom: 6px;
}
.result p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

/* ===== ورود ===== */
.auth-body {
  display: grid;
  place-items: center;
  padding: 20px;
  padding-bottom: 20px;
  overflow-x: hidden;
  position: relative;
}
.auth-theme {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  z-index: 5;
}
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}
.b1 {
  width: 340px;
  height: 340px;
  background: #6d5dfc;
  top: -90px;
  right: -90px;
}
.b2 {
  width: 300px;
  height: 300px;
  background: #4f8cff;
  bottom: -80px;
  left: -80px;
  animation-delay: -5s;
}
.b3 {
  width: 200px;
  height: 200px;
  background: #c084fc;
  top: 45%;
  left: 30%;
  opacity: 0.3;
  animation-delay: -9s;
}
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -30px) scale(1.12);
  }
}
.auth-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: center;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px 26px 26px;
  box-shadow: var(--shadow);
  animation: in 0.5s ease both;
  text-align: center;
}
.auth-logo {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  border-radius: 26px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 32px;
  box-shadow: 0 14px 30px rgba(109, 93, 252, 0.45);
}
.auth-card h1 {
  font-size: 21px;
  font-weight: 800;
}
.auth-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 10px;
}
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  background: var(--badbg);
  color: var(--bad);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  margin: 14px 0 0;
  animation: shake 0.4s;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card2);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  margin-top: 14px;
  transition: 0.2s;
}
.field:focus-within {
  border-color: var(--p1);
  box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.14);
  background: var(--card);
}
.field > i {
  color: var(--muted);
}
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 16px 0;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}
.field input[dir="ltr"] {
  text-align: left;
}
.eye {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  padding: 6px;
}
.auth-card .btn {
  margin-top: 22px;
}
.auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.8s infinite;
}

@media (max-width: 400px) {
  .tb-title small {
    display: none;
  }
  .stat .val {
    font-size: 13px;
  }
  .pill {
    padding: 7px 10px;
  }
}
