:root {
  --ink: #1F1A24; --ink-2: #4A4152; --muted: #7A7182; --line: #EADFE4; --bg: #FBF6F8; --card: #fff;
  --brand: #C2255C; --brand-2: #A61E4D; --brand-soft: #FCE8EF; --ok: #1E8E5A; --ok-soft: #E3F5EC; --warn: #B45309; --warn-soft: #FEF3C7;
  --bad: #C2410C; --bad-soft: #FDECE4; --radius: 14px; --shadow: 0 1px 2px rgba(31, 26, 36, .05), 0 6px 18px rgba(31, 26, 36, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding-top: env(safe-area-inset-top); }
.top-in { max-width: 860px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.logo { font-weight: 700; font-size: 19px; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(194, 37, 92, .25); }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px 16px 110px; }

h1 { font-size: 24px; margin: 6px 0 4px; line-height: 1.3; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 160px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }

label.f { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.in { width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px; font-size: 16px; }
.in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(194, 37, 92, .15); }
textarea.in { min-height: 80px; resize: vertical; }
.in[dir="ltr"] { text-align: right; }
.field { margin-bottom: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 15px; text-decoration: none; background: var(--brand); color: #fff; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: #cdbfc6; }
.btn.ok { background: var(--ok); } .btn.ok:hover { background: #17744a; }
.btn.wa { background: #1FA855; } .btn.wa:hover { background: #178a45; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 17px; }

.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: #F1ECEF; color: var(--ink-2); white-space: nowrap; }
.chip.brand { background: var(--brand-soft); color: var(--brand-2); }
.chip.ok { background: var(--ok-soft); color: #166B44; }
.chip.warn { background: var(--warn-soft); color: #92400E; }
.chip.bad { background: var(--bad-soft); color: #9A3412; }

.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #F3EEF1; border: 1px solid var(--line); flex: none; }
.thumb.ph { display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.sum { display: grid; gap: 6px; }
.sum div { display: flex; justify-content: space-between; }
.sum .tot { font-weight: 700; font-size: 18px; border-top: 1px dashed var(--line); padding-top: 8px; }
.note { background: var(--warn-soft); color: #7C3A0B; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.err { color: var(--bad); font-size: 14px; margin-top: 6px; }
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: calc(100% - 32px); font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.spin { text-align: center; color: var(--muted); padding: 40px; }

/* portal item card */
.item { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: #fff; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.up { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.up label { cursor: pointer; }
.up input[type=file] { display: none; }
.x { border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.x:hover { background: #F3EEF1; }
.est { font-size: 14px; color: var(--ok); font-weight: 600; }

/* tracking */
.titem { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.titem:first-of-type { border-top: 0; }
.titem .t { font-weight: 600; }
.hero { background: linear-gradient(150deg, var(--ink), #3A2A3F); color: #fff; border-radius: 18px; padding: 22px 18px; margin-bottom: 16px; }
.hero h1 { color: #fff; }
.hero p { color: #E6DDE8; margin: 0; }

/* ready-stock catalog */
.hero-link { margin-top: 12px; background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.cat-card img, .cat-ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #F3EEF1; display: grid; place-items: center; font-size: 34px; }
.cat-body { padding: 10px; display: grid; gap: 6px; }
.cat-body .t { font-weight: 600; font-size: 15px; }
.sticky-go { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); margin-top: 16px; display: flex; justify-content: center; }
.sticky-go .btn { box-shadow: 0 6px 20px rgba(31, 26, 36, .25); width: 100%; max-width: 480px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
