/* Admin + vendor overlay — same tokens as the storefront modernizer */

html.adm {
  --adm-accent: #ff9800;
  --adm-accent-hover: #fb8c00;
  --adm-bg: #f6f1e8;
  --adm-surface: #fffdf8;
  --adm-card: #ffffff;
  --adm-border: rgba(28, 25, 23, 0.12);
  --adm-text: #1c1917;
  --adm-muted: #6b6560;
  --adm-link: #c2410c;
  --adm-shadow: 0 12px 28px rgba(28, 25, 23, 0.08);
  --adm-footer: #efe8dc;
  --adm-font: "Estedad", "IRANSans", iran_sens, Tahoma, "Segoe UI", sans-serif;
  color-scheme: light;
  scroll-behavior: smooth;
}

html.adm[data-theme="dark"] {
  --adm-accent: #ff9800;
  --adm-accent-hover: #ffa726;
  --adm-bg: #0c0c0e;
  --adm-surface: #17171c;
  --adm-card: #1e1e25;
  --adm-border: rgba(255, 255, 255, 0.08);
  --adm-text: #f4f4f5;
  --adm-muted: #a1a1aa;
  --adm-link: #ffcc80;
  --adm-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  --adm-footer: #101014;
  color-scheme: dark;
}

html.adm,
html.adm body {
  background: var(--adm-bg) !important;
  color: var(--adm-text) !important;
  font-family: var(--adm-font) !important;
  font-weight: 500 !important;
  direction: rtl;
  text-align: right;
  max-width: 100%;
  overflow-x: hidden;
}

html.adm body *:not(.fa):not(.glyphicon):not(.mdi) {
  font-family: inherit;
}

html.adm h1,
html.adm h2,
html.adm h3,
html.adm h4,
html.adm h5,
html.adm nav.navbar,
html.adm div.left-side {
  text-transform: none !important;
  font-weight: 600 !important;
  line-height: 1.45;
}

html.adm h1 {
  font-size: 20px !important;
}

html.adm h2,
html.adm .page-titles h2 {
  font-size: 18px !important;
}

html.adm h3 {
  font-size: 15px !important;
}

html.adm .vendor-login h1 {
  font-size: 20px !important;
}

html.adm a:not(.btn) {
  color: var(--adm-link) !important;
  text-decoration: none !important;
}

html.adm #wrapper {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--adm-bg);
  min-height: 100%;
}

html.adm .adm-skip {
  position: absolute;
  right: -999px;
  top: 8px;
  z-index: 10000;
  background: var(--adm-accent);
  color: #111 !important;
  padding: 8px 14px;
  border-radius: 8px;
}

html.adm .adm-skip:focus {
  right: 12px;
}

html.adm *:focus-visible {
  outline: 2px solid var(--adm-accent) !important;
  outline-offset: 3px;
}

html.adm nav.navbar,
html.adm .navbar-blue {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--adm-surface) !important;
  box-shadow: var(--adm-shadow);
  min-height: 56px;
}

html.adm nav.navbar a,
html.adm .navbar-blue a,
html.adm .navbar-blue li a {
  color: var(--adm-text) !important;
}

html.adm nav.navbar .navbar-nav > li > a:hover,
html.adm nav.navbar .navbar-nav > li > a:focus {
  background: rgba(255, 152, 0, 0.12) !important;
}

html.adm .navbar-toggle {
  float: left;
  margin: 10px;
  border-color: var(--adm-border);
  color: var(--adm-text);
}

html.adm .navbar-toggle .icon-bar,
html.adm .navbar-toggle .fa {
  color: var(--adm-text);
  background: var(--adm-text);
}

html.adm .mz-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 8px 10px;
  border: 1px solid var(--adm-border);
  border-radius: 999px;
  background: var(--adm-card);
  color: var(--adm-text);
  cursor: pointer;
}

html.adm .mz-theme-toggle:hover {
  border-color: var(--adm-accent);
  color: var(--adm-accent);
}

html.adm .adm-shell {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  align-items: flex-start;
}

html.adm .adm-shell > [class*="col-"] {
  float: none;
}

html.adm div.left-side,
html.adm #sidebarpan {
  background: var(--adm-surface) !important;
  color: var(--adm-text);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  margin: 12px 8px;
  box-shadow: var(--adm-shadow);
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  overflow: visible;
}

