/* =============================================================================
   پارسی شو — مدیریت «ارسال و تحویل» (پنل ادمین)
   ============================================================================= */
main.phx-admin-ship-mode > :not(#ph-shipadmin) { display: none !important; }

.phs {
  --phs-ink: #16283b;
  --phs-muted: #7b8797;
  --phs-line: #e3eaf3;
  --phs-brand: #1d4ed8;
  margin: 0 auto;
  max-width: 1180px;
  padding: 4px 2px 30px;
  color: var(--phs-ink);
  font-family: inherit;
}

/* سرصفحه */
.phs-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 1px solid var(--phs-line);
  border-radius: 20px;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(37, 99, 235, .08), transparent 58%),
    linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 24px 48px -42px rgba(15, 34, 55, .6);
}
.phs-ttl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.phs-ico {
  display: grid; place-items: center; flex: 0 0 46px;
  width: 46px; height: 46px; border-radius: 14px;
  color: #fff; background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 14px 26px -18px rgba(37, 99, 235, .95);
}
.phs-ico svg { width: 22px; height: 22px; }
.phs-ttl h1 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: -.2px; }
.phs-ttl p { margin: 3px 0 0; font-size: 11px; color: var(--phs-muted); line-height: 1.7; }
.phs-acts { display: flex; gap: 8px; align-items: center; }
.phs-btn {
  border: 1px solid var(--phs-line); background: #fff; color: #4b5b6e;
  font: inherit; font-size: 12px; font-weight: 800;
  padding: 9px 15px; border-radius: 11px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.phs-btn:hover { border-color: #c9d8e8; color: var(--phs-brand); }
.phs-btn:active { transform: scale(.97); }
.phs-btn--p {
  border: 0; color: #fff;
  background: linear-gradient(120deg, #2563eb, #1d4ed8);
  box-shadow: 0 14px 26px -18px rgba(37, 99, 235, .95);
}
.phs-btn--p:hover { color: #fff; filter: brightness(1.05); }
.phs-btn[disabled] { opacity: .6; cursor: default; transform: none; }

/* KPI */
.phs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.phs-kpi {
  padding: 12px 14px; border: 1px solid var(--phs-line); border-radius: 15px; background: #fff;
}
.phs-kpi span { display: block; font-size: 10px; font-weight: 700; color: var(--phs-muted); }
.phs-kpi b { display: block; font-size: 16px; font-weight: 900; margin-top: 4px; font-variant-numeric: tabular-nums; }
.phs-kpi i { display: block; font-style: normal; font-size: 9.5px; color: #9aa6b5; margin-top: 2px; }
.phs-kpi.is-ok b { color: #0d7a5f; }

/* تب‌ها */
.phs-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.phs-tab {
  border: 1px solid var(--phs-line); background: #fff; color: #4b5b6e;
  font: inherit; font-size: 11.5px; font-weight: 800;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
}
.phs-tab.is-on {
  background: var(--phs-brand); border-color: var(--phs-brand); color: #fff;
  box-shadow: 0 10px 20px -14px rgba(29, 78, 216, .95);
}

.phs-body { display: grid; gap: 10px; }

/* کارت روش ارسال */
.phs-m {
  border: 1px solid var(--phs-line); border-radius: 17px; background: #fff;
  overflow: hidden;
}
.phs-m.is-off { opacity: .72; background: #fbfcfe; }
.phs-m-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
}
.phs-m-key {
  font-size: 9.5px; font-weight: 800; color: #64748b;
  background: #eef2f7; border-radius: 6px; padding: 3px 7px; direction: ltr;
}
.phs-m-title { font-size: 13px; font-weight: 900; }
.phs-m-head .phs-sw { margin-inline-start: auto; }
.phs-m-del {
  border: 0; background: #fff5f5; color: #b91c1c; font: inherit; font-size: 10.5px; font-weight: 800;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.phs-m-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 13px 14px; }
.phs-f { display: block; }
.phs-f > span { display: block; font-size: 10px; font-weight: 800; color: #5b6b7e; margin-bottom: 4px; }
.phs-f > span em { font-style: normal; color: #9aa6b5; font-weight: 600; }
.phs-f input[type="text"], .phs-f input[type="number"], .phs-f select {
  width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid #e0e8f2; border-radius: 9px; background: #fff;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--phs-ink);
  font-variant-numeric: tabular-nums;
}
.phs-f input:focus, .phs-f select:focus {
  outline: none; border-color: #93b4f5; box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}
.phs-f--wide { grid-column: span 2; }
.phs-f--full { grid-column: 1 / -1; }

.phs-zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 14px 13px; }
.phs-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border: 1px dashed #e0e8f2; border-radius: 10px; padding: 7px 9px; background: #fbfdff;
}
.phs-zone > span { font-size: 10px; font-weight: 800; color: #5b6b7e; }
.phs-zone input { width: 92px; height: 30px; text-align: left; }

.phs-prov-wrap { padding: 0 14px 13px; }
.phs-prov-wrap summary {
  cursor: pointer; font-size: 10.5px; font-weight: 800; color: #4b5b6e;
  padding: 6px 0; list-style: none;
}
.phs-prov-wrap summary::-webkit-details-marker { display: none; }
.phs-prov-wrap summary::before { content: "▾ "; color: #94a3b8; }
.phs-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.phs-chip {
  position: relative; cursor: pointer;
  font-size: 10px; font-weight: 700; color: #52657a;
  border: 1px solid #e3eaf3; background: #fff; border-radius: 999px; padding: 5px 10px;
  user-select: none;
}
.phs-chip input { position: absolute; opacity: 0; pointer-events: none; }
.phs-chip:has(input:checked) {
  background: #eaf1ff; border-color: #9dbcf5; color: #1d4ed8; font-weight: 800;
}

/* جدول مناطق */
.phs-ztable { border: 1px solid var(--phs-line); border-radius: 16px; overflow: hidden; background: #fff; }
.phs-ztable table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.phs-ztable th {
  background: linear-gradient(120deg, #1d4ed8, #2563eb); color: #fff;
  font-weight: 800; padding: 9px 12px; text-align: right; white-space: nowrap;
}
.phs-ztable td { padding: 8px 12px; border-bottom: 1px solid #eef2f7; }
.phs-ztable tr:last-child td { border-bottom: 0; }
.phs-ztable tr:hover td { background: #f8fbff; }
.phs-ztable td:nth-child(n+2) { text-align: center; width: 96px; }
.phs-zradio { display: inline-flex; }
.phs-zradio input { width: 16px; height: 16px; accent-color: #1d4ed8; cursor: pointer; }

/* قواعد */
.phs-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.phs-card {
  border: 1px solid var(--phs-line); border-radius: 17px; background: #fff; padding: 14px;
}
.phs-card h3 { margin: 0 0 4px; font-size: 12.5px; font-weight: 900; }
.phs-card p { margin: 0 0 10px; font-size: 10.5px; line-height: 1.9; color: var(--phs-muted); }
.phs-formula {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #f6f9fe; border: 1px dashed #d9e6f8;
  font-size: 10.5px; line-height: 2; color: #44586e; direction: rtl;
}
.phs-formula code {
  font-family: ui-monospace, Consolas, monospace; direction: ltr; display: inline-block;
  background: #fff; border: 1px solid #e3eaf3; border-radius: 5px; padding: 1px 5px; font-size: 10px;
}

/* آزمون */
.phs-test { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.phs-test-out { margin-top: 10px; display: grid; gap: 7px; }
.phs-trow {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #e9eff7; border-radius: 11px; padding: 9px 12px; background: #fff;
  font-size: 11.5px;
}
.phs-trow b { font-weight: 900; }
.phs-trow .phs-tcost { margin-inline-start: auto; font-weight: 900; font-variant-numeric: tabular-nums; }
.phs-trow .phs-tcost.is-free { color: #0d7a5f; }
.phs-trow .phs-ttag { font-size: 9.5px; font-weight: 800; color: #1d4ed8; background: #eaf1ff; border-radius: 999px; padding: 2px 8px; }

/* کلید روشن/خاموش */
.phs-sw { position: relative; width: 42px; height: 23px; flex: 0 0 42px; display: inline-block; }
.phs-sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.phs-knob { position: absolute; inset: 0; border-radius: 999px; background: #dfe8f3; transition: background .18s; }
.phs-knob::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(15, 34, 55, .25); transition: transform .18s;
}
.phs-sw input:checked + .phs-knob { background: #16a34a; }
.phs-sw input:checked + .phs-knob::after { transform: translateX(-19px); }

/* پیام */
.phs-toast {
  position: fixed; inset-inline: 0; bottom: 18px; margin: 0 auto;
  width: fit-content; max-width: 90vw;
  padding: 10px 18px; border-radius: 12px;
  background: #0f2b22; color: #d6ffe9; font-size: 12px; font-weight: 800;
  box-shadow: 0 22px 44px -24px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 9999;
}
.phs-toast.is-on { opacity: 1; transform: translateY(0); }
.phs-toast.is-err { background: #3b1414; color: #ffdada; }

.phs-empty { padding: 22px; text-align: center; color: var(--phs-muted); font-size: 12px; border: 1px dashed #dbe5f1; border-radius: 14px; }

/* موبایل */
@media (max-width: 900px) {
  .phs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phs-m-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phs-rules { grid-template-columns: 1fr; }
  .phs-test { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phs-zones { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .phs-top { padding: 13px; }
  .phs-ttl h1 { font-size: 15px; }
  .phs-m-grid { grid-template-columns: 1fr; }
  .phs-kpis { grid-template-columns: 1fr 1fr; }
  .phs-ztable th, .phs-ztable td { padding: 7px 8px; font-size: 10.5px; }
}
