/* =====================================================================
   سامانه گمرکی سفیر — طراحی بصری
   پالت از لوگو: سرمه‌ای #214077 و نارنجی #EE750D
   ===================================================================== */
:root {
  --navy: #214077;
  --navy-900: #0a1b38;
  --navy-800: #112a52;
  --orange: #ee750d;

  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --ink: #13203d;
  --muted: #667391;
  --line: #e2e8f3;
  --line-strong: #cfd8e8;

  --brand: #214077;            /* لینک‌ها و عناصر اصلی */
  --brand-2: #3b64b4;
  --primary-bg: linear-gradient(180deg, #2c5099, #214077);
  --primary-ink: #ffffff;
  --accent: #ee750d;
  --ok: #178a5b;
  --warn: #c97a00;
  --bad: #d23f4b;

  --side-ink: #b9c8e4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 32, 66, .05);
  --shadow: 0 1px 2px rgba(17, 32, 66, .05), 0 8px 24px rgba(17, 32, 66, .06);
  --shadow-lg: 0 24px 70px rgba(10, 27, 56, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --show-l: block; --show-d: none;   /* نسخه‌ی لوگو برای زمینه روشن/تیره */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080f1f; --surface: #0f1a30; --surface-2: #132039; --ink: #e8eef9; --muted: #92a0bd; --line: #1d2b48; --line-strong: #2a3b5e;
    --brand: #93b4f2; --brand-2: #b3ccfa;
    --primary-bg: linear-gradient(180deg, #4574cf, #3563b9); --primary-ink: #fff;
    --ok: #3cc48c; --warn: #f0a93a; --bad: #f2707b;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.35);
    --show-l: none; --show-d: block; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080f1f; --surface: #0f1a30; --surface-2: #132039; --ink: #e8eef9; --muted: #92a0bd; --line: #1d2b48; --line-strong: #2a3b5e;
  --brand: #93b4f2; --brand-2: #b3ccfa;
  --primary-bg: linear-gradient(180deg, #4574cf, #3563b9); --primary-ink: #fff;
  --ok: #3cc48c; --warn: #f0a93a; --bad: #f2707b;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.35);
  --show-l: none; --show-d: block; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.75;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--orange) 30%, transparent); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.4; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
b, strong { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.lg-l { display: var(--show-l); }
.lg-d { display: var(--show-d); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
#app { min-height: 100vh; display: flex; }
.side {
  width: 268px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  color: var(--side-ink); overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(59, 100, 180, .35), transparent 60%),
    linear-gradient(180deg, var(--navy-800), var(--navy-900));
}
.side::after {   /* ردّ محو لوگو در پایین نوار کناری */
  content: ""; position: absolute; inset-inline: -40px; bottom: -30px; height: 260px; z-index: -1; opacity: .05;
  background: url(../img/logo-light.png) center bottom / 320px auto no-repeat;
}
.brand { padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.brand img { width: 104px; height: auto; display: block; }
.brand b { display: block; color: #fff; font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; }
.brand span { display: block; font-size: .76rem; color: var(--side-ink); opacity: .8; margin-top: 1px; }
.nav { padding: 6px 12px 12px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav .grp { font-size: .7rem; letter-spacing: .04em; color: rgba(185, 200, 228, .55); padding: 16px 12px 6px; font-weight: 600; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px;
  color: var(--side-ink); margin-bottom: 2px; text-decoration: none; font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: linear-gradient(270deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); color: #fff; font-weight: 700; }
.nav a.active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--orange); box-shadow: 0 0 14px rgba(238, 117, 13, .7);
}
.nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; transition: color .18s, opacity .18s; }
.nav a.active svg { color: #ffa65a; opacity: 1; }
.side-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .12); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--orange), #f59a45); box-shadow: 0 4px 12px rgba(238, 117, 13, .35); }
.side-foot .who { color: #fff; display: block; font-weight: 700; font-size: .9rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .role { font-size: .74rem; opacity: .7; }
.side-foot .grow { flex: 1; min-width: 0; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: transparent; color: var(--side-ink); cursor: pointer; transition: background .15s, color .15s; flex-shrink: 0; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.icon-btn svg { width: 17px; height: 17px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  display: none; align-items: center; gap: 12px; padding: 10px 14px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top img { height: 30px; width: auto; }
.top b { font-weight: 800; }
.top .icon-btn { border-color: var(--line); color: var(--ink); }
.top .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
#view { padding: 28px 32px 56px; max-width: 1360px; width: 100%; margin: 0 auto; }
#view > * { animation: rise .35s var(--ease) both; }
#view > *:nth-child(2) { animation-delay: .04s; }
#view > *:nth-child(3) { animation-delay: .08s; }
#view > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.scrim { display: none; }

@media (max-width: 900px) {
  .side { position: fixed; inset-block: 0; right: 0; z-index: 60; transform: translateX(105%); transition: transform .28s var(--ease); width: 284px; }
  .side.open { transform: none; box-shadow: -16px 0 48px rgba(0, 0, 0, .4); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(6, 14, 30, .55); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .top { display: flex; }
  #view { padding: 18px 14px 48px; }
}

/* ---------- components ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { position: relative; padding-inline-start: 14px; }
.page-head h1::before { content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 4px; height: 1.1em; transform: translateY(-50%); border-radius: 4px; background: linear-gradient(180deg, var(--orange), #f6a04f); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card h2 { margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { gap: 10px; } .stat { padding: 14px; } .stat .v { font-size: 1.35rem; } .stat .ico { width: 34px; height: 34px; margin-bottom: 6px; } }
@media (max-width: 380px) { .g4 { grid-template-columns: 1fr; } }

/* بنر خوش‌آمد */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 26px 28px; margin-bottom: 18px; color: #fff; isolation: isolate;
  background: radial-gradient(90% 140% at 0% 0%, rgba(238, 117, 13, .28), transparent 55%), linear-gradient(120deg, var(--navy), #17305c 60%, var(--navy-900));
  box-shadow: 0 18px 40px -12px rgba(17, 42, 82, .55);
}
.hero::after { content: ""; position: absolute; inset-block: -20% -30%; inset-inline-start: -4%; width: 360px; z-index: -1; opacity: .13; background: url(../img/logo-light.png) center / contain no-repeat; transform: rotate(-4deg); }
.hero h1 { font-size: 1.55rem; color: #fff; }
.hero h1::before { display: none; }
.hero p { margin: 4px 0 0; color: rgba(255, 255, 255, .78); }
.hero .row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.hero .btn:hover { background: rgba(255, 255, 255, .22); }
.hero .btn.accent { background: linear-gradient(180deg, #f58a2e, var(--orange)); border-color: transparent; box-shadow: 0 8px 20px -6px rgba(238, 117, 13, .7); }
@media (max-width: 700px) { .hero { padding: 20px; } .hero::after { opacity: .08; } }

.stat { position: relative; display: flex; flex-direction: column; gap: 2px; overflow: hidden; padding-top: 18px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(17,32,66,.05), 0 14px 32px rgba(17,32,66,.1); }
.stat .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px;
  background: color-mix(in srgb, var(--tone, var(--brand)) 13%, transparent); color: var(--tone, var(--brand)); }
.stat .ico svg { width: 21px; height: 21px; }
.stat .v { font-size: 1.85rem; font-weight: 800; line-height: 1.25; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--tone, var(--brand)); opacity: .85; }
.stat { --tone: var(--brand); }
.stat.bad { --tone: var(--bad); }
.stat.ok { --tone: var(--ok); }
.stat.warn { --tone: var(--orange); }
.stat.bad .v { color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; line-height: 1.5;
  box-shadow: var(--shadow-sm); white-space: nowrap; transition: background .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--brand-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(33, 64, 119, .65); }
.btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 9%, var(--surface)); border-color: var(--bad); }
.btn.sm { padding: 3px 11px; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.side .btn { background: transparent; color: var(--side-ink); border-color: rgba(255,255,255,.2); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); border-color: transparent; }
.badge.warn { background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--warn); border-color: transparent; }
.badge.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); border-color: transparent; }
.badge.info { background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: var(--brand); border-color: transparent; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.toolbar input, .toolbar select { max-width: 280px; }
.toolbar input[type=text], .toolbar input:not([type]) {
  padding-inline-start: 38px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23919db8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 12px center / 17px;
}

input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=file], select, textarea, input:not([type]) {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type=file] { padding: 8px; background: var(--surface-2); border-style: dashed; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #9aa6c0; }
input:hover, select:hover, textarea:hover { border-color: var(--brand-2); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 20%, transparent); outline: none; }
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; padding-inline-end: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23919db8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat left 11px center / 16px; }
label.f { display: block; }
label.f > span { display: block; font-size: .83rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
label.f .req { color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); max-height: 72vh; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 16px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-weight: 700; font-size: .78rem; color: var(--muted); white-space: nowrap; letter-spacing: .02em; border-bottom: 1px solid var(--line-strong); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--brand-2) 6%, transparent); }
tbody tr.click { cursor: pointer; }
td.acts { white-space: nowrap; text-align: left; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty::before { content: ""; display: block; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; opacity: .9;
  background: color-mix(in srgb, var(--brand-2) 11%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b64b4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3C/svg%3E") center / 26px no-repeat; }
.empty.loading::before { display: none; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; width: fit-content; max-width: 100%; }
.tabs button { background: none; border: 0; padding: 7px 16px; cursor: pointer; color: var(--muted); border-radius: 9px; white-space: nowrap; font-weight: 600; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand); background: var(--surface); box-shadow: 0 1px 3px rgba(17, 32, 66, .12), 0 0 0 1px var(--line); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 8px; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 24px 16px 0; }
.timeline li::before { content: ""; position: absolute; right: 3px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 3px solid var(--orange); }
.timeline li::after { content: ""; position: absolute; right: 8px; top: 20px; bottom: -4px; width: 1.5px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; gap: 12px; align-items: center; font-size: .88rem; }
.bar-row b { text-align: left; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(270deg, var(--navy), var(--brand-2)); border-radius: 6px; transform-origin: right; animation: grow .7s var(--ease) both; }
.bar > i.alt { background: linear-gradient(270deg, var(--orange), #f6a04f); }
@keyframes grow { from { transform: scaleX(0); } }
.cols { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding-top: 10px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.col .stack { width: 100%; max-width: 54px; display: flex; flex-direction: column; justify-content: flex-end; flex: 1; }
.col .stack i { display: block; background: linear-gradient(180deg, var(--brand-2), var(--navy)); border-radius: 6px 6px 0 0; }
.col .stack i.alt { background: linear-gradient(180deg, #f6a04f, var(--orange)); }
.col small { color: var(--muted); font-size: .72rem; text-align: center; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); margin-top: 10px; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; background: var(--navy); }
.legend b.alt { background: var(--orange); }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(6, 14, 30, .6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; overflow-y: auto; animation: fade .2s; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 660px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .28s var(--ease); }
.modal.wide { max-width: 880px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-h h2 { margin: 0; }
.modal-b { padding: 22px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-start; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); position: sticky; bottom: 0; }
.x { background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; width: 34px; height: 34px; border-radius: 10px; transition: background .15s, color .15s; }
.x:hover { background: var(--surface-2); color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
#toasts { position: fixed; bottom: 20px; left: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--navy-900); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: 380px; border-inline-start: 4px solid var(--orange); animation: slide .28s var(--ease); }
.toast.err { background: #4a1620; border-inline-start-color: var(--bad); }
.toast.ok { background: #0d3a2a; border-inline-start-color: var(--ok); }
@keyframes slide { from { opacity: 0; transform: translateX(-16px); } }

/* ---------- skeleton ---------- */
.sk { display: block; border-radius: 12px; min-height: 18px; background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 37%, var(--line) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk.h { height: 34px; width: 240px; margin-bottom: 22px; }
.sk.c { height: 120px; }
.sk.t { height: 280px; margin-top: 16px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate;
  background: radial-gradient(80% 60% at 100% 0%, rgba(59, 100, 180, .55), transparent 60%), radial-gradient(60% 50% at 0% 100%, rgba(238, 117, 13, .28), transparent 60%), linear-gradient(160deg, var(--navy-800), var(--navy-900));
}
.auth-hero::before { content: ""; position: absolute; width: 640px; height: 640px; inset-inline-end: -180px; bottom: -160px; z-index: -1; opacity: .07; background: url(../img/logo-light.png) center / contain no-repeat; }
.auth-hero .lg { width: 148px; }
.auth-hero h2 { font-size: 2.1rem; font-weight: 800; line-height: 1.5; color: #fff; margin: 0 0 14px; }
.auth-hero h2 em { font-style: normal; color: #ffa65a; }
.auth-hero p { color: rgba(255, 255, 255, .72); max-width: 460px; margin: 0 0 28px; font-size: 1rem; }
.auth-hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .88); }
.auth-hero li i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12); color: #ffa65a; flex-shrink: 0; }
.auth-hero li svg { width: 17px; height: 17px; }
.auth-hero small { color: rgba(255, 255, 255, .45); }
.auth-panel { display: grid; place-items: center; padding: 28px 20px; }
.auth .box { width: 100%; max-width: 410px; animation: rise .5s var(--ease) both; }
.auth .box .lg-m { display: none; }
.auth .box h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth .box h1::before { display: none; }
.auth form { display: grid; gap: 15px; margin-top: 24px; }
.auth form .btn.primary { padding: 11px; font-size: 1rem; margin-top: 4px; }
.auth .switch { margin-top: 18px; text-align: center; }
.auth .card-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: var(--shadow); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth .box .lg-m { display: block; width: 92px; margin: 0 auto 18px; }
  .auth .box .lg-m.lg-d { display: var(--show-d); }
  .auth .box .lg-m.lg-l { display: var(--show-l); }
  .auth .box h1, .auth .box > .muted { text-align: center; }
}
.note { background: color-mix(in srgb, var(--orange) 11%, transparent); border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); padding: 11px 15px; border-radius: 12px; font-size: .88rem; }
.items-row { display: grid; grid-template-columns: 1fr 90px 130px 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 560px) { .items-row { grid-template-columns: 1fr 70px 100px 28px; } }
.res-table td:last-child { text-align: left; font-weight: 700; font-variant-numeric: tabular-nums; }
.res-table tr.total td { background: color-mix(in srgb, var(--orange) 11%, transparent); font-size: 1.05rem; font-weight: 800; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

@media print {
  .side, .top, .no-print, .toolbar, #toasts, .scrim { display: none !important; }
  body { background: #fff; color: #000; }
  #view { padding: 0; max-width: none; }
  #view > * { animation: none; }
  .card, .table-wrap { box-shadow: none; border-color: #bbb; }
  .hero { display: none; }
}

/* =====================================================================
   V.04 — تقویم، ماشین‌حساب، پرش سریع، صفحه ورود، دسترسی‌ها، تعامل
   ===================================================================== */
.jd-wrap { position: relative; display: block; }
.jd-wrap input { padding-inline-end: 40px; }
.jd-ico { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--brand-2); border-radius: 8px; cursor: pointer; transition: background .15s, transform .15s var(--ease); }
.jd-ico:hover { background: color-mix(in srgb, var(--brand-2) 14%, transparent); transform: translateY(-50%) scale(1.08); }
.jd-ico svg { width: 18px; height: 18px; }
.jd-pop { position: fixed; z-index: 400; width: 296px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 12px; animation: pop .18s var(--ease); direction: rtl; }
.jd-h { display: grid; grid-template-columns: 34px 1fr 84px 34px; gap: 6px; margin-bottom: 8px; }
.jd-h select { padding: 5px 8px; font-size: .86rem; background-position: left 8px center; padding-inline-end: 22px; }
.jd-nav { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--brand); transition: background .15s, transform .15s; }
.jd-nav:hover { background: color-mix(in srgb, var(--brand-2) 16%, var(--surface)); transform: scale(1.06); }
.jd-w, .jd-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.jd-w span { font-size: .75rem; color: var(--muted); padding: 4px 0; font-weight: 700; }
.jd-w .fri, .jd-d.fri { color: var(--bad); }
.jd-d { height: 35px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font-size: .92rem; transition: background .12s, transform .12s var(--ease); }
.jd-d:hover { background: color-mix(in srgb, var(--brand-2) 16%, transparent); transform: scale(1.1); }
.jd-d.today { box-shadow: inset 0 0 0 1.5px var(--orange); font-weight: 800; }
.jd-d.sel { background: var(--primary-bg); color: #fff; font-weight: 800; box-shadow: 0 4px 12px -4px rgba(33, 64, 119, .7); }
.jd-f { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.jd-f button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 2px 11px; font-size: .78rem; cursor: pointer; color: var(--brand); transition: background .15s; }
.jd-f button:hover { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); }
.jd-f .clr { color: var(--bad); margin-inline-start: auto; }

/* dock + ماشین‌حساب */
.dock { position: fixed; left: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 10px; }
.dock-btn { position: relative; overflow: hidden; display: flex; align-items: center; gap: 0; height: 48px; width: 48px; padding: 0 13px; border: 0; border-radius: 16px; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--orange), #f59a45); box-shadow: 0 10px 24px -8px rgba(238, 117, 13, .8); transition: width .25s var(--ease), transform .2s var(--ease); white-space: nowrap; }
.dock-btn + .dock-btn { background: var(--primary-bg); box-shadow: 0 10px 24px -8px rgba(33, 64, 119, .8); }
.dock-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.dock-btn span { max-width: 0; opacity: 0; overflow: hidden; font-weight: 700; font-size: .85rem; transition: max-width .25s var(--ease), opacity .2s, margin .25s; }
.dock-btn:hover, .dock-btn:focus-visible { width: 144px; transform: translateY(-2px); }
.dock-btn:hover span, .dock-btn:focus-visible span { max-width: 100px; opacity: 1; margin-inline-start: 9px; }
.calc-open .dock-btn:first-child { box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 40%, transparent), 0 10px 24px -8px rgba(238, 117, 13, .8); }
.calc { position: fixed; z-index: 120; left: 82px; bottom: 18px; width: 286px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; direction: rtl; opacity: 0; transform: translateY(16px) scale(.96); pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.calc.on { opacity: 1; transform: none; pointer-events: auto; }
.calc.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.calc-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: linear-gradient(120deg, var(--navy), #17305c); color: #fff; cursor: grab; touch-action: none; }
.calc-h b { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.calc-h svg { width: 18px; height: 18px; color: #ffa65a; }
.calc-h .x { color: #fff; }
.calc-h .x:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.calc-d { padding: 10px 16px 6px; text-align: left; direction: ltr; background: var(--surface-2); min-height: 108px; display: flex; flex-direction: column; justify-content: flex-end; }
.calc-d .ch { display: flex; flex-direction: column; gap: 1px; max-height: 44px; overflow: hidden; }
.calc-d .ch button { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: .74rem; color: var(--muted); }
.calc-d .ch button:hover { color: var(--brand); }
.calc-d .cr { color: var(--muted); font-size: .95rem; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.calc-d .cx { font-size: 1.7rem; font-weight: 800; word-break: break-all; line-height: 1.3; font-variant-numeric: tabular-nums; }
.calc-k { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 10px 12px; direction: ltr; }
.calc-k button { height: 46px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-size: 1.1rem; font-weight: 700; cursor: pointer; color: var(--ink); transition: background .12s, transform .1s; }
.calc-k button:hover { background: var(--surface-2); border-color: var(--brand-2); }
.calc-k button:active { transform: scale(.94); }
.calc-k .op { color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); }
.calc-k .fn { color: var(--brand); background: var(--surface-2); }
.calc-k .eq { background: linear-gradient(180deg, #f58a2e, var(--orange)); color: #fff; border-color: transparent; }
.calc-f { display: flex; gap: 6px; padding: 0 12px 12px; }
.calc-f button { flex: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 6px; font-size: .8rem; cursor: pointer; color: var(--brand); font-weight: 600; }
.calc-f button:hover { border-color: var(--brand-2); }
@media (max-width: 900px) { .dock { left: 12px; bottom: 12px; } .dock-btn { width: 44px; height: 44px; } .dock-btn:hover { width: 44px; } .dock-btn span { display: none; } .calc { left: 12px; right: 12px; width: auto; max-width: 340px; bottom: 70px; } #toasts { left: 12px !important; right: 12px; bottom: 70px !important; } }
#toasts { left: 84px; }

/* پرش سریع */
.pal-bg { position: fixed; inset: 0; z-index: 300; background: rgba(6, 14, 30, .55); backdrop-filter: blur(4px); display: grid; align-items: start; justify-items: center; padding: 12vh 16px 0; animation: fade .15s; }
.pal { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s var(--ease); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.pal-in input { border: 0 !important; box-shadow: none !important; padding: 6px 0 !important; background: transparent !important; font-size: 1rem; }
kbd { font-family: inherit; font-size: .72rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; color: var(--muted); background: var(--surface-2); }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal-i { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; cursor: pointer; }
.pal-i svg { width: 18px; height: 18px; color: var(--brand-2); flex-shrink: 0; }
.pal-i small { color: var(--muted); }
.pal-i em { margin-inline-start: auto; font-style: normal; font-size: .74rem; color: var(--muted); }
.pal-i.on { background: color-mix(in srgb, var(--brand-2) 13%, transparent); }
.pal-f { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .74rem; color: var(--muted); }

/* نسخه */
.ver { text-align: center; font-size: .68rem; letter-spacing: .08em; color: var(--muted); opacity: .7; padding: 10px 0 14px; direction: ltr; user-select: none; }
.auth .ver { grid-column: 1 / -1; background: var(--bg); }

/* صفحه ورود */
.auth.has-about { grid-template-rows: minmax(100vh, auto) auto auto; }
.auth-hero { min-height: 100vh; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); margin-bottom: 14px; }
.pill.lite { color: #ffc592; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.pill svg { width: 15px; height: 15px; }
.auth-hero .more, .auth .more-m { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: #ffc592; font-weight: 700; text-decoration: none; }
.auth-hero .more svg, .more-m svg { width: 18px; height: 18px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
.auth .more-m { display: none; color: var(--brand); justify-content: center; width: 100%; }
.auth-hero > div > * { animation: rise .6s var(--ease) both; }
.auth-hero > div > *:nth-child(2) { animation-delay: .08s; } .auth-hero > div > *:nth-child(3) { animation-delay: .16s; } .auth-hero > div > *:nth-child(4) { animation-delay: .24s; } .auth-hero > div > *:nth-child(5) { animation-delay: .32s; }
.auth-hero li { transition: transform .2s var(--ease); } .auth-hero li:hover { transform: translateX(-6px); }
.about { grid-column: 1 / -1; background: var(--surface); border-top: 1px solid var(--line); padding: 72px 24px 56px; }
.about-in { max-width: 1120px; margin: 0 auto; }
.about-head { text-align: center; max-width: 760px; margin: 0 auto 36px; }
.about-head h2 { font-size: 1.9rem; font-weight: 800; margin-bottom: 12px; }
.about-head p { color: var(--muted); font-size: 1.02rem; line-height: 2; margin: 0; }
.feat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.feat:hover { transform: translateY(-6px); box-shadow: 0 18px 36px -14px rgba(17, 32, 66, .25); border-color: var(--brand-2); }
.feat i, .trust i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; color: var(--orange); background: color-mix(in srgb, var(--orange) 13%, transparent); transition: transform .3s var(--ease); }
.feat:hover i { transform: rotate(-8deg) scale(1.1); }
.feat svg, .trust svg { width: 23px; height: 23px; }
.feat h3 { margin-bottom: 6px; font-size: 1rem; } .feat p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.9; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps li { position: relative; padding: 22px 20px; border-radius: 18px; border: 1px dashed var(--line-strong); background: var(--surface); }
.steps li b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary-bg); color: #fff; margin-bottom: 12px; font-size: 1.05rem; }
.steps li h3 { margin-bottom: 4px; } .steps li p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.9; }
.trust { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.trust > div { display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; }
.trust span { color: var(--muted); font-size: .86rem; line-height: 1.8; }
.cta { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 26px 30px; border-radius: 22px; color: #fff; background: radial-gradient(90% 140% at 0% 0%, rgba(238, 117, 13, .3), transparent 55%), linear-gradient(120deg, var(--navy), var(--navy-900)); }
.cta h3 { color: #fff; font-size: 1.25rem; } .cta p { margin: 4px 0 0; color: rgba(255, 255, 255, .75); }
.cta .btn.accent { background: linear-gradient(180deg, #f58a2e, var(--orange)); color: #fff; border-color: transparent; padding: 10px 22px; }
.rv { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.rv.in { opacity: 1; transform: none; }
@media (max-width: 1000px) { .feat-grid, .steps, .trust { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .auth.has-about { grid-template-rows: auto auto auto; } .auth .more-m { display: flex; margin-top: 22px; } .auth-panel { min-height: 100vh; } .about { padding: 48px 16px 40px; } }
@media (max-width: 560px) { .feat-grid, .steps, .trust { grid-template-columns: 1fr; } .about-head h2 { font-size: 1.5rem; } }

/* دسترسی‌ها و فرم کاربر */
.chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 380px; }
.chip { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--brand); cursor: pointer; font-weight: 600; transition: background .15s, transform .15s; }
.chip:hover:not(:disabled) { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); transform: translateY(-1px); }
.chip:disabled { opacity: .5; cursor: not-allowed; }
.chip.sm { padding: 0 9px; font-size: .72rem; cursor: default; }
.chip.sm.l1 { color: var(--muted); } .chip.sm.l2 { color: var(--brand); border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line)); } .chip.sm.l3 { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.perm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.perm-wrap { max-height: 46vh; }
.perm-table td { padding: 8px 14px; } .perm-table td:last-child { width: 46%; }
.perm-table select { padding-block: 6px; }
.chk { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; margin-bottom: 4px; }
.chk input { width: 18px; height: 18px; accent-color: var(--orange); }
.pw-row { display: flex; gap: 8px; } .pw-row input { flex: 1; }
.role-card { transition: transform .2s var(--ease), box-shadow .2s; } .role-card:hover { transform: translateY(-2px); }

/* وارد کردن اکسل */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--surface-2); transition: border-color .2s, background .2s, transform .2s var(--ease); }
.drop i { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: var(--orange); background: color-mix(in srgb, var(--orange) 13%, transparent); margin-bottom: 6px; }
.drop i svg { width: 24px; height: 24px; }
.drop:hover, .drop.over { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 7%, var(--surface)); }
.drop.over { transform: scale(1.015); }
.drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.imp-status { margin-top: 12px; font-size: .9rem; line-height: 1.9; }
.imp-status.ok { color: var(--ok); } .imp-status.bad { color: var(--bad); }
.imp-status.bad .table-wrap, .imp-status.bad .small { color: var(--ink); }
.imp-bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 12px; overflow: hidden; }
.imp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(270deg, var(--orange), #f6a04f); transition: width .3s var(--ease); }
.imp-help { margin-top: 14px; font-size: .88rem; } .imp-help summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* جزئیات تعاملی */
.has-rip { overflow: hidden; }
.rip { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: rip .6s var(--ease) forwards; pointer-events: none; }
@keyframes rip { to { transform: scale(1); opacity: 0; } }
.toast { display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; cursor: pointer; }
.toast i { display: grid; place-items: center; flex-shrink: 0; } .toast i svg { width: 18px; height: 18px; }
.toast::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: currentColor; opacity: .5; transform-origin: right; animation: shrink var(--dur, 3s) linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }
.hero { background-size: 160% 160%, 100% 100%; animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { background-position: 40% 60%, 0 0; } }
.grid > .card:not(.stat) { transition: transform .2s var(--ease), box-shadow .2s; }
.grid > .card:not(.stat):hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(17, 32, 66, .05), 0 14px 30px rgba(17, 32, 66, .09); }
.nav a:hover svg { transform: scale(1.15) rotate(-4deg); } .nav a svg { transition: transform .2s var(--ease), color .18s, opacity .18s; }
tbody tr.click:hover { background: color-mix(in srgb, var(--orange) 8%, transparent); }
.in-app { border-top: 1px solid var(--line); margin-top: auto; }
@media print { .dock, .calc, .pal-bg, .jd-pop, .ver { display: none !important; } }
.calc-k .eq:hover { background: linear-gradient(180deg, #f9964a, #f07a14); border-color: transparent; }
.calc-k .op:hover { background: color-mix(in srgb, var(--orange) 20%, var(--surface)); }

/* خواندن خودکار اظهارنامه */
.ai-box { margin-bottom: 4px; }
.ai-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 20px 16px; border: 2px dashed color-mix(in srgb, var(--orange) 55%, var(--line-strong)); border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--orange) 7%, var(--surface)), var(--surface-2)); transition: transform .2s var(--ease), border-color .2s; }
.ai-drop i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--orange), #f59a45); box-shadow: 0 8px 18px -8px rgba(238, 117, 13, .8); margin-bottom: 4px; }
.ai-drop i svg { width: 22px; height: 22px; }
.ai-drop:hover, .ai-drop.over { border-color: var(--orange); transform: translateY(-1px); }
.ai-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.ai-res { margin-top: 10px; }
.ai-status { color: var(--muted); font-size: .9rem; }
.ai-ok { border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); border-radius: 14px; padding: 12px 14px; }
.ai-ok > b { color: var(--ok); }
label.f.autofilled input, label.f.autofilled select, label.f.autofilled textarea { background: color-mix(in srgb, var(--orange) 10%, var(--surface)); border-color: color-mix(in srgb, var(--orange) 55%, var(--line-strong)); animation: flash .9s var(--ease); }
@keyframes flash { from { box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 45%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }
