@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn/Vazirmatn-Variable.woff2") format("woff2-variations"),
    url("../fonts/vazirmatn/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --theme-primary: #6658dd;
  --theme-primary-hover: #5c50c8;
  --theme-secondary: #4a81d4;
  --theme-success: #1abc9c;
  --theme-info: #43bfe5;
  --theme-warning: #f7b84b;
  --theme-danger: #f1556c;
  --theme-body-bg: #f5f6f8;
  --theme-body-color: #33384a;
  --theme-muted: #8b97ad;
  --theme-card-bg: #ffffff;
  --theme-border: #e7e9eb;
  --theme-topbar-bg: #343f4b;
  --theme-sidebar-bg: #ffffff;
  --theme-sidebar-color: #65758a;
  --theme-sidebar-active: #6658dd;
  --theme-shadow: 0 1px 4px rgba(130, 143, 163, 0.15);
  --theme-radius: 0.3rem;
  --sidebar-width: 240px;
  --topbar-height: 70px;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--theme-body-color);
  background: var(--theme-body-bg);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: var(--theme-primary);
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  background: #fff;
  color: var(--theme-body-color);
  padding: 0.66rem 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #b9c1d0;
  box-shadow: 0 0 0 3px rgba(102, 88, 221, 0.08);
}

label span {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: #252b3d;
}

label small {
  display: block;
  margin-top: 0.45rem;
  color: var(--theme-muted);
}

.multi-choice-select:not([data-multiselect-dropdown]) {
  min-height: 176px;
  padding: 0.4rem;
  overflow: auto;
}

.multi-choice-select:not([data-multiselect-dropdown]) option {
  border-radius: 7px;
  margin-bottom: 4px;
  padding: 0.55rem 0.65rem;
}

.multi-choice-select:not([data-multiselect-dropdown]) option:checked {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: #fff;
  font-weight: 800;
}

select[data-multiselect-dropdown].is-enhanced {
  display: none;
}

.multi-dropdown {
  position: relative;
  width: 100%;
}

.multi-dropdown-toggle {
  position: relative;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  background: #fff;
  color: var(--theme-body-color);
  padding: 0.66rem 2.3rem 0.66rem 0.85rem;
  font: inherit;
  text-align: start;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.multi-dropdown-toggle::after {
  content: "";
  position: absolute;
  inset-inline-start: 0.9rem;
  top: calc(50% - 2px);
  border: 5px solid transparent;
  border-top-color: var(--theme-muted);
}

.multi-dropdown-toggle.is-empty {
  color: var(--theme-muted);
}

.multi-dropdown.is-open .multi-dropdown-toggle {
  border-color: #b9c1d0;
  box-shadow: 0 0 0 3px rgba(102, 88, 221, 0.08);
}

.multi-dropdown-menu {
  position: absolute;
  z-index: 50;
  inset-inline: 0;
  top: calc(100% + 6px);
  max-height: 238px;
  overflow: auto;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(49, 54, 74, 0.15);
  padding: 6px;
}

.multi-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.multi-dropdown-option:hover {
  background: #f4f6fb;
}

.multi-dropdown-option input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  flex: 0 0 18px;
}

.auth-body {
  background: #f6f7fb;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-card,
.install-card {
  width: min(100%, 546px);
  background: var(--theme-card-bg);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(56, 65, 74, 0.08);
  padding: 38px 36px;
}

.install-card {
  width: min(100%, 1120px);
}

.auth-logo,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-logo {
  justify-content: center;
  width: 100%;
  margin-bottom: 18px;
  font-size: 22px;
  color: #151929;
}

.brand {
  height: var(--topbar-height);
  padding: 0 22px;
  color: #1f2433;
  font-weight: 800;
  font-size: 18px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  display: inline-block;
  border-radius: 7px;
  background: conic-gradient(from 160deg, var(--theme-primary), var(--theme-info), var(--theme-success), var(--theme-primary));
}

.brand-mark.danger {
  background: conic-gradient(from 160deg, var(--theme-danger), var(--theme-warning), var(--theme-danger));
}

.login-card h1,
.install-card h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
}

.login-card p,
.install-card > p {
  margin: 12px auto 26px;
  max-width: 650px;
  text-align: center;
  color: var(--theme-muted);
}

.install-form {
  display: grid;
  gap: 18px;
}

.form-section {
  border: 1px dashed var(--theme-border);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
}

.form-section h2,
.card-header h2 {
  margin: 0;
  font-size: 16px;
}

.form-section h2 {
  margin-bottom: 18px;
}

.form-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.form-section-heading h2 {
  margin-bottom: 0;
}

.db-test-result {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #dfe4ee;
  background: #f7f8fb;
  color: #566176;
  font-size: 12px;
  line-height: 1.8;
}

.db-test-result.ok {
  border-color: #bce9df;
  background: #f1fbf8;
  color: #0f8d74;
}

.db-test-result.bad {
  border-color: #ffd3db;
  background: #fff4f6;
  color: #b93749;
}

.license-check-modal {
  width: min(100%, 860px);
}

.license-check-summary {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #dfe4ee;
  border-radius: 8px;
  background: #f7f8fb;
  color: #566176;
  font-size: 13px;
  line-height: 1.8;
}

.license-check-summary.ok {
  border-color: #bce9df;
  background: #f1fbf8;
  color: #0f8d74;
}

.license-check-summary.bad {
  border-color: #ffd3db;
  background: #fff4f6;
  color: #b93749;
}

.license-check-details {
  padding: 0;
}

.license-check-json-box {
  position: relative;
  margin-top: 16px;
}

