:root {
  --admin-sidebar-width: 280px;
}

html {
  overflow-x: hidden;
}

body {
  font-family: "Vazirmatn Variable", Tahoma, sans-serif;
  font-feature-settings: "ss01", "tnum";
  overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
  font: inherit;
}

.admin-shell {
  grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
}

.admin-sidebar {
  --bs-offcanvas-width: min(92vw, 320px);
  width: var(--admin-sidebar-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 20% 10%, #285b4c, transparent 35%), var(--sidebar);
}

.admin-sidebar__brand {
  flex: 0 0 auto;
  padding: 1.4rem 1.5rem;
  overflow: hidden;
}

.admin-sidebar__brand h2 {
  min-width: 0;
  line-height: 1.7;
  overflow-wrap: normal;
}

.admin-sidebar__nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}

.admin-sidebar__nav.offcanvas-body {
  padding: 1rem;
}

.admin-sidebar__nav::-webkit-scrollbar {
  width: 6px;
}

.admin-sidebar__nav::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, .28);
}

.admin-nav-section {
  margin-top: .35rem;
}

.admin-nav-group {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1rem;
  color: rgba(255, 255, 255, .74);
  border: 0;
  border-radius: .8rem;
  background: transparent;
  text-align: start;
  transition: background-color .2s ease, color .2s ease;
}

.admin-nav-group > span {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.admin-nav-group:hover,
.admin-nav-group.active {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.admin-nav-group__chevron {
  flex: 0 0 auto;
  font-size: .72rem;
  transition: transform .2s ease;
}

.admin-nav-group[aria-expanded="true"] .admin-nav-group__chevron {
  transform: rotate(180deg);
}

.admin-nav-submenu {
  position: relative;
  min-width: 0;
  margin: .25rem .9rem .5rem 0;
  padding-right: .8rem;
  border-right: 1px solid rgba(255, 255, 255, .14);
}

.admin-nav-link--child {
  min-width: 0;
  margin-bottom: .15rem;
  padding: .62rem .75rem;
  border-radius: .65rem;
  font-size: .87rem;
}

.admin-nav-link--child i {
  flex: 0 0 auto;
  font-size: .88rem;
}

.admin-nav-link--child span {
  min-width: 0;
  line-height: 1.8;
  white-space: normal;
}

.admin-main {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  overflow: clip;
}

.admin-topbar {
  position: sticky;
  z-index: 1020;
  top: 0;
  gap: 1rem;
}

.admin-topbar__heading,
.admin-topbar__actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.admin-topbar__actions {
  flex: 0 0 auto;
}

.admin-topbar__actions form {
  margin: 0;
}

.admin-menu-toggle {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--sidebar);
  border: 1px solid #d8ded7;
  border-radius: .8rem;
  background: #fff;
  font-size: 1.45rem;
}

.admin-content {
  width: 100%;
  min-width: 0;
  max-width: 1760px;
  margin-inline: auto;
}

.admin-content img,
.admin-content svg,
.admin-content video,
.admin-content iframe {
  max-width: 100%;
}

.admin-content .row > * {
  min-width: 0;
}

.admin-content .table-responsive {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-inline: contain;
}

.admin-content .table-responsive > .table {
  min-width: 680px;
  margin-bottom: 0;
}

.admin-content .nav {
  max-width: 100%;
}

.admin-content .form-control,
.admin-content .form-select,
.admin-content .input-group {
  max-width: 100%;
}

.admin-panel {
  max-width: 100%;
}

.auth-admin-body {
  font-family: "Vazirmatn Variable", Tahoma, sans-serif;
  font-feature-settings: "ss01", "tnum";
}

.admin-login {
  min-height: 100svh;
  grid-template-columns: minmax(360px, 44%) minmax(0, 1fr);
}

.admin-login > *,
.admin-login__card {
  min-width: 0;
  max-width: 100%;
}

.admin-login__visual,
.admin-login__form-column {
  width: 100%;
}

.admin-login__message h1 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

@media (min-width: 992px) {
  .admin-sidebar.offcanvas {
    position: sticky !important;
    z-index: auto;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    width: var(--admin-sidebar-width) !important;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    color: #fff;
    border: 0 !important;
    background: radial-gradient(circle at 20% 10%, #285b4c, transparent 35%), var(--sidebar) !important;
    transform: none !important;
    transition: none;
    visibility: visible !important;
  }
}

@media (max-width: 991.98px) {
  .auth-admin-body,
  .admin-login {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .admin-shell {
    display: block;
  }

  .admin-sidebar.offcanvas {
    position: fixed !important;
    top: 0;
    bottom: 0;
    width: var(--bs-offcanvas-width);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  .admin-sidebar__nav.offcanvas-body {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
  }

  .admin-topbar {
    min-height: 78px;
    padding: .85rem 1rem;
  }

  .admin-content {
    padding: 1.25rem;
  }

  .admin-login {
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-login__visual {
    min-height: auto;
    max-width: 100vw;
    gap: 1.4rem;
    padding: 1.5rem max(1.25rem, env(safe-area-inset-right)) 1.5rem max(1.25rem, env(safe-area-inset-left));
  }

  .admin-login__message {
    max-width: 680px;
  }

  .admin-login__message h1 {
    margin: .55rem 0 0;
    font-size: clamp(1.25rem, 5vw, 1.65rem);
    line-height: 1.65;
  }

  .admin-login__message p {
    margin-top: .35rem;
    line-height: 1.8;
  }

  .admin-login__form-column {
    width: 100%;
    max-width: 100vw;
    display: block;
    padding: 1.5rem 1rem;
  }

  .admin-login__card {
    width: min(100%, 430px) !important;
    margin-inline: auto;
  }
}

@media (max-width: 767.98px) {
  .admin-topbar {
    align-items: center;
  }

  .admin-topbar__heading .small {
    display: none;
  }

  .admin-topbar__heading h1 {
    max-width: 42vw;
    overflow: hidden;
    font-size: 1rem !important;
    line-height: 1.7;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-content .d-flex.justify-content-between {
    flex-wrap: wrap;
  }

  .admin-panel.p-4 {
    padding: 1.1rem !important;
  }

  .admin-list-item {
    flex-direction: column;
  }

  .cms-tabs {
    flex-wrap: nowrap;
    padding-bottom: .4rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .cms-tabs .nav-link {
    white-space: nowrap;
  }

  .cms-setting-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .cms-setting-form > div {
    grid-column: auto;
  }

  .cms-row > .d-flex,
  .admin-content .col-12.d-flex {
    flex-wrap: wrap;
  }
}

@media (max-width: 575.98px) {
  .admin-sidebar__brand {
    padding: 1.1rem 1rem;
  }

  .admin-sidebar__brand h2 {
    font-size: .95rem !important;
  }

  .admin-sidebar__nav.offcanvas-body {
    padding: .75rem;
  }

  .admin-nav-group,
  .admin-nav-link {
    padding-inline: .8rem;
  }

  .admin-nav-submenu {
    margin-right: .65rem;
    padding-right: .55rem;
  }

  .admin-topbar {
    gap: .5rem;
  }

  .admin-topbar__heading,
  .admin-topbar__actions {
    gap: .45rem;
  }

  .admin-topbar__actions .btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
  }

  .admin-action-label {
    display: none;
  }

  .admin-menu-toggle {
    width: 40px;
    height: 40px;
  }

  .admin-content {
    padding: .85rem;
  }

  .admin-content .row > [class*="col-"]:not(.col-auto) {
    width: 100%;
    max-width: 100%;
  }

  .admin-content .table-responsive > .table {
    min-width: 620px;
  }

  .admin-login__visual {
    padding-block: 1.1rem;
  }

  .admin-login__brand {
    gap: .65rem;
  }

  .admin-login__brand > span {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .admin-login__brand strong {
    font-size: .92rem;
  }

  .admin-login__brand small {
    max-width: 230px;
    font-size: .66rem;
    line-height: 1.7;
  }

  .admin-login__message > span {
    font-size: .64rem;
  }

  .admin-login__message h1 {
    font-size: 1.2rem;
    line-height: 1.65;
  }

  .admin-login__form-column {
    align-items: start;
    padding: 1rem .75rem calc(1rem + env(safe-area-inset-bottom));
  }

  .admin-login__card {
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 16px 45px rgba(21, 55, 47, .09);
  }

  .admin-login__icon {
    width: 46px;
    height: 46px;
    margin-bottom: .9rem;
    border-radius: 14px;
  }

  .admin-login__card h2 {
    font-size: 1.2rem;
  }

  .admin-login__card > p {
    margin-bottom: 1.2rem;
  }

  .admin-input .form-control {
    font-size: 1rem;
  }
}

@media (max-height: 700px) and (min-width: 992px) {
  .admin-login__visual,
  .admin-login__form-column {
    padding-block: 1.5rem;
  }

  .admin-login__message h1 {
    margin-block: .6rem;
    font-size: 1.8rem;
  }

  .admin-login__card {
    padding-block: 1.5rem;
  }
}

.service-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.service-editor-heading h1 { font-weight: 800; }
.service-editor-alert { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.service-editor-form { display: grid; gap: 1rem; }
.service-editor-section { padding: clamp(1rem, 2.5vw, 1.75rem); border: 1px solid #e4e9e4; border-radius: 1.15rem; background: #fff; box-shadow: 0 10px 28px rgba(22, 49, 40, .04); }
.service-editor-section__heading { margin-bottom: 1.35rem; }
.service-editor-section__heading > div { display: flex; align-items: flex-start; gap: .75rem; }
.service-editor-section__heading h2 { margin: 0; font-size: 1.08rem; font-weight: 800; }
.service-editor-section__heading p { margin: .25rem 0 0; color: #718078; font-size: .86rem; }
.service-editor-step { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: .7rem; color: #fff; background: var(--sidebar); font-weight: 800; }
.service-editor-preview-line { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; padding: .65rem .8rem; border-radius: .7rem; color: #65736c; background: #f5f8f5; font-size: .78rem; }
.service-editor-preview-line code { color: #285b4c; overflow-wrap: anywhere; }
.service-editor-flags { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1.1rem; padding-bottom: .3rem; }
.service-icon-preview { min-width: 2.9rem; justify-content: center; color: var(--sidebar); background: #f3f7f3; font-size: 1.2rem; }
.service-ltr-group { direction: rtl; }
.service-ltr-group .service-ltr-control,
.service-icon-group .service-ltr-control { direction: ltr; text-align: left; }
.service-ltr-group .input-group-text { border-radius: .375rem 0 0 .375rem; }
.service-ltr-group .form-control { border-radius: 0 .375rem .375rem 0; }
.service-icon-group .service-icon-preview { border-radius: .375rem 0 0 .375rem; }
.service-icon-group .form-select { border-radius: 0 .375rem .375rem 0; }
.service-hero-editor-card { padding: 1rem; border: 1px solid #e4e9e4; border-radius: .95rem; background: #f8faf8; }
.service-hero-editor-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; color: var(--sidebar); }
.service-hero-editor-card__header > div { display: grid; gap: .15rem; }
.service-hero-editor-card__header small { color: #74827a; font-size: .75rem; }
.service-hero-preview { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: .8rem; background: #dde5df; cursor: zoom-in; }
.service-hero-preview img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .25s ease; }
.service-hero-preview:hover img { transform: scale(1.03); }
.service-hero-preview span { position: absolute; inset-inline: .7rem; bottom: .7rem; display: inline-flex; justify-content: center; gap: .35rem; padding: .4rem .65rem; border-radius: .55rem; color: #fff; background: rgba(20, 37, 30, .72); font-size: .75rem; }
.service-upload-button { width: 100%; margin-top: .8rem; }
.service-language-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: .55rem; border-bottom: 1px solid #e8ede9; color: var(--sidebar); font-weight: 800; }
.service-language-heading > span:last-child { color: #8a9790; font-size: .75rem; font-weight: 600; }
.service-editor-actions { display: flex; justify-content: flex-end; gap: .65rem; padding-bottom: .5rem; }

/* Dashboard */
.dashboard-page {
  display: grid;
  gap: 1rem;
}

.dashboard-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 1.35rem;
  overflow: hidden;
  border: 1px solid #dfe6df;
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at 6% 20%, rgba(230, 185, 79, .12), transparent 24%),
    linear-gradient(120deg, #fff, #f8faf7);
  box-shadow: 0 10px 30px rgba(23, 53, 44, .045);
}

.dashboard-overview__eyebrow {
  display: block;
  margin-bottom: .25rem;
  color: #9a6c19;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.dashboard-overview h2 {
  margin: 0;
  color: var(--sidebar);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 850;
}

.dashboard-overview p {
  margin: .3rem 0 0;
  color: #718078;
  font-size: .82rem;
  line-height: 1.8;
}

.dashboard-overview__status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .8rem;
  color: #306244;
  border: 1px solid #d9e9dc;
  border-radius: 999px;
  background: #f2f9f3;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-overview__status .status-dot {
  width: 7px;
  height: 7px;
  margin: 0;
  box-shadow: 0 0 0 4px rgba(56, 161, 105, .12);
}

.dashboard-metric {
  --metric-color: #276c59;
  --metric-soft: #edf7f3;
  position: relative;
  min-height: 142px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .9rem;
  padding: 1.1rem;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid #e0e6e0;
  border-radius: 1.05rem;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 53, 44, .055);
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dashboard-metric::before {
  content: "";
  position: absolute;
  inset-block: .9rem;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: var(--metric-color);
}

.dashboard-metric:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--metric-color) 26%, #dfe5df);
  box-shadow: 0 14px 34px rgba(23, 53, 44, .09);
  transform: translateY(-2px);
}

.dashboard-metric.metric-success { --metric-color: #63893f; --metric-soft: #f1f7e9; }
.dashboard-metric.metric-warning { --metric-color: #c58325; --metric-soft: #fff7e9; }
.dashboard-metric.metric-info { --metric-color: #327d94; --metric-soft: #edf8fb; }

.dashboard-metric__icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: var(--metric-color);
  border-radius: .85rem;
  background: var(--metric-soft);
  font-size: 1.05rem;
}

.dashboard-metric__content {
  min-width: 0;
  display: grid;
  gap: .18rem;
}

.dashboard-metric__label {
  color: #79877f;
  font-size: .72rem;
  font-weight: 700;
}

.dashboard-metric__content strong {
  color: var(--sidebar);
  font-size: 1.85rem;
  font-weight: 850;
  line-height: 1.25;
}

.dashboard-metric__content small {
  overflow: hidden;
  color: #69766f;
  font-size: .76rem;
  line-height: 1.75;
  text-overflow: ellipsis;
}

.dashboard-metric__arrow {
  align-self: end;
  color: #9aa59f;
  font-size: .9rem;
}

.dashboard-panels {
  margin-top: 0;
}

.dashboard-panel {
  min-height: 275px;
  overflow: hidden;
  border-radius: 1.05rem;
  box-shadow: 0 10px 28px rgba(23, 53, 44, .045);
}

.dashboard-panel__header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #edf1ed;
  background: #fcfdfb;
}

.dashboard-panel__header > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .7rem;
}

.dashboard-panel__header h2 {
  margin: 0;
  color: var(--sidebar);
  font-size: .95rem;
  font-weight: 800;
}

.dashboard-panel__header small {
  display: block;
  margin-top: .18rem;
  color: #87938d;
  font-size: .68rem;
}

.dashboard-panel__header > a {
  flex: 0 0 auto;
  color: #487567;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-panel__header > a:hover {
  color: var(--sidebar);
}

.dashboard-panel__icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #276c59;
  border-radius: .72rem;
  background: #edf7f3;
}

.dashboard-panel__icon--warning { color: #a46d18; background: #fff6e5; }
.dashboard-panel__icon--muted { color: #687670; background: #f0f3f1; }

.dashboard-panel__body {
  padding: .3rem 1.15rem .7rem;
}

.dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid #eef1ee;
}

.dashboard-list-item:last-child { border-bottom: 0; }
.dashboard-list-item > div:first-child { min-width: 0; }
.dashboard-list-item strong,
.dashboard-list-item small { display: block; }
.dashboard-list-item strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-list-item small { margin-top: .2rem; overflow: hidden; color: #7d8983; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-list-item__meta {
  flex: 0 0 auto;
  text-align: end;
}

.dashboard-list-item__meta time,
.dashboard-list-item__meta span {
  display: block;
  color: #8a958f;
  font-size: .65rem;
  white-space: nowrap;
}

.dashboard-list-item__meta a {
  display: inline-block;
  margin-top: .2rem;
  color: #386d5c;
  font-size: .7rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-empty {
  min-height: 185px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  color: #7d8983;
  text-align: center;
}

.dashboard-empty i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: .7rem;
  color: #52806f;
  border-radius: 50%;
  background: #f0f6f2;
  font-size: 1.05rem;
}

.dashboard-empty strong { color: #4f5f57; font-size: .8rem; }
.dashboard-empty span { max-width: 260px; margin-top: .3rem; font-size: .7rem; line-height: 1.8; }

@media (max-width: 767.98px) {
  .service-editor-heading { align-items: stretch; flex-direction: column; }
  .service-editor-heading .btn { align-self: flex-start; }
  .service-editor-flags { align-items: flex-start; flex-direction: column; gap: .7rem; }
  .service-editor-actions { justify-content: stretch; }
  .service-editor-actions .btn { flex: 1 1 0; }

  .dashboard-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: .75rem;
  }

  .dashboard-panel { min-height: 0; }
  .dashboard-panel__header { min-height: 70px; }
  .dashboard-empty { min-height: 150px; }
}

@media (max-width: 575.98px) {
  .dashboard-page { gap: .8rem; }
  .dashboard-overview { padding: 1rem; border-radius: .95rem; }
  .dashboard-overview__status { padding: .45rem .65rem; }
  .dashboard-metric { min-height: 126px; padding: .95rem; border-radius: .95rem; }
  .dashboard-metric__content strong { font-size: 1.65rem; }
  .dashboard-panel { border-radius: .95rem; }
  .dashboard-panel__header { padding: .9rem 1rem; }
  .dashboard-panel__body { padding-inline: 1rem; }
  .dashboard-list-item { align-items: flex-start; }
  .dashboard-list-item__meta { max-width: 42%; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-nav-link,
  .admin-nav-group,
  .admin-nav-group__chevron,
  .admin-login__submit {
    transition: none;
  }

  .dashboard-metric {
    transition: none;
  }
}
