@import url('./wallpaper-borhe-nt-preview.css');

:root {
  color-scheme: light;
  font-family: "Vazirmatn", "IRANSans", sans-serif;
  --color-bg: #f4f6fb;
  --color-bg-soft: #eef2ff;
  --color-surface: #ffffff;
  --color-surface-soft: #f8faff;
  --color-surface-elevated: #fdfdff;
  --color-border: #e1e7f0;
  --color-border-soft: rgba(148, 163, 184, 0.18);
  --color-muted: #64748b;
  --color-text: #0f172a;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-shadow-soft: rgba(15, 23, 42, 0.12);
  --color-input-bg: #f8fafc;
}

body {
  --color-primary: #239799;
  --color-primary-soft: rgba(35, 151, 153, 0.12);
  --color-primary-strong: rgba(35, 151, 153, 0.28);
  --analytics-chart-fill: rgba(35, 151, 153, 0.55);
  --analytics-chart-stroke: #1b787a;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

body[data-accent="borhe"],
body[data-accent="rose"] {
  --color-primary: #a91859;
  --color-primary-soft: rgba(169, 24, 89, 0.12);
  --color-primary-strong: rgba(169, 24, 89, 0.28);
  --analytics-chart-fill: rgba(169, 24, 89, 0.5);
  --analytics-chart-stroke: #a91859;
}

body[data-accent="calmBlue"] {
  --color-primary: #53b1fd;
  --color-primary-soft: rgba(83, 177, 253, 0.12);
  --color-primary-strong: rgba(83, 177, 253, 0.28);
  --analytics-chart-fill: rgba(83, 177, 253, 0.55);
  --analytics-chart-stroke: #3c8fe6;
}

body[data-accent="webOrange"] {
  --color-primary: #ffa300;
  --color-primary-soft: rgba(255, 163, 0, 0.12);
  --color-primary-strong: rgba(255, 163, 0, 0.28);
  --analytics-chart-fill: rgba(255, 163, 0, 0.55);
  --analytics-chart-stroke: #e68f00;
}

body[data-accent="cherry"] {
  --color-primary: #d20a2e;
  --color-primary-soft: rgba(210, 10, 46, 0.12);
  --color-primary-strong: rgba(210, 10, 46, 0.28);
  --analytics-chart-fill: rgba(210, 10, 46, 0.5);
  --analytics-chart-stroke: #a50825;
}

body[data-accent="seaGreen"] {
  --color-primary: #2e8b57;
  --color-primary-soft: rgba(46, 139, 87, 0.12);
  --color-primary-strong: rgba(46, 139, 87, 0.28);
  --analytics-chart-fill: rgba(46, 139, 87, 0.5);
  --analytics-chart-stroke: #227546;
}

body[data-accent="violetBlue"],
body[data-accent="purple"] {
  --color-primary: #6a5acd;
  --color-primary-soft: rgba(106, 90, 205, 0.12);
  --color-primary-strong: rgba(106, 90, 205, 0.28);
  --analytics-chart-fill: rgba(106, 90, 205, 0.55);
  --analytics-chart-stroke: #5749b0;
}

body[data-accent="proBlue"],
body[data-accent="blue"] {
  --color-primary: #2d8cda;
  --color-primary-soft: rgba(45, 140, 218, 0.12);
  --color-primary-strong: rgba(45, 140, 218, 0.28);
  --analytics-chart-fill: rgba(45, 140, 218, 0.55);
  --analytics-chart-stroke: #2474b8;
}

body[data-accent="yourBorhe"] {
  --color-primary: #239799;
  --color-primary-soft: rgba(35, 151, 153, 0.12);
  --color-primary-strong: rgba(35, 151, 153, 0.28);
  --analytics-chart-fill: rgba(35, 151, 153, 0.55);
  --analytics-chart-stroke: #1b787a;
}

body[data-accent="iranianPink"] {
  --color-primary: #f77fbe;
  --color-primary-soft: rgba(247, 127, 190, 0.12);
  --color-primary-strong: rgba(247, 127, 190, 0.28);
  --analytics-chart-fill: rgba(247, 127, 190, 0.55);
  --analytics-chart-stroke: #e056a3;
}

body[data-accent="neutral"] {
  --color-primary: #475569;
  --color-primary-soft: rgba(71, 85, 105, 0.12);
  --color-primary-strong: rgba(71, 85, 105, 0.28);
  --color-success: #64748b;
  --analytics-chart-fill: rgba(100, 116, 139, 0.42);
  --analytics-chart-stroke: #475569;
}

body.is-admin-dark[data-accent="neutral"] {
  --color-primary: #94a3b8;
  --color-primary-soft: rgba(148, 163, 184, 0.16);
  --color-primary-strong: rgba(148, 163, 184, 0.32);
  --color-success: #94a3b8;
  --analytics-chart-fill: rgba(148, 163, 184, 0.4);
  --analytics-chart-stroke: #cbd5e1;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0b111c;
  --color-bg-soft: #10182b;
  --color-surface: #141b2f;
  --color-surface-soft: #18223a;
  --color-surface-elevated: #1d2742;
  --color-border: rgba(148, 163, 184, 0.35);
  --color-border-soft: rgba(148, 163, 184, 0.22);
  --color-muted: #aeb7cb;
  --color-text: #f2f5fb;
  --color-shadow-soft: rgba(0, 0, 0, 0.55);
  --color-input-bg: #0f1423;
}

body[data-theme="ink"] {
  color-scheme: dark;
  --color-bg: #1a1a1a;
  --color-bg-soft: #1e1e1e;
  --color-surface: #1e1e1e;
  --color-surface-soft: #292929;
  --color-surface-elevated: #2d2d2d;
  --color-border: rgba(240, 240, 240, 0.14);
  --color-border-soft: rgba(240, 240, 240, 0.08);
  --color-muted: #b4b4b4;
  --color-text: #f0f0f0;
  --color-shadow-soft: rgba(0, 0, 0, 0.45);
  --color-input-bg: #161616;
}

body[data-theme="void"] {
  color-scheme: dark;
  --color-bg: #0a0a0a;
  --color-bg-soft: #0f0f0f;
  --color-surface: #0f0f0f;
  --color-surface-soft: #1d1d1d;
  --color-surface-elevated: #222222;
  --color-border: rgba(219, 219, 219, 0.14);
  --color-border-soft: rgba(219, 219, 219, 0.08);
  --color-muted: #a3a3a3;
  --color-text: #dbdbdb;
  --color-shadow-soft: rgba(0, 0, 0, 0.65);
  --color-input-bg: #0c0c0c;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  direction: rtl;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("./logo-group-pattern.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

body.is-admin-dark::before {
  filter: invert(1);
  opacity: 0.45;
}

body[data-theme="void"]::before {
  opacity: 0.28;
}

body.is-admin-bg-pattern-off::before {
  display: none;
}

body.is-admin-shadows-off {
  --color-shadow-soft: transparent;
}

body.is-admin-shadows-off,
body.is-admin-shadows-off .sidebar,
body.is-admin-shadows-off .sidebar-float-toggle,
body.is-admin-shadows-off * {
  box-shadow: none !important;
}

body.is-admin-shadows-off :is(a, button, input, select, textarea):focus-visible {
  box-shadow: 0 0 0 3px var(--color-primary-soft) !important;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view[hidden] {
  display: none !important;
}

.view--auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.auth-card {
  background: var(--color-surface);
  border-radius: 24px;
  padding: 40px;
  width: min(420px, 100%);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.auth-card__logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--color-primary);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto;
  font-weight: 700;
  font-size: 20px;
}

.auth-card__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.auth-card__subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--color-muted);
}

.auth-card__hint {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--color-muted);
  text-align: right;
}

.auth-form input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  background: var(--color-input-bg);
  color: var(--color-text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

button {
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

.primary-button {
  background: var(--color-primary);
  color: #fff;
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.primary-button--sm {
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 10px;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px var(--color-primary-soft);
}

.primary-button--danger {
  background: #dc2626;
}

.primary-button--danger:hover {
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.28);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: wait;
  box-shadow: none;
}

.primary-button[data-loading="true"]::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.ghost-button {
  border-radius: 16px;
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.ghost-button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.ghost-button.danger {
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

.ghost-button.danger:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.ghost-button--sm {
  padding: 6px 12px;
  border-radius: 10px;
}

.ghost-button--icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 0;
}

.ghost-button--icon .isax {
  width: 18px;
  height: 18px;
}

.isax-close {
  transform: rotate(45deg);
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.field-with-isax {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.field-with-isax > .isax {
  position: absolute;
  inset-inline-start: 12px;
  width: 16px;
  height: 16px;
  color: var(--color-muted);
  pointer-events: none;
}

.field-with-isax > input {
  width: 100%;
  padding-inline-start: 36px !important;
}

.login-error {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #b91c1c;
  font-size: 13px;
}

.view--shell {
  --admin-sidebar-rail: 80px;
  --admin-sidebar-expanded: 272px;
  --admin-sidebar-inset: 18px;
  --admin-sidebar-gap: 18px;
  display: block;
  min-height: 100vh;
}

.sidebar {
  width: var(--admin-sidebar-rail);
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 16px;
  overflow: visible;
  position: fixed;
  z-index: 40;
  top: var(--admin-sidebar-inset);
  bottom: var(--admin-sidebar-inset);
  inset-inline-start: var(--admin-sidebar-inset);
  height: auto;
  border-radius: 24px;
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.05);
}

body.is-admin-sidebar-expanded .sidebar {
  width: var(--admin-sidebar-expanded);
  padding: 20px 16px;
}

body.is-admin-dark .sidebar {
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.42),
    0 2px 8px rgba(0, 0, 0, 0.24);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  width: 100%;
}

body.is-admin-sidebar-expanded .sidebar__brand {
  justify-content: flex-start;
  gap: 12px;
}

.sidebar-float-toggle .isax,
.sidebar__rail-toggle .isax {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

.sidebar__rail-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: color-mix(in srgb, var(--color-muted) 16%, var(--color-surface));
  color: var(--color-muted);
  cursor: pointer;
}

.sidebar__rail-toggle .isax {
  transform: rotate(180deg);
}

body.is-admin-sidebar-expanded .sidebar__rail-toggle {
  width: 100%;
}

body.is-admin-sidebar-expanded .sidebar__rail-toggle .isax {
  transform: none;
}

.sidebar__rail-toggle:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.sidebar-float-toggle {
  display: grid;
  position: fixed;
  inset-inline-start: var(--admin-sidebar-inset, 18px);
  top: 50%;
  z-index: 40;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--color-border-soft);
  border-radius: 24px;
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.14),
    0 2px 8px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) scale(0.92);
}

.sidebar-float-toggle:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

body.is-admin-sidebar-collapsed .sidebar {
  width: var(--admin-sidebar-rail);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + var(--admin-sidebar-inset) + 16px));
}

html[dir="ltr"] body.is-admin-sidebar-collapsed .sidebar {
  transform: translateX(calc(-100% - var(--admin-sidebar-inset) - 16px));
}

body.is-admin-sidebar-collapsed .sidebar-float-toggle {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

body.admin-sidebar-ready .sidebar {
  transition:
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease;
}

body.admin-sidebar-ready .sidebar-float-toggle {
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s ease;
}

body.admin-sidebar-ready .workspace {
  transition: padding-inline-start 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

body.admin-sidebar-ready.is-admin-sidebar-collapsed .sidebar-float-toggle {
  transition-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  body.admin-sidebar-ready .sidebar,
  body.admin-sidebar-ready .sidebar-float-toggle,
  body.admin-sidebar-ready .workspace {
    transition: none;
  }
}

.sidebar__logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar__company {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
}

body.is-admin-sidebar-expanded .sidebar__company {
  max-width: 180px;
  opacity: 1;
}

.sidebar__name {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  white-space: nowrap;
}

.sidebar__tagline {
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}

.sidebar__menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.sidebar__menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.is-admin-sidebar-expanded .sidebar__menu {
  align-items: stretch;
  scrollbar-width: thin;
}

.sidebar__settings {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

body.is-admin-sidebar-expanded .sidebar__settings {
  align-items: stretch;
}

.sidebar__settings .sidebar__divider {
  margin-top: 0;
}

.sidebar__settings .nav-item {
  width: 48px;
}

body.is-admin-sidebar-expanded .sidebar__settings .nav-item {
  width: 100%;
}

.sidebar__divider {
  border: none;
  border-top: 1px solid var(--color-border);
  width: 24px;
  margin: 8px auto;
}

body.is-admin-sidebar-expanded .sidebar__divider {
  width: 100%;
  margin: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 24px;
  color: var(--color-muted);
  background: color-mix(in srgb, var(--color-muted) 16%, var(--color-surface));
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease, width 0.32s cubic-bezier(0.22, 1, 0.36, 1), padding 0.32s ease;
}

body.is-admin-sidebar-expanded .nav-item {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
}

.nav-item:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.nav-item.is-active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

body.is-admin-sidebar-expanded .nav-item.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px var(--color-primary-soft);
}

.nav-item__icon {
  width: 24px;
  height: 24px;
  border-radius: 24px;
  background: transparent;
  display: grid;
  place-items: center;
  color: inherit;
  flex-shrink: 0;
}

body.is-admin-sidebar-expanded .nav-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 24px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

body.is-admin-sidebar-expanded .nav-item.is-active .nav-item__icon {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.nav-item__icon svg,
.nav-item__icon .isax {
  width: 18px;
  height: 18px;
}

body.is-admin-sidebar-expanded .nav-item__icon .isax {
  width: 16px;
  height: 16px;
}

.nav-item__text {
  flex: 1;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
}

body.is-admin-sidebar-expanded .nav-item__text {
  max-width: 180px;
  opacity: 1;
}

.sidebar__footer {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.sidebar__support {
  background: var(--color-primary-soft);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text);
}

.sidebar__support a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  min-height: 100vh;
  padding-inline-start: calc(var(--admin-sidebar-inset) + var(--admin-sidebar-rail) + var(--admin-sidebar-gap));
}

body.is-admin-sidebar-expanded .workspace {
  padding-inline-start: calc(var(--admin-sidebar-inset) + var(--admin-sidebar-expanded) + var(--admin-sidebar-gap));
}

body.is-admin-sidebar-collapsed .workspace {
  padding-inline-start: 0;
}

.workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
}

.workspace__title-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace__title-heading .isax {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.workspace__title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.workspace__title p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--color-muted);
}

.workspace__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

body[data-admin-page="settings"] .workspace__header {
  position: relative;
  justify-content: center;
  text-align: center;
}

body[data-admin-page="settings"] .workspace__title-heading {
  justify-content: center;
}

body[data-admin-page="settings"] .workspace__actions {
  position: absolute;
  inset-inline-end: 32px;
}

.settings-page {
  width: min(100%, 90rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  flex: 1 1 auto;
  min-height: 0;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 45px var(--color-shadow-soft);
}

.settings-group--account {
  flex: 0 0 auto;
}

.settings-group__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.settings-group__head .muted {
  margin: 4px 0 0;
}

.settings-identity {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.settings-identity__avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--color-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
}

.settings-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
  flex: 1;
  min-width: 0;
}

.settings-facts dt {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.settings-facts dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

.settings-group .ghost-button.danger {
  align-self: flex-start;
}

.settings-switch-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.settings-switch__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-switch__copy strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.settings-switch input {
  appearance: none;
  width: 44px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-muted) 28%, var(--color-surface-soft));
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease;
}

.settings-switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transition: inset-inline-start 0.18s ease;
}

.settings-switch input:checked {
  background: var(--color-primary);
}

.settings-switch input:checked::after {
  inset-inline-start: 23px;
}

.settings-switch input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

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

.settings-shortcut--wide {
  grid-column: 1 / -1;
}

.settings-shortcut {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  background: var(--color-surface-soft);
}

.settings-shortcut__keys {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.settings-shortcut__keys--mini {
  gap: 6px;
}

.settings-shortcut__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.settings-shortcut__copy strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.settings-shortcut__copy .muted {
  font-size: 13px;
  line-height: 1.6;
}

.settings-shortcut__scope {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.settings-shortcut__followups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
}

.settings-shortcut__followup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 12px;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--color-text) 14%, transparent);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.kbd--mod,
.kbd--wide {
  min-width: 64px;
  font-size: 12px;
  font-weight: 600;
}

.kbd--sm {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--color-text) 14%, transparent);
}

.kbd--sm.kbd--wide {
  min-width: 52px;
  font-weight: 600;
}

.kbd-plus {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

@media (max-width: 860px) {
  .settings-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .settings-identity {
    flex-direction: column;
  }

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

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

  .settings-shortcut {
    flex-wrap: wrap;
  }

  .settings-shortcut__scope {
    margin-top: 0;
  }
}

.theme-settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.theme-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-card {
  width: 80px;
  height: 88px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--color-text) 80%, transparent);
  background: var(--color-surface);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 8px 8px;
  box-sizing: border-box;
  text-align: right;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-card--mode-light {
  background: #ffffff;
  border: 1px solid #111827;
  color: #111827;
}

.theme-card--mode-dark {
  background: #1D2853;
  border: none;
  color: #f8fafc;
}

.theme-card--mode-ink {
  background: #1A1A1A;
  border: none;
  color: #F0F0F0;
}

.theme-card--mode-void {
  background: #0A0A0A;
  border: 1px solid rgba(219, 219, 219, 0.16);
  color: #DBDBDB;
}

.theme-card--color {
  background: var(--theme-card-bg, #2563eb);
  border: none;
  color: #ffffff;
  padding-top: 8px;
  padding-bottom: 8px;
}

.theme-card-name {
  display: block;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
}

.theme-card-name--mode {
  margin-inline-start: 0;
}

.theme-card-name--color {
  width: auto;
  max-width: 100%;
}

.theme-card-desc {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  width: auto;
  max-width: 100%;
  color: inherit;
}

.theme-card-desc--mode {
  margin-top: auto;
}

.theme-card--mode-dark .theme-card-desc,
.theme-card--mode-ink .theme-card-desc,
.theme-card--mode-void .theme-card-desc {
  color: rgba(241, 245, 249, 0.82);
}

.theme-card-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.theme-card--color .color-tag-code-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
}

.theme-card--color .color-tag-code-label,
.theme-card--color .color-tag-code-value {
  color: #ffffff;
}

.theme-card--color .color-tag-code-value {
  font-family: "Victor Mono", "Courier New", monospace;
}

.theme-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.theme-card--color:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, #ffffff 32%, transparent);
}

.theme-card.is-selected,
.theme-card.is-active {
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 28%, transparent);
  transform: translateY(-1px);
}

.theme-card--color.is-selected,
.theme-card--color.is-active {
  box-shadow: 0 0 0 3px color-mix(in srgb, #ffffff 45%, transparent);
}

.theme-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 32%, transparent);
}

.theme-card--color:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, #ffffff 50%, transparent);
}

.theme-card.is-selected.theme-card--mode-light,
.theme-card.is-active.theme-card--mode-light {
  border-color: #0f172a;
}

.theme-card.is-selected.theme-card--mode-dark,
.theme-card.is-active.theme-card--mode-dark {
  box-shadow: 0 0 0 3px rgba(29, 40, 83, 0.48);
}

.theme-card.is-selected.theme-card--mode-ink,
.theme-card.is-active.theme-card--mode-ink {
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.5);
}

.theme-card.is-selected.theme-card--mode-void,
.theme-card.is-active.theme-card--mode-void {
  box-shadow: 0 0 0 3px rgba(219, 219, 219, 0.28);
}

@media (max-width: 680px) {
  .theme-card-grid {
    justify-content: flex-start;
  }
}

.workspace__content {
  flex: 1;
  padding: 0 32px 32px;
}

.page {
  display: none;
}

.page:not([hidden]) {
  display: block;
}

.page[data-page="settings"]:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: none;
  min-height: calc(100dvh - 148px);
}

.page-card {
  background: var(--color-surface);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 45px var(--color-shadow-soft);
  border: 1px solid var(--color-border-soft);
}

.page[data-page="calendar-datasets"] .page-card {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
  max-width: none;
  margin: 0;
}

.page[data-page="calendar-datasets"] {
  width: 100%;
}

.page[data-page="calendar-datasets"] .datasets-panel {
  width: 100%;
}

.page-card--wide {
  padding: 28px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-root {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--color-border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.metric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(99, 102, 241, 0.12);
}

.metric-card__icon .isax {
  width: 20px;
  height: 20px;
}

.metric-card__label {
  font-size: 14px;
  color: var(--color-muted);
}

.metric-card__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
}

.metric-card__hint {
  font-size: 12px;
  color: var(--color-muted);
}

.metric-card__delta {
  font-size: 12px;
  font-weight: 600;
}

.metric-card__delta--up {
  color: var(--color-success);
}

.metric-card__delta--down {
  color: var(--color-danger);
}

.metric-card__value,
.metric-card__delta,
.data-table th,
.data-table td,
.analytics-stat-card .value,
.analytics-stat-item .value,
.analytics-job-sankey__metric strong,
.analytics-wallpaper-metric .value,
.analytics-pie-legend__value,
.analytics-table th,
.analytics-table td,
.event-group__count,
.preset-bookmarks__count,
.explorer-section__count,
.explorer-user-filters__count,
.explorer-kv__value,
.campaign-audiences__members-count,
.message-analytics-meta__value,
.message-analytics-breakdown__value,
.suggested-tools-stat strong {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.chart-row,
.list-row {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.chart-card,
.list-card {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  padding: 20px 22px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.chart-card header h3,
.list-card header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.chart-card__body {
  position: relative;
  min-height: 220px;
}

.list-card__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-card__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-size: 14px;
}

body.is-admin-dark .list-card__item {
  background: var(--color-surface-elevated);
  color: var(--color-text);
}

.list-card__item span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.message {
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid transparent;
  display: none;
}

.message.show {
  display: block;
}

.message--info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: #075985;
}

.message--success {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.25);
  color: #166534;
}

.message--error {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.20);
  color: #b91c1c;
}

.entity-panel .message {
  margin-bottom: 12px;
}

.entity-panel .message.show {
  display: block;
}

.entity-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.page-header h2 {
  margin: 0;
  font-size: 20px;
}

.page-header .muted {
  font-size: 13px;
  color: var(--color-muted);
}

.entity-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
}

.entity-tabs button {
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-muted);
  font-size: 13px;
}

.entity-tabs button.is-active {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.entity-tabs__panels {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.data-table thead {
  background: rgba(99, 102, 241, 0.08);
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: right;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:nth-child(odd) {
  background: #f8faff;
}

.data-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
}

body.is-admin-dark .data-table tbody tr:nth-child(odd) {
  background: rgba(148, 163, 184, 0.08);
}

body.is-admin-dark .data-table tbody tr:hover {
  background: rgba(111, 75, 255, 0.16);
}

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

.table-actions .ghost-button,
.table-actions .primary-button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.message-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-title__text {
  font-weight: 600;
  color: var(--color-text);
}

.message-title__preview {
  font-size: 12px;
  color: var(--color-muted);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-title__preview--empty {
  opacity: 0.7;
}

.chip--status {
  border: 1px solid transparent;
}

.chip--status-active {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
}

.chip--status-trial {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
}

.chip--status-cancelled {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.24);
}

.chip--status-expired,
.chip--status-default {
  color: #64748b;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.28);
}

.chip--audience {
  color: #4338ca;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.24);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-editor {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  display: none;
  flex-direction: column;
  gap: 16px;
}

.entity-editor[open] {
  display: flex;
}

.entity-editor .field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.entity-editor label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.checkbox-field input {
  width: auto;
  margin: 0;
}

.entity-editor input,
.entity-editor textarea,
.entity-editor select {
  font-family: inherit;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  background: var(--color-input-bg);
  color: var(--color-text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.entity-editor input:focus,
.entity-editor textarea:focus,
.entity-editor select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.entity-editor textarea {
  min-height: 110px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
}

.analytics-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.analytics-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.analytics-toolbar__actions .ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.analytics-toolbar__actions .ghost-button .isax {
  width: 16px;
  height: 16px;
}

.analytics-stat-filters-btn.is-active,
.analytics-demo-filters-btn.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.analytics-stat-filters-modal .panel-modal__dialog {
  width: min(520px, 100%);
  border-radius: 24px;
}

.analytics-demo-filters-modal .panel-modal__dialog {
  width: min(640px, 100%);
  max-height: min(88vh, 760px);
  border-radius: 24px;
}

.analytics-demo-filters-modal__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}

.analytics-demo-filters-group {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface-soft, var(--color-surface));
}

.analytics-demo-filters-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  list-style: none;
  cursor: pointer;
}

.analytics-demo-filters-group__toggle::-webkit-details-marker,
.analytics-demo-filters-group__toggle::marker {
  display: none;
  content: none;
}

.analytics-demo-filters-group__toggle .isax {
  width: 16px;
  height: 16px;
  color: var(--color-muted);
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.analytics-demo-filters-group[open] .analytics-demo-filters-group__toggle .isax {
  transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
  .analytics-demo-filters-group__toggle .isax {
    transition: none;
  }
}

.analytics-demo-filters-group__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.analytics-demo-filters-group__body {
  padding-top: 12px;
}

.analytics-demo-filters-group__hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--color-muted);
}

.analytics-demo-filters-age {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analytics-demo-filters-age label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

.analytics-demo-filters-age input {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  font-size: 14px;
  color: var(--color-text);
  direction: ltr;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.analytics-demo-filters-age input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.analytics-demo-filters-gender {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-demo-filters-choice {
  display: inline-flex;
  align-items: center;
}

.analytics-demo-filters-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.analytics-demo-filters-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-input-bg);
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
}

.analytics-demo-filters-choice input:checked + span {
  border-color: var(--color-primary);
  background: var(--color-primary-soft, color-mix(in srgb, var(--color-primary) 12%, var(--color-surface)));
  color: var(--color-primary);
}

.analytics-demo-filters-choice input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.analytics-demo-filters-jobs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics-demo-filters-jobs-cat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analytics-demo-filters-jobs-cat__title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.analytics-demo-filters-jobs-cat__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-demo-filters-activity,
.analytics-demo-filters-weight {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-stat-filters-modal__list {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface-soft, var(--color-surface));
}

.analytics-stat-filters-modal__list .settings-switch + .settings-switch {
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.analytics-float-search {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: 12vh 20px 24px;
  isolation: isolate;
}

.analytics-float-search[hidden] {
  display: none;
}

.analytics-float-search__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.22s ease;
}

.analytics-float-search.is-open .analytics-float-search__backdrop {
  opacity: 1;
}

.analytics-float-search__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}

.analytics-float-search.is-open .analytics-float-search__panel {
  opacity: 1;
  transform: none;
}

.analytics-float-search__panel input[type="search"] {
  width: 100%;
  font-family: inherit;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  font-size: 15px;
}

.analytics-float-search__panel input[type="search"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.analytics-float-search__results {
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  background: var(--color-surface);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.analytics-float-search__empty,
.analytics-float-search__hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-float-search__empty {
  color: var(--color-danger);
}

@media (prefers-reduced-motion: reduce) {
  .analytics-float-search__backdrop,
  .analytics-float-search__panel {
    transition: none;
  }
}

.analytics-filters {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.analytics-filters label {
  font-size: 13px;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-filters input,
.analytics-filters select {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  font-size: 14px;
}

.analytics-date-input {
  position: relative;
}

.analytics-date-input input[data-analytics-date-display] {
  width: 100%;
  direction: ltr;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.analytics-date-input.is-disabled input[data-analytics-date-display] {
  background: var(--color-surface-soft);
  cursor: not-allowed;
  color: var(--color-muted);
}

.event-editor .analytics-date-input input[data-analytics-date-display] {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  font-size: 14px;
}

.analytics-date-input input[type="hidden"] {
  display: none;
}

.jalali-date-input {
  position: relative;
}

.jalali-date-input input[data-jalali-date-display] {
  width: 100%;
  direction: ltr;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding-inline-end: 70px;
}

.jalali-date-input input[type="hidden"] {
  display: none;
}

.jalali-date-trigger {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  color: var(--color-text, #111827);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
}

.jalali-date-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.analytics-date-picker {
  position: fixed;
  min-width: 240px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface, #ffffff);
  color: var(--color-title, #111827);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.14);
  border: 1px solid color-mix(in srgb, var(--color-border) 65%, transparent);
  z-index: 1000;
  display: none;
  direction: rtl;
}

.analytics-date-picker.is-visible {
  display: block;
}

.analytics-date-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.analytics-date-picker__title {
  font-size: 14px;
  font-weight: 600;
}

.analytics-date-picker__controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.analytics-date-picker__controls select {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
}

.analytics-date-picker__shortcuts {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.analytics-date-picker__shortcuts button {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  font-size: 12px;
  padding: 6px 0;
  font-weight: 600;
}

.analytics-date-picker__nav {
  display: flex;
  gap: 6px;
}

.analytics-date-picker__nav button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  color: inherit;
  font-weight: 600;
}

.analytics-date-picker__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
}

.analytics-date-picker__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.analytics-date-picker__day {
  border: none;
  background: var(--color-input-bg);
  border-radius: 10px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
}

.analytics-date-picker__day.is-today {
  border: 1px solid var(--color-primary-soft);
}

.analytics-date-picker__day.is-selected {
  background: var(--color-primary);
  color: #ffffff;
}

.analytics-date-picker__day[disabled] {
  opacity: 0;
  pointer-events: none;
}

.analytics-date-picker__day:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.analytics-date-picker__controls select:focus-visible,
.analytics-date-picker__nav button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.analytics-date-input.has-error input[data-analytics-date-display] {
  border-color: var(--color-danger, #ef4444);
  color: var(--color-danger, #ef4444);
}

.jalali-date-input.has-error input[data-jalali-date-display] {
  border-color: var(--color-danger, #ef4444);
  color: var(--color-danger, #ef4444);
}

body.is-admin-dark .analytics-date-picker {
  background: rgba(24, 31, 44, 0.95);
  color: var(--color-title, #f8fafc);
  border-color: color-mix(in srgb, rgba(31, 41, 55, 0.8) 60%, transparent);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

body.is-admin-dark .analytics-date-picker__nav button,
body.is-admin-dark .analytics-date-picker__controls select,
body.is-admin-dark .analytics-date-picker__day {
  background: color-mix(in srgb, var(--color-input-bg, #1f2937) 85%, transparent);
  border-color: color-mix(in srgb, var(--color-border, rgba(255,255,255,0.1)) 80%, transparent);
  color: var(--color-text, #f8fafc);
}

body.is-admin-dark .jalali-date-trigger {
  background: color-mix(in srgb, var(--color-input-bg, #1f2937) 85%, transparent);
  border-color: color-mix(in srgb, var(--color-border, rgba(255,255,255,0.1)) 80%, transparent);
  color: var(--color-text, #f8fafc);
}

body.is-admin-dark .analytics-date-picker__day.is-selected {
  background: var(--color-primary);
  color: #ffffff;
}

.analytics-filter-actions {
  display: flex;
  gap: 12px;
}

.analytics-filter-actions .primary-button {
  border-radius: 16px;
}

.analytics-filters__hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}


.analytics-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.analytics-search__field {
  position: relative;
  display: flex;
  align-items: center;
}

.analytics-search__icon {
  position: absolute;
  inset-inline-start: 14px;
  width: 18px;
  height: 18px;
  color: var(--color-muted);
  pointer-events: none;
}

.analytics-search__field input[type="search"] {
  width: 100%;
  font-family: inherit;
  padding: 12px 14px;
  padding-inline: 42px 40px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.analytics-search__field input[type="search"]::-webkit-search-decoration,
.analytics-search__field input[type="search"]::-webkit-search-cancel-button,
.analytics-search__field input[type="search"]::-webkit-search-results-button,
.analytics-search__field input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.analytics-search__field input[type="search"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.analytics-search__clear {
  position: absolute;
  inset-inline-end: 10px;
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.analytics-search__clear .isax {
  width: 14px;
  height: 14px;
}

.analytics-search__clear:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-primary);
}

.analytics-search__hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-search__empty {
  margin: 0;
  font-size: 13px;
  color: var(--color-danger);
}

.analytics-search__results {
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  background: var(--color-surface);
  padding: 6px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

.analytics-search__result {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.analytics-search__result:hover,
.analytics-search__result:focus-visible,
.analytics-search__result.is-active {
  outline: none;
  background: var(--color-primary-soft);
}

.analytics-search__result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
}

.analytics-search__result-key {
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-search__result mark {
  background: rgba(250, 204, 21, 0.45);
  color: inherit;
  padding: 0 2px;
  border-radius: 6px;
}

.analytics-overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 20px;
}

.analytics-quicknav {
  position: sticky;
  top: 10px;
  z-index: 20;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  box-shadow: 0 8px 18px var(--color-shadow-soft);
}

.analytics-quicknav__inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 4px;
}

.analytics-quicknav__inner::-webkit-scrollbar {
  height: 6px;
}

.analytics-quicknav__inner::-webkit-scrollbar-thumb {
  background: var(--color-primary-soft);
  border-radius: 999px;
}

.analytics-quicknav__item {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  color: var(--color-muted);
  padding: 8px 16px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  min-width: 120px;
  justify-content: center;
  cursor: grab;
  user-select: none;
  position: relative;
}

.analytics-quicknav__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.analytics-quicknav__icon svg,
.analytics-quicknav__icon .isax {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.8;
}

.analytics-quicknav__item:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.analytics-quicknav__item[aria-selected="true"] {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.analytics-quicknav__item:active {
  cursor: grabbing;
}

.analytics-quicknav__item.is-dragging {
  opacity: 0.45;
  transform: scale(0.95);
}

.analytics-quicknav__item.is-drop-target::after {
  content: '';
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: 0;
  right: 0;
  border-radius: 999px;
  border: 2px dashed var(--color-primary);
  pointer-events: none;
  opacity: 0.4;
}

.analytics-quicknav__item.is-drop-target-before::before,
.analytics-quicknav__item.is-drop-target-after::before {
  content: '';
  position: absolute;
  width: 4px;
  height: 70%;
  top: 15%;
  border-radius: 999px;
  background: var(--color-primary);
}

.analytics-quicknav__item.is-drop-target-before::before {
  left: -6px;
}

.analytics-quicknav__item.is-drop-target-after::before {
  right: -6px;
}

.analytics-quicknav__placeholder {
  flex: 0 0 auto;
  min-width: 130px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px dashed var(--color-primary);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary-soft) 70%, transparent);
  font-size: 12px;
  text-align: center;
  font-weight: 600;
}

.analytics-stat-card {
  background: var(--color-surface-soft);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--color-border-soft);
}

.analytics-stat-card .title {
  font-size: 13px;
  color: var(--color-muted);
}

.analytics-stat-card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}

.analytics-stat-card .subtitle {
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-reports {
  display: grid;
  gap: 18px;
}

.analytics-card {
  background: var(--color-surface-elevated);
  border-radius: 24px;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 20px;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 26px var(--color-shadow-soft);
  scroll-margin-top: 120px;
  overflow: hidden;
  background-clip: padding-box;
}

.analytics-card__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.analytics-card header h3 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.45;
}

.analytics-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.analytics-info-btn {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  color: var(--color-muted);
}

.analytics-info-btn svg,
.analytics-info-btn .isax {
  width: 18px;
  height: 18px;
}

.analytics-info-btn[aria-expanded="true"],
.analytics-info-btn:hover {
  color: var(--color-primary);
}

.analytics-info-modal .panel-modal__dialog {
  width: min(680px, 100%);
  max-height: min(88vh, 880px);
  padding: 24px;
  gap: 16px;
  overflow: hidden;
}

.analytics-info-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analytics-info-modal__kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

.analytics-info-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text);
}

.analytics-info-modal__close {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.analytics-info-modal__close svg,
.analytics-info-modal__close .isax {
  width: 16px;
  height: 16px;
}

.analytics-info-modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding-inline-end: 4px;
  min-height: 0;
}

.analytics-info-modal__section {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--color-surface-elevated, var(--color-surface));
  border: 1px solid var(--color-border);
}

.analytics-info-modal__section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.analytics-info-modal__section p,
.analytics-info-modal__section li,
.analytics-info-modal__defs dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--color-muted);
}

.analytics-info-modal__section p + p {
  margin-top: 8px;
}

.analytics-info-modal__section ul {
  margin: 0;
  padding-inline-start: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-info-modal__defs {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-info-modal__defs dt {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--color-text);
}

.analytics-info-modal__defs dd {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-border) 42%, transparent);
}

.analytics-card summary {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.analytics-pie-grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics-pie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.analytics-pie-card {
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 16px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-super-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.analytics-pie-card__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--color-text);
}

.analytics-pie-card__subtitle {
  font-size: 12px;
  margin-bottom: 10px;
  color: var(--color-muted);
}

.analytics-pie-gauge {
  --gauge-primary: #6f4bff;
  --gauge-secondary: rgba(148, 163, 184, 0.5);
  --gauge-fill: 0%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--gauge-primary) 0 var(--gauge-fill), var(--gauge-secondary) var(--gauge-fill) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.analytics-pie-gauge::before {
  content: '';
  position: absolute;
  width: 68%;
  height: 68%;
  border-radius: 50%;
  background: var(--color-surface-elevated);
  box-shadow: inset 0 0 0 1px var(--color-border-super-soft);
}

.analytics-pie-gauge::after {
  content: attr(data-label);
  position: absolute;
  font-weight: 700;
  color: var(--color-text);
  font-size: 16px;
}

.analytics-pie-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-pie-legend__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-pie-legend__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
  font-weight: 600;
}

.analytics-pie-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.analytics-pie-legend__value {
  font-weight: 600;
  color: var(--color-text);
}

.adoption-insights {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.adoption-insights__lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.adoption-insights__line-card {
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 16px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-super-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.adoption-insights__line-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.adoption-insights__line-card .muted {
  font-size: 12px;
}

.adoption-insights__line-chart {
  width: 100%;
  height: 120px;
  margin-top: 8px;
}

.adoption-insights__line-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-muted);
}

.adoption-insights__line-value {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.adoption-insights__line-details {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  max-height: 120px;
  overflow-y: auto;
  border-top: 1px solid var(--color-border-super-soft);
}

.adoption-insights__line-details li {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 4px 0;
  color: var(--color-muted);
}

.adoption-insights__line-details li span:last-child {
  font-weight: 600;
  color: var(--color-text);
}

.analytics-chart__pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-chart__pager .ghost-button {
  padding: 6px 10px;
}

.analytics-chart__note {
  margin-top: 6px;
  font-size: 12px;
}

.analytics-chart__outliers {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
  font-size: 12px;
  color: var(--color-text);
}

.analytics-chart__outliers summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.analytics-chart__outliers summary::-webkit-details-marker {
  display: none;
}

.analytics-chart__outliers summary::after {
  content: '▾';
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-chart__outliers[open] summary::after {
  content: '▴';
}

.analytics-chart__outliers-grid {
  padding: 0 14px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.analytics-chart__outlier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
}

.analytics-chart__outlier .label {
  font-weight: 600;
  color: var(--color-text);
}

.analytics-chart__outlier .value {
  color: var(--color-muted);
}

.analytics-card .analytics-chart {
  min-height: 220px;
}

.analytics-skeleton__summary {
  min-height: 20px;
}

.analytics-skeleton__bone {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: var(--color-surface-soft);
  animation: analytics-skeleton-pulse 1.2s ease-in-out infinite;
}

.analytics-skeleton__bone--summary {
  width: min(72%, 420px);
  height: 12px;
}

.analytics-skeleton__bone--title {
  width: 58%;
  height: 12px;
}

.analytics-skeleton__bone--note {
  width: 74%;
  height: 10px;
}

.analytics-skeleton__bone--legend {
  width: 46%;
}

.analytics-skeleton__bone--value {
  width: 22%;
}

.analytics-skeleton__bone--stat-label {
  width: 70%;
  margin-inline: auto;
}

.analytics-skeleton__bone--stat-value {
  width: 42%;
  height: 16px;
  margin: 8px auto 0;
}

.analytics-skeleton__bone--cell {
  width: 68%;
}

.analytics-skeleton__canvas {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--color-surface-soft);
  border-radius: 16px;
}

.analytics-skeleton__bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  width: 86%;
  height: 72%;
  margin-bottom: 18px;
}

.analytics-skeleton__bar {
  flex: 1 1 0;
  border-radius: 6px 6px 0 0;
  background: var(--color-border);
  animation: analytics-skeleton-pulse 1.2s ease-in-out infinite;
}

.analytics-skeleton__line-plot {
  width: 86%;
  height: 58%;
  margin: auto;
  border-block-end: 2px solid var(--color-border);
  border-radius: 0;
  background:
    linear-gradient(135deg, transparent 46%, var(--color-border) 46%, var(--color-border) 54%, transparent 54%)
    center / 24px 24px repeat-x;
  animation: analytics-skeleton-pulse 1.2s ease-in-out infinite;
}

.analytics-skeleton__doughnut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: auto;
  background: conic-gradient(var(--color-border) 0 38%, var(--color-surface) 38% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent 58%, #000 59%);
  mask: radial-gradient(farthest-side, transparent 58%, #000 59%);
  animation: analytics-skeleton-pulse 1.2s ease-in-out infinite;
}

.analytics-skeleton__gauge {
  background: conic-gradient(var(--color-border) 0 32%, var(--color-surface-soft) 32% 100%);
  animation: analytics-skeleton-pulse 1.2s ease-in-out infinite;
}

.analytics-skeleton__thumb {
  background: var(--color-surface-soft);
  animation: analytics-skeleton-pulse 1.2s ease-in-out infinite;
}

@keyframes analytics-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.analytics-chart__extras {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.analytics-chart__extra {
  flex: 1 1 220px;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px var(--color-border-super-soft);
}

.analytics-chart__extra-title {
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--color-muted);
}

.analytics-job-sankey {
  flex: 1 1 100%;
  min-width: 100%;
}

.analytics-job-sankey__svg {
  display: block;
  width: 100%;
  height: 360px;
  direction: ltr;
  overflow: visible;
}

.analytics-job-sankey__title,
.analytics-job-sankey__pct,
.analytics-job-sankey__flow-label,
.analytics-job-sankey__drop-label {
  fill: var(--color-text);
  font-family: "Vazirmatn", "IRANSans", sans-serif;
}

.analytics-job-sankey__title {
  font-size: 12px;
  font-weight: 700;
}

.analytics-job-sankey__pct,
.analytics-job-sankey__flow-label {
  font-size: 12px;
  font-weight: 700;
  fill: var(--color-text);
}

.analytics-job-sankey__drop-label {
  font-size: 10px;
  fill: #e24b4a;
}

.analytics-job-sankey__node {
  cursor: pointer;
}

.analytics-job-sankey__tooltip {
  margin-top: 10px;
  border: 1px solid var(--color-border-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface);
  font-family: "Vazirmatn", "IRANSans", sans-serif;
}

.analytics-job-sankey__tooltip-head {
  padding: 8px 12px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
}

.analytics-job-sankey__tooltip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
}

.analytics-job-sankey__metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.analytics-job-sankey__metric span {
  font-size: 11px;
  color: var(--color-muted);
}

.analytics-job-sankey__metric strong {
  font-size: 18px;
}

.analytics-job-sankey__metric--people strong { color: #2563eb; }
.analytics-job-sankey__metric--dropped strong { color: #dc2626; }
.analytics-job-sankey__metric--continued strong { color: #16a34a; }

.analytics-echarts-funnel {
  flex: 1 1 100%;
  min-width: 100%;
}

.message-analytics-modal .analytics-echarts-funnel {
  margin: 4px 0 12px;
}

.analytics-echarts-funnel__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 2px 0 8px;
}

.analytics-echarts-funnel__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text);
}

.analytics-echarts-funnel__legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #4F7CFF;
}

.analytics-echarts-funnel__legend-item--continued::before { background: #16a34a; }
.analytics-echarts-funnel__legend-item--dropped::before { background: #e24b4a; }

.analytics-echarts-funnel__chart {
  position: relative;
  width: 100%;
  height: 440px;
  min-height: 400px;
  max-height: none;
  direction: ltr;
}

.analytics-echarts-funnel canvas,
.analytics-echarts-funnel svg {
  min-height: 0 !important;
  max-height: none !important;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.analytics-echarts-funnel__tooltip,
.analytics-echarts-funnel__tooltip * {
  font-family: "Vazirmatn", "IRANSans", sans-serif !important;
}

.analytics-echarts-funnel__tooltip-card {
  min-width: 240px;
  margin-top: 0;
  direction: rtl;
  text-align: right;
  font-family: "Vazirmatn", "IRANSans", sans-serif;
}

.analytics-echarts-funnel__tooltip-card,
.analytics-echarts-funnel__tooltip-card * {
  font-family: inherit;
}

@media (max-width: 720px) {
  .analytics-echarts-funnel__chart {
    height: 480px;
  }
}

.analytics-chart__extra canvas {
  min-height: 120px;
  max-height: 150px;
}

.analytics-chart__canvas {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 220px;
  min-height: 220px;
  max-height: 220px;
  overflow: hidden;
}

.analytics-chart__canvas--mini {
  height: 220px;
  min-height: 220px;
  max-height: 220px;
}

.analytics-chart__canvas canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.analytics-table {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--color-border);
}

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

.analytics-table th,
.analytics-table td {
  padding: 10px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
}

.analytics-table tbody tr:nth-child(odd) {
  background: var(--color-surface-soft);
}

.analytics-table__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-wallpaper-gallery {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics-wallpaper-gallery__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analytics-wallpaper-gallery__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.analytics-wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.analytics-wallpaper-card {
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 10px;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-super-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-wallpaper-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 12px;
}

.analytics-wallpaper-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.analytics-wallpaper-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-wallpaper-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-wallpaper-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-wallpaper-metric .value {
  font-weight: 700;
  color: var(--color-text);
}

@media (max-width: 1200px) {
  .analytics-wallpaper-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .analytics-wallpaper-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .analytics-wallpaper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-wallpaper-gallery__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .analytics-wallpaper-grid {
    grid-template-columns: 1fr;
  }
}

.analytics-empty {
  text-align: center;
  padding: 24px;
  font-size: 14px;
  color: var(--color-muted);
  border: 1px dashed var(--color-border);
  border-radius: 16px;
  background: var(--color-surface-soft);
}

.analytics-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.analytics-stat-item {
  background: var(--color-surface-soft);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  border: 1px solid var(--color-border-soft);
}

.analytics-stat-item .label {
  display: block;
  font-size: 12px;
  color: var(--color-muted);
}

.analytics-stat-item .value {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

.analytics-card .message {
  margin-top: 6px;
}

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.toast {
  min-width: 240px;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  animation: fadeIn 0.2s ease;
}

.toast.toast--success {
  border-color: rgba(22, 163, 74, 0.30);
  background: rgba(22, 163, 74, 0.10);
  color: #166534;
}

.toast.toast--error {
  border-color: rgba(220, 38, 38, 0.30);
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}

.toast.toast--info {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.10);
  color: #084c9e;
}

.toast__close {
  background: transparent;
  border: none;
  margin-left: auto;
  color: inherit;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toast__close .isax {
  width: 14px;
  height: 14px;
}

.panel-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12060;
}

body.is-admin-dark .panel-modal {
  background: rgba(0, 0, 0, 0.62);
}

.panel-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.panel-modal__dialog {
  width: min(420px, 100%);
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.panel-modal.is-open .panel-modal__dialog {
  transform: translateY(0) scale(1);
}

.panel-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.panel-modal__message {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.6;
}

.panel-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.panel-modal__actions .ghost-button,
.panel-modal__actions .primary-button {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 10px;
}

.analytics-demo-filters-modal .panel-modal__actions .ghost-button,
.analytics-demo-filters-modal .panel-modal__actions .primary-button,
.analytics-stat-filters-modal .panel-modal__actions .ghost-button,
.analytics-stat-filters-modal .panel-modal__actions .primary-button {
  border-radius: 16px;
}

.message-analytics-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12050;
}

body.is-admin-dark .message-analytics-modal {
  background: rgba(0, 0, 0, 0.62);
}

.message-analytics-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.message-analytics-modal__dialog {
  width: min(980px, 96vw);
  max-height: 92vh;
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.message-analytics-modal.is-open .message-analytics-modal__dialog {
  transform: translateY(0) scale(1);
}

.message-analytics-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.message-analytics-modal__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.message-analytics-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.message-analytics-modal__subtitle {
  margin: 0 20px;
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.6;
}

.message-analytics-modal__body {
  padding: 0 20px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

.message-analytics-modal__body > .analytics-card,
.message-analytics-modal__body > .message-analytics-grid {
  flex: 0 0 auto;
}

.message-analytics-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.message-analytics-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.message-analytics-meta__item {
  background: var(--color-surface-soft);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-analytics-meta__label {
  font-size: 11px;
  color: var(--color-muted);
}

.message-analytics-meta__value {
  font-size: 13px;
  color: var(--color-text);
}

.message-analytics-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-analytics-breakdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.message-analytics-breakdown__label {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 600;
}

.message-analytics-breakdown__meta {
  font-size: 12px;
  color: var(--color-muted);
}

.message-analytics-breakdown__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.message-analytics-chart {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
  padding: 12px;
}

.message-analytics-chart--large {
  height: 520px;
  min-height: 360px;
}

.message-analytics-chart--medium {
  height: 360px;
  min-height: 260px;
}

.message-analytics-daily .message-analytics-chart {
  min-height: 320px;
}

.message-analytics-chart canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

@media (max-width: 960px) {
  .message-analytics-chart--large {
    height: 360px;
  }
  .message-analytics-chart--medium {
    height: 300px;
  }
  .message-analytics-daily .message-analytics-chart {
    min-height: 260px;
  }
}

.message-analytics-hourly {
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.message-analytics-hourly .message-analytics-chart {
  flex: 1 1 auto;
  min-height: 320px;
}

@media (max-width: 960px) {
  .message-analytics-hourly {
    min-height: 420px;
  }
}

.is-loading {
  position: relative;
}

.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(249, 250, 251, 0.78);
  border-radius: inherit;
  backdrop-filter: blur(2px);
}

.is-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 50%;
  width: 36px;
  height: 36px;
  margin: -18px -18px 0 0;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: rgba(99, 102, 241, 0.7);
  animation: spin 0.8s linear infinite;
  z-index: 2;
}

.muted {
  color: var(--color-muted);
  font-size: 13px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .sidebar,
  .sidebar-float-toggle {
    display: none;
  }

  .workspace,
  body.is-admin-sidebar-collapsed .workspace,
  body.is-admin-sidebar-expanded .workspace {
    padding-inline-start: 0;
    padding-top: 12px;
  }

  .workspace__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .workspace__actions {
    width: 100%;
    justify-content: space-between;
  }
}

.suggested-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.suggested-tools-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  width: 100%;
}

.suggested-tools-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.suggested-tools-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.suggested-tools-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.suggested-tools-stat {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggested-tools-stat strong {
  font-size: 18px;
}

.suggested-tools-stat--active {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}

.suggested-tools-stat--inactive {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.3);
}

.suggested-tools-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
}

.suggested-tools-toolbar__left,
.suggested-tools-toolbar__right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.suggested-field {
  font-family: inherit;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  background: var(--color-input-bg);
  color: var(--color-text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.suggested-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.suggested-field.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.suggested-field--sm {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 10px;
}

.suggested-field--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

textarea.suggested-field {
  min-height: 90px;
  resize: vertical;
}

.tool-editor {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.tool-editor__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tool-editor__header h3 {
  margin: 0;
  font-size: 18px;
}

.tool-editor__grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tool-editor label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

.suggested-field--file {
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.suggested-field__hint {
  font-size: 11px;
  color: var(--color-muted);
  line-height: 1.5;
}

.suggested-field__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.suggested-color-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.suggested-color-field--modal {
  align-items: center;
}

.badge-color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--swatch-color, var(--color-surface-soft));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.badge-color-swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.badge-color-swatch:focus-visible {
  outline: 2px solid var(--color-primary-soft);
  outline-offset: 3px;
}

.badge-color-swatch[data-empty="true"] {
  background: var(--color-surface-soft);
}

.badge-color-trigger {
  white-space: nowrap;
}

.suggested-color-field .suggested-field--mono {
  flex: 1 1 140px;
  min-width: 140px;
}

.suggested-action-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.suggested-action-field__summary {
  flex: 1 1 220px;
  font-size: 12px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.badge-color-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.badge-color-title {
  font-size: 11px;
  color: var(--color-muted);
}

.badge-color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-color-chip {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--chip-color, #e2e8f0);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.badge-color-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.badge-color-chip.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-soft);
}

.badge-color-chip--clear {
  width: auto;
  height: 32px;
  padding: 0 10px;
  font-size: 11px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
}

.badge-color-chip-wrap {
  position: relative;
  display: inline-flex;
}

.badge-color-chip-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.badge-color-chip-remove .isax {
  width: 10px;
  height: 10px;
}

.badge-color-chip-remove:hover {
  transform: scale(1.05);
  color: var(--color-danger);
}

.badge-color-empty {
  font-size: 11px;
  color: var(--color-muted);
}

.badge-color-modal__hex.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.suggested-field--color {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: transparent;
}

.suggested-field--color::-webkit-color-swatch-wrapper {
  padding: 6px;
}

.suggested-field--color::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.badge-color-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12020;
}

body.is-admin-dark .badge-color-modal {
  background: rgba(0, 0, 0, 0.62);
}

.badge-color-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.badge-color-modal__dialog {
  width: min(960px, 96vw);
  max-height: 92vh;
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.badge-color-modal.is-open .badge-color-modal__dialog {
  transform: translateY(0) scale(1);
}

.badge-color-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.badge-color-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.badge-color-modal__subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.badge-color-modal__body {
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  overflow: auto;
}

.badge-color-modal__column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.badge-color-modal__footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-soft);
}

.badge-color-section {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.badge-color-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge-color-section__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.badge-color-list--custom {
  gap: 10px;
}

.badge-color-picker {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.badge-color-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-color-picker__body {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}

.badge-color-picker__input {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: transparent;
  padding: 6px;
  cursor: pointer;
}

.badge-color-picker__input::-webkit-color-swatch-wrapper {
  padding: 6px;
}

.badge-color-picker__input::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.badge-color-picker__hex {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.badge-color-picker__label {
  font-size: 11px;
  color: var(--color-muted);
}

.badge-color-modal__preview {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.badge-color-modal__preview-card {
  background: var(--color-surface);
}

.badge-color-modal__hint {
  margin: 0;
  font-size: 11px;
  color: var(--color-muted);
}

@media (max-width: 820px) {
  .badge-color-modal__body {
    grid-template-columns: 1fr;
  }
}

.badge-placement-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12030;
}

body.is-admin-dark .badge-placement-modal {
  background: rgba(0, 0, 0, 0.62);
}

.badge-placement-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.badge-placement-modal__dialog {
  width: min(880px, 96vw);
  max-height: 92vh;
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.badge-placement-modal.is-open .badge-placement-modal__dialog {
  transform: translateY(0) scale(1);
}

.icon-library-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12040;
}

body.is-admin-dark .icon-library-modal {
  background: rgba(0, 0, 0, 0.62);
}

.icon-library-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.icon-library-modal__dialog {
  width: min(1080px, 96vw);
  max-height: 92vh;
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.icon-library-modal.is-open .icon-library-modal__dialog {
  transform: translateY(0) scale(1);
}

.icon-library-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.icon-library-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.icon-library-modal__subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.icon-library-modal__body {
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
  overflow: auto;
}

.icon-library-modal__column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.icon-library-modal__footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-soft);
}

.dataset-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12030;
}

body.is-admin-dark .dataset-modal {
  background: rgba(0, 0, 0, 0.62);
}

.dataset-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* No transform on the dialog: transforms + overflow break native <select> menus in Chrome. */
.dataset-modal__dialog {
  width: min(760px, 94vw);
  max-height: 92vh;
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dataset-modal.is-open .dataset-modal__dialog {
  opacity: 1;
}

.dataset-modal--sm .dataset-modal__dialog {
  width: min(520px, 92vw);
}

.dataset-modal--md .dataset-modal__dialog {
  width: min(760px, 94vw);
}

.dataset-modal--lg .dataset-modal__dialog {
  width: min(1080px, 96vw);
}

.dataset-modal[data-modal="dataset-explorer"] {
  z-index: 12020;
}

.dataset-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.dataset-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.dataset-modal__subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.dataset-modal__subtitle:empty {
  display: none;
}

.dataset-modal__body {
  padding: 0 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  min-height: 0;
}

.dataset-modal__footer {
  padding: 12px 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-soft);
}

.dataset-modal__footer:empty {
  display: none;
}

.dataset-modal__analytics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dataset-modal .dataset-summary__actions .primary-button {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 10px;
}

.dataset-modal .dataset-summary__actions .ghost-button {
  padding: 6px 12px;
  font-size: 13px;
}

.dataset-modal .dataset-events {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.dataset-modal .dataset-events__header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-soft);
}

.dataset-modal .dataset-import,
.dataset-modal .tool-editor,
.dataset-modal .dataset-detail__section {
  box-shadow: none;
}

.dataset-modal .dataset-detail__section--editor {
  padding: 0;
  border: none;
  background: transparent;
}

@media (max-width: 720px) {
  .dataset-modal__header {
    padding: 16px 16px 0;
  }

  .dataset-modal__body {
    padding: 0 16px 16px;
  }

  .dataset-modal__footer {
    padding: 10px 16px 16px;
  }
}

.icon-library-search {
  display: flex;
}

.icon-library-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.icon-library-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.icon-library-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  border-color: var(--color-border);
}

.icon-library-card.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.icon-library-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.icon-library-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-library-card__icon .isax {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.icon-library-card__label {
  font-size: 12px;
  text-align: center;
  color: var(--color-muted);
}

.icon-library-empty {
  text-align: center;
  font-size: 12px;
  color: var(--color-muted);
  padding: 16px;
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
}

.icon-library-preview {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.icon-library-preview__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.icon-library-preview__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.icon-library-preview__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.icon-library-preview__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-library-preview__label {
  font-size: 13px;
  color: var(--color-text);
}

.icon-library-auto {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.icon-library-auto__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.icon-library-auto__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icon-library-auto__row .suggested-field {
  flex: 1 1 220px;
  min-width: 200px;
}

.icon-library-auto__status {
  font-size: 11px;
  color: var(--color-muted);
}

@media (max-width: 820px) {
  .icon-library-modal__body {
    grid-template-columns: 1fr;
  }
}

.badge-placement-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.badge-placement-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.badge-placement-modal__subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.badge-placement-modal__body {
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
  overflow: auto;
}

.badge-placement-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
}

.badge-placement-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge-placement-control__label {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 600;
}

.badge-placement-control__inputs {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  align-items: center;
}

.badge-placement-control__range {
  width: 100%;
}

.badge-placement-control__number {
  padding: 8px 10px;
}

.badge-placement-control__select {
  padding: 8px 10px;
}

.badge-placement-control--actions {
  align-items: flex-start;
}

.badge-placement-modal__preview {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.badge-placement-modal__preview-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.badge-placement-modal__preview-card {
  background: var(--color-surface);
}

.badge-placement-modal__hint {
  margin: 0;
  font-size: 11px;
  color: var(--color-muted);
}

.badge-placement-modal__footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-soft);
}

@media (max-width: 820px) {
  .badge-placement-modal__body {
    grid-template-columns: 1fr;
  }
}

.tool-background-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12030;
}

body.is-admin-dark .tool-background-modal {
  background: rgba(0, 0, 0, 0.62);
}

.tool-background-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.tool-background-modal__dialog {
  width: min(920px, 96vw);
  max-height: 92vh;
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.tool-background-modal.is-open .tool-background-modal__dialog {
  transform: translateY(0) scale(1);
}

.tool-background-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.tool-background-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.tool-background-modal__subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.tool-background-modal__body {
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
  overflow: auto;
}

.tool-background-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
}

.tool-background-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-background-control__label {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 600;
}

.tool-background-control__inputs {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  align-items: center;
}

.tool-background-control__range {
  width: 100%;
}

.tool-background-control__number {
  padding: 8px 10px;
}

.tool-background-control__colors {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.tool-background-control__color {
  width: 72px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: transparent;
  padding: 6px;
  cursor: pointer;
}

.tool-background-control__color::-webkit-color-swatch-wrapper {
  padding: 6px;
}

.tool-background-control__color::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.tool-background-control__hex {
  padding: 8px 10px;
}

.tool-background-control__hex.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.tool-background-control--actions {
  align-items: flex-start;
  gap: 8px;
}

.tool-background-suggest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border-soft);
  border-radius: 16px;
  padding: 10px;
}

.tool-background-suggest__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-background-suggest__title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.tool-background-suggest__list {
  margin-top: 4px;
}

.tool-background-modal__preview {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-background-modal__preview-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.tool-background-modal__preview-card {
  background: var(--color-surface);
}

.tool-background-modal__footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-soft);
}

.event-pattern-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2000;
}

.event-pattern-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.event-pattern-modal__dialog {
  width: min(980px, 96vw);
  max-height: 92vh;
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px var(--color-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.event-pattern-modal.is-open .event-pattern-modal__dialog {
  transform: translateY(0) scale(1);
}

.event-pattern-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.event-pattern-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.event-pattern-modal__subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.event-pattern-modal__body {
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  overflow: auto;
  align-items: start;
}

.event-pattern-modal__preview {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 16px;
}

.event-pattern-modal__preview-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.event-pattern-modal__preview-card {
  background: var(--color-surface);
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  padding: 14px;
}

.event-pattern-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

.event-pattern-group__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-title);
}

.event-pattern-group__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-muted);
}

.event-pattern-group__body {
  display: grid;
  gap: 10px;
}

.event-pattern-image-actions {
  display: flex;
  justify-content: flex-end;
}

.event-pattern-image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border-radius: 10px;
  border: 1px dashed var(--color-border-soft);
  background: var(--color-surface-soft);
  overflow: hidden;
  text-align: center;
  font-size: 12px;
  color: var(--color-muted);
}

.event-pattern-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-pattern-modal__footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-soft);
}

@media (max-width: 820px) {
  .tool-background-modal__body {
    grid-template-columns: 1fr;
  }

  .event-pattern-modal__body {
    grid-template-columns: 1fr;
  }

  .event-pattern-modal__preview {
    position: static;
  }
}

.tool-editor__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tool-editor__advanced {
  border: 1px dashed var(--color-border);
  border-radius: 16px;
  padding: 10px 12px;
}

.tool-editor__advanced summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--color-muted);
}

.tool-editor__preview {
  background: var(--color-surface-soft);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--color-border-soft);
}