.license-check-copy {
  position: absolute;
  z-index: 2;
  top: 10px;
  inset-inline-end: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  color: var(--theme-primary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.license-check-copy:hover,
.license-check-copy:focus-visible,
.password-icon-button:hover,
.password-icon-button:focus-visible {
  border-color: #cfcaf6;
  background: #f3f1ff;
  color: var(--theme-primary);
}

.license-check-copy.is-copied,
.password-icon-button.is-copied {
  border-color: #bce9df;
  background: #f1fbf8;
  color: #0f8d74;
}

.license-check-copy svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}

.license-check-json {
  max-height: 260px;
  margin: 0;
  padding: 52px 14px 14px;
  overflow: auto;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #e3e8f1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.7;
}

.password-control {
  position: relative;
  width: 100%;
}

.password-control-input {
  padding-inline-end: 48px;
}

.password-control.has-tools .password-control-input {
  padding-inline-end: 126px;
}

.password-control-actions {
  position: absolute;
  z-index: 1;
  inset-block: 0;
  inset-inline-end: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.password-icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #7b879a;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.password-icon-button svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}

.password-strength-ribbon {
  min-height: 30px;
  margin-top: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e3e8f1;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
}

.password-strength-track {
  position: relative;
  flex: 1 1 96px;
  min-width: 96px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.password-strength-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  border-radius: inherit;
  background: #cbd5e1;
  transition: width 0.18s ease, background 0.18s ease;
}

.password-strength-text {
  flex: 0 0 auto;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.password-strength-ribbon.is-weak {
  border-color: #ffd3db;
  background: #fff4f6;
  color: #b93749;
}

.password-strength-ribbon.is-weak .password-strength-fill {
  background: var(--theme-danger);
}

.password-strength-ribbon.is-medium {
  border-color: #ffe2aa;
  background: #fff9eb;
  color: #a86c0d;
}

.password-strength-ribbon.is-medium .password-strength-fill {
  background: var(--theme-warning);
}

.password-strength-ribbon.is-good {
  border-color: #cce2ff;
  background: #f4f8ff;
  color: #2d6eb8;
}

.password-strength-ribbon.is-good .password-strength-fill {
  background: var(--theme-secondary);
}

.password-strength-ribbon.is-strong {
  border-color: #bce9df;
  background: #f1fbf8;
  color: #0f8d74;
}

.password-strength-ribbon.is-strong .password-strength-fill {
  background: var(--theme-success);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.license-inline-grid {
  align-items: start;
}

.license-inline-grid input {
  min-height: 44px;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.license-danger-zone {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--theme-border);
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--theme-radius);
  padding: 0.66rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  min-height: 38px;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--theme-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--theme-primary-hover);
}

.btn-secondary {
  background: var(--theme-secondary);
  color: #fff;
}

.btn-danger {
  background: var(--theme-danger);
  color: #fff;
}

.btn-danger:hover,
.btn-danger:focus-visible {
  background: #d94b60;
}

.btn-light {
  background: #eef2f7;
  color: #465066;
  border-color: #e0e5ef;
}

.btn-outline {
  background: #fff;
  color: var(--theme-primary);
  border-color: #cfcaf6;
}

.btn-wide {
  width: 100%;
}

.btn-sm {
  min-height: 32px;
  padding: 0.38rem 0.65rem;
  font-size: 12px;
}

.btn-icon-only {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.btn-icon-only svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(49, 54, 74, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(100%, 760px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(49, 54, 74, 0.22);
}

.product-modal {
  width: min(100%, 980px);
}

.modal-header {
  min-height: 62px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--theme-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  padding: 22px 24px 24px;
}

.confirm-modal {
  width: min(100%, 420px);
}

.confirm-modal .modal-body {
  display: grid;
  gap: 18px;
}

.confirm-modal p {
  margin: 0;
  color: #465066;
  line-height: 1.9;
}

.confirm-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.confirm-icon.danger {
  background: #fde6e9;
  color: var(--theme-danger);
}

body.modal-open {
  overflow: hidden;
}

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-success {
  background: #ddf5f0;
  color: #0f7d68;
  border-color: #a3e4d7;
}

.alert-danger {
  background: #fde6e9;
  color: #b93749;
  border-color: #f9bbc4;
}

.alert-warning {
  background: #fff6df;
  color: #9a650d;
  border-color: #f5d48c;
}

.alert[data-toast][data-toast-consumed="1"] {
  display: none;
}

.toast-viewport {
  position: fixed;
  z-index: 12000;
  inset-block-start: 18px;
  inset-inline-end: 18px;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.app-toast {
  --toast-accent: var(--theme-info);
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: flex-start;
  min-height: 66px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  color: #202637;
  box-shadow: 0 18px 45px rgba(27, 31, 45, 0.16);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}

.app-toast::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--toast-accent);
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-toast.is-hiding {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.app-toast-success {
  --toast-accent: var(--theme-success);
}

.app-toast-error {
  --toast-accent: var(--theme-danger);
}

.app-toast-warning {
  --toast-accent: var(--theme-warning);
}

.app-toast-info {
  --toast-accent: var(--theme-info);
}

.app-toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--toast-accent) 13%, #fff);
  color: var(--toast-accent);
}

.app-toast-icon svg,
.app-toast-close svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}

.app-toast-content {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-top: 1px;
}

.app-toast-content strong {
  font-size: 13px;
  font-weight: 900;
  color: #161b2d;
}

.app-toast-content span {
  color: #667186;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.app-toast-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8a94a8;
  cursor: pointer;
}

.app-toast-close:hover,
.app-toast-close:focus-visible {
  background: #f1f3f8;
  color: #30364a;
}

body.app-loading {
  overflow: hidden;
}

.app-loading .app-wrapper {
  opacity: 0;
  pointer-events: none;
}

.app-skeleton {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--theme-body-bg);
  opacity: 1;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.app-ready .app-skeleton {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-skeleton-sidebar {
  min-height: 100vh;
  padding: 20px 18px 28px;
  background: var(--theme-sidebar-bg);
  box-shadow: 0 0.75rem 6rem rgba(56, 65, 74, 0.05);
}

.app-skeleton-brand,
.skeleton-nav-row,
.skeleton-topbar-group,
.skeleton-stat-card {
  display: flex;
  align-items: center;
}

.app-skeleton-brand {
  gap: 12px;
  margin-bottom: 24px;
}

.app-skeleton-nav {
  display: grid;
  gap: 9px;
}

.skeleton-nav-row {
  min-height: 40px;
  gap: 11px;
  padding: 7px 8px;
  border-radius: 8px;
}

.app-skeleton-main {
  min-width: 0;
}

.app-skeleton-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  background: var(--theme-topbar-bg);
  box-shadow: var(--theme-shadow);
}

.skeleton-topbar-group {
  gap: 12px;
}

.app-skeleton-content {
  padding: 26px 24px 42px;
}

.skeleton-page-heading {
  display: grid;
  justify-items: end;
  gap: 10px;
  margin-bottom: 20px;
}

[dir="ltr"] .skeleton-page-heading {
  justify-items: start;
}

.skeleton-stats-grid,
.skeleton-lower-grid {
  display: grid;
  gap: 18px;
}

.skeleton-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.skeleton-lower-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.skeleton-card {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-card-bg);
  box-shadow: var(--theme-shadow);
}

.skeleton-stat-card {
  position: relative;
  min-height: 110px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  padding: 22px;
}

[dir="rtl"] .skeleton-stat-card {
  align-items: flex-end;
}

.skeleton-table-card {
  padding: 20px;
}

.skeleton-table-row {
  display: block;
  height: 42px;
  border-bottom: 1px solid #eef1f5;
}

.skeleton-table-row:last-child {
  border-bottom: 0;
}

.skeleton-panel-card {
  min-height: 210px;
}

.skeleton-line,
.skeleton-shape,
.skeleton-table-row,
.skeleton-panel-card {
  overflow: hidden;
  background: linear-gradient(90deg, #edf1f7 0%, #f8fafc 42%, #edf1f7 78%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

.skeleton-line {
  display: block;
  height: 12px;
  border-radius: 999px;
}

.skeleton-shape {
  display: inline-flex;
  flex: 0 0 auto;
}

.skeleton-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.skeleton-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
}

.skeleton-menu,
.skeleton-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.skeleton-avatar {
  border-radius: 50%;
}

.skeleton-line-brand {
  width: 118px;
}

.skeleton-nav-row .skeleton-line {
  width: min(126px, 70%);
}

.skeleton-topbar-search {
  width: min(360px, 34vw);
  height: 40px;
  border-radius: 10px;
}

.skeleton-chip {
  width: 118px;
  height: 30px;
}

.skeleton-title-line {
  width: min(240px, 52vw);
  height: 18px;
}

.skeleton-subtitle-line {
  width: min(360px, 58vw);
}

.skeleton-stat-number {
  width: 74px;
  height: 22px;
}

.skeleton-stat-label {
  width: 118px;
}

.skeleton-stat-icon {
  position: absolute;
  inset-block-start: 24px;
  inset-inline-end: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.skeleton-table-title {
  width: 150px;
  height: 16px;
  margin-bottom: 18px;
  margin-inline-start: auto;
}

[dir="ltr"] .skeleton-table-title {
  margin-inline-start: 0;
  margin-inline-end: auto;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line,
  .skeleton-shape,
  .skeleton-table-row,
  .skeleton-panel-card {
    animation: none;
  }
}

.app-wrapper {
  min-height: 100vh;
}

.sidebar-overlay {
  display: none;
}

.sidenav {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: var(--sidebar-width);
  background: var(--theme-sidebar-bg);
  box-shadow: 0 0.75rem 6rem rgba(56, 65, 74, 0.05);
  overflow-y: auto;
  z-index: 1002;
  transition: transform 0.2s ease;
}

.sidebar-collapsed .sidenav {
  transform: translateX(105%);
}

[dir="ltr"] .sidebar-collapsed .sidenav {
  transform: translateX(-105%);
}

.menu-title {
  padding: 14px 22px 6px;
  color: #6e7c91;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
}

.side-nav {
  display: grid;
  gap: 5px;
  padding: 0 12px 28px;
}

.side-link {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--theme-sidebar-color);
}

.side-link:hover,
.side-link.active {
  color: var(--theme-sidebar-active);
  background: rgba(102, 88, 221, 0.08);
}

.side-link small {
  margin-inline-start: auto;
  color: #a5afbf;
  font-size: 11px;
}

.nav-icon {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 10px;
  color: currentColor;
  background: rgba(102, 88, 221, 0.08);
}

.nav-icon svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: currentColor;
}

.main {
  min-height: 100vh;
  margin-inline-start: var(--sidebar-width);
  transition: margin-inline-start 0.2s ease;
}

.sidebar-collapsed .main {
  margin-inline-start: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--theme-topbar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: var(--theme-shadow);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right form {
  margin: 0;
}

.logout-trigger {
  border-color: rgba(241, 85, 108, 0.24);
  background: #fde6e9;
  color: var(--theme-danger);
}

.logout-trigger:hover,
.logout-trigger:focus-visible {
  border-color: rgba(241, 85, 108, 0.38);
  background: var(--theme-danger);
  color: #fff;
  box-shadow: 0 8px 18px rgba(241, 85, 108, 0.22);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: transparent;
  color: #dce5ef;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.search-box {
  position: relative;
  min-width: 300px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #b7c2d2;
}

.search-box input {
  border: 0;
  background: transparent;
  color: #e8edf5;
  padding: 0;
  box-shadow: none;
}

.search-box input::placeholder {
  color: #aab5c4;
}

.quick-search-panel {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 1200;
  width: min(460px, calc(100vw - 48px));
  max-height: min(420px, calc(100vh - var(--topbar-height) - 36px));
  overflow-y: auto;
  border: 1px solid #dfe4ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(26, 32, 44, 0.18);
  padding: 8px;
}

.quick-search-panel[hidden] {
  display: none;
}

.quick-search-item,
.quick-search-empty {
  width: 100%;
  border-radius: 8px;
  padding: 10px 11px;
}

.quick-search-item {
  border: 0;
  display: grid;
  gap: 4px;
  background: transparent;
  color: #252b3d;
  text-align: start;
  cursor: pointer;
}

.quick-search-item strong,
.quick-search-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-search-item span,
.quick-search-empty {
  color: var(--theme-muted);
  font-size: 12px;
}

.quick-search-item:hover,
.quick-search-item.is-active {
  background: #f0edff;
  color: var(--theme-primary);
}

.quick-search-hit {
  outline: 3px solid rgba(102, 88, 221, 0.22);
  outline-offset: 3px;
  border-radius: 8px;
}

.pill {
  color: #dce5ef;
  font-weight: 700;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #dce5ef;
}

.admin-avatar svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: currentColor;
}

.content-page {
  padding: 26px 24px 42px;
}

.page-title {
  min-height: 58px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-title h1 {
  margin: 0;
  font-size: 20px;
}

.page-title p {
  margin: 4px 0 0;
  color: var(--theme-muted);
}

.bot-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.bot-tabs a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 8px 14px;
  color: #667186;
  background: #fff;
  white-space: nowrap;
}

.bot-tabs a.active,
.bot-tabs a:hover {
  color: var(--theme-primary);
  border-color: #d6d1fb;
  background: #f0edff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stat-card,
.card {
  background: var(--theme-card-bg);
  border-radius: 8px;
  box-shadow: var(--theme-shadow);
}

.stat-card {
  min-height: 118px;
  padding: 22px 24px;
  display: grid;
  align-content: center;
  justify-items: end;
  position: relative;
}

[dir="ltr"] .stat-card {
  justify-items: start;
}

.stat-card strong {
  font-size: 27px;
  font-weight: 700;
  color: #31364a;
}

.stat-card small {
  color: #919db3;
}

.stat-icon {
  position: absolute;
  inset-inline-start: 24px;
  top: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

.stat-icon.purple {
  background: #e8e6fa;
  color: var(--theme-primary);
}

.stat-icon.green {
  background: #ddf5f0;
  color: var(--theme-success);
}

.stat-icon.cyan {
  background: #e3f5fb;
  color: var(--theme-info);
}

.stat-icon.amber {
  background: #fef4e4;
  color: var(--theme-warning);
}

.stat-icon.red {
  background: #fde6e9;
  color: var(--theme-danger);
}

.metric-chart-grid {
  align-items: stretch;
}

.metric-chart-card {
  --metric-accent: var(--theme-primary);
  --metric-soft: #f0edff;
  --metric-border: #dcd7ff;
  --metric-fade: #c9c2ff;
  --metric-shadow: rgba(102, 88, 221, 0.2);
  min-height: 154px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: stretch;
  align-items: center;
  justify-items: stretch;
  gap: 18px;
  overflow: hidden;
  border: 1px solid var(--metric-border);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, var(--metric-soft), #fff);
}

.metric-purple {
  --metric-accent: var(--theme-primary);
  --metric-soft: #f0edff;
  --metric-border: #ded8ff;
  --metric-fade: #c9c2ff;
  --metric-shadow: rgba(102, 88, 221, 0.2);
}

.metric-green {
  --metric-accent: var(--theme-success);
  --metric-soft: #ddf5f0;
  --metric-border: #b9ebe1;
  --metric-fade: #8ce3d2;
  --metric-shadow: rgba(26, 188, 156, 0.2);
}

.metric-amber {
  --metric-accent: var(--theme-warning);
  --metric-soft: #fff6df;
  --metric-border: #f5dca9;
  --metric-fade: #ffd789;
  --metric-shadow: rgba(247, 184, 75, 0.22);
}

.metric-cyan {
  --metric-accent: var(--theme-info);
  --metric-soft: #e3f5fb;
  --metric-border: #bdeaf5;
  --metric-fade: #9de0f3;
  --metric-shadow: rgba(67, 191, 229, 0.2);
}

.metric-copy {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 4px;
}

[dir="ltr"] .metric-copy {
  justify-items: start;
}

.metric-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--metric-soft);
  color: var(--metric-accent);
  font-size: 12px;
  font-weight: 800;
}

.metric-chart-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 25px;
}