html.adm div.left-side ul.sidebar-menu li {
  border-bottom-color: var(--adm-border);
}

html.adm div.left-side ul.sidebar-menu li a,
html.adm div.left-side ul li a {
  color: var(--adm-text) !important;
  border-radius: 8px;
}

html.adm div.left-side ul.sidebar-menu li a:hover,
html.adm div.left-side ul.sidebar-menu li a.active,
html.adm div.left-side ul li a:hover {
  background: rgba(255, 152, 0, 0.14) !important;
  color: var(--adm-text) !important;
}

html.adm div.left-side ul.sidebar-menu li.header {
  color: var(--adm-muted) !important;
  font-size: 12px;
}

html.adm .panel,
html.adm .well,
html.adm .form-panel,
html.adm .content,
html.adm .vendor-login,
html.adm .login-container,
html.adm .page-titles {
  background: var(--adm-card) !important;
  color: var(--adm-text) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--adm-shadow);
}

html.adm .panel-body,
html.adm .panel-footer {
  background: var(--adm-card) !important;
  color: var(--adm-text) !important;
}

html.adm .panel-heading {
  border-radius: 14px 14px 0 0;
}

html.adm table,
html.adm th,
html.adm td {
  text-align: center;
  vertical-align: middle;
  color: var(--adm-text);
}

html.adm .table,
html.adm .table tr,
html.adm form:not(.search-form),
html.adm footer {
  background-color: var(--adm-card) !important;
  color: var(--adm-text) !important;
}

html.adm .table-striped > tbody > tr:nth-of-type(odd) {
  background: rgba(28, 25, 23, 0.04);
}

html.adm[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
  background: rgba(255, 255, 255, 0.04);
}

html.adm .form-control,
html.adm input,
html.adm textarea,
html.adm select {
  background: var(--adm-surface) !important;
  color: var(--adm-text) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 10px !important;
  min-height: 44px;
  font-size: 16px !important;
  font-weight: 500 !important;
  direction: rtl;
  text-align: right;
}

html.adm input[type="email"],
html.adm input[type="password"],
html.adm input[type="tel"],
html.adm input[type="number"],
html.adm input[type="url"],
html.adm input[dir="ltr"],
html.adm textarea[dir="ltr"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

html.adm input::placeholder,
html.adm textarea::placeholder {
  direction: rtl !important;
  text-align: right !important;
  color: var(--adm-muted) !important;
}

html.adm .btn {
  font-weight: 700 !important;
  border-radius: 10px;
  min-height: 40px;
  box-shadow: none !important;
  text-shadow: none !important;
}

html.adm .btn-primary,
html.adm .btn-info,
html.adm .btn-success,
html.adm .btn-green,
html.adm .btn-warning,
html.adm .login.submit,
html.adm .adm-btn--primary,
html.adm .bootstrap-select .btn-green,
html.adm .bootstrap-select .dropdown-toggle {
  background: var(--adm-accent) !important;
  border-color: var(--adm-accent) !important;
  color: #111 !important;
}

html.adm .adm-btn--danger,
html.adm .btn-danger:not(#notifer_close) {
  background: transparent !important;
  border: 1px solid #dc2626 !important;
  color: #dc2626 !important;
}

html.adm .product-list {
  background: var(--adm-card) !important;
  border: 1px solid var(--adm-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--adm-shadow) !important;
}

html.adm .product-list .img-container {
  box-shadow: none !important;
  border-radius: 12px !important;
  background: var(--adm-bg);
}

html.adm .product-list .buttons {
  display: flex;
  gap: 8px;
  justify-content: stretch;
}

html.adm .product-list .buttons .btn {
  flex: 1;
  min-height: 40px;
}

html.adm footer {
  background: var(--adm-footer) !important;
  color: var(--adm-muted) !important;
  border-top: 1px solid var(--adm-border);
  position: relative;
  height: auto;
}

html.adm .login-container {
  width: min(360px, 92vw);
  margin: 80px auto;
  color: var(--adm-text);
}

html.adm .gParent {
  margin-top: 1em;
  display: flex;
  justify-content: center;
}

html.adm .cf-turnstile {
  width: 100%;
  max-width: 300px;
}

html.adm .settings,
html.adm .settings .panel-body {
  color: var(--adm-text) !important;
  background: var(--adm-card) !important;
}

html.adm .modal-content {
  background: var(--adm-card);
  color: var(--adm-text);
}

html.adm .alert {
  text-align: right;
}

html.adm .blink {
  color: var(--adm-accent);
  font-weight: 700;
}

html.adm #notifer {
  display: none;
  background: var(--adm-card);
  color: var(--adm-text);
  box-shadow: var(--adm-shadow);
  text-shadow: none;
  z-index: 10000;
  margin: 12% auto 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 90%);
  padding: 24px;
  border-radius: 14px;
  text-align: center;
}