.tool-editor__preview h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.tagline-section {
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tagline-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tagline-section__header h4 {
  margin: 0;
  font-size: 15px;
}

.tagline-parts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tagline-part {
  border: 1px solid var(--color-border-soft);
  border-radius: 10px;
  padding: 12px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tagline-part__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tagline-part__summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tagline-part__summary strong {
  font-size: 13px;
}

.tagline-part__summary span {
  font-size: 12px;
  color: var(--color-muted);
}

.tagline-part__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tagline-part__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.tagline-color-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tagline-color-field input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 4px;
}

.tagline-preview {
  border: 1px dashed var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tagline-preview__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tagline-preview__text {
  min-height: 44px;
  border-radius: 10px;
  padding: 10px;
  background: var(--color-surface-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tagline-preview__text--final {
  font-weight: 600;
}

.tagline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tagline-card {
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 12px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tagline-card.is-inactive {
  opacity: 0.7;
}

.tagline-card__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.tagline-card__preview {
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.tagline-card__meta {
  font-size: 12px;
  color: var(--color-muted);
}

.tagline-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--color-border-soft);
}

body.is-admin-dark .tool-preview-card {
  background: rgba(15, 23, 42, 0.4);
}

.tool-preview-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--suggested-bg, var(--color-surface));
  border: 1px solid var(--color-border);
  box-shadow: var(--suggested-shadow, none);
  display: grid;
  place-items: center;
  overflow: visible;
  position: relative;
}

.tool-preview-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.tool-preview-card__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-preview-card__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.tool-preview-card__meta {
  font-size: 12px;
  color: var(--color-muted);
}

.tool-preview-card__dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ef4444;
  border: 2px solid var(--color-surface);
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35);
}