.metric-chart-card small {
  max-width: 100%;
  color: #7e8aa0;
  text-align: end;
}

[dir="ltr"] .metric-chart-card small {
  text-align: start;
}

.metric-bars {
  height: 74px;
  min-width: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  padding: 6px 3px;
}

.metric-bars span {
  width: 10px;
  height: var(--bar-height);
  min-height: 10px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--metric-accent), var(--metric-fade));
  box-shadow: 0 7px 14px var(--metric-shadow);
}

.metric-bars-revenue span {
  width: 9px;
}

.metric-ring-wrap {
  position: relative;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
}

.metric-ring {
  width: 86px;
  height: 86px;
}

.metric-ring-track,
.metric-ring-value {
  fill: none;
  stroke-width: 5;
}

.metric-ring-track {
  stroke: #edf1f7;
}

.metric-ring-value {
  stroke: var(--metric-accent);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.metric-ring-wrap span {
  position: absolute;
  font-size: 14px;
  font-weight: 900;
  color: #30364a;
}

.card {
  margin-bottom: 18px;
}

.card.narrow {
  max-width: 720px;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--theme-border);
}

.card-header.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.health-card-header {
  flex-wrap: wrap;
}

.health-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--theme-border);
  background: #f8fafc;
  color: #59657a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.health-pill strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  color: #202637;
  font-size: 12px;
}

.health-pill.ok {
  border-color: #c9f3e9;
  background: #effcf9;
  color: #16846f;
}

.health-pill.warn {
  border-color: #fde8b7;
  background: #fff8e8;
  color: #9a650e;
}

.health-pill.fail {
  border-color: #ffd4dc;
  background: #fff1f4;
  color: #b4233a;
}

.card > p,
.license-summary,
.roadmap {
  padding: 22px 24px;
}

.card-body-pad {
  padding: 22px 24px;
}

.detail-list {
  display: grid;
  gap: 0;
  padding: 8px 24px 20px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--theme-border);
}

.detail-list div:last-child {
  border-bottom: 0;
}

.detail-list span {
  color: var(--theme-muted);
}

.detail-list strong {
  min-width: 0;
}

.breakable {
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 24px 22px;
}

.card-actions form {
  margin: 0;
}

.dashboard-grid {
  align-items: stretch;
}

.license-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.license-summary small {
  display: block;
  color: var(--theme-muted);
}

.license-summary strong {
  display: block;
  margin-top: 4px;
}

.roadmap {
  display: grid;
  gap: 10px;
}

.roadmap span,
.soft-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 12px;
  background: #f1f3f8;
  color: #667186;
  width: fit-content;
}

.menu-preview,
.feature-pills {
  padding: 22px 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-preview span,
.feature-pills span {
  border-radius: 999px;
  padding: 7px 12px;
  background: #f0edff;
  color: var(--theme-primary);
  font-weight: 700;
}

.tooltip-button {
  position: relative;
  overflow: visible;
}

.tooltip-button::after,
.tooltip-button::before {
  display: none;
}

.app-tooltip {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: min(320px, calc(100vw - 20px));
  padding: 9px 11px;
  border-radius: 8px;
  background: #31364a;
  color: #fff;
  box-shadow: 0 12px 30px rgba(49, 54, 74, 0.18);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.8;
  text-align: start;
  white-space: normal;
  pointer-events: none;
}

.app-tooltip::before {
  content: "";
  position: absolute;
  inset-inline-start: calc(50% - 5px);
  border: 5px solid transparent;
}

.app-tooltip[data-placement="bottom"]::before {
  inset-block-start: -10px;
  border-block-end-color: #31364a;
}

.app-tooltip[data-placement="top"]::before {
  inset-block-end: -10px;
  border-block-start-color: #31364a;
}

.menu-preview span.disabled {
  background: #eef2f7;
  color: #a2acba;
  text-decoration: line-through;
}

.menu-preview span.style-primary {
  background: #e9edff;
  color: var(--theme-primary);
}

.menu-preview span.style-success {
  background: #ddf5f0;
  color: var(--theme-success);
}

.menu-preview span.style-danger {
  background: #fde6e9;
  color: var(--theme-danger);
}

.builder-form {
  display: block;
}

.builder-menu-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
  gap: 18px;
  align-items: start;
}

