:root {
  --bs-orange: #f97316;
  --bs-orange-bright: #fb923c;
  --bs-ink: #0f172a;
  --bs-muted: #64748b;
  --bs-border: #e2e8f0;
  --bs-panel: rgba(255, 255, 255, 0.92);
  --bs-soft: #f8fafc;
  --bs-shadow: 0 18px 55px -35px rgba(15, 23, 42, 0.38);
}

.dark {
  --bs-ink: #f8fafc;
  --bs-muted: #94a3b8;
  --bs-border: rgba(148, 163, 184, 0.16);
  --bs-panel: rgba(15, 23, 42, 0.78);
  --bs-soft: rgba(30, 41, 59, 0.55);
  --bs-shadow: 0 22px 65px -35px rgba(0, 0, 0, 0.82);
}

html { scroll-behavior: smooth; }
body { letter-spacing: -0.006em; }

#nav-sidebar {
  background-image: radial-gradient(circle at 15% 5%, rgba(249, 115, 22, 0.13), transparent 28%);
}

.dark #nav-sidebar {
  background-color: #060b16;
  background-image:
    radial-gradient(circle at 8% 4%, rgba(249, 115, 22, 0.17), transparent 25%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(6, 11, 22, 0.96));
}

.bs-dashboard {
  color: var(--bs-ink);
  display: flex;
  flex-direction: column;
  gap: 22px;
  opacity: 0;
  padding: 12px 0 34px;
  transform: translateY(6px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.bs-dashboard.is-visible { opacity: 1; transform: none; }

.bs-hero {
  align-items: flex-end;
  background:
    radial-gradient(circle at 82% 12%, rgba(249, 115, 22, 0.23), transparent 30%),
    linear-gradient(125deg, #0f172a 0%, #101827 48%, #1c1917 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 24px 70px -40px rgba(0, 0, 0, 0.9);
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 178px;
  overflow: hidden;
  padding: 30px 32px;
  position: relative;
}

.bs-hero::after {
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(90deg, transparent, black);
  pointer-events: none;
  position: absolute;
}

.bs-eyebrow, .bs-panel-kicker {
  color: var(--bs-orange-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.bs-eyebrow { align-items: center; display: flex; gap: 9px; }
.bs-eyebrow > span { background: var(--bs-orange); border-radius: 99px; box-shadow: 0 0 14px rgba(249,115,22,.7); height: 7px; width: 7px; }
.bs-hero h1 { font-size: clamp(31px, 4vw, 46px); font-weight: 760; letter-spacing: -.045em; line-height: 1; margin: 15px 0 10px; }
.bs-hero p { color: #94a3b8; font-size: 14px; margin: 0; max-width: 620px; }
.bs-hero-meta { align-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; color: #cbd5e1; display: flex; font-size: 11px; gap: 7px; padding: 8px 12px; position: relative; z-index: 1; }
.bs-hero-meta .material-symbols-outlined { color: var(--bs-orange-bright); font-size: 16px; }

.bs-kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.bs-kpi {
  align-items: center;
  background: var(--bs-panel);
  border: 1px solid var(--bs-border);
  border-radius: 16px;
  box-shadow: var(--bs-shadow);
  color: var(--bs-ink);
  display: flex;
  gap: 13px;
  min-height: 118px;
  padding: 19px;
  position: relative;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.bs-kpi:hover { border-color: color-mix(in srgb, var(--bs-card-accent) 44%, var(--bs-border)); box-shadow: 0 22px 60px -35px color-mix(in srgb, var(--bs-card-accent) 45%, transparent); transform: translateY(-2px); }
.bs-kpi-icon { align-items: center; background: color-mix(in srgb, var(--bs-card-accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--bs-card-accent) 22%, transparent); border-radius: 12px; color: var(--bs-card-accent); display: flex; font-size: 24px; height: 44px; justify-content: center; width: 44px; }
.bs-kpi-copy { display: flex; flex-direction: column; min-width: 0; }
.bs-kpi-label { color: var(--bs-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.bs-kpi-copy strong { font-size: 29px; letter-spacing: -.04em; line-height: 1.25; }
.bs-kpi-copy small { color: var(--bs-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-kpi-arrow { color: var(--bs-muted); font-size: 17px; margin-left: auto; opacity: .55; }
.bs-tone-orange { --bs-card-accent: #f97316; }.bs-tone-violet { --bs-card-accent: #8b5cf6; }.bs-tone-green { --bs-card-accent: #10b981; }.bs-tone-blue { --bs-card-accent: #3b82f6; }.bs-tone-rose { --bs-card-accent: #f43f5e; }

.bs-dashboard-grid { display: grid; gap: 16px; }
.bs-dashboard-grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); }
.bs-dashboard-grid-lists { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bs-panel { background: var(--bs-panel); border: 1px solid var(--bs-border); border-radius: 17px; box-shadow: var(--bs-shadow); min-width: 0; padding: 20px; }
.bs-panel-header { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; margin-bottom: 20px; }
.bs-panel-header h2 { color: var(--bs-ink); font-size: 17px; font-weight: 750; letter-spacing: -.025em; margin: 3px 0 0; }
.bs-panel-header > a { color: var(--bs-orange); font-size: 11px; font-weight: 750; margin-top: 7px; text-decoration: none; }

.bs-legend { align-items: center; color: var(--bs-muted); display: flex; font-size: 10px; gap: 13px; }
.bs-legend span { align-items: center; display: flex; gap: 5px; }
.bs-dot { border-radius: 50%; height: 7px; width: 7px; }.bs-dot-users { background: #f97316; }.bs-dot-sessions { background: #3b82f6; }
.bs-chart { align-items: end; border-bottom: 1px solid var(--bs-border); display: grid; gap: 6px; grid-template-columns: repeat(14, minmax(18px, 1fr)); height: 230px; padding: 12px 4px 0; }
.bs-chart-column { align-items: center; display: flex; flex-direction: column; height: 100%; justify-content: flex-end; min-width: 0; }
.bs-chart-bars { align-items: end; display: flex; gap: 3px; height: calc(100% - 30px); justify-content: center; width: 100%; }
.bs-chart-bar { border-radius: 5px 5px 2px 2px; display: block; height: var(--bs-bar-height); min-height: 3px; opacity: .9; transform: scaleY(0); transform-origin: bottom; transition: transform 650ms cubic-bezier(.2,.75,.2,1); width: min(10px, 38%); }
.bs-dashboard.is-visible .bs-chart-bar { transform: scaleY(1); }
.bs-chart-users { background: linear-gradient(180deg, #fb923c, #ea580c); }.bs-chart-sessions { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.bs-chart-column small { color: var(--bs-muted); font-size: 8px; margin-top: 8px; overflow: hidden; text-align: center; text-overflow: clip; white-space: nowrap; width: 100%; }

.bs-action-list, .bs-table-list, .bs-alert-list { display: flex; flex-direction: column; }
.bs-action-item { align-items: center; border-top: 1px solid var(--bs-border); color: var(--bs-ink); display: flex; gap: 11px; padding: 13px 2px; text-decoration: none; }
.bs-action-item:first-child { border-top: 0; }
.bs-action-item > .material-symbols-outlined:first-child { align-items: center; background: rgba(249,115,22,.1); border-radius: 9px; color: var(--bs-orange); display: flex; font-size: 19px; height: 34px; justify-content: center; width: 34px; }
.bs-action-item > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.bs-action-item strong { font-size: 12px; }.bs-action-item small { color: var(--bs-muted); font-size: 10px; margin-top: 2px; }
.bs-action-arrow { color: var(--bs-muted); font-size: 18px; margin-left: auto; transition: transform 160ms ease; }.bs-action-item:hover .bs-action-arrow { color: var(--bs-orange); transform: translateX(3px); }

.bs-table-row { align-items: center; border-top: 1px solid var(--bs-border); color: var(--bs-ink); display: grid; gap: 10px; grid-template-columns: auto minmax(0, 1fr) auto auto; min-height: 59px; text-decoration: none; }
.bs-table-row:first-child { border-top: 0; }
.bs-table-row:hover { background: color-mix(in srgb, var(--bs-orange) 4%, transparent); }
.bs-avatar, .bs-rank { align-items: center; background: var(--bs-soft); border: 1px solid var(--bs-border); border-radius: 10px; color: var(--bs-orange); display: flex; font-size: 11px; font-weight: 800; height: 32px; justify-content: center; width: 32px; }
.bs-rank { color: var(--bs-muted); font-variant-numeric: tabular-nums; }
.bs-row-main { display: flex; flex-direction: column; min-width: 0; }.bs-row-main strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.bs-row-main small { color: var(--bs-muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-table-row time { color: var(--bs-muted); font-size: 9px; }
.bs-pill { border-radius: 999px; font-size: 8px; font-weight: 850; letter-spacing: .06em; padding: 4px 7px; }.bs-pill-pro { background: rgba(139,92,246,.12); color: #8b5cf6; }.bs-pill-neutral { background: var(--bs-soft); color: var(--bs-muted); }
.bs-score { display: flex; flex-direction: column; text-align: right; }.bs-score strong { color: #10b981; font-size: 13px; }.bs-score small { color: var(--bs-muted); font-size: 8px; }

.bs-live-indicator { align-items: center; color: #10b981; display: flex; font-size: 9px; font-weight: 800; gap: 5px; text-transform: uppercase; }.bs-live-indicator i { animation: bs-pulse 1.8s infinite; background: #10b981; border-radius: 50%; height: 6px; width: 6px; }
.bs-system-stats { background: var(--bs-soft); border: 1px solid var(--bs-border); border-radius: 12px; display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.bs-system-stats > div { border-left: 1px solid var(--bs-border); display: flex; flex-direction: column; padding: 11px; }.bs-system-stats > div:first-child { border-left: 0; }
.bs-system-stats span { color: var(--bs-muted); font-size: 8px; text-transform: uppercase; }.bs-system-stats strong { font-size: 18px; }
.bs-alert { align-items: center; border-top: 1px solid var(--bs-border); color: var(--bs-ink); display: flex; gap: 9px; padding: 10px 2px; text-decoration: none; }.bs-alert:first-child { border-top: 0; }
.bs-alert > .material-symbols-outlined { color: #10b981; font-size: 20px; }.bs-alert-danger > .material-symbols-outlined { color: #ef4444; }.bs-alert-success > .material-symbols-outlined { color: #10b981; }
.bs-alert > span:last-child { display: flex; flex-direction: column; }.bs-alert strong { font-size: 10px; }.bs-alert small { color: var(--bs-muted); font-size: 9px; }
.bs-text-danger { color: #ef4444; }.bs-empty { color: var(--bs-muted); font-size: 11px; margin: 20px 0; text-align: center; }

body.login #page > div.flex.grow > div.w-full { max-width: none !important; width: min(1040px, calc(100vw - 44px)) !important; }
.bs-login-shell { align-items: stretch; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .72fr); min-height: 520px; width: 100%; }
.bs-login-brand { background: radial-gradient(circle at 18% 12%, rgba(249,115,22,.28), transparent 32%), linear-gradient(145deg, #111827, #060b16 70%); border-radius: 24px 0 0 24px; color: white; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 58px; position: relative; }
.bs-login-brand::after { background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 34px 34px; content: ""; inset: 0; mask-image: linear-gradient(135deg, transparent 20%, black); pointer-events: none; position: absolute; }
.bs-login-mark { align-items: center; background: var(--bs-orange); border-radius: 14px; box-shadow: 0 18px 45px -18px rgba(249,115,22,.85); display: flex; height: 48px; justify-content: center; margin-bottom: 34px; width: 48px; }.bs-login-mark span { font-size: 27px; }
.bs-login-brand h1 { font-size: clamp(34px, 4vw, 52px); font-weight: 760; letter-spacing: -.05em; line-height: 1.03; margin: 18px 0; position: relative; z-index: 1; }.bs-login-brand h1 em { color: var(--bs-orange-bright); font-style: normal; }
.bs-login-brand > p { color: #94a3b8; font-size: 13px; line-height: 1.7; max-width: 500px; position: relative; z-index: 1; }
.bs-login-trust { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 42px; position: relative; z-index: 1; }.bs-login-trust span { align-items: center; color: #cbd5e1; display: flex; font-size: 9px; font-weight: 650; gap: 5px; text-transform: uppercase; }.bs-login-trust i { color: var(--bs-orange-bright); font-size: 16px; }
.bs-login-card { background: var(--bs-panel); border: 1px solid var(--bs-border); border-left: 0; border-radius: 0 24px 24px 0; display: flex; flex-direction: column; justify-content: center; padding: 54px 48px; }
.bs-login-card header h2 { color: var(--bs-ink); font-size: 28px; font-weight: 760; letter-spacing: -.035em; margin: 8px 0 3px; }.bs-login-card header p { color: var(--bs-muted); font-size: 11px; margin: 0 0 25px; }
.bs-login-mobile-mark { display: none; }
.bs-language-switch { align-self: flex-end; background: var(--bs-soft); border: 1px solid var(--bs-border); border-radius: 10px; display: flex; gap: 3px; margin-bottom: 22px; padding: 3px; }
.bs-language-switch form { display: flex; }
.bs-language-switch button { background: transparent; border: 0; border-radius: 7px; color: var(--bs-muted); cursor: pointer; font-size: 10px; font-weight: 700; padding: 6px 10px; }
.bs-language-switch button.is-active { background: var(--bs-panel); box-shadow: 0 2px 7px rgba(15,23,42,.12); color: var(--bs-orange); }
.bs-login-field { margin-bottom: 14px; }
.bs-login-submit { align-items: center; background: linear-gradient(135deg, #f97316, #ea580c); border: 0; border-radius: 11px; box-shadow: 0 15px 35px -16px rgba(249,115,22,.8); color: white; cursor: pointer; display: flex; font-size: 12px; font-weight: 750; justify-content: space-between; margin-top: 22px; padding: 13px 16px; transition: box-shadow 160ms ease, transform 160ms ease; width: 100%; }.bs-login-submit:hover { box-shadow: 0 18px 40px -14px rgba(249,115,22,.95); transform: translateY(-1px); }.bs-login-submit .material-symbols-outlined { font-size: 18px; }
.bs-login-error { align-items: flex-start; background: rgba(239,68,68,.09); border: 1px solid rgba(239,68,68,.24); border-radius: 10px; color: #ef4444; display: flex; font-size: 10px; gap: 8px; margin-bottom: 16px; padding: 10px 12px; }.bs-login-error .material-symbols-outlined { font-size: 17px; }
.bs-login-card footer { align-items: center; color: var(--bs-muted); display: flex; font-size: 9px; gap: 5px; justify-content: center; margin-top: 28px; text-transform: uppercase; }.bs-login-card footer .material-symbols-outlined { font-size: 14px; }

@keyframes bs-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.35); } 50% { box-shadow: 0 0 0 5px rgba(16,185,129,0); } }

@media (max-width: 1100px) {
  .bs-dashboard-grid-main, .bs-dashboard-grid-lists, .bs-product-grid { grid-template-columns: 1fr 1fr; }
  .bs-activity-panel, .bs-system-panel { grid-column: 1 / -1; }
  .bs-system-panel { grid-row: auto; }
}

@media (max-width: 760px) {
  .bs-dashboard { gap: 14px; }
  .bs-hero { align-items: flex-start; flex-direction: column; min-height: 0; padding: 24px; }
  .bs-hero-meta { margin-top: 20px; }
  .bs-dashboard-grid-main, .bs-dashboard-grid-lists, .bs-product-grid { grid-template-columns: 1fr; }
  .bs-activity-panel, .bs-system-panel { grid-column: auto; }
  .bs-chart { gap: 2px; height: 190px; }
  .bs-chart-column small { display: none; }
  .bs-login-shell { display: block; width: min(440px, calc(100vw - 28px)); }
  .bs-login-brand { display: none; }
  .bs-login-card { border: 1px solid var(--bs-border); border-radius: 20px; padding: 38px 28px; }
  .bs-login-mobile-mark { align-items: center; background: var(--bs-orange); border-radius: 10px; color: white; display: flex; font-size: 21px; height: 38px; justify-content: center; margin-bottom: 22px; width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

html[dir="rtl"] .bs-kpi-arrow,
html[dir="rtl"] .bs-action-arrow { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .bs-score { text-align: left; }
html[dir="rtl"] .bs-system-stats > div { border-left: 0; border-right: 1px solid var(--bs-border); }
html[dir="rtl"] .bs-system-stats > div:first-child { border-right: 0; }
html[dir="rtl"] .bs-login-brand { border-radius: 0 24px 24px 0; }
html[dir="rtl"] .bs-login-card { border-left: 1px solid var(--bs-border); border-right: 0; border-radius: 24px 0 0 24px; }

@media (max-width: 760px) {
  html[dir="rtl"] .bs-login-card { border: 1px solid var(--bs-border); border-radius: 20px; }
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations");
}

html[lang="fa"] body,
html[lang="fa"] button,
html[lang="fa"] input,
html[lang="fa"] select,
html[lang="fa"] textarea { font-family: "Vazirmatn", Tahoma, sans-serif !important; }

/* Operational forms: clearer hierarchy, focused inputs, and responsive targeting. */
form[method="post"] fieldset {
  border: 1px solid var(--bs-border);
  border-radius: 14px;
  box-shadow: 0 12px 38px -34px rgba(15, 23, 42, .55);
  margin-bottom: 16px;
  overflow: visible;
}
form[method="post"] fieldset > h2 {
  background: color-mix(in srgb, var(--bs-soft) 82%, transparent);
  border-bottom: 1px solid var(--bs-border);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.01em;
}
form[method="post"] input:not([type="checkbox"]):not([type="radio"]),
form[method="post"] textarea,
form[method="post"] select { transition: border-color 150ms ease, box-shadow 150ms ease; }
form[method="post"] input:focus,
form[method="post"] textarea:focus,
form[method="post"] select:focus {
  border-color: rgba(249, 115, 22, .62) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .10) !important;
  outline: none !important;
}
.bs-conditional-hidden { display: none !important; }
.bs-selection-count {
  background: rgba(16, 185, 129, .10);
  border: 1px solid rgba(16, 185, 129, .18);
  border-radius: 999px;
  color: #059669;
  display: inline-flex;
  font-size: 9px;
  font-weight: 800;
  margin-top: 8px;
  padding: 4px 8px;
}
.bs-selection-count.is-empty { background: var(--bs-soft); border-color: var(--bs-border); color: var(--bs-muted); }
.bs-submit-busy { cursor: wait !important; opacity: .62 !important; }
.errorlist {
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .18);
  border-radius: 9px;
  color: #ef4444;
  font-size: 10px;
  margin-bottom: 9px;
  padding: 8px 10px;
}
.select2-container { max-width: 100%; }
.select2-container .select2-selection--multiple { min-height: 44px; }
.bs-kpi-static { cursor: default; }
.bs-kpi-static:hover { transform: none; }
.bs-product-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.bs-metric-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.bs-metric-table th, .bs-metric-table td { border-bottom: 1px solid var(--bs-border); padding: 8px 6px; text-align: start; }
.bs-metric-table th { color: var(--bs-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.bs-metric-list { display: grid; gap: 8px; margin: 0; }
.bs-metric-list div { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; }
.bs-metric-list dt { color: var(--bs-muted); font-size: 12px; }
.bs-metric-list dd { font-weight: 700; margin: 0; }

@media (max-width: 760px) {
  form[method="post"] fieldset { border-radius: 11px; margin-bottom: 12px; }
  .submit-row { align-items: stretch; display: flex; flex-direction: column; gap: 8px; }
  .submit-row input, .submit-row a { justify-content: center; text-align: center; width: 100%; }
}