.tool-preview-card__badge {
  position: absolute;
  top: var(--badge-offset-y, -6px);
  left: var(--badge-offset-x, 16px);
  transform: translateX(-100%);
  transform-origin: top left;
  background: color-mix(in srgb, var(--badge-color, #2563eb) 14%, transparent);
  color: var(--badge-color, #2563eb);
  border: 1px solid color-mix(in srgb, var(--badge-color, #2563eb) 32%, transparent);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: var(--badge-font-size, 11px);
  font-weight: var(--badge-font-weight, 600);
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
  z-index: 2;
}

.tool-preview-card__badge--placeholder {
  opacity: 0.6;
  font-weight: 500;
}

.suggested-checkbox {
  align-items: center;
  padding-top: 22px;
}

.suggested-tools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card {
  display: grid;
  grid-template-columns: 28px 56px minmax(0, 1fr) 110px 110px minmax(180px, 240px);
  grid-template-areas: "drag icon content order status actions";
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.quick-access-card {
  grid-template-columns: 28px 56px minmax(0, 1fr) 110px minmax(180px, 240px);
  grid-template-areas: "drag icon content status actions";
}

.tool-card.is-dragging {
  opacity: 0.6;
  border-style: dashed;
}

.tool-card.is-inactive {
  opacity: 0.75;
}

.tool-card.is-editing {
  border-color: var(--color-primary);
  box-shadow: 0 12px 28px var(--color-primary-soft);
}

.tool-card__drag {
  grid-area: drag;
  width: 28px;
  height: 48px;
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: transparent;
  color: var(--color-muted);
  font-weight: 700;
  letter-spacing: 1px;
  display: grid;
  place-items: center;
  cursor: grab;
}

.tool-card__drag:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tool-card__icon {
  grid-area: icon;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--suggested-bg, var(--color-surface-soft));
  border: 1px solid var(--color-border);
  box-shadow: var(--suggested-shadow, none);
  display: grid;
  place-items: center;
  overflow: visible;
  position: relative;
}

.tool-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.tool-card__content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tool-card__title {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
}

.tool-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  align-items: center;
}

.tool-card__meta a {
  color: inherit;
  text-decoration: none;
}

.tool-card__meta a:hover {
  color: var(--color-primary);
}

.tool-card__url {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}

.tool-card__slug {
  background: var(--color-surface-soft);
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--color-border-soft);
}

.tool-card__badge {
  background: color-mix(in srgb, var(--badge-color, #0284c7) 14%, transparent);
  color: var(--badge-color, #0284c7);
  border: 1px solid color-mix(in srgb, var(--badge-color, #0284c7) 32%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

.tool-card__updated {
  opacity: 0.75;
}

.tool-card__order {
  grid-area: order;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--color-muted);
}

.tool-card__order input {
  width: 72px;
}

.tool-card__status {
  grid-area: status;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.tool-card__actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  justify-items: stretch;
  align-items: center;
}

.tool-card__actions .ghost-button {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
  width: 100%;
}

.tool-card__dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ef4444;
  border: 2px solid var(--color-surface);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

.events-overview,
.quick-access-overview,
.datasets-overview,
.tagline-overview,
.sidebar-presets-overview,
.wallpaper-overview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wallpaper-board {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
}

.wallpaper-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.wallpaper-section {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wallpaper-section--sync {
  background: transparent;
  border: none;
  padding: 0;
}

.wallpaper-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.wallpaper-section__header .muted {
  font-size: 12px;
}

.wallpaper-section__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wallpaper-guide {
  background: var(--color-surface-soft);
}

.wallpaper-guide__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
}

.wallpaper-guide__steps .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.16);
  color: #0284c7;
  font-size: 12px;
  font-weight: 700;
  margin-inline-end: 8px;
}

.wallpaper-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
}

.wallpaper-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallpaper-filters__body {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.wallpaper-panel--side .suggested-tools-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallpaper-category-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.wallpaper-category-grid .wallpaper-category-card {
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  padding: 12px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  appearance: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wallpaper-category-grid .wallpaper-category-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.wallpaper-category-grid .wallpaper-category-card.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.wallpaper-category-grid .wallpaper-category-card:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.wallpaper-category-grid .wallpaper-category-card.is-inactive {
  opacity: 0.6;
}

.wallpaper-category-grid .wallpaper-category-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallpaper-category-grid .wallpaper-category-card__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.wallpaper-category-grid .wallpaper-category-card__meta {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  align-items: center;
  justify-content: flex-end;
}

.wallpaper-category-grid .wallpaper-category-card__status {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-weight: 600;
}

.wallpaper-category-grid .wallpaper-category-card__status--empty {
  background: rgba(148, 163, 184, 0.16);
  color: var(--color-muted);
  border-color: rgba(148, 163, 184, 0.3);
}

@media (max-width: 1100px) {
  .wallpaper-board {
    grid-template-columns: 1fr;
  }

  .wallpaper-panel--side .suggested-tools-stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 720px) {
  .wallpaper-section__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .wallpaper-filters__body {
    grid-template-columns: 1fr;
  }

  .wallpaper-category-grid {
    grid-template-columns: 1fr;
  }

  .wallpaper-category-grid .wallpaper-category-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .wallpaper-category-grid .wallpaper-category-card__meta {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.wallpaper-sync {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
}

.wallpaper-sync__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wallpaper-sync__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallpaper-sync[data-loading="true"] {
  opacity: 0.7;
}

.wallpaper-section--ops {
  margin-top: 6px;
}

.wallpaper-ops {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallpaper-ops__body {
  font-size: 13px;
  line-height: 1.55;
}

.wallpaper-ops__grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wallpaper-ops__line code {
  font-size: 12px;
  direction: ltr;
  unicode-bidi: embed;
}

.wallpaper-ops__line strong {
  font-weight: 600;
  color: var(--color-text);
}

.wallpaper-ops__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.wallpaper-ops__record {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}

.wallpaper-ops__record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wallpaper-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.wallpaper-preview__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wallpaper-preview__theme-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wallpaper-preview__theme-group .ghost-button.is-active {
  border-color: var(--color-accent, #6f4bff);
  background: var(--color-surface);
}

.wallpaper-preview__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wallpaper-preview__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallpaper-preview__details {
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.5;
}

.wallpaper-bulk {
  border-radius: 16px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface);
  padding: 12px 14px;
}

.wallpaper-bulk[open] {
  border-color: var(--color-border);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.wallpaper-bulk__summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
}

.wallpaper-bulk__summary::-webkit-details-marker {
  display: none;
}

.wallpaper-bulk__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.wallpaper-bulk__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.wallpaper-bulk__actions {
  display: flex;
  justify-content: flex-end;
}

.wallpaper-bulk__results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(360px, 50vh);
  overflow: auto;
}

.wallpaper-bulk__summary-line {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-border-soft);
}

.wallpaper-bulk__progress {
  font-size: 13px;
  padding: 6px 0;
}

/* دسته: دکمه + منوی سفارشی (به‌جای <select> بومی داخل مودال) */
.wallpaper-category-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wallpaper-category-picker__label {
  font-size: 13px;
  color: var(--color-muted);
  cursor: pointer;
  user-select: none;
  align-self: flex-start;
}

.wallpaper-category-picker__label:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.wallpaper-category-picker__trigger {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wallpaper-category-picker__trigger::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--color-muted);
  flex-shrink: 0;
}

.wallpaper-category-picker__native {
  display: none !important;
}

.wallpaper-category-picker__empty {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.wallpaper-category-picker__menu {
  margin: 0;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}

body.is-admin-dark .wallpaper-category-picker__menu {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.wallpaper-category-picker__option {
  display: block;
  width: 100%;
  text-align: start;
  padding: 8px 10px;
  margin: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.wallpaper-category-picker__option:hover,
.wallpaper-category-picker__option:focus-visible {
  background: var(--color-surface-soft);
  outline: none;
}

/* فیلد فایل والپیپر: دکمه صریح + درگ‌اند‌دراپ */
.wallpaper-file-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wallpaper-file-field.is-dragover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface-soft));
}

.wallpaper-file-field__caption {
  font-size: 13px;
  color: var(--color-muted);
}

.wallpaper-file-field .suggested-field__actions {
  margin-top: 4px;
}

.wallpaper-bulk__item {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.wallpaper-bulk__item.is-success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.wallpaper-bulk__item.is-error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.wallpaper-card {
  grid-template-columns: 28px 88px minmax(0, 1fr) 110px 110px minmax(180px, 240px);
}

.wallpaper-category-card {
  grid-template-columns: 28px 88px minmax(0, 1fr) 110px 110px minmax(200px, 260px);
}

.wallpaper-card__thumb {
  width: 88px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 12px;
  overflow: hidden;
}

.wallpaper-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wallpaper-tag {
  background: color-mix(in srgb, var(--badge-color, #0ea5e9) 12%, transparent);
  color: var(--badge-color, #0ea5e9);
  border: 1px solid color-mix(in srgb, var(--badge-color, #0ea5e9) 30%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.suggested-tools-orderbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.35);
  font-size: 13px;
  color: #92400e;
}

body.is-admin-dark .suggested-tools-orderbar {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
}

.suggested-tools-orderbar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.suggested-tools-empty {
  text-align: center;
  font-size: 13px;
  color: var(--color-muted);
  padding: 24px;
  border-radius: 16px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
}

.dataset-version {
  font-size: 12px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.dataset-editor__description,
.dataset-event-editor__description {
  display: flex;
}

.dataset-editor__toggles,
.dataset-event-editor__toggles {
  align-items: center;
}

.datasets-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  width: 100%;
}

.datasets-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.datasets-pane--list {
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border-soft);
  padding: 16px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

.datasets-pane--detail {
  background: var(--color-surface);
  border-radius: 24px;
  border: 1px solid var(--color-border-soft);
  padding: 16px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.datasets-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.datasets-header__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.datasets-header__copy h2 {
  margin: 0;
}

.datasets-header__lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-muted);
}

.datasets-header__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.dataset-detail__header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-soft);
}

.dataset-detail__header h3 {
  margin: 0;
  font-size: 16px;
}

.dataset-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dataset-detail__actions .dataset-detail__tab {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
}

.dataset-detail__actions .dataset-detail__tab.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}


.dataset-detail__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.dataset-detail__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dataset-analytics {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.dataset-analytics__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dataset-analytics__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dataset-detail__section--editor .tool-editor {
  box-shadow: none;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

.dataset-detail__section--editor .tool-editor__header {
  padding-inline: 4px;
}

.dataset-detail__section--editor .tool-editor__actions {
  margin-top: 4px;
}

.datasets-pane--detail .message {
  margin-top: 0;
}

@media (min-width: 1100px) {
  .datasets-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .page[data-page="calendar-datasets"] .datasets-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .datasets-pane--list {
    min-width: 0;
  }

  .datasets-pane--detail {
    position: sticky;
    top: 18px;
  }

  .datasets-shell--expanded {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .datasets-shell--expanded .datasets-pane--detail {
    position: static;
  }
}

.datasets-scope {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
}

.datasets-scope__btn {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.datasets-scope__btn.is-active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.datasets-scope-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--color-primary-soft);
  border: 1px solid var(--color-border-soft);
  color: var(--color-text);
  font-size: 13px;
}

.datasets-scope-hint[hidden] {
  display: none;
}

.datasets-overview-toggle {
  align-self: flex-start;
}

.datasets-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.datasets-list .suggested-tools-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.dataset-family {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 20px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
}

.dataset-family.is-open {
  border-color: var(--color-border);
}

.dataset-family__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dataset-family__panel[hidden] {
  display: none !important;
}

.dataset-family__search {
  width: 100%;
}

.dataset-family__children {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-inline-start: 8px;
}

.dataset-family__children > .dataset-family {
  margin: 0;
}

.dataset-tree-node__chevron {
  display: inline-block;
  margin-inline-end: 6px;
  transition: transform 0.16s ease;
}

.dataset-tree-node.is-open > .dataset-card .dataset-tree-node__chevron {
  transform: rotate(-90deg);
}

.dataset-explorer-launch {
  gap: 12px;
}

.dataset-explorer-launch p {
  margin: 0;
}

.dataset-explorer-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dataset-explorer-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

.dataset-explorer-crumbs__sep {
  opacity: 0.55;
}

.dataset-explorer-crumb {
  border: 0;
  background: transparent;
  color: var(--color-text);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.dataset-explorer-crumb:hover {
  text-decoration: underline;
}

.dataset-explorer-stats,
.dataset-explorer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dataset-explorer-search {
  width: 100%;
}

.dataset-explorer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button.dataset-explorer-row {
  width: 100%;
  text-align: inherit;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
}

.dataset-explorer-analytics {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.dataset-explorer-analytics .message-analytics-modal__title {
  margin: 0;
  font-size: 16px;
}

.dataset-explorer-analytics .message-analytics-modal__subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.dataset-explorer-analytics .message-analytics-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dataset-explorer-analytics .analytics-echarts-funnel {
  margin: 4px 0 12px;
}

.dataset-refresh-timer {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.dataset-refresh-timer.is-due {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.dataset-sync-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dataset-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

.dataset-sync-row__copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dataset-sync-row__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dataset-sync-row__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.dataset-sync-row__chips,
.dataset-sync-row__meta,
.dataset-sync-row__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dataset-sync-row > .dataset-sync-progress {
  flex: 1 1 100%;
}

.dataset-sync-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.dataset-sync-progress[hidden] {
  display: none;
}

.dataset-sync-progress__track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  overflow: hidden;
}

.dataset-sync-progress__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.dataset-sync-progress__label {
  font-size: 12px;
  color: var(--color-muted);
}

.dataset-schedule-row {
  align-items: center;
}

.dataset-schedule-row__hint {
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.6;
}

.dataset-schedule-row__select {
  width: auto;
  min-width: 140px;
  flex-shrink: 0;
}

.dataset-modal[data-modal="dataset-sync-sources"] .dataset-modal__footer {
  flex-wrap: wrap;
  align-items: center;
}

.dataset-modal[data-modal="dataset-sync-sources"] .dataset-modal__footer .dataset-sync-progress {
  flex: 1 1 100%;
}

.primary-button.is-busy,
.ghost-button.is-busy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.isax-spin {
  animation: spin 0.8s linear infinite;
}

.dataset-explorer-row:not(button) {
  cursor: pointer;
}

.dataset-explorer-actions .dataset-sync-progress,
.dataset-card__actions .dataset-sync-progress {
  flex: 1 1 100%;
}

@media (max-width: 720px) {
  .dataset-sync-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.dataset-card {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dataset-card--family {
  cursor: pointer;
  box-shadow: none;
}

.dataset-card--child {
  border-radius: 12px;
}

.dataset-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.dataset-card:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.dataset-card.is-inactive {
  opacity: 0.7;
}

.dataset-card.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  transform: translateY(-1px);
}

.dataset-card__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dataset-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dataset-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.dataset-card__chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dataset-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
}

.dataset-card__meta span {
  background: var(--color-surface-soft);
  border-radius: 999px;
  border: 1px solid var(--color-border-soft);
  padding: 2px 8px;
}

.dataset-card__description {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dataset-card__stats {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
  align-self: stretch;
}

.dataset-card__stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
}

.dataset-card__stats strong {
  font-size: 14px;
  color: var(--color-text);
}

.dataset-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .dataset-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .dataset-card__stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .dataset-card__stats div {
    flex-direction: column;
    align-items: flex-start;
  }
}

.dataset-events {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.dataset-events__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dataset-events__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dataset-events__toolbar {
  margin-top: 4px;
}

.dataset-import {
  border-radius: 16px;
  border: 1px dashed var(--color-border-soft);
  background: var(--color-surface-soft);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dataset-import__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dataset-import__guide {
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dataset-import__guide-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dataset-import__guide-card {
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
  padding: 10px 12px;
}

.dataset-import__guide-card h5 {
  margin: 0;
  font-size: 13px;
  color: var(--color-text);
}

.dataset-import__guide-card ul {
  margin: 6px 0 0;
  padding: 0 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.dataset-import__guide-card code {
  background: var(--color-surface);
  border-radius: 6px;
  padding: 1px 6px;
  border: 1px solid var(--color-border-soft);
  font-size: 11px;
}

.dataset-import__guide-note {
  font-size: 12px;
  color: var(--color-muted);
}

.dataset-import__sample {
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dataset-import__sample-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dataset-import__sample-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.dataset-import__sample-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dataset-import__sample-code {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
  font-size: 12px;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  overflow: auto;
  max-height: 220px;
}

.dataset-import__options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.dataset-import__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dataset-import__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dataset-import__item {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.dataset-import__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dataset-import__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dataset-workflow {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 14px;
}

.dataset-workflow__step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 10px;
  padding: 10px 12px;
}

.dataset-workflow__step p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-muted);
}

.dataset-workflow__badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dataset-editor__hint {
  font-size: 12px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-soft);
  border-radius: 10px;
  padding: 8px 12px;
}

.dataset-events-placeholder {
  border-radius: 16px;
  border: 1px dashed var(--color-border-soft);
  background: var(--color-surface-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dataset-events-placeholder__title {
  font-weight: 700;
  font-size: 14px;
}

.dataset-events__summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.dataset-summary__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dataset-summary__title {
  font-size: 15px;
  color: var(--color-text);
}

.dataset-summary__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--color-muted);
}

.dataset-summary__meta-item {
  background: var(--color-surface);
  border-radius: 999px;
  border: 1px solid var(--color-border-soft);
  padding: 2px 8px;
}

.dataset-summary__description {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dataset-summary__stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.dataset-summary__stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-muted);
  background: var(--color-surface);
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  padding: 8px 10px;
}

.dataset-summary__stats strong {
  font-size: 14px;
  color: var(--color-text);
}

.dataset-summary__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: center;
}

.dataset-summary__actions button {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.dataset-import__item.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.events-view-hint {
  font-size: 13px;
  color: var(--color-muted);
}

.event-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.event-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-group__title {
  margin: 0;
  font-size: 14px;
  color: var(--color-text);
}

.event-group__count {
  font-size: 12px;
  color: var(--color-muted);
}

.event-group__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-card {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.event-card.is-inactive {
  opacity: 0.7;
}

.event-card.is-editing {
  border-color: var(--color-primary);
  box-shadow: 0 12px 26px var(--color-primary-soft);
}

.event-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-card__title {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
}

.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
}

.event-card__description {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.7;
}

.event-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-card__tags span {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  color: var(--color-muted);
}

.event-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-visual-grid {
  margin-top: 10px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.event-visual-card {
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-visual-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-visual-card__title {
  margin: 0;
  font-size: 14px;
  color: var(--color-title);
}

.event-visual-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.event-pattern-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.event-pattern-swatch {
  position: relative;
  border-radius: 10px;
  border: 1px dashed var(--color-border-soft);
  background: var(--color-surface-soft);
  height: 86px;
  overflow: hidden;
}

.event-pattern-swatch__layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.event-title-icon-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--color-border-soft);
  background: var(--color-surface-soft);
  font-size: 13px;
  color: var(--color-text);
}

.event-title-icon-preview.is-empty {
  opacity: 0.7;
}

.event-title-icon-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.range-field {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  align-items: center;
}

.event-preview {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  --radius-md: 16px;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --surface: #ffffff;
  --surface-2: #efefef;
  --surface-3: #e6e6e6;
  --surface-strong: #dadada;
  --surface-inverse: #111827;
  --text: #321124;
  --text-strong: #240b19;
  --text-subtle: #7d4c63;
  --muted: #7b4e63;
  --muted-strong: #5a3546;
  --border: rgba(169, 24, 89, 0.18);
  --color-primary: #a91859;
  --danger-500: #ef4444;
  --danger-surface: rgba(239, 68, 68, 0.18);
  --panel-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
  --transition-fast: 120ms ease-out;
}

.event-preview__card {
  --event-accent: var(--muted-strong);
  --event-accent-soft: var(--surface-2);
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 19px;
  padding: var(--space-3);
  display: block;
  color: var(--text);
  position: relative;
  overflow: visible;
}

.event-preview__card.event-item--has-category {
  padding-block-start: 2px;
  padding-block-end: 2px;
  padding-inline-start: 2px;
}

.event-preview .event-item__category {
  flex: 0 1 auto;
  z-index: 2;
  height: 36px;
  max-width: 46%;
  padding: 0 14px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--text) 10%, var(--surface-2));
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

html.theme-new-new .event-preview .event-item {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--text) 10%, transparent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.event-item__title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.event-item__title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.event-item__title-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-item__pattern-wrap {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.event-item__pattern {
  position: absolute;
  inset: -120%;
  pointer-events: none;
  z-index: 0;
}

.event-item--pattern > :not(.event-item__pattern-wrap) {
  position: relative;
  z-index: 1;
}

.event-preview__card.event-item--accent {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--text) 10%, transparent);
}

.event-preview__card.event-item--link {
  cursor: pointer;
}

.event-preview__card.holiday {
  --event-accent: var(--muted-strong);
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--text) 10%, transparent);
}

.event-preview .event-item.holiday .event-title::after {
  content: ' - تعطیل';
  color: var(--text-strong);
  font-weight: 600;
}

.event-preview .event-item.holiday .event-title {
  color: var(--text-strong);
}

.event-preview .event-item__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.event-preview .event-item__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-strong);
}

.event-preview .event-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.event-preview .event-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.event-preview .event-item__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--event-accent) 28%, transparent);
  background: color-mix(in srgb, var(--event-accent) 14%, transparent);
  color: var(--text-strong);
  font-size: 0.7rem;
}

.event-preview .event-item__description {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.event-preview .event-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-preview .event-item__tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted-strong);
}

.event-preview .event-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.event-preview .event-item__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--event-accent) 40%, transparent);
  background: color-mix(in srgb, var(--event-accent) 20%, transparent);
  color: var(--text-strong);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  align-self: flex-start;
}

.event-preview .event-item__link-inline {
  color: var(--text-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.event-preview .event-item__notice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 2px 6px;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.35);
  border: 2px solid var(--surface);
  position: absolute;
  top: calc(var(--space-3) * -1);
  right: calc(var(--space-3) * -1);
  left: auto;
  transform: translate(50%, -50%);
  z-index: 2;
}

.event-preview .event-item__notice--dot {
  width: 10px;
  min-width: 10px;
  height: 10px;
  padding: 0;
}

.analytics-card--highlight {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

@media (max-width: 900px) {
  .tool-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "drag"
      "icon"
      "content"
      "order"
      "status"
      "actions";
    align-items: start;
  }

  .quick-access-card {
    grid-template-areas:
      "drag"
      "icon"
      "content"
      "status"
      "actions";
  }

  .tool-card__drag {
    width: 100%;
    height: 32px;
  }

  .tool-card__order,
  .tool-card__status {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

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

  .wallpaper-bulk__grid {
    grid-template-columns: 1fr;
  }

  .wallpaper-sync {
    flex-direction: column;
    align-items: flex-start;
  }
}

.sidebar-presets-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-presets-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-presets-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-presets-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.sidebar-presets-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-presets-empty {
  text-align: center;
  font-size: 13px;
  color: var(--color-muted);
  padding: 24px;
  border-radius: 16px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
}

.preset-bookmarks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.preset-bookmarks__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.preset-bookmarks__header h4 {
  margin: 0;
  font-size: 15px;
}

.preset-bookmarks__count {
  font-size: 12px;
  color: var(--color-muted);
}

.preset-bookmarks__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-bookmarks__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preset-bookmarks__empty {
  text-align: center;
  padding: 14px;
  font-size: 12px;
  color: var(--color-muted);
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface);
}

.preset-bulk__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.preset-bookmark-row {
  display: grid;
  grid-template-columns: 70px minmax(140px, 1fr) minmax(180px, 1.2fr) minmax(120px, 0.6fr) minmax(160px, 1fr) minmax(160px, 1fr) 52px 80px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

.preset-bookmark-row__move {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-bookmark-row__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.preset-bookmark-row__icon-url {
  display: none;
}

.preset-bookmark-row.has-custom-icon .preset-bookmark-row__icon-url {
  display: flex;
}

.preset-bookmark-row__icon-file {
  display: none;
}

.preset-bookmark-row.has-custom-icon .preset-bookmark-row__icon-file {
  display: flex;
}

.preset-bookmark-row__icon-actions {
  justify-content: flex-end;
}

.preset-bookmark-row__preview {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--color-muted);
  font-weight: 600;
}

.preset-bookmark-row__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preset-bookmark-row__remove {
  align-self: center;
}

.preset-preview-card {
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 14px;
  background: var(--color-surface-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preset-preview-card__header h3 {
  margin: 0;
  font-size: 16px;
}

.preset-preview-card__icons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.preset-preview-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 600;
  color: var(--color-muted);
}

.preset-preview-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preset-preview-card__icon--more {
  width: auto;
  padding: 0 10px;
  font-size: 11px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
}

.preset-preview-card__desc {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.preset-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

.preset-card.is-inactive {
  opacity: 0.78;
}

.preset-card__preview {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.preset-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.preset-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preset-card__icon--more {
  width: auto;
  padding: 0 8px;
  font-size: 11px;
}

.preset-card__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-card__title {
  font-weight: 600;
}

.preset-card__desc {
  font-size: 12px;
  color: var(--color-muted);
}

.preset-card__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--color-muted);
}

.preset-card__slug {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
}

.preset-card__drag {
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  padding: 6px 8px;
  cursor: grab;
}

.preset-card__drag:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.preset-card__order label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--color-muted);
}

.preset-card__order input {
  width: 72px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  color: var(--color-text);
  font-size: 12px;
}

.preset-card__status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.preset-card__meta .chip--audience {
  max-width: 220px;
}

.preset-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 1100px) {
  .preset-bookmark-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .preset-bookmark-row__move {
    flex-direction: row;
  }
}

@media (max-width: 900px) {
  .preset-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

.update-announcements-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.update-announcements-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.update-announcements-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-announcements-builder {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  grid-template-areas: "form preview";
  align-items: start;
}

.update-announcements-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.update-announcements-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.update-announcements-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
}

.update-announcements-toolbar__left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  flex-wrap: wrap;
}

.update-announcements-toolbar__left .suggested-field[type="search"] {
  flex: 1 1 240px;
  min-width: 220px;
}

.update-announcement-form {
  grid-area: form;
}

.update-announcement-preview {
  grid-area: preview;
}

.update-announcement-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.update-announcement-form__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.update-announcement-form__header h3 {
  margin: 0;
  font-size: 18px;
}

.update-announcement-form__meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.update-announcement-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.update-announcement-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-muted);
}

.update-announcement-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
}

.update-announcement-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.update-announcement-blocks__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.update-announcement-blocks__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.update-announcement-blocks__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-blocks-empty {
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
  font-size: 13px;
}

.announcement-block {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.announcement-block__title {
  font-weight: 600;
  font-size: 13px;
}

.announcement-block__actions {
  display: flex;
  gap: 6px;
}

.announcement-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.announcement-toolbar__select {
  min-width: 120px;
}

.announcement-toolbar__color {
  width: 44px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 0;
  background: var(--color-surface);
}

.announcement-richtext {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 140px;
  background: var(--color-input-bg);
  font-size: 14px;
  line-height: 1.9;
}

.announcement-richtext:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.update-announcement-preview .announcement-richtext {
  border: none;
  padding: 0;
  background: transparent;
  min-height: 0;
}

.announcement-richtext p {
  margin: 0 0 10px;
}

.announcement-richtext h1,
.announcement-richtext h2,
.announcement-richtext h3,
.announcement-richtext h4 {
  margin: 0 0 10px;
}

.announcement-richtext ul,
.announcement-richtext ol {
  margin: 0 0 10px;
  padding-inline-start: 1.4rem;
}

.announcement-richtext li {
  margin-bottom: 4px;
}

.announcement-richtext blockquote {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border-inline-start: 3px solid var(--color-primary);
  background: var(--color-surface-soft);
}

.announcement-richtext pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-surface-soft);
  font-family: "VictorMono", "Courier New", monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.announcement-richtext code {
  font-family: "VictorMono", "Courier New", monospace;
  font-size: 0.9em;
  background: rgba(111, 75, 255, 0.12);
  border-radius: 6px;
  padding: 0 4px;
}