.builder-menu-card,
.bot-preview-card {
  min-width: 0;
}

.builder-menu-header,
.bot-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.builder-menu-header p,
.bot-preview-head p {
  margin: 5px 0 0;
  color: var(--theme-muted);
  font-size: 12px;
  line-height: 1.8;
}

.builder-tab-list,
.preview-device-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #f7f8fb;
  flex-shrink: 0;
}

.builder-tab-button,
.preview-device-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #657186;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.builder-tab-button.is-active,
.preview-device-switch button.is-active {
  background: #fff;
  color: var(--theme-primary);
  box-shadow: 0 6px 18px rgba(37, 43, 61, 0.08);
}

.builder-tab-panels {
  padding: 22px 24px;
}

.builder-tab-panel {
  display: grid;
  gap: 14px;
}

.builder-tab-panel[hidden] {
  display: none;
}

.mini-app-grid {
  padding: 0;
}

.bot-preview-card {
  position: sticky;
  top: 92px;
}

.bot-phone-preview {
  width: min(100%, 310px);
  margin: 22px auto 26px;
  padding: 12px;
  border: 1px solid #d7dfec;
  border-radius: 26px;
  background: #1f2937;
  box-shadow: 0 22px 60px rgba(37, 43, 61, 0.18);
}

.bot-phone-preview.ios {
  border-radius: 34px;
  background: #111827;
}

.phone-shell-top {
  height: 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: #dbe4f0;
  font-size: 11px;
  padding: 0 8px;
}

