@font-face {
  font-family: 'Vazirmatn';
  src: url("../vendor/vazirmatn/vazirmatn-variable.f6d31671339d.woff2") format('woff2-variations'),
       url("../vendor/vazirmatn/vazirmatn-variable.f6d31671339d.woff2") format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bs-body-font-family: 'Vazirmatn', system-ui, sans-serif;
  --brand: #8a1c3b;
  --brand-2: #d9603b;
  --brand-soft: #fbeef0;
  --ink: #1d1b22;
  --muted: #6b6774;
  --line: #ebe7ee;
  --bg: #f7f5f8;
  --card: #fff;
  --sidebar-w: 260px;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 138, 28, 59;
  --bs-link-hover-color: #6c142d;
}

body { font-family: var(--bs-body-font-family); background: var(--bg); font-feature-settings: "ss01"; }
code, .mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.ltr { direction: ltr; unicode-bidi: embed; text-align: start; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { background: var(--card); padding: 1rem; }
@media (min-width: 992px) {
  .sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); display: flex; flex-direction: column;
    border-inline-end: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; }
  .sidebar .offcanvas-body, .sidebar { display: flex; flex-direction: column; }
}
.sidebar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; padding: .25rem .25rem 1.25rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; overflow-y: auto; }
.sidebar-nav > a:not(.btn) {
  display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: .6rem;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.sidebar-nav > a:not(.btn):hover { background: var(--bg); }
.sidebar-nav > a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.sidebar-nav i { font-size: 1.1rem; }
.sidebar-user { display: flex; align-items: center; gap: .6rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.avatar-letter {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 800;
}

.main { flex: 1; min-width: 0; padding: 1.25rem clamp(1rem, 3vw, 2rem) 3rem; }
.topbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-title { font-size: 1.35rem; font-weight: 800; margin: 0; }

/* ---------- components ---------- */
.btn-brand {
  --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #6c142d; --bs-btn-hover-border-color: #6c142d;
  --bs-btn-active-bg: #5a1026; --bs-btn-active-color: #fff; font-weight: 600;
}
.card { border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 1px 2px rgba(20, 10, 30, .03); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 700; padding: .9rem 1.1rem; }
.stat { padding: 1rem 1.1rem; }
.stat .num { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.stat a { color: inherit; text-decoration: none; }

.form-control, .form-select { border-radius: .6rem; }
.form-control:focus, .form-select:focus { border-color: #d29aa9; box-shadow: 0 0 0 .2rem rgba(138, 28, 59, .12); }
.form-label { font-weight: 600; font-size: .92rem; }
.form-text { font-size: .8rem; }

.post-row { display: flex; gap: .85rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: #fcfbfd; }
.thumb { width: 56px; height: 56px; border-radius: .6rem; object-fit: cover; background: #eee; flex: 0 0 56px; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.thumb video { width: 100%; height: 100%; object-fit: cover; }
.post-row .meta { font-size: .8rem; color: var(--muted); }
.post-row .ttl { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; vertical-align: middle; }
.acc-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.badge-type { background: var(--bg); color: var(--muted); font-weight: 500; }

/* ---------- calendar ---------- */
.cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.cal th { text-align: center; font-weight: 600; color: var(--muted); font-size: .85rem; padding: .5rem 0; }
.cal td { vertical-align: top; height: 120px; border: 1px solid var(--line); border-width: 0 0 1px 1px; padding: .35rem; background: var(--card); }
.cal tr td:first-child { border-inline-start-width: 0; }
.cal td.empty { background: #faf9fb; }
.cal td.today { background: var(--brand-soft); }
.cal .d { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .9rem; }
.cal .d a.add { opacity: 0; color: var(--brand); text-decoration: none; }
.cal td:hover .d a.add { opacity: 1; }
.cal .ev {
  display: block; font-size: .75rem; padding: .15rem .35rem; border-radius: .35rem; margin-top: .2rem;
  text-decoration: none; color: var(--ink); background: #f3f1f5; border-inline-start: 3px solid var(--c, var(--brand));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal .ev.published { opacity: .65; }
.cal .ev.failed { background: #fde8ea; }
@media (max-width: 767.98px) {
  .cal-wrap { overflow-x: auto; }
  .cal { min-width: 640px; }
  .cal td { height: 90px; }
}

/* ---------- editor ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; }
.media-item { position: relative; aspect-ratio: 1; border-radius: .7rem; overflow: hidden; background: #eee; cursor: grab; border: 2px solid transparent; }
.media-item.dragging { opacity: .4; }
.media-item.over { border-color: var(--brand); }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.media-item .rm {
  position: absolute; top: .3rem; inset-inline-end: .3rem; border: 0; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: .8rem;
}
.media-item .idx { position: absolute; bottom: .3rem; inset-inline-start: .3rem; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; border-radius: .4rem; padding: 0 .35rem; }
.media-item .new { position: absolute; top: .3rem; inset-inline-start: .3rem; background: var(--brand); color: #fff; font-size: .65rem; border-radius: .4rem; padding: 0 .35rem; }
.dropzone {
  border: 2px dashed #d8d2dd; border-radius: .9rem; padding: 1.5rem; text-align: center; color: var(--muted);
  cursor: pointer; transition: .15s; background: #fcfbfd;
}
.dropzone.over, .dropzone:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.counter { font-size: .78rem; color: var(--muted); }
.counter.bad { color: #c0392b; font-weight: 700; }
.type-pick .btn { flex: 1; }
.type-pick .btn-check:checked + .btn { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }

/* ---------- phone preview ---------- */
.phone { width: 100%; max-width: 340px; margin-inline: auto; border: 1px solid var(--line); border-radius: 1.2rem; background: #fff; overflow: hidden; }
.phone-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; font-weight: 700; font-size: .85rem; }
.phone-media { aspect-ratio: 1; background: #111; position: relative; }
.phone-media.story, .phone-media.reel { aspect-ratio: 9 / 16; }
.phone-media img, .phone-media video { width: 100%; height: 100%; object-fit: cover; }
.phone-media .many { position: absolute; top: .5rem; inset-inline-end: .5rem; background: rgba(0,0,0,.6); color: #fff; border-radius: 1rem; padding: 0 .5rem; font-size: .75rem; }
.phone-cap { padding: .6rem .75rem 1rem; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 1.2rem .9rem 0; border-inline-start: 2px solid var(--line); margin-inline-start: .4rem; padding-inline-start: 1rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline .when { font-size: .75rem; color: var(--muted); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #fbeef0, #f7f5f8 50%); }
.auth-card { width: 100%; max-width: 400px; }

/* datepicker / tom-select tweaks */
jdp-container { font-family: var(--bs-body-font-family) !important; }
.ts-wrapper.form-control, .ts-wrapper.form-select { padding: 0; border: 0; }
.ts-control { border-radius: .6rem !important; min-height: 38px; }
.ts-dropdown .create { color: var(--brand); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .5; }