.announcement-richtext mark {
  background: rgba(111, 75, 255, 0.2);
  border-radius: 6px;
  padding: 0 2px;
}

.announcement-richtext hr {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 10px 0;
}

.announcement-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  margin: 0 0.2em;
  color: currentColor;
}

.announcement-inline-icon svg,
.announcement-inline-icon .isax {
  width: 100%;
  height: 100%;
}

.announcement-block__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.announcement-image-preview {
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-soft);
  padding: 12px;
  display: grid;
  place-items: center;
}

.announcement-image-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
}

.announcement-icon-preview {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
}

.announcement-icon-preview__icon {
  font-size: 34px;
  color: var(--color-primary);
}

.announcement-icon-preview__icon .isax {
  width: 1em;
  height: 1em;
}

.announcement-divider-hint {
  font-size: 12px;
  color: var(--color-muted);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border);
}

.announcement-divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 4px 0;
}

.update-announcement-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
  position: sticky;
  top: 16px;
  align-self: start;
}

.update-announcement-preview-shell {
  position: relative;
  width: 100%;
  height: clamp(260px, 45vh, 520px);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  overflow: hidden;
  display: block;
  font-family: 'IRANYekan', sans-serif;
  font-size: 15px;
  direction: rtl;
  color: var(--text);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px; --radius-2xl: 24px;
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-2: 0 12px 32px rgba(15, 23, 42, 0.18);
  --shadow-3: 0 24px 48px rgba(15, 23, 42, 0.28);
  --transition-fast: 120ms ease-out;
  --bg: #fff5f9;
  --surface: #ffffff;
  --surface-2: #efefef;
  --surface-3: #e6e6e6;
  --surface-strong: #dadada;
  --surface-inverse: #1a0b14;
  --text: #320f24;
  --text-strong: #210714;
  --text-subtle: #7d4c63;
  --muted: #825068;
  --muted-strong: #67394d;
  --icon-color: #5a2a3d;
  --border: rgba(169, 24, 89, 0.22);
  --border-stronger: rgba(169, 24, 89, 0.32);
  --ring: #c72d6f;
  --focus-outline: 2px solid var(--ring);
  --color-primary: #a91859;
  --color-primary-200: #f5a6c5;
  --color-primary-300: #f5a6c5;
  --color-accent: #f78fb7;
}

.update-announcement-preview-scale {
  transform-origin: top left;
  will-change: transform;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

.update-announcement-preview-viewport {
  position: relative;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  transform-origin: top left;
  will-change: transform;
}

.update-announcement-preview-shell .modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1;
  padding: var(--space-6);
}

.update-announcement-preview-shell .update-announcement-modal {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.update-announcement-preview-shell .modal__dialog {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--border);
  width: min(520px, 100%);
  max-height: min(80vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.update-announcement-preview-shell .update-announcement-modal__dialog {
  width: var(--announcement-modal-width, min(720px, 94vw));
  max-width: var(--announcement-modal-max-width, 94vw);
  height: var(--announcement-modal-height, auto);
  max-height: var(--announcement-modal-max-height, min(86vh, 820px));
  border-radius: var(--radius-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
}

.update-announcement-preview-shell .modal__header,
.update-announcement-preview-shell .modal__footer {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.update-announcement-preview-shell .modal__footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
}

.update-announcement-preview-shell .modal__body {
  padding: var(--space-4);
  overflow-y: auto;
}

.update-announcement-preview-shell .update-announcement-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.update-announcement-preview-shell .update-announcement-modal__title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text-strong);
}

.update-announcement-preview-shell .update-announcement-modal__subtitle {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--text-subtle);
  line-height: 1.6;
}

.update-announcement-preview-shell .update-announcement-modal__close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.update-announcement-preview-shell .update-announcement-modal__close .isax {
  width: 16px;
  height: 16px;
}

.update-announcement-preview-shell .update-announcement-modal__close:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--border) 100%, transparent);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.update-announcement-preview-shell .update-announcement-modal__close:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

.update-announcement-preview-shell .update-announcement-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.update-announcement-preview-shell .update-announcement-modal__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.update-announcement-preview-shell .update-announcement-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.update-announcement-preview-shell .update-announcement-modal__cta {
  min-width: 180px;
  justify-content: center;
}

.update-announcement-preview-shell .btn {
  --btn-padding-y: var(--space-2);
  --btn-padding-x: var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.update-announcement-preview-shell .btn:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, var(--color-primary-200) 30%);
}

.update-announcement-preview-shell .btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

.update-announcement-preview-shell .btn:disabled,
.update-announcement-preview-shell .btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

.update-announcement-preview-shell .btn-primary {
  background: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 80%, var(--border));
  color: var(--surface-inverse);
  box-shadow: 0 12px 20px rgba(45, 140, 218, 0.25);
}

.update-announcement-preview-shell .btn-primary:hover {
  background: color-mix(in srgb, var(--color-primary) 85%, white 15%);
}

.update-announcement-preview-shell .update-announcement-modal__cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.update-announcement-preview-shell .announcement-richtext {
  color: var(--text);
  line-height: 1.85;
  font-size: 0.98rem;
}

.update-announcement-preview-shell .announcement-richtext h2 {
  margin: 0 0 var(--space-2);
  font-size: 1.15rem;
  color: var(--text-strong);
}

.update-announcement-preview-shell .announcement-richtext h1 {
  margin: 0 0 var(--space-2);
  font-size: 1.35rem;
  color: var(--text-strong);
}

.update-announcement-preview-shell .announcement-richtext h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.05rem;
  color: var(--text-strong);
}

.update-announcement-preview-shell .announcement-richtext h4 {
  margin: 0 0 var(--space-2);
  font-size: 0.98rem;
  color: var(--text-strong);
}

.update-announcement-preview-shell .announcement-richtext p {
  margin: 0 0 var(--space-2);
}

.update-announcement-preview-shell .announcement-richtext ul {
  margin: 0 0 var(--space-2);
  padding-inline-start: 1.2rem;
}

.update-announcement-preview-shell .announcement-richtext ol {
  margin: 0 0 var(--space-2);
  padding-inline-start: 1.4rem;
}

.update-announcement-preview-shell .announcement-richtext li {
  margin-bottom: 4px;
}

.update-announcement-preview-shell .announcement-richtext blockquote {
  margin: 0 0 var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--color-primary);
  background: var(--surface-2);
  color: var(--text);
}

.update-announcement-preview-shell .announcement-richtext pre {
  margin: 0 0 var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: "VictorMono", "Courier New", monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.update-announcement-preview-shell .announcement-richtext code {
  font-family: "VictorMono", "Courier New", monospace;
  font-size: 0.9em;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  border-radius: 6px;
  padding: 0 4px;
}

.update-announcement-preview-shell .announcement-richtext mark {
  background: color-mix(in srgb, var(--color-primary-200) 65%, transparent);
  border-radius: 6px;
  padding: 0 2px;
}

.update-announcement-preview-shell .announcement-richtext hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: var(--space-2) 0;
}

.update-announcement-preview-shell .announcement-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  margin-inline: 0.2em;
  vertical-align: -0.2em;
  color: currentColor;
}

.update-announcement-preview-shell .announcement-inline-icon svg,
.update-announcement-preview-shell .announcement-inline-icon .isax {
  width: 100%;
  height: 100%;
}

