/* irancts — سامانه طراحی مشترک (پنل، ورود، فعالان، پروفایل، درخواست‌ها)
 * زبان تصویری: «ردیابی محموله» — سرمه‌ای بندر، نارنجی بار، نقشه نقطه‌ای با مسیرها
 */
@font-face { font-family: 'icn-vazirmatn'; src: url('fonts/vazirmatn.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
    --icn-font: 'Iran Yekan', 'icn-yekan', 'icn-vazirmatn', Tahoma, sans-serif;
    --icn-harbor: #13254f;
    --icn-harbor-2: #0d1b3d;
    --icn-navy: #1e3a8a;
    --icn-navy-2: #172e6e;
    --icn-navy-soft: #e9eefb;
    --icn-cargo: #f08a2e;
    --icn-cargo-2: #e07a1e;
    --icn-cargo-soft: #fdf0e3;
    --icn-cargo-ink: #13254f;
    --icn-bg: #f4f6fa;
    --icn-surface: #fff;
    --icn-ink: #16213a;
    --icn-muted: #5b6478;
    --icn-line: #dde2ec;
    --icn-line-2: #ebeef4;
    --icn-ok: #1e7a46; --icn-ok-soft: #e6f4ec;
    --icn-warn: #9a5b00; --icn-warn-soft: #fff3df;
    --icn-err: #b42318; --icn-err-soft: #fdecea;
    --icn-r-lg: 18px; --icn-r: 12px; --icn-r-sm: 8px;
    --icn-sh-1: 0 1px 2px rgba(19, 37, 79, .06), 0 1px 1px rgba(19, 37, 79, .03);
    --icn-sh-2: 0 12px 32px -12px rgba(19, 37, 79, .28);
    --icn-ease: cubic-bezier(.2, .7, .2, 1);
    --icn-side-w: 256px;
    --icn-top-h: 64px;
}

/* ------------------------------------------------------------ پایه */
.icn-i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: -4px; }
.icn-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.icn-app-body { margin: 0; background: var(--icn-bg); color: var(--icn-ink); font-family: var(--icn-font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.icn-app-body *, body.icn-app-body *::before, body.icn-app-body *::after { box-sizing: border-box; }
.icn-panel, .icn-auth, .icn-dir, .icn-pp, .icn-rqb, .icn-rqp { font-family: var(--icn-font); }

/* دکمه اصلی نارنجی (یک کار مهم در هر صفحه) */
.icn-btn--cta { background: var(--icn-cargo) !important; color: var(--icn-cargo-ink) !important; }
.icn-btn--cta:hover { background: var(--icn-cargo-2) !important; }
.icn-btn .icn-i { width: 18px; height: 18px; }

/* ------------------------------------------------------------ نقشه مسیرها */
.icn-map { display: block; width: 100%; height: 100%; }
.icn-map__dots { fill: none; stroke: currentColor; stroke-width: .5; stroke-linecap: round; opacity: .55; }
.icn-map__route { fill: none; stroke: var(--icn-cargo); stroke-width: var(--icn-rw, .25); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: icn-route 1.6s var(--icn-ease) forwards; animation-delay: calc(.25s + var(--i) * .18s); }
.icn-map__pin { fill: #fff; r: .42; opacity: 0; animation: icn-fade .4s ease forwards; animation-delay: calc(1.3s + var(--i, 0) * .18s); }
.icn-map__route + .icn-map__pin { animation-delay: 1.5s; }
.icn-map__home { fill: var(--icn-cargo); r: .6; }
.icn-map__pulse { fill: none; stroke: var(--icn-cargo); stroke-width: calc(var(--icn-rw, .25) * .7); r: .6; transform-origin: center; transform-box: fill-box; animation: icn-pulse 2.4s ease-out 1.8s infinite; opacity: 0; }
@keyframes icn-route { to { stroke-dashoffset: 0; } }
@keyframes icn-fade { to { opacity: 1; } }
@keyframes icn-pulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(4.5); } }

/* ------------------------------------------------------------ پوسته اپ */
.icn-panel.icn-app { display: block; min-height: 100vh; padding: 0; max-width: none; margin: 0; background: var(--icn-bg); }
.icn-app__main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.icn-p-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }

/* نوار کناری */
.icn-side { position: fixed; z-index: 60; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); background: var(--icn-harbor); color: #c9d3ea; display: flex; flex-direction: column; overflow-y: auto; transform: translateX(105%); transition: transform .28s var(--icn-ease); }
.icn-app.is-side-open .icn-side { transform: none; box-shadow: var(--icn-sh-2); }
.icn-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(13, 27, 61, .45); }
.icn-side__top { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.icn-side__close { border: 0; background: none; color: #c9d3ea; padding: 6px; border-radius: 8px; cursor: pointer; }
.icn-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: -.2px; }
.icn-side .icn-brand { color: #fff; }
.icn-brand img { max-height: 36px; width: auto; border-radius: 8px; }
.icn-side .icn-me { display: flex; gap: 12px; align-items: center; margin: 6px 14px 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 0; }
.icn-side .icn-me .icn-p-head__name { color: #fff; font-size: .98rem; font-weight: 700; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icn-side .icn-me .icn-p-head__meta { color: #9fb0d4; font-size: .78rem; margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icn-me__ring { --p: 0; flex: none; width: 52px; height: 52px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--icn-cargo) calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0); }
.icn-side .icn-me__ring .icn-avatar { width: 100%; height: 100%; border: 2px solid var(--icn-harbor); background: #2a3f74; color: #fff; font-size: 1.15rem; }
.icn-me__pct { font-size: .76rem; color: var(--icn-cargo); text-decoration: none; font-weight: 700; }
.icn-me__pct.is-done { color: #8fd1ae; display: inline-flex; align-items: center; gap: 4px; }
.icn-me__pct .icn-i { width: 14px; height: 14px; }
.icn-side .icn-p-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; margin: 0; background: none; border: 0; position: static; overflow: visible; }
.icn-side .icn-p-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9d3ea; text-decoration: none; font-weight: 600; font-size: .95rem; text-align: start; white-space: nowrap; }
.icn-side .icn-p-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.icn-side .icn-p-nav a.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.icn-side .icn-p-nav a.is-active::before { content: ""; position: absolute; inset-inline-start: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--icn-cargo); }
.icn-side .icn-p-nav a > span:not(.icn-p-nav__badge) { flex: 1; }
.icn-p-nav__badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--icn-navy-soft); color: var(--icn-navy); font-size: .72rem; font-weight: 800; line-height: 1; }
.icn-side .icn-p-nav__badge { position: static; background: var(--icn-cargo); color: var(--icn-cargo-ink); font-weight: 800; }
.icn-side__foot { margin-top: auto; padding: 12px 10px 18px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 2px; }
.icn-side__foot a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #9fb0d4; text-decoration: none; font-size: .88rem; }
.icn-side__foot a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.icn-side__code { margin-inline-start: auto; font-size: .75rem; opacity: .8; direction: ltr; }

/* نوار بالا */
.icn-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; height: var(--icn-top-h); padding: 0 12px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--icn-line); }
.admin-bar .icn-top { top: 46px; }
.icn-top__menu { border: 0; background: none; padding: 8px; border-radius: 10px; color: var(--icn-ink); cursor: pointer; display: inline-flex; }
.icn-top__title { margin: 0; font-size: 1.08rem; font-weight: 800; color: var(--icn-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.icn-top__search { display: none; position: relative; align-items: center; flex: 0 1 420px; }
.icn-top__search .icn-i { position: absolute; inset-inline-start: 12px; color: var(--icn-muted); pointer-events: none; }
.icn-top__search input { width: 100%; height: 40px; padding: 0 40px 0 14px; border: 1px solid var(--icn-line); border-radius: 99px; background: var(--icn-bg); font: inherit; font-size: .9rem; color: var(--icn-ink); }
.icn-top__search input:focus { outline: none; border-color: var(--icn-navy); background: #fff; box-shadow: 0 0 0 3px rgba(30, 58, 138, .12); }
.icn-top__end { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.icn-top__new { display: none !important; min-height: 40px !important; padding: 0 16px !important; font-size: .9rem !important; border-radius: 10px !important; }

/* اعلان‌ها */
.icn-bell { position: relative; }
.icn-bell > summary { list-style: none; position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--icn-ink); cursor: pointer; }
.icn-bell > summary::-webkit-details-marker { display: none; }
.icn-bell > summary:hover, .icn-bell[open] > summary { background: var(--icn-bg); }
.icn-bell__dot { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--icn-cargo); color: var(--icn-cargo-ink); font-size: .68rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.icn-bell__menu { position: absolute; inset-inline-end: 0; top: 48px; width: min(92vw, 360px); max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--icn-line); border-radius: 14px; box-shadow: var(--icn-sh-2); padding: 6px; z-index: 50; }
.icn-bell__head { margin: 6px 10px 8px; font-weight: 800; font-size: .9rem; }
.icn-bell__empty { margin: 10px; color: var(--icn-muted); font-size: .9rem; }
.icn-bell__item { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--icn-ink); font-size: .88rem; line-height: 1.7; }
.icn-bell__item:hover { background: var(--icn-bg); }
.icn-bell__item.is-new { background: var(--icn-navy-soft); }
.icn-bell__item small { color: var(--icn-muted); font-size: .74rem; }

/* نوار پایین موبایل */
.icn-tabbar { position: fixed; z-index: 45; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 0 6px env(safe-area-inset-bottom, 0px); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--icn-line); }
.icn-tabbar a, .icn-tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 64px; border: 0; background: none; color: var(--icn-muted); text-decoration: none; font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; }
.icn-tabbar a.is-active { color: var(--icn-navy); }
.icn-tabbar a.is-active .icn-i { stroke-width: 2.3; }
.icn-tabbar__fab { width: 54px; height: 54px !important; margin: 0 auto 14px; border-radius: 18px; background: var(--icn-cargo) !important; color: var(--icn-cargo-ink) !important; box-shadow: 0 8px 20px -6px rgba(240, 138, 46, .7); }
.icn-tabbar__fab .icn-i { width: 26px; height: 26px; stroke-width: 2.4; }
.icn-tabbar__dot { position: absolute; top: 10px; inset-inline-end: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--icn-cargo); }

