/* ============================================================
   پنل مدیریت هنرتو — سامانهٔ طراحی اختصاصی
   زیبایی + کارایی + رسپانسیو  |  RTL
   ============================================================ */
@font-face {
  font-family: Vazirmatn;
  src: url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

:root {
  --bg: #f2f4fb;
  --surface: #ffffff;
  --ink: #1e2340;
  --ink-2: #5a6180;
  --ink-3: #9aa1bd;
  --line: #e6e9f5;
  --primary: #4f46e5;
  --primary-2: #7c6cf5;
  --primary-soft: #eef0ff;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
  --ok: #0d9f6e;   --ok-soft: #e6f7f0;
  --warn: #d97706; --warn-soft: #fdf1e0;
  --bad: #dc2626;  --bad-soft: #fdeaea;
  --info: #0284c7; --info-soft: #e8f3fb;
  --side-w: 264px;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(30,35,64,.05), 0 8px 24px -12px rgba(30,35,64,.14);
  --shadow-lg: 0 12px 40px -12px rgba(30,35,64,.25);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, #eef0ff, #f6efff);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.8;
}
a { color: var(--primary); text-decoration: none; }
::selection { background: var(--primary); color: #fff; }

/* ---------- چیدمان کلی ---------- */
.shell { display: flex; min-height: 100vh; }

/* ---------- سایدبار ---------- */
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  background: linear-gradient(180deg, #171c3a 0%, #1e2340 60%, #241f4e 100%);
  color: #cdd2ea; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
  transition: transform .28s ease;
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-logo {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 44px;
  background: var(--grad); display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(124,58,237,.7);
}
.brand b { color: #fff; font-size: 16px; display: block; line-height: 1.4; }
.brand small { color: #8d94b8; font-size: 11px; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
.nav-title { font-size: 10.5px; letter-spacing: .12em; color: #6f76a0; padding: 12px 14px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px;
  border-radius: 12px; color: #b9bfdc; font-weight: 500; font-size: 13.5px;
  transition: background .18s, color .18s, transform .18s;
}
.nav a svg { width: 19px; height: 19px; flex: 0 0 19px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(-2px); }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(124,58,237,.8); }
.nav a.active svg { opacity: 1; }

.side-foot {
  margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.1);
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.side-foot b { color: #fff; font-size: 13px; display: block; }
.side-foot small { color: #8d94b8; font-size: 11px; }
.side-foot .logout {
  margin-inline-start: auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #f87171; background: rgba(248,113,113,.12);
  transition: background .18s;
}
.side-foot .logout:hover { background: rgba(248,113,113,.25); }

/* ---------- محتوای اصلی ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 28px;
  background: rgba(255,255,255,.7); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.topbar .crumb { color: var(--ink-3); font-size: 12px; }
.burger {
  display: none; border: 0; background: var(--primary-soft); color: var(--primary);
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 18px;
}
.top-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }

.content { padding: 26px 28px 60px; width: 100%; max-width: 1280px; margin-inline: auto; }

/* ---------- کارت‌ها ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.card-head .sub { color: var(--ink-3); font-size: 12px; width: 100%; margin-top: -6px; }
.card-head .grow { flex: 1; }

/* ---------- آمار ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat {
  position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: var(--tint, var(--grad));
}
.stat .ico {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--tint-soft, var(--primary-soft)); font-size: 20px; margin-bottom: 10px;
}
.stat b { font-size: 21px; font-weight: 700; display: block; letter-spacing: -.02em; }
.stat span { color: var(--ink-2); font-size: 12.5px; }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px;
  padding: 10px 18px; border-radius: 12px; color: #fff; background: var(--grad);
  box-shadow: 0 6px 16px -6px rgba(79,70,229,.55);
  transition: transform .16s, box-shadow .16s, filter .16s; text-decoration: none;
}
.btn:hover { transform: translateY(-1.5px); filter: brightness(1.06); box-shadow: 0 10px 22px -8px rgba(79,70,229,.65); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: var(--surface); color: var(--primary); border: 1.5px solid #dcd9ff; box-shadow: none; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.ok { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 6px 16px -6px rgba(5,150,105,.5); }
.btn.warn { background: linear-gradient(135deg, #d97706, #f59e0b); box-shadow: 0 6px 16px -6px rgba(217,119,6,.5); }
.btn.danger { background: linear-gradient(135deg, #dc2626, #f43f5e); box-shadow: 0 6px 16px -6px rgba(220,38,38,.5); }
.btn.dark { background: linear-gradient(135deg, #334155, #1e293b); box-shadow: 0 6px 16px -6px rgba(30,41,59,.5); }
.btn.sm { padding: 7px 13px; font-size: 12px; border-radius: 10px; }
.btn.wide { width: 100%; padding: 13px; font-size: 14.5px; border-radius: 14px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- جدول ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl thead th {
  background: #f8f9ff; color: var(--ink-2); font-weight: 600; font-size: 12px;
  text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #fafaff; }
.tbl .num { font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--ink-3); padding: 34px 10px !important; font-size: 13px; }

/* ---------- نشان‌ها ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: #eef1f8; color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* ---------- فرم‌ها ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field label b { color: var(--bad); }
.input, .field select, .field textarea {
  font: inherit; font-size: 13.5px; color: var(--ink); background: #fbfbfe;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px;
  transition: border-color .18s, box-shadow .18s, background .18s; width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
/* منوی کشویی همرنگ و هم‌قالبِ ورودی‌های متنی */
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
  padding-left: 34px; min-width: 150px;
}
.searchbar select.input { width: auto; flex: 0 0 auto; }
.hint { font-size: 11px; color: var(--ink-3); }
.form-foot { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- صفحهٔ ورود ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(168,85,247,.28), transparent 60%),
    radial-gradient(700px 460px at 8% 110%, rgba(14,165,233,.22), transparent 60%),
    linear-gradient(160deg, #141833 0%, #1e2340 55%, #2a1e4e 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5;
}
.login-wrap::before { width: 340px; height: 340px; border: 1.5px dashed rgba(255,255,255,.14); top: -120px; left: -80px; animation: spin 60s linear infinite; }
.login-wrap::after { width: 220px; height: 220px; border: 1.5px dashed rgba(255,255,255,.1); bottom: -60px; right: -40px; animation: spin 45s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-card {
  width: min(430px, 100%); background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12); border-radius: 26px;
  backdrop-filter: blur(18px); padding: 38px 34px; color: #e6e9ff;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7); position: relative; z-index: 1;
  animation: rise .5s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.login-logo {
  width: 64px; height: 64px; border-radius: 20px; background: var(--grad);
  display: grid; place-items: center; font-size: 28px; font-weight: 700; color: #fff;
  margin: 0 auto 16px; box-shadow: 0 14px 34px -10px rgba(124,58,237,.8);
}
.login-card h1 { text-align: center; font-size: 19px; margin: 0 0 4px; color: #fff; }
.login-card .sub { text-align: center; color: #a6adcf; font-size: 12.5px; margin-bottom: 26px; }
.login-card .field label { color: #b9bfdc; }
.login-card .input {
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #fff;
}
.login-card .input::placeholder { color: #7d84a8; }
.login-card .input:focus { background: rgba(255,255,255,.1); border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(124,108,245,.25); }
.login-err {
  background: rgba(220,38,38,.14); border: 1px solid rgba(248,113,113,.4); color: #fecaca;
  border-radius: 12px; padding: 9px 14px; font-size: 12.5px; margin-bottom: 14px; text-align: center;
}
.login-foot { text-align: center; color: #7d84a8; font-size: 11px; margin-top: 22px; }

/* ---------- تب‌ها ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a {
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  border-radius: 10px 10px 0 0; border-bottom: 2.5px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.tabs a:hover { color: var(--primary); }
.tabs a.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* ---------- متفرقه ---------- */
.muted { color: var(--ink-3); }
.mt0 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.notice {
  border-radius: 14px; padding: 12px 16px; font-size: 12.5px; margin-bottom: 16px;
  background: var(--info-soft); color: var(--info); border: 1px solid #cfe6f8;
}
.notice.ok { background: #e5f6ec; color: var(--ok); border-color: #bfe6cf; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: #f5dfbe; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; font-size: 13px; }
.kv div { background: #fafaff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.kv small { color: var(--ink-3); display: block; font-size: 11px; }

/* ---------- رسپانسیو ---------- */
@media (max-width: 960px) {
  .sidebar { position: fixed; inset-inline-start: 0; transform: translateX(100%); }
  body.side-open .sidebar { transform: translateX(0); box-shadow: -20px 0 60px rgba(0,0,0,.35); }
  .burger { display: grid; place-items: center; }
  .content { padding: 18px 14px 60px; }
  .topbar { padding: 12px 14px; }
  .scrim { position: fixed; inset: 0; background: rgba(20,24,51,.5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.side-open .scrim { opacity: 1; pointer-events: auto; }
}
@media (min-width: 961px) { .scrim { display: none; } }

/* ---------- سایدبار جمع‌شونده (ریل باریک آیکونی) ---------- */
.side-toggle {
  margin: 10px 12px 4px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,.06); color: #b9bfdc; border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 8px; cursor: pointer; font: inherit; font-size: 12px;
  transition: background .18s;
}
.side-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
.side-toggle svg { width: 16px; height: 16px; transition: transform .25s; }

@media (min-width: 961px) {
  body.side-collapsed .sidebar { width: 82px; flex-basis: 82px; }
  body.side-collapsed .brand div, body.side-collapsed .nav-title,
  body.side-collapsed .nav a span, body.side-collapsed .side-foot div,
  body.side-collapsed .side-toggle span { display: none; }
  body.side-collapsed .brand { justify-content: center; padding: 18px 8px; }
  body.side-collapsed .nav a { justify-content: center; padding: 12px 8px; }
  body.side-collapsed .nav a svg { width: 21px; height: 21px; flex-basis: 21px; }
  body.side-collapsed .side-foot { justify-content: center; }
  body.side-collapsed .side-foot .logout { display: none; }
  body.side-collapsed .side-toggle svg { transform: rotate(180deg); }
  .sidebar { transition: width .25s ease, flex-basis .25s ease, transform .28s ease; }
}
@media (max-width: 960px) {
  body.side-collapsed .sidebar { width: var(--side-w); flex-basis: var(--side-w); }
  .side-toggle { display: none; }
}

/* ---------- گالری آثار ---------- */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.art-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fbfbfe; }
.art-card img { width: 100%; height: 170px; object-fit: cover; display: block; transition: transform .3s; }
.art-card:hover img { transform: scale(1.04); }
.art-card .cap { padding: 8px 12px; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.art-ph { height: 170px; display: grid; place-items: center; font-size: 34px; background: var(--grad-soft); }

/* ---------- صفحهٔ خروجی‌ها ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.exp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
  transition: transform .2s, box-shadow .2s; }
.exp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.exp-card .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  font-size: 21px; background: var(--primary-soft); }
.exp-card b { font-size: 14px; }
.exp-card p { margin: 0; color: var(--ink-2); font-size: 12.5px; flex: 1; }

/* جستجوی سریع بالای جدول‌ها */
.searchbar { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.searchbar .input { width: 210px; flex: 0 0 auto; }

/* ---------------- دیت‌پیکر شمسی ---------------- */
.jp-wrap { display: inline-flex; gap: 6px; align-items: center; width: 100%; }
.jp-wrap .jp-vis { flex: 1; }
.jp-pop {
  position: absolute; z-index: 99; width: 300px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  box-shadow: 0 14px 40px rgba(25, 32, 80, .18); direction: rtl;
}
.jp-head { display: flex; gap: 8px; margin-bottom: 10px; }
.jp-head select { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; font: inherit; }
.jp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.jp-grid .jp-wd { font-size: 11px; color: var(--ink-2); text-align: center; font-weight: 700; }
.jp-day { border: 0; background: transparent; border-radius: 8px; padding: 6px 0; cursor: pointer; font: inherit; }
.jp-day:hover { background: var(--accent-soft); }
.jp-day.sel { background: var(--accent); color: #fff; font-weight: 700; }
.jp-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.jp-time select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; background: #fff; font: inherit; }
.jp-time .jp-today { margin-right: auto; }
.jp-ok { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 6px 14px; font: inherit; cursor: pointer; }