.update-announcement-preview-shell .announcement-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.update-announcement-preview-shell .announcement-figure img {
  max-width: min(520px, 100%);
  height: auto;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.update-announcement-preview-shell .announcement-figure figcaption {
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.update-announcement-preview-shell .announcement-figure--start {
  align-items: flex-start;
}

.update-announcement-preview-shell .announcement-figure--end {
  align-items: flex-end;
}

.update-announcement-preview-shell .announcement-figure--full img {
  width: 100%;
  max-width: 100%;
}

.update-announcement-preview-shell .announcement-divider {
  border: none;
  border-top: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
  margin: var(--space-2) 0;
}

.update-announcement-preview-shell .announcement-media__figure figcaption {
  font-size: 12px;
  color: var(--text-subtle);
}

.update-announcement-preview-shell .announcement-icon-block__icon svg,
.update-announcement-preview-shell .announcement-icon-block__icon .isax,
.announcement-icon-block__icon .isax {
  width: 1em;
  height: 1em;
}

.announcement-empty {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: var(--color-muted);
  text-align: center;
}

.announcement-media {
  display: flex;
  gap: var(--announcement-media-gap, 16px);
  align-items: center;
}

.announcement-media--image-right {
  flex-direction: row;
}

.announcement-media--image-left {
  flex-direction: row-reverse;
}

.announcement-media--center {
  align-items: center;
}

.announcement-media--start {
  align-items: flex-start;
}

.announcement-media--end {
  align-items: flex-end;
}

.announcement-media__text {
  flex: 1;
  min-width: 0;
}

.announcement-media__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.announcement-media__figure img {
  width: var(--announcement-media-image-width, 240px);
  max-width: 100%;
  height: auto;
}

.announcement-media__figure figcaption {
  font-size: 12px;
  color: var(--color-muted);
}

@media (max-width: 720px) {
  .announcement-media {
    flex-direction: column;
    align-items: stretch;
  }

  .announcement-media__figure img {
    width: 100%;
  }
}

.update-announcement-preview-card {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-announcement-preview__header h3 {
  margin: 0;
  font-size: 16px;
}

.update-announcement-preview__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-announcement-preview__footer {
  display: flex;
  justify-content: flex-end;
}

.update-announcement-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.update-announcements-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.update-announcements-empty {
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
}

.announcement-card {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.announcement-card.is-editing {
  border-color: var(--color-primary);
  box-shadow: 0 12px 26px rgba(111, 75, 255, 0.2);
}

.announcement-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.announcement-card__title {
  font-weight: 600;
  font-size: 15px;
}

.announcement-card__subtitle {
  color: var(--color-muted);
  font-size: 13px;
}

.announcement-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--color-muted);
}

.announcement-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.announcement-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.announcement-figure img {
  max-width: 100%;
  height: auto;
}

.announcement-figure figcaption {
  font-size: 12px;
  color: var(--color-muted);
}

.announcement-figure--start {
  align-items: flex-start;
}

.announcement-figure--end {
  align-items: flex-end;
}

.announcement-figure--full img {
  width: 100%;
}

.announcement-icon-block {
  display: flex;
  justify-content: center;
}

.announcement-icon-block--start {
  justify-content: flex-start;
}

.announcement-icon-block--end {
  justify-content: flex-end;
}

.announcement-icon-block__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1200px) {
  .update-announcements-builder {
    grid-template-columns: 1fr;
    grid-template-areas: "preview" "form";
  }

  .update-announcement-preview {
    position: static;
  }

  .update-announcement-preview-shell {
    height: clamp(240px, 45vh, 460px);
  }
}

@media (max-width: 720px) {
  .update-announcement-form {
    padding: 16px;
  }

  .announcement-block__grid {
    grid-template-columns: 1fr;
  }

  .announcement-card__actions {
    flex-direction: column;
    align-items: stretch;
  }
}

body.is-admin-shadows-off .sidebar,
body.is-admin-shadows-off .sidebar-float-toggle,
body.is-admin-shadows-off .page-card,
body.is-admin-shadows-off .settings-group,
body.is-admin-shadows-off .auth-card,
body.is-admin-shadows-off .metric-card {
  box-shadow: none !important;
}

.page[data-page="analytics-explorer"] .page-card {
  width: 100%;
  max-width: none;
}

.explorer-users {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.explorer-users.is-loading {
  opacity: 0.72;
}

.explorer-users__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.explorer-users__search {
  flex: 1 1 280px;
  max-width: 420px;
}

.explorer-users__search input {
  width: 100%;
  min-height: 40px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: inherit;
  padding-block: 8px;
}

.explorer-users__meta,
.explorer-users__empty,
.explorer-users__error,
.explorer-section__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.explorer-users__error {
  color: #b91c1c;
}

.explorer-users__table-wrap {
  overflow: auto;
  border-radius: 16px;
}

.explorer-users__row {
  cursor: pointer;
}

.explorer-users__row:focus-visible {
  outline: 2px solid var(--color-accent, #a91859);
  outline-offset: -2px;
}

.explorer-pager,
.explorer-users__pager-host .explorer-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.explorer-pager__info {
  margin-inline-end: auto;
  color: var(--color-muted);
  font-size: 13px;
}

.explorer-user-modal .dataset-modal__dialog {
  width: min(1080px, 96vw);
}

.explorer-dossier {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.explorer-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.explorer-summary__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: rgba(148, 163, 184, 0.08);
}

.explorer-summary__item strong {
  font-size: 18px;
}

.explorer-summary__item span {
  color: var(--color-muted);
  font-size: 12px;
}

.explorer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

.explorer-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}

.explorer-section__count {
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 500;
}

.explorer-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  margin: 0;
}

.explorer-kv__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.explorer-kv__label {
  font-size: 12px;
  color: var(--color-muted);
}

.explorer-kv__value {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.explorer-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.explorer-chips__label {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.explorer-chips__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.explorer-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(169, 24, 89, 0.08);
  font-size: 12px;
}

.explorer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
}

.explorer-mini-table {
  width: 100%;
}

.explorer-collection {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.is-admin-dark .explorer-summary__item,
body.is-admin-dark .explorer-section {
  background: rgba(148, 163, 184, 0.06);
}

body.is-admin-dark .explorer-chip {
  background: rgba(169, 24, 89, 0.18);
}

@media (max-width: 720px) {
  .explorer-users__toolbar {
    align-items: stretch;
  }

  .explorer-users__search {
    max-width: none;
  }

  .explorer-kv {
    grid-template-columns: 1fr;
  }
}

.explorer-users,
.explorer-users__filters,
.page[data-page="analytics-explorer"] .page-card--wide {
  overflow: visible;
}

.explorer-user-filters {
  min-width: 0;
}

.explorer-user-filters__card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  overflow: visible;
}

.explorer-user-filters__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  text-align: start;
}

.explorer-user-filters.is-open .explorer-user-filters__toggle {
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.explorer-user-filters__toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.explorer-user-filters__toggle-summary {
  margin-inline-start: auto;
  color: var(--color-muted);
  font-size: 12px;
}

.explorer-user-filters__caret--toggle {
  margin-inline-start: 4px;
}

.explorer-user-filters.is-open .explorer-user-filters__caret--toggle {
  transform: rotate(225deg);
  margin-block-start: 3px;
}

.explorer-user-filters__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 20px;
}

.explorer-user-filters__panel[hidden] {
  display: none !important;
}

.explorer-user-filters__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.explorer-user-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}

.explorer-user-filters--embedded .explorer-user-filters__card {
  overflow: visible;
}

.explorer-user-filters__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}

.explorer-user-filters__title .isax {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
}

.explorer-user-filters__match {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.explorer-user-filters__match-label,
.explorer-user-filters__field-label,
.explorer-user-filters__meta,
.explorer-user-filters__empty,
.explorer-user-filters__group {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.explorer-user-filters__field-label {
  padding-inline: 2px;
}

.explorer-user-filters__segment {
  display: inline-flex;
  padding: 4px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.12);
  gap: 4px;
}

.explorer-user-filters__segment-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.explorer-user-filters__segment-item input,
.explorer-user-filters__choice input,
.explorer-user-filters__option input {
  appearance: none;
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.explorer-user-filters__segment-item span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.explorer-user-filters__segment-item input:checked + span {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 0 var(--color-border-soft);
}

.explorer-user-filters__segment-item input:focus-visible + span {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.explorer-user-filters__facets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 12px;
  align-items: start;
}

.explorer-user-filters__field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  z-index: 1;
}

.explorer-user-filters__field.is-open {
  z-index: 30;
}

.explorer-user-filters__field--inline {
  grid-column: span 2;
}

.explorer-user-filters__range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.explorer-user-filters__range-inputs input,
.explorer-user-filters__picker,
.explorer-user-filters__search {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  color: inherit;
  padding: 8px 10px;
}

.explorer-user-filters__range-inputs input:focus,
.explorer-user-filters__picker:focus-visible,
.explorer-user-filters__search:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.explorer-user-filters__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  align-items: center;
}

.explorer-user-filters__choice,
.explorer-user-filters__option {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.explorer-user-filters__choice span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 13px;
}


.explorer-user-filters__choice input:checked + span,
.explorer-user-filters__picker.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-text);
}

.explorer-user-filters__choice input:focus-visible + span {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.explorer-user-filters__picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--color-surface);
  text-align: start;
}

.explorer-user-filters__picker-label {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--color-muted);
}

.explorer-user-filters__picker.is-active .explorer-user-filters__picker-label {
  color: inherit;
}

.explorer-user-filters__caret {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-block-start: -3px;
  border-inline-end: 1.5px solid var(--color-muted);
  border-bottom: 1.5px solid var(--color-muted);
  transform: rotate(45deg);
}

.explorer-user-filters__count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.explorer-user-filters__popover {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 16px 40px var(--color-shadow-soft);
}

.explorer-user-filters__popover[hidden] {
  display: none !important;
}

.explorer-user-filters__popover.is-open {
  display: flex;
}

.explorer-user-filters__search {
  min-height: 36px;
}

.explorer-user-filters__options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}

.explorer-user-filters__option {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
}

.explorer-user-filters__option:hover {
  background: rgba(148, 163, 184, 0.1);
}

.explorer-user-filters__option input:checked + span {
  color: var(--color-primary);
}

.explorer-user-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border-soft);
}

.explorer-user-filters__chips[hidden] {
  display: none;
}

.explorer-user-filters__chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  font-size: 12px;
}

.explorer-user-filters__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.explorer-user-filters__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.explorer-user-filters__create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.explorer-user-filters__create[hidden] {
  display: none !important;
}

.explorer-user-filters__create .isax {
  width: 16px;
  height: 16px;
}

.explorer-user-filters__actions .primary-button.is-ready {
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.explorer-user-filters__error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border-soft);
}

.explorer-user-filters__error p {
  margin: 0;
  color: #b91c1c;
  font-size: 13px;
}

body.is-admin-dark .explorer-user-filters__card,
body.is-admin-dark .explorer-user-filters__popover {
  background: var(--color-surface);
}

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

@media (max-width: 720px) {
  .explorer-user-filters__header,
  .explorer-user-filters__footer {
    align-items: stretch;
  }

  .explorer-user-filters__facets {
    grid-template-columns: 1fr;
  }

  .explorer-user-filters__field--inline {
    grid-column: span 1;
  }
}

.explorer-campaign-audience-modal {
  z-index: 12040;
}

.explorer-campaign-audience {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.explorer-campaign-audience__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.explorer-campaign-audience__label {
  font-size: 13px;
}

.explorer-campaign-audience__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.7;
}

.explorer-user-modal__header-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.explorer-user-analytics-modal {
  z-index: 12050;
}

.explorer-user-analytics-modal .dataset-modal__dialog,
.explorer-user-analytics-modal__dialog {
  width: min(1280px, 98vw);
  max-height: 94vh;
  height: min(94vh, 1100px);
}

.explorer-user-analytics-modal .dataset-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.explorer-user-analytics.page-card,
.explorer-user-analytics.page-card--wide {
  padding: 0;
  margin: 0;
  max-width: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.explorer-user-analytics__lock {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: rgba(148, 163, 184, 0.1);
}

.explorer-user-analytics__lock strong {
  font-size: 13px;
}

.explorer-user-analytics__lock span {
  color: var(--color-muted);
  font-size: 12px;
}

.explorer-user-analytics__lock p {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.7;
}

body:has(.explorer-user-analytics-modal.is-open) .analytics-date-picker {
  z-index: 12080;
}

.explorer-user-analytics-float-search {
  z-index: 12070;
}

.page[data-page="campaign-audiences"] .page-card,
.page[data-page="campaign-audiences"] .page-card--wide {
  width: 100%;
  max-width: none;
  overflow: visible;
}

.campaign-audiences {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.campaign-audiences.is-loading {
  opacity: 0.72;
}

.campaign-audiences [hidden] {
  display: none !important;
}

.campaign-audiences__toolbar,
.campaign-audiences__editor-head,
.campaign-audiences__editor-lead,
.campaign-audiences__actions,
.campaign-audiences__tools,
.campaign-audiences__members-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.campaign-audiences__toolbar,
.campaign-audiences__editor-head,
.campaign-audiences__members-head {
  justify-content: space-between;
}

.campaign-audiences__tools {
  flex: 1 1 auto;
  min-width: 0;
}

.campaign-audiences__search {
  flex: 1 1 280px;
  max-width: 420px;
}

.campaign-audiences__search input {
  width: 100%;
  min-height: 40px;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 14px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  color: inherit;
  padding-block: 8px;
  padding-inline-end: 12px;
}

.campaign-audiences__search input::placeholder {
  color: var(--color-muted);
}

.campaign-audiences__search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.campaign-audiences__meta,
.campaign-audiences__error,
.campaign-audiences__hint,
.campaign-audiences__preview,
.campaign-audiences__editor-subtitle {
  margin: 0;
  font-size: 13px;
}

.campaign-audiences__error {
  color: #b91c1c;
}

.campaign-audiences__hint,
.campaign-audiences__preview,
.campaign-audiences__meta,
.campaign-audiences__editor-subtitle {
  color: var(--color-muted);
}

.campaign-audiences__empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 20px;
  border-radius: 20px;
  border: 1px dashed var(--color-border-soft);
  text-align: center;
}

.campaign-audiences__empty p {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.campaign-audiences__table-wrap {
  overflow: auto;
  max-height: min(64vh, 720px);
  border-radius: 20px;
}

.campaign-audiences__row {
  cursor: pointer;
}

.campaign-audiences__row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.campaign-audiences__count,
.campaign-audiences__id,
.campaign-audiences__email {
  font-variant-numeric: tabular-nums;
}

.campaign-audiences__email,
.campaign-audiences__id {
  text-align: start;
}

.campaign-audiences__row-action {
  width: 1%;
  white-space: nowrap;
}

.campaign-audiences__editor,
.campaign-audiences__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.campaign-audiences__editor-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-block-end: 12px;
  background: var(--color-surface);
}

.campaign-audiences__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.campaign-audiences__back .isax,
.campaign-audiences__toolbar .isax-add {
  width: 16px;
  height: 16px;
}

.campaign-audiences__toolbar .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.campaign-audiences__title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.campaign-audiences__editor-title,
.campaign-audiences__members-title {
  margin: 0;
  font-size: 16px;
}

.campaign-audiences__editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.campaign-audiences__main,
.campaign-audiences__members {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.campaign-audiences__field,
.campaign-audiences__filters,
.campaign-audiences__preview {
  flex-shrink: 0;
}

.campaign-audiences__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campaign-audiences__label {
  font-size: 13px;
}

.campaign-audiences__preview {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.1);
  line-height: 1.7;
}

.campaign-audiences__preview.is-ready {
  background: var(--color-primary-soft);
}

.campaign-audiences__members {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

.campaign-audiences__members-count {
  font-size: 12px;
  color: var(--color-muted);
}

.campaign-audiences__delete {
  color: #b91c1c;
}

@media (max-width: 1100px) {
  .campaign-audiences__editor-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .campaign-audiences__toolbar,
  .campaign-audiences__editor-head,
  .campaign-audiences__search {
    max-width: none;
  }

  .campaign-audiences__table-wrap {
    max-height: none;
  }
}

.content-audience-targeting-host {
  width: 100%;
}

.content-audience-targeting {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-soft);
}

.content-audience-targeting__title,
.content-audience-targeting__hint,
.content-audience-targeting__empty,
.content-audience-targeting__error {
  margin: 0;
}

.content-audience-targeting__title {
  font-size: 13px;
  font-weight: 600;
}

.content-audience-targeting__modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-audience-targeting__mode,
.content-audience-targeting__option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.content-audience-targeting__option {
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--color-surface);
}

.content-audience-targeting__option-name {
  flex: 1 1 auto;
  min-width: 0;
}

.content-audience-targeting__option-meta,
.content-audience-targeting__hint,
.content-audience-targeting__empty {
  color: var(--color-muted);
  font-size: 12px;
}

.content-audience-targeting__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.content-audience-targeting__error {
  color: #b91c1c;
  font-size: 12px;
}

.content-audience-targeting__picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-audience-targeting__picker[hidden] {
  display: none !important;
}

.bale-phone {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.bale-phone__stat,
.bale-phone__webhook,
.bale-phone__table-wrap,
.bale-phone__detail {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 20px;
  padding: 16px;
}

.bale-phone__stat strong {
  display: block;
  font-size: 1.25rem;
}

.bale-phone__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bale-phone__filters input,
.bale-phone__filters select {
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  padding: 8px 10px;
}

.bale-phone__table-wrap {
  overflow: auto;
}

.bale-phone table {
  width: 100%;
  border-collapse: collapse;
}

.bale-phone th,
.bale-phone td {
  text-align: start;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border-soft);
  font-size: 13px;
}

.bale-phone__empty {
  margin: 0;
  color: var(--color-text-muted, #64748b);
}

.bale-phone__detail pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
}