.phone-shell-top i {
  width: 76px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.bot-phone-preview.ios .phone-shell-top i {
  width: 92px;
  height: 22px;
  background: #05070a;
}

.phone-screen {
  min-height: 530px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  border-radius: 18px;
  background: linear-gradient(180deg, #eef7fb 0%, #f8fafc 46%, #eef2f7 100%);
}

.bot-phone-preview.ios .phone-screen {
  border-radius: 28px;
}

.phone-status-bar {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.phone-chat-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.phone-header-icon,
.phone-header-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex: 0 0 auto;
}

.phone-header-icon {
  width: 28px;
  height: 28px;
}

.phone-header-tools {
  gap: 10px;
  margin-inline-start: auto;
}

.phone-header-icon svg,
.phone-header-tools svg,
.phone-composer-send svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.phone-bale-brand {
  display: none;
}

.phone-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #3b82f6);
  color: #fff;
  font-weight: 800;
}

.phone-chat-header strong,
.phone-chat-header span {
  display: block;
}

.phone-chat-header strong {
  max-width: 190px;
  overflow: hidden;
  color: #1f2937;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-chat-header span {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.phone-chat-header span b,
.phone-chat-header span i {
  font-style: normal;
}

.phone-chat-header span b::after {
  content: " · ";
}

.phone-screen.platform-telegram .phone-avatar {
  background: linear-gradient(135deg, #2aabee, #1d4ed8);
}

.phone-screen.platform-bale .phone-avatar {
  background: linear-gradient(135deg, #20c997, #16a34a);
}

.phone-screen.platform-rubika .phone-avatar {
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.phone-chat-body {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.phone-bubble {
  max-width: 94%;
  justify-self: start;
  padding: 12px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(37, 43, 61, 0.08);
}

.phone-bubble p {
  margin: 0 0 10px;
  color: #334155;
  line-height: 1.8;
  font-size: 12px;
}

.phone-message-meta {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1;
}

.phone-message-meta i {
  color: #0ea5e9;
  font-style: normal;
  letter-spacing: -2px;
}

.phone-inline-buttons,
.phone-reply-keyboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.phone-inline-buttons {
  grid-template-columns: 1fr;
}

.phone-menu-button,
.phone-empty-button {
  min-height: 34px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0.35rem 0.5rem;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.phone-menu-button.style-primary {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

.phone-menu-button.style-success {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.phone-menu-button.style-danger {
  border-color: #fecdd3;
  background: #ffe4e6;
  color: #be123c;
}

.phone-empty-button {
  grid-column: 1 / -1;
  color: #94a3b8;
  font-weight: 700;
}

.phone-mini-app {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  box-shadow: 0 10px 24px rgba(37, 43, 61, 0.08);
}

.phone-mini-app.theme-dark {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-color: #334155;
  color: #e2e8f0;
}

.phone-mini-app.height-compact {
  max-height: 92px;
}

.phone-mini-app.height-medium {
  max-height: 130px;
}

.phone-mini-app span,
.phone-mini-app strong,
.phone-mini-app small {
  display: block;
}

.phone-mini-app span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.phone-mini-app.theme-dark span,
.phone-mini-app.theme-dark small {
  color: #cbd5e1;
}

.phone-mini-app strong {
  color: #2563eb;
  font-size: 13px;
}

.phone-mini-app.theme-dark strong {
  color: #93c5fd;
}

.phone-mini-app small {
  color: #64748b;
  line-height: 1.7;
}

.phone-reply-keyboard {
  padding: 10px;
  background: rgba(226, 232, 240, 0.82);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.phone-reply-keyboard.is-disabled {
  opacity: 0.72;
}

.phone-composer {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.phone-composer-icon,
.phone-composer-send {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex: 0 0 auto;
}

.phone-composer-icon {
  border: 1px solid #dbe4ef;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
}

.phone-composer-input {
  min-width: 0;
  flex: 1;
  min-height: 32px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.phone-composer-send {
  background: var(--theme-primary);
  color: #fff;
}

.phone-screen.platform-bale {
  direction: rtl;
  background:
    radial-gradient(circle at 20% 18%, rgba(21, 186, 144, 0.10) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 34%, rgba(79, 209, 197, 0.09) 0 2px, transparent 3px),
    linear-gradient(180deg, #edf8f8 0%, #f5fbfb 48%, #eaf5f7 100%);
}

.phone-screen.platform-bale .phone-status-bar {
  background: #fff;
  color: #334155;
}

.phone-screen.platform-bale .phone-chat-header {
  min-height: 56px;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-bottom-color: #e2eef1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.phone-screen.platform-bale .phone-back-icon {
  color: #12a783;
}

.phone-screen.platform-bale .phone-avatar {
  width: 38px;
  height: 38px;
  background: #18b985;
  box-shadow: inset 0 -8px 18px rgba(0, 0, 0, 0.08);
}

.phone-screen.platform-bale .phone-chat-header strong {
  color: #17212b;
  font-size: 13px;
}

.phone-screen.platform-bale .phone-chat-header span,
.phone-screen.platform-bale .phone-header-tools {
  color: #7b8794;
}

.phone-screen.platform-bale .phone-bale-brand {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-inline-start: 2px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1ec99a, #2f80ed);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.phone-screen.platform-bale .phone-chat-body {
  gap: 10px;
  padding: 13px 12px;
}

.phone-screen.platform-bale .phone-bubble {
  width: min(100%, 218px);
  max-width: 88%;
  justify-self: start;
  border: 1px solid #e4eff2;
  border-radius: 17px 17px 4px 17px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.phone-screen.platform-bale .phone-bubble p {
  color: #243447;
  font-size: 12px;
}

.phone-screen.platform-bale .phone-inline-buttons {
  gap: 6px;
  margin-top: 8px;
}

.phone-screen.platform-bale .phone-inline-buttons .phone-menu-button {
  min-height: 34px;
  border-color: #cbeef0;
  border-radius: 10px;
  background: #eefbfb;
  color: #07856c;
  box-shadow: none;
}

.phone-screen.platform-bale .phone-inline-buttons .phone-menu-button.style-primary {
  border-color: #abdff2;
  background: #e4f6ff;
  color: #0876a8;
}

.phone-screen.platform-bale .phone-inline-buttons .phone-menu-button.style-success {
  border-color: #b8eee0;
  background: #dcfbf2;
  color: #0b7c63;
}

.phone-screen.platform-bale .phone-inline-buttons .phone-menu-button.style-danger {
  border-color: #ffd4da;
  background: #fff1f3;
  color: #c42c48;
}

.phone-screen.platform-bale .phone-message-meta {
  color: #95a4b3;
}

.phone-screen.platform-bale .phone-message-meta i {
  color: #18b985;
}

.phone-screen.platform-bale .phone-mini-app {
  justify-self: stretch;
  border-color: #c8edf2;
  background: linear-gradient(135deg, #ecfbff, #eefdf6);
}

.phone-screen.platform-bale .phone-mini-app strong {
  color: #128c71;
}

.phone-screen.platform-bale .phone-reply-keyboard {
  padding: 9px 10px;
  background: rgba(236, 244, 247, 0.96);
  border-top-color: #dbe8ec;
}

.phone-screen.platform-bale .phone-reply-keyboard .phone-menu-button {
  min-height: 34px;
  border-color: #d7e5eb;
  border-radius: 9px;
  background: #fff;
  color: #243447;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.phone-screen.platform-bale .phone-reply-keyboard .phone-menu-button.style-primary {
  border-color: #a8d9ff;
  background: #e8f5ff;
  color: #0876a8;
}

.phone-screen.platform-bale .phone-reply-keyboard .phone-menu-button.style-success {
  border-color: #aeead7;
  background: #e3fbf2;
  color: #0a7b62;
}

.phone-screen.platform-bale .phone-reply-keyboard .phone-menu-button.style-danger {
  border-color: #ffcbd4;
  background: #fff0f2;
  color: #c42c48;
}

.phone-screen.platform-bale .phone-composer {
  direction: rtl;
  min-height: 50px;
  background: #fff;
  border-top-color: #dce9ed;
}

.phone-screen.platform-bale .phone-composer-input {
  background: #f3f7f8;
  color: #94a3b8;
}

.phone-screen.platform-bale .phone-composer-send {
  background: #18b985;
}

.form-grid {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.portal-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.compact {
  gap: 14px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.inline-note {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid #dfe4ee;
  border-radius: 8px;
  background: #f8fafc;
}

.inline-note strong {
  color: #252b3d;
}

.inline-note span {
  margin: 0;
  color: var(--theme-muted);
  font-weight: 500;
}

.split-actions {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.button-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bot-create-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.bot-create-form {
  padding: 22px 24px;
  display: grid;
  gap: 18px;
}

.bot-create-field {
  display: grid;
  gap: 7px;
}

.bot-token-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.bot-platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bot-platform-card {
  min-height: 82px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 18px 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bot-platform-card:hover,
.bot-platform-card:has(input:checked) {
  border-color: #cfc9fb;
  background: #fbfaff;
  box-shadow: 0 10px 24px rgba(102, 88, 221, 0.08);
}

.bot-platform-card input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.bot-platform-copy {
  min-width: 0;
}

.bot-platform-copy strong,
.bot-platform-copy small {
  display: block;
}

.bot-platform-copy strong {
  color: #252b3d;
}

.bot-platform-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  overflow: hidden;
}

.bot-platform-icon.telegram {
  background: #e8f4fd;
}

.bot-platform-icon.bale {
  background: #ddf5f0;
}

.bot-platform-icon.rubika {
  background: #f5e7fb;
}

.bot-platform-icon svg,
.bot-platform-icon img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(49, 54, 74, 0.12));
}

.token-field {
  min-height: 42px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.bot-help-card {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
}

.setup-steps {
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}

.setup-steps div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
}

.setup-steps span {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-primary);
  background: #f0edff;
  font-weight: 900;
}

.setup-steps strong {
  color: #252b3d;
}

.setup-steps p {
  margin: 0;
  color: var(--theme-muted);
  line-height: 1.8;
}

.bot-create-hint {
  margin: 0;
  padding: 0 20px 20px;
  line-height: 1.8;
}

.inline-filter {
  padding: 18px 24px 22px;
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  gap: 12px;
  align-items: end;
}

.inline-filter.wide,
.inline-filter.report-filter {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
}

.divider {
  height: 1px;
  background: var(--theme-border);
  margin: 4px 24px 18px;
}

.pad-x {
  padding: 0 24px 22px;
}

.field-label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: #252b3d;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-card,
.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  min-height: 40px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
}

.check-card input,
.switch-line input,
.toggle-card input {
  width: auto;
}

body input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid #cfd6e4;
  border-radius: 5px;
  display: inline-grid;
  place-content: center;
  background: linear-gradient(180deg, #fff, #f7f9fc);
  box-shadow: inset 0 1px 2px rgba(49, 54, 74, 0.06);
  color: #fff;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.1s ease;
}

body input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(14% 44%, 0 58%, 39% 100%, 100% 17%, 84% 4%, 38% 69%);
  transform: scale(0);
  transform-origin: center;
  transition: transform 0.14s ease;
}

body input[type="checkbox"]:hover {
  border-color: #b9b2f4;
  box-shadow: 0 0 0 3px rgba(102, 88, 221, 0.07), inset 0 1px 2px rgba(49, 54, 74, 0.04);
}

body input[type="checkbox"]:checked {
  border-color: var(--theme-primary);
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  box-shadow: 0 7px 15px rgba(102, 88, 221, 0.22);
}

body input[type="checkbox"]:checked::before {
  transform: scale(1);
}

body input[type="checkbox"]:focus-visible {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 4px rgba(102, 88, 221, 0.16), 0 7px 15px rgba(102, 88, 221, 0.16);
}

body input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.check-card:has(input[type="checkbox"]:checked),
.switch-line:has(input[type="checkbox"]:checked),
.toggle-card:has(input[type="checkbox"]:checked) {
  border-color: #d6d1fb;
  background: #fbfaff;
  box-shadow: 0 8px 20px rgba(102, 88, 221, 0.07);
}

.switch-line {
  align-self: end;
}

.hint {
  margin: 0 0 10px;
  color: var(--theme-muted);
}

.settings-info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 24px 28px;
  padding: 14px 16px 16px;
  border: 1px solid #dce8fb;
  border-radius: 8px;
  background: #f7fbff;
  color: #47556d;
  overflow-wrap: anywhere;
}

.woocommerce-sync-note {
  margin-bottom: 28px;
}

.settings-info-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f1ff;
  color: var(--theme-secondary);
}

.settings-info-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.settings-info-box strong {
  display: block;
  margin-bottom: 5px;
  color: #1f2738;
  font-size: 13px;
}

.settings-info-box p {
  margin: 0;
  line-height: 1.9;
}

.meta-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.meta-chip-row code {
  direction: ltr;
  unicode-bidi: plaintext;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #e3e8f2;
  border-radius: 999px;
  background: #fff;
  color: #e43f5a;
  white-space: nowrap;
}

.localized-editor-shell {
  display: grid;
  gap: 12px;
}

.localized-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.localized-editor-heading .hint {
  margin-bottom: 0;
}

.localized-editor {
  display: grid;
  gap: 12px;
}

.localized-row {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.localized-row-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, auto);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.localized-row-title strong,
.localized-row-title small {
  display: block;
}

.localized-row-title strong {
  color: #252b3d;
}

.localized-row-title small {
  margin-top: 4px;
  color: var(--theme-muted);
  direction: ltr;
  text-align: start;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.localized-row-actions {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 38px;
  gap: 8px;
  align-items: end;
}

.localized-row-actions label:only-child {
  grid-column: 1 / -1;
}

.localized-row-actions input {
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  font-size: 12px;
}

.localized-row-actions input[readonly] {
  background: #f4f6fa;
  color: #7b8799;
}

.localized-language-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.localized-language-field textarea {
  min-height: 118px;
  line-height: 1.8;
}

.feature-grid {
  align-items: start;
}

.toggle-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.toggle-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}

.toggle-card:hover {
  border-color: #d6d1fb;
  background: #fbfaff;
}

.toggle-card strong,
.toggle-card small {
  display: block;
}

.toggle-card small {
  color: var(--theme-muted);
  margin-top: 2px;
}

.sticky-save {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(245, 246, 248, 0), var(--theme-body-bg) 35%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--theme-border);
  text-align: start;
  vertical-align: middle;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  color: #31364a;
  background: #fbfcfe;
}

th.sortable-column {
  padding: 0;
}

.table-sort-control,
.table-sort-button {
  appearance: none;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  cursor: pointer;
  font-weight: 800;
  text-align: start;
  text-transform: inherit;
  letter-spacing: 0;
  user-select: none;
}

.table-sort-control:hover,
.table-sort-control:focus-visible,
.table-sort-button:hover,
.table-sort-button:focus-visible {
  background: #f0edff;
  color: var(--theme-primary);
  outline: none;
}

.table-sort-label {
  min-width: 0;
}

.table-sort-indicator {
  position: relative;
  flex: 0 0 10px;
  width: 10px;
  height: 14px;
  opacity: 0.75;
}

.table-sort-indicator::before,
.table-sort-indicator::after {
  content: "";
  position: absolute;
  inset-inline-start: 1px;
  border-inline-start: 4px solid transparent;
  border-inline-end: 4px solid transparent;
}

.table-sort-indicator::before {
  top: 1px;
  border-block-end: 5px solid #a8b2c3;
}

.table-sort-indicator::after {
  top: 8px;
  border-block-start: 5px solid #a8b2c3;
}

th[aria-sort="ascending"] .table-sort-indicator::before {
  border-block-end-color: var(--theme-primary);
}

th[aria-sort="ascending"] .table-sort-indicator::after,
th[aria-sort="descending"] .table-sort-indicator::before {
  opacity: 0.28;
}

th[aria-sort="descending"] .table-sort-indicator::after {
  border-block-start-color: var(--theme-primary);
}

.table-pagination {
  min-height: 58px;
  padding: 12px 18px;
  border-top: 1px solid var(--theme-border);
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 12px;
  background: #fbfcfe;
}

.table-pagination[hidden] {
  display: none;
}

.table-pagination-size,
.table-pagination-nav,
.table-pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.table-pagination-size {
  color: #667186;
  font-size: 12px;
  font-weight: 700;
}

.table-pagination-size select {
  width: 88px;
  min-height: 32px;
  padding: 0.35rem 0.55rem;
  font-size: 12px;
}

.table-pagination-pages {
  justify-content: center;
  flex-wrap: wrap;
}

.table-pagination-nav {
  justify-content: flex-end;
  color: #667186;
  font-size: 12px;
  font-weight: 700;
}

.table-page-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid #dfe4ee;
  border-radius: 7px;
  background: #fff;
  color: #657186;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.table-page-btn:hover,
.table-page-btn:focus-visible,
.table-page-btn.is-active {
  border-color: #cfc9fb;
  background: #f0edff;
  color: var(--theme-primary);
  outline: none;
}

.table-page-btn.is-active {
  background: var(--theme-primary);
  color: #fff;
}

.table-page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.table-page-gap {
  color: var(--theme-muted);
  padding: 0 2px;
}

.card-title-tools .filter-trigger {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  border-color: #dfe4ee;
  background: #f7f8fb;
  color: #657186;
  box-shadow: none;
}

.card-title-tools .filter-trigger:hover,
.card-title-tools .filter-trigger:focus-visible {
  border-color: #cfc9fb;
  background: #f0edff;
  color: var(--theme-primary);
}

.card-title-tools .filter-trigger svg {
  width: 15px;
  height: 15px;
}

.card-title-tools .filter-trigger.is-active {
  border-color: #cfc9fb;
  background: var(--theme-primary);
  color: #fff;
}

td small {
  display: block;
  color: #96a1b6;
}

code {
  color: var(--theme-danger);
  background: #f6f7fb;
  padding: 3px 6px;
  border-radius: 4px;
}

.code-field {
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2f7;
  color: #657186;
}

.status.active {
  background: #ddf5f0;
  color: #0f8d74;
}

.status.owner,
.status.finance,
.status.support,
.status.sales,
.status.viewer {
  background: #f0edff;
  color: var(--theme-primary);
}

.status.available {
  background: #ddf5f0;
  color: #0f8d74;
}

.status.draft {
  background: #fef4e4;
  color: #c27e12;
}

.status.disabled {
  background: #fde6e9;
  color: #b93749;
}

.status.paid,
.status.delivered,
.status.success,
.status.sent,
.status.ok {
  background: #ddf5f0;
  color: #0f8d74;
}

.status.pending,
.status.receipt_pending,
.status.scheduled,
.status.queued,
.status.open,
.status.running,
.status.paused,
.status.warn {
  background: #fef4e4;
  color: #c27e12;
}

.status.answered,
.status.skipped {
  background: #ddf5f0;
  color: #0f8d74;
}

.status.closed {
  background: #eef2f7;
  color: #657186;
}

.status.failed,
.status.rejected,
.status.banned,
.status.expired,
.status.canceled,
.status.fail {
  background: #fde6e9;
  color: #b93749;
}

.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

.inline-reject {
  display: inline-flex;
  gap: 6px;
}

.inline-reject input {
  width: 120px;
  min-height: 32px;
  padding: 0.35rem 0.5rem;
  font-size: 12px;
}

.wallet-form {
  min-width: 430px;
  display: grid;
  grid-template-columns: 92px 92px minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.admin-edit-form {
  min-width: 280px;
  display: grid;
  grid-template-columns: 100px 100px auto;
  gap: 6px;
  align-items: center;
}

.wallet-form input,
.wallet-form select,
.admin-edit-form select {
  min-height: 32px;
  padding: 0.35rem 0.5rem;
  font-size: 12px;
}

.customer-actions {
  white-space: nowrap;
}

.customer-actions form {
  margin: 0;
}

.user-detail-list {
  padding: 0;
}

.user-detail-list div:first-child {
  padding-top: 0;
}

.modal-code-block {
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #f8fafc;
  color: #2b3145;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.8;
}

.modal-empty {
  margin: 0;
}

.admin-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  white-space: nowrap;
}

.admin-actions form {
  margin: 0;
}

.admin-actions .btn[disabled] {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.money-cell {
  font-weight: 800;
  color: #31364a;
}

.compact-details {
  padding-top: 4px;
}

.support-grid {
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.ticket-list {
  display: grid;
  gap: 0;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--theme-border);
  color: var(--theme-body-color);
}

.ticket-row:hover,
.ticket-row.active {
  background: #f7f5ff;
  color: var(--theme-primary);
}

.ticket-row strong,
.ticket-row small,
.message-head strong,
.message-head small {
  display: block;
}

.ticket-row small,
.message-head small {
  color: var(--theme-muted);
}

.ticket-meta {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--theme-border);
}

.ticket-meta span {
  display: block;
  color: var(--theme-muted);
  font-size: 12px;
}

.message-thread {
  padding: 20px 24px;
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
}

.message-bubble {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.message-bubble.admin {
  background: #f0edff;
  border-color: #d9d3fb;
}

.message-bubble.user {
  background: #fbfcfe;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.message-bubble p {
  margin: 0;
  white-space: normal;
}

.support-action-form {
  margin-top: 12px;
}

.broadcast-list {
  display: grid;
  gap: 8px;
  padding: 0 24px 24px;
}

.campaign-detail {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--theme-border);
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-metrics div {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}

.mini-metrics span {
  display: block;
  color: var(--theme-muted);
  font-size: 12px;
}

.mini-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.message-preview {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.message-preview p {
  margin: 10px 0 0;
  line-height: 1.9;
  color: #48536a;
}

.menu-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.menu-editor-row {
  display: grid;
  grid-template-columns: 34px minmax(120px, 0.8fr) minmax(150px, 1fr) 86px 140px auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fbfcfe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.menu-editor-row.is-dragging {
  opacity: 0.58;
  border-color: #cfc9fb;
  box-shadow: 0 12px 30px rgba(37, 43, 61, 0.14);
}

.menu-editor-row input,
.menu-editor-row select,
.menu-editor-row textarea {
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  font-size: 12px;
}

.icon-mini {
  width: 34px;
  height: 34px;
  border: 1px solid var(--theme-border);
  border-radius: 7px;
  background: #fff;
  color: #657186;
  cursor: pointer;
}

.icon-mini svg {
  width: 17px;
  height: 17px;
  display: block;
  margin: auto;
  fill: currentColor;
}

.menu-drag-handle {
  color: #6d5dfc;
  cursor: grab;
  touch-action: none;
}

.menu-drag-handle:active {
  cursor: grabbing;
}

.mini-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: auto;
  font-size: 12px;
}

.mini-check input {
  width: auto;
}

.mini-check span {
  margin: 0;
  font-weight: 700;
}

.menu-editor-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-style-field {
  display: grid;
  gap: 7px;
  align-self: end;
}

.menu-style-field > span {
  display: block;
  margin-bottom: 0;
  font-weight: 600;
  color: #252b3d;
}

.menu-style-picker {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
}

.menu-style-swatch {
  position: relative;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  padding: 0;
  color: var(--theme-body-color);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.menu-style-swatch span {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(37, 43, 61, 0.08);
}

.menu-style-swatch.swatch-default span {
  background: linear-gradient(135deg, #f7f8fb 0 48%, #dfe4ee 48% 52%, #fff 52% 100%);
}

.menu-style-swatch.swatch-primary span {
  background: #4a81d4;
}

.menu-style-swatch.swatch-success span {
  background: var(--theme-success);
}

.menu-style-swatch.swatch-danger span {
  background: var(--theme-danger);
}

.menu-style-swatch:hover,
.menu-style-swatch:focus-visible,
.menu-style-swatch.is-selected {
  border-color: #cfc9fb;
  background: #f5f3ff;
}

.menu-style-swatch.is-selected {
  box-shadow: 0 0 0 3px rgba(102, 88, 221, 0.12);
}

.menu-remove-btn {
  border-color: #f7bdc7;
  background: #fff;
  color: var(--theme-danger);
}

.menu-remove-btn:hover,
.menu-remove-btn:focus-visible {
  border-color: var(--theme-danger);
  background: #fde6e9;
  color: var(--theme-danger);
}

.menu-config-btn {
  border-color: #dfe4ee;
  background: #f7f8fb;
  color: var(--theme-primary);
}

.menu-config-btn:hover,
.menu-config-btn:focus-visible {
  border-color: #cfc9fb;
  background: #f0edff;
  color: var(--theme-primary);
}

.menu-action-modal {
  width: min(100%, 1040px);
}

.gateway-form {
  align-items: start;
}

.gateway-fieldset {
  border: 1px dashed #dfe4ee;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.gateway-fieldset-title {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.gateway-fieldset-title strong {
  color: #252b3d;
}

.gateway-fieldset-title small {
  color: var(--theme-muted);
}

.gateway-support-list,
.gateway-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.gateway-support-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
}

.gateway-support-item strong {
  color: #252b3d;
}

.gateway-support-item span,
.gateway-support-item small {
  color: var(--theme-muted);
}

.gateway-item {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.gateway-item summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 14px 16px;
  list-style: none;
}

.gateway-item summary::-webkit-details-marker {
  display: none;
}

.gateway-item summary span {
  display: grid;
  gap: 4px;
}

.gateway-item summary strong {
  color: #252b3d;
}

.gateway-item summary small {
  color: var(--theme-muted);
}

.gateway-item form {
  border-top: 1px solid var(--theme-border);
}

.channel-section-card {
  margin-bottom: 18px;
}

.channel-section-card .card-header p {
  margin: 6px 0 0;
  color: var(--theme-muted);
  line-height: 1.8;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px;
}

.channel-card {
  min-height: 248px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--theme-shadow);
}

.channel-card.is-planned {
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.channel-card-head,
.channel-card-footer,
.channel-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-card-head,
.channel-card-footer {
  justify-content: space-between;
}

.channel-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.embedded-form-grid {
  padding: 0;
}

.instagram-login-panel {
  min-height: 118px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dfe4ee;
  border-radius: 8px;
  background: #fff;
}

.instagram-login-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.instagram-login-copy {
  display: grid;
  gap: 5px;
}

.instagram-login-copy strong {
  color: #252b3d;
  font-size: 15px;
}

.instagram-login-copy p {
  margin: 0;
  color: var(--theme-muted);
  line-height: 1.8;
}

.instagram-login-panel small {
  color: var(--theme-muted);
  font-size: 11px;
}

.instagram-advanced {
  border: 1px dashed #d8deea;
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.instagram-advanced summary {
  min-height: 44px;
  padding: 11px 14px;
  cursor: pointer;
  color: #566176;
  font-weight: 800;
}

.instagram-advanced[open] {
  padding-bottom: 14px;
}

.instagram-advanced .instagram-oauth-box {
  display: none;
}

@media (max-width: 760px) {
  .instagram-login-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

.channel-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef2ff;
  color: var(--theme-primary);
  font-weight: 900;
  direction: ltr;
  overflow: hidden;
}

.channel-avatar img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.channel-telegram { background: #e8f6fd; color: #229ed9; }
.channel-bale { background: #e8fbf3; color: #0a9b75; }
.channel-rubika { background: #f1edff; color: #6b4eff; }
.channel-eitaa { background: #fff7ed; color: #d97706; }
.channel-gap { background: #ecfdf5; color: #0f766e; }
.channel-instagram { background: #fdf2f8; color: #e1306c; }
.channel-facebook { background: #eff6ff; color: #1877f2; }
.channel-linkedin { background: #eff6ff; color: #0a66c2; }
.channel-x,
.channel-tiktok { background: #f3f4f6; color: #111827; }
.channel-aparat { background: #fff1f2; color: #ed145b; }
.channel-youtube { background: #fef2f2; color: #ff0000; }
.channel-pinterest { background: #fef2f2; color: #bd081c; }
.channel-tumblr { background: #f1f5f9; color: #35465c; }

.channel-card-copy {
  display: grid;
  gap: 5px;
}

.channel-card-copy h2 {
  margin: 0;
  color: #252b3d;
  font-size: 16px;
}

.channel-card-copy span,
.channel-card-copy p,
.channel-card-footer small {
  color: var(--theme-muted);
}

.channel-card-copy p {
  margin: 0;
  line-height: 1.8;
}

.channel-chip-row {
  flex-wrap: wrap;
}

.channel-chip-row span {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f5fa;
  color: #566176;
  font-size: 11px;
  font-weight: 800;
}

.bot-platform-card.is-disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.bot-platform-card.is-disabled input {
  cursor: not-allowed;
}

.bot-platform-icon > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef2ff;
  color: var(--theme-primary);
  font-weight: 900;
}

.bot-platform-icon.telegram > span { background: #e8f6fd; color: #229ed9; }
.bot-platform-icon.bale > span { background: #e8fbf3; color: #0a9b75; }
.bot-platform-icon.rubika > span { background: #f1edff; color: #6b4eff; }
.bot-platform-icon.eitaa > span { background: #fff7ed; color: #d97706; }
.bot-platform-icon.gap > span { background: #ecfdf5; color: #0f766e; }

.integration-hero {
  min-height: 116px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid #e4e8f0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(102, 88, 221, 0.08), rgba(67, 191, 229, 0.08)),
    #fff;
  box-shadow: var(--theme-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.integration-hero strong {
  display: block;
  color: #252b3d;
  font-size: 18px;
  margin-bottom: 6px;
}

.integration-hero p {
  max-width: 760px;
  margin: 0;
  color: #657186;
  line-height: 1.9;
}

.integration-hero-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--theme-primary);
  box-shadow: 0 14px 32px rgba(102, 88, 221, 0.14);
}

.integration-hero-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.integration-filter-card {
  position: relative;
  min-height: 88px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--theme-shadow);
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) auto repeat(3, minmax(150px, 0.6fr)) auto auto;
  align-items: end;
  gap: 12px;
}

.integration-filter-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 20px;
  inset-inline-end: 20px;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--theme-primary), transparent);
  opacity: 0;
  transform: scaleX(0.35);
  transform-origin: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.integration-filter-card.is-loading::after {
  opacity: 1;
  transform: scaleX(1);
}

.integration-grid.is-loading {
  opacity: 0.72;
  transition: opacity 0.12s ease;
}

.integration-search-field {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  background: #fff;
  padding: 0 12px;
}

.integration-search-field svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: #a5afbf;
}

.integration-search-field input {
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 38px;
}

.integration-filter-label {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: #465066;
  font-weight: 800;
  white-space: nowrap;
}

.integration-filter-card label {
  display: grid;
  gap: 6px;
}

.integration-filter-card label span {
  margin: 0;
  color: #657186;
  font-size: 12px;
}

.integration-filter-card select {
  min-height: 40px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.integration-card {
  --integration-accent: var(--theme-primary);
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--theme-shadow);
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 28px 24px 0;
}

.integration-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--integration-accent) 20%, #fff), transparent 58%),
    linear-gradient(180deg, color-mix(in srgb, var(--integration-accent) 10%, #fff), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.integration-logo-wrap,
.integration-copy,
.integration-actions,
.integration-meta,
.integration-state {
  position: relative;
}

.integration-logo-wrap {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--integration-accent) 12%, #fff);
  margin-bottom: 16px;
}

.integration-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
}

.integration-logo svg {
  width: 58px;
  height: 58px;
  display: block;
  overflow: visible;
}

.integration-logo svg text {
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

.integration-copy {
  width: 100%;
  text-align: center;
  display: grid;
  gap: 6px;
}

.integration-copy h2 {
  margin: 0;
  color: #252b3d;
  font-size: 17px;
}

.integration-copy span {
  color: #8c98ad;
  font-weight: 700;
  font-size: 12px;
}

.integration-copy p {
  min-height: 54px;
  margin: 4px 0 0;
  color: #657186;
  line-height: 1.8;
}

.integration-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 24px;
  border-bottom: 1px dashed #dfe4ee;
}

.integration-meta {
  width: calc(100% + 48px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 22px 20px;
}

.integration-meta div {
  min-width: 0;
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.integration-meta strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #252b3d;
  font-size: 13px;
}

.integration-meta span {
  color: #98a3b7;
  font-size: 12px;
}

.integration-state {
  position: absolute;
  inset-block-start: 18px;
  inset-inline-start: 18px;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #fef4e4;
  color: #c27e12;
}

.integration-state.active {
  background: #ddf5f0;
  color: #0f8d74;
}

.integration-modal {
  width: min(100%, 820px);
}

.integration-management-card {
  margin-top: 18px;
}

.route-profile-modal {
  width: min(100%, 900px);
}

.route-channel-form {
  padding: 22px 24px;
  display: grid;
  gap: 22px;
}

.route-channel-section {
  display: grid;
  gap: 12px;
}

.route-channel-section h3 {
  margin: 0;
  color: #252b3d;
  font-size: 15px;
}

.route-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.route-channel-item {
  min-height: 118px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fff;
}

.route-channel-item select {
  grid-column: 1 / -1;
}

.route-channel-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.route-channel-copy strong,
.route-channel-copy small {
  display: block;
  margin: 0;
}

.route-channel-copy strong {
  color: #252b3d;
}

.route-channel-copy small,
.muted-text {
  color: var(--theme-muted);
  font-size: 12px;
}

.integration-modal .settings-info-box {
  margin: 4px 0 10px;
}

.integration-modal .woocommerce-sync-note.full {
  grid-column: 1 / -1;
}

.integration-empty {
  grid-column: 1 / -1;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed #dfe4ee;
  border-radius: 8px;
  background: #fff;
  color: var(--theme-muted);
  font-weight: 700;
}

.menu-action-body {
  display: grid;
  gap: 18px;
}

.menu-action-body .form-grid {
  padding: 0;
}

.action-picker-field {
  display: grid;
  gap: 8px;
}

.action-picker {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fbfcfe;
}

.action-picker-selected {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #dfe4ee;
  border-radius: 8px;
  background: #fff;
  color: #252b3d;
  font-size: 12px;
}

.action-picker-selected strong {
  font-size: 13px;
}

.action-picker-selected span {
  color: var(--theme-muted);
  font-size: 11px;
}

.action-picker-search {
  min-height: 38px;
}

.action-picker-results {
  max-height: 340px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-inline-end: 4px;
}

.action-picker-group {
  display: grid;
  gap: 6px;
}

.action-picker-group-title {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 5px 2px;
  background: #fbfcfe;
  color: #657186;
  font-size: 11px;
  font-weight: 800;
}

.action-picker-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(110px, 0.7fr);
  gap: 4px 12px;
  align-items: center;
  text-align: start;
  padding: 9px 10px;
  border: 1px solid #dfe4ee;
  border-radius: 8px;
  background: #fff;
  color: #252b3d;
  cursor: pointer;
}

.action-picker-item strong {
  font-size: 13px;
}

.action-picker-item span {
  color: var(--theme-muted);
  font-size: 11px;
  text-align: left;
}

.action-picker-item small {
  grid-column: 1 / -1;
  color: #7d8798;
  line-height: 1.7;
}

.action-picker-item:hover,
.action-picker-item:focus-visible,
.action-picker-item.is-selected {
  border-color: #cfc9fb;
  background: #f6f4ff;
}

.action-picker-item.is-selected {
  box-shadow: 0 0 0 3px rgba(102, 88, 221, 0.1);
}

.action-picker-empty {
  padding: 16px;
  border: 1px dashed #dfe4ee;
  border-radius: 8px;
  color: var(--theme-muted);
  text-align: center;
  background: #fff;
}

.submenu-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.submenu-editor-head strong,
.submenu-editor-head small {
  display: block;
}

.submenu-editor-head strong {
  color: #252b3d;
}

.submenu-editor-head small {
  margin-top: 3px;
  color: var(--theme-muted);
}

.submenu-list,
.submenu-children {
  display: grid;
  gap: 10px;
}

.submenu-children {
  margin-top: 10px;
  margin-inline-start: 24px;
  padding-inline-start: 14px;
  border-inline-start: 2px dashed #dfe4ee;
}

.submenu-item {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.submenu-item-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(140px, 1fr) minmax(150px, 0.9fr) minmax(140px, 0.9fr) 140px 86px;
  gap: 10px;
  align-items: end;
}

.submenu-item-fields .full {
  grid-column: 1 / -1;
}

.submenu-item-fields input,
.submenu-item-fields select,
.submenu-item-fields textarea {
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  font-size: 12px;
}

.submenu-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.error-cell {
  max-width: 260px;
  color: #9a6070;
  font-size: 12px;
}

.empty {
  text-align: center;
  color: var(--theme-muted);
  padding: 28px;
}

.capacity-summary {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.capacity-summary div {
  min-height: 92px;
  border: 1px dashed var(--theme-border);
  border-radius: 8px;
  display: grid;
  align-content: center;
  justify-items: center;
  background: #fbfcfe;
}

.capacity-summary strong {
  font-size: 28px;
  color: #31364a;
}

.capacity-summary span {
  color: var(--theme-muted);
}

@media (max-width: 1100px) {
  .skeleton-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.three,
  .feature-grid,
  .stats-grid,
  .integration-filter-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bot-create-shell {
    grid-template-columns: 1fr;
  }

  .integration-hero,
  .builder-menu-layout,
  .integration-filter-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .integration-hero {
    flex-direction: column;
  }

  .bot-help-card {
    position: static;
  }

  .bot-preview-card {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-skeleton {
    grid-template-columns: 1fr;
  }

  .app-skeleton-sidebar {
    display: none;
  }

  .skeleton-topbar-search {
    width: min(280px, 46vw);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: block;
    border: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    background: rgba(49, 54, 74, 0.28);
    transition: opacity 0.2s ease;
  }

  .sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .sidenav {
    transform: translateX(105%);
    transition: transform 0.2s ease;
  }

  [dir="ltr"] .sidenav {
    transform: translateX(-105%);
  }

  .sidebar-open .sidenav {
    transform: translateX(0);
  }

  .main {
    margin-inline-start: 0;
  }

  .search-box {
    min-width: 180px;
  }

  .topbar {
    padding: 0 14px;
  }
}

@media (max-width: 680px) {
  .skeleton-stats-grid,
  .skeleton-lower-grid {
    grid-template-columns: 1fr;
  }

  .app-skeleton-topbar {
    height: auto;
    min-height: var(--topbar-height);
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .skeleton-topbar-search,
  .skeleton-chip {
    width: min(240px, 68vw);
  }

  .grid.two,
  .grid.three,
  .feature-grid,
  .support-grid,
  .stats-grid,
  .capacity-summary,
  .license-summary,
  .bot-token-row,
  .form-grid,
  .localized-row-head,
  .localized-language-grid {
    grid-template-columns: 1fr;
  }

  .inline-filter {
    grid-template-columns: 1fr;
  }

  .inline-filter.wide,
  .inline-filter.report-filter,
  .wallet-form,
  .admin-edit-form,
  .menu-editor-row,
  .submenu-item-fields,
  .bot-platform-grid,
  .table-pagination {
    grid-template-columns: 1fr;
  }

  .submenu-editor-head,
  .submenu-item-actions,
  .builder-menu-header,
  .bot-preview-head,
  .localized-editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .builder-tab-list,
  .preview-device-switch {
    width: 100%;
    overflow-x: auto;
  }

  .builder-tab-button,
  .preview-device-switch button {
    flex: 1;
    white-space: nowrap;
  }

  .builder-tab-panels {
    padding: 18px;
  }

  .bot-phone-preview {
    width: min(100%, 300px);
  }

  .localized-row-actions {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .submenu-children {
    margin-inline-start: 0;
  }

  .table-pagination-pages,
  .table-pagination-nav {
    justify-content: flex-start;
  }

  .login-card,
  .install-card {
    padding: 28px 20px;
  }

  .page-title,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ticket-meta {
    grid-template-columns: 1fr;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    min-width: 0;
    flex: 1;
  }
}