html.adm #notifer_close {
  margin-top: 12px;
}

html.adm .right-side.col-sm-offset-3,
html.adm .right-side.col-md-offset-3,
html.adm .right-side.col-lg-offset-2 {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html.adm .page-titles {
  position: relative;
  top: auto;
  width: auto;
  margin-bottom: 16px;
}

html.adm .right-side {
  padding-top: 16px;
}

html.adm .navbar-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

html.adm table.table {
  max-width: 100%;
}

@media (min-width: 768px) {
  html.adm #sidebarpan {
    display: block !important;
  }
}

@media (max-width: 991px) {
  html.adm .navbar-toggle {
    display: block !important;
  }

  html.adm .navbar-header {
    float: none;
    width: 100%;
  }

  html.adm .navbar-collapse.collapse {
    display: none !important;
    height: auto !important;
  }

  html.adm .navbar-collapse.collapse.in,
  html.adm .navbar-collapse.collapsing {
    display: block !important;
    width: 100%;
    background: var(--adm-surface);
    border-top: 1px solid var(--adm-border);
  }

  html.adm .navbar-nav,
  html.adm .navbar-nav.navbar-right {
    float: none !important;
    margin: 0;
    width: 100%;
  }

  html.adm .navbar-nav > li {
    float: none;
    display: block;
  }

  html.adm .navbar-nav > li > a {
    min-height: 44px;
    padding: 12px 16px;
  }

  html.adm .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 767px) {
  html.adm .adm-shell {
    flex-direction: column-reverse;
  }

  html.adm .adm-shell > [class*="col-"] {
    width: 100% !important;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }

  html.adm #sidebarpan {
    display: none;
    width: 100% !important;
    margin: 8px 0;
  }

  html.adm .right-side {
    width: 100% !important;
    padding: 8px !important;
  }

  html.adm .form-panel {
    padding: 16px !important;
  }

  html.adm .settings {
    position: relative;
    width: 100%;
    max-width: 100%;
  }

  html.adm .home-page .huge {
    font-size: 22px;
  }

  html.adm .home-page .fast-view-panel {
    height: auto;
    min-height: 110px;
  }

  html.adm .header-img {
    height: 28px;
    margin: 0 8px 0 0;
    float: none;
  }

  html.adm h1 {
    font-size: 18px !important;
  }

  html.adm h2,
  html.adm .page-titles h2 {
    font-size: 16px !important;
  }

  html.adm .table {
    font-size: 13px;
  }

  html.adm .table-responsive,
  html.adm table.table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  html.adm .modal-dialog {
    width: auto;
    margin: 10px;
  }

  html.adm #calculator .btn {
    margin: 4px;
  }

  html.adm .login-container {
    margin: 24px auto;
    padding: 20px 16px 28px;
    width: min(360px, 94vw);
  }

  html.adm .login-container::before,
  html.adm .login-container::after {
    display: none;
  }

  html.adm .col-lg-3,
  html.adm .col-md-6,
  html.adm .col-sm-4,
  html.adm .col-sm-6,
  html.adm .col-sm-8 {
    width: 100%;
    float: none;
  }

  html.adm .bootstrap-select {
    width: 100% !important;
  }

  html.adm .cke,
  html.adm .cke_chrome {
    max-width: 100% !important;
  }

  html.adm .mz-theme-toggle {
    float: none;
  }

  html.adm #notifer {
    width: min(420px, 92%);
    margin-top: 20%;
    padding: 16px;
  }
}

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