/* مراحل ساخت پروفایل و صفحه‌های تمرکز */
.icn-app--focus { background: var(--icn-bg); }
.icn-focusbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--icn-line); }
.icn-focusbar .icn-brand { color: var(--icn-ink); }
.icn-focusbar__end { display: flex; gap: 4px; }
.icn-focusbar__end a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; color: var(--icn-muted); text-decoration: none; font-size: .85rem; }
.icn-focusbar__end a:hover { background: var(--icn-bg); color: var(--icn-ink); }
.icn-focus { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }

@media (min-width: 640px) {
    .icn-focusbar__end a span { display: inline; }
}
@media (max-width: 639px) {
    .icn-focusbar__end a span { display: none; }
}

/* دسکتاپ: نوار کناری ثابت */
@media (min-width: 1024px) {
    .icn-panel.icn-app:not(.icn-app--focus) { display: grid; grid-template-columns: var(--icn-side-w) minmax(0, 1fr); background: linear-gradient(to left, var(--icn-harbor) var(--icn-side-w), var(--icn-bg) 0); }
    [dir="ltr"] .icn-panel.icn-app:not(.icn-app--focus) { background: linear-gradient(to right, var(--icn-harbor) var(--icn-side-w), var(--icn-bg) 0); }
    .icn-app__main { background: var(--icn-bg); }
    .icn-side { position: sticky; top: 0; height: 100vh; width: auto; transform: none; transition: none; }
    .admin-bar .icn-side { top: 32px; height: calc(100vh - 32px); }
    .icn-side__close, .icn-top__menu, .icn-tabbar, .icn-scrim { display: none !important; }
    .icn-top { padding: 0 28px; gap: 16px; }
    .admin-bar .icn-top { top: 32px; }
    .icn-top__title { flex: 0 1 auto; font-size: 1.2rem; }
    .icn-top__search { display: flex; margin-inline-start: 24px; }
    .icn-top__new { display: inline-flex !important; }
    .icn-p-main { padding: 28px 28px 56px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .icn-top__search { display: flex; }
    .icn-p-main { padding: 24px 20px calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ------------------------------------------------------------ ورود (صفحه دوتکه) */
.icn-authx { display: grid; min-height: 100vh; background: #fff; }
.icn-authx__art { position: relative; overflow: hidden; background: var(--icn-harbor); color: #9fb3d9; min-height: 220px; }
.icn-authx__map { position: absolute; inset: 0; --icn-rw: .4; }
@media (min-width: 900px) { .icn-authx__map { --icn-rw: .13; } }
.icn-authx__copy { position: relative; z-index: 1; padding: 28px 24px; color: #fff; display: none; }
.icn-authx__lead { margin: 0 0 14px; color: var(--icn-cargo); font-weight: 800; }
.icn-authx__copy h2 { margin: 0 0 22px; font-size: 1.9rem; line-height: 1.55; font-weight: 800; max-width: 22ch; letter-spacing: -.3px; }
.icn-authx__copy ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; color: #c9d3ea; }
.icn-authx__copy li { display: flex; gap: 10px; align-items: center; }
.icn-authx__copy li .icn-i { color: var(--icn-cargo); }
.icn-authx__main { display: flex; flex-direction: column; padding: 0 16px 32px; }
.icn-authx__bar { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.icn-authx__bar .icn-brand { color: var(--icn-ink); }
.icn-authx__back { display: inline-flex; align-items: center; gap: 6px; color: var(--icn-muted); text-decoration: none; font-size: .88rem; }
.icn-authx__back:hover { color: var(--icn-navy); }
.icn-authx__form { flex: 1; display: grid; align-items: start; justify-items: center; padding-top: 4vh; }
.icn-authx__form .icn-auth { width: 100%; max-width: 420px; padding: 0; }
.icn-authx__form .icn-auth__card { border: 0; box-shadow: none; padding: 0; max-width: none; }
@media (max-width: 899px) {
    .icn-authx { grid-template-rows: 200px 1fr; }
    .icn-authx__main { border-radius: 22px 22px 0 0; margin-top: -24px; background: #fff; position: relative; z-index: 2; }
}
@media (min-width: 900px) {
    .icn-authx { grid-template-columns: minmax(0, 1fr) minmax(420px, 46%); }
    .icn-authx__art { order: 2; min-height: 100vh; }
    .icn-authx__copy { display: block; position: absolute; inset-inline: 48px; bottom: 56px; padding: 0; }
    .icn-authx__main { padding: 0 56px 40px; }
    .icn-authx__form { align-items: center; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .icn-map__route { animation: none; stroke-dashoffset: 0; }
    .icn-map__pin { animation: none; opacity: 1; }
    .icn-map__pulse { animation: none; }
    .icn-side { transition: none; }
}
/* پرش و فوکوس زیر نوار بالا/پایین پنهان نشود */
html:has(body.icn-app-body) { scroll-padding-top: calc(var(--icn-top-h) + 12px); scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { html:has(body.icn-app-body) { scroll-padding-bottom: 12px; } }
