:root {
  color-scheme: dark;
  --bg: #111217;
  --panel: #161a20;
  --panel-2: #1d222b;
  --panel-3: #20252d;
  --line: #2d333d;
  --line-soft: #242a33;
  --text: #d7dce8;
  --muted: #98a2b7;
  --muted-2: #717b91;
  --orange: #ff8b1a;
  --blue: #5794f2;
  --green: #73bf69;
  --red: #f2495c;
  --amber: #f2cc0c;
  --purple: #b877d9;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 139, 26, 0.14), transparent 330px),
    rgba(9, 10, 14, 0.78);
  backdrop-filter: blur(8px);
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.sync-overlay.done {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.sync-card {
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid rgba(64, 73, 88, 0.92);
  border-radius: 8px;
  background: rgba(22, 26, 32, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.sync-card strong {
  color: #f3f6fb;
  font-size: 16px;
}

.sync-card small {
  color: var(--muted);
}

.sync-mark {
  width: 22px;
  height: 22px;
  border: 4px solid rgba(255, 139, 26, 0.24);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: syncSpin 0.9s linear infinite;
}

.sync-bar {
  position: relative;
  overflow: hidden;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: #252b35;
}

.sync-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--orange), #ffbd6b);
  animation: syncBar 1.1s ease-in-out infinite;
}

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

@keyframes syncBar {
  0% {
    transform: translateX(-105%);
  }

  100% {
    transform: translateX(245%);
  }
}

.auth-screen {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 139, 26, 0.08), transparent 310px),
    linear-gradient(180deg, rgba(255, 139, 26, 0.12), transparent 260px),
    var(--bg);
}

.auth-screen::before,
.auth-screen::after {
  content: "";
  position: absolute;
  inset: -2% -4% 0;
  pointer-events: none;
}

.auth-screen::before {
  background:
    linear-gradient(180deg, rgba(17, 18, 23, 0.04), rgba(17, 18, 23, 0.42) 68%, rgba(17, 18, 23, 0.14)),
    url("./assets/pixel-mountains-login-generated.png") center bottom / cover no-repeat;
  filter: saturate(1.12) contrast(1.03);
  opacity: 0.98;
  transform: translate3d(0, 0, 0) scale(1.02);
  animation: mountainDrift 18s ease-in-out infinite alternate;
}

.auth-screen::after {
  background:
    linear-gradient(115deg, transparent 0 28%, rgba(255, 139, 26, 0.12) 42%, transparent 56% 100%),
    radial-gradient(circle at 50% 58%, rgba(255, 139, 26, 0.11), transparent 250px),
    linear-gradient(180deg, rgba(7, 8, 12, 0.08), rgba(7, 8, 12, 0.34));
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: mountainSheen 12s ease-in-out infinite alternate;
}

.auth-screen[hidden] {
  display: none;
}

.auth-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(180deg, transparent 0%, #000 10%, #000 86%, transparent 100%);
}

.auth-particles span {
  position: absolute;
  left: var(--x);
  top: -24px;
  width: var(--size);
  height: var(--size);
  border-radius: 2px;
  background: rgba(255, 139, 26, var(--alpha));
  box-shadow:
    0 0 8px rgba(255, 139, 26, calc(var(--alpha) * 0.7)),
    0 0 18px rgba(255, 99, 22, calc(var(--alpha) * 0.2));
  opacity: 0;
  transform: translate3d(0, -40px, 0);
  animation:
    emberDrop var(--duration) linear var(--delay) infinite,
    emberFlicker var(--flicker) ease-in-out var(--delay) infinite alternate;
  will-change: transform, opacity;
}

.auth-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid rgba(64, 73, 88, 0.9);
  border-radius: 8px;
  background: rgba(22, 26, 32, 0.88);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 139, 26, 0.03) inset;
  backdrop-filter: blur(10px);
}

.auth-brand {
  display: flex;
  width: max-content;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-form,
.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form {
  gap: 12px;
}

.auth-field {
  position: relative;
}

.auth-form label span {
  color: #dfe5f3;
  font-weight: 700;
}

.auth-form input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111118;
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.auth-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(87, 148, 242, 0.35);
}

.auth-form input.invalid {
  border-color: rgba(242, 73, 92, 0.92);
  box-shadow:
    0 0 0 1px rgba(242, 73, 92, 0.35),
    0 0 0 4px rgba(242, 73, 92, 0.08);
}

.field-error,
.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-top: 1px;
  padding: 6px 9px;
  border: 1px solid rgba(242, 73, 92, 0.34);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(242, 73, 92, 0.14), rgba(120, 18, 34, 0.12));
  color: #ffc5cb;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.field-error::before,
.auth-error::before {
  content: "!";
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  background: var(--orange);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.field-error[hidden],
.auth-error[hidden] {
  display: none;
}

@keyframes mountainDrift {
  0% {
    transform: translate3d(-10px, 0, 0) scale(1.025);
  }

  100% {
    transform: translate3d(10px, -8px, 0) scale(1.035);
  }
}

@keyframes mountainSheen {
  0% {
    opacity: 0.36;
    transform: translate3d(-22px, 0, 0);
  }

  100% {
    opacity: 0.58;
    transform: translate3d(22px, -6px, 0);
  }
}

@keyframes emberDrop {
  0% {
    opacity: 0;
    transform: translate3d(0, -48px, 0) scale(0.85);
  }

  8% {
    opacity: var(--alpha);
  }

  64% {
    opacity: var(--alpha);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 108vh, 0) scale(0.55);
  }
}

@keyframes emberFlicker {
  0% {
    filter: blur(0);
    box-shadow:
      0 0 7px rgba(255, 139, 26, calc(var(--alpha) * 0.55)),
      0 0 15px rgba(255, 99, 22, calc(var(--alpha) * 0.15));
  }

  100% {
    filter: blur(0.25px);
    box-shadow:
      0 0 11px rgba(255, 180, 90, calc(var(--alpha) * 0.78)),
      0 0 24px rgba(255, 99, 22, calc(var(--alpha) * 0.24));
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-screen::before,
  .auth-screen::after,
  .auth-particles span {
    animation: none;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 48px 1fr;
}

.app-shell[hidden] {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #14181f;
}

body.sidebar-collapsed .sidebar {
  overflow: hidden;
}

.brand-row {
  display: grid;
  grid-template-columns: 20px 1fr 32px;
  align-items: center;
  height: 35px;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: #f0f3fa;
  font-weight: 600;
}

body.sidebar-collapsed .brand-row {
  grid-template-columns: 28px;
  justify-content: center;
  padding: 0 8px;
}

body.sidebar-collapsed .brand-row span,
body.sidebar-collapsed .brand-mark {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  display: inline-grid;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 4px solid var(--orange);
  border-radius: 50%;
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--orange);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-left: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.icon-button:hover,
.nav-item:hover,
.button:hover,
.segmented button:hover {
  background: #272c35;
  color: #fff;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: #aab4c8;
  text-align: left;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 0;
  border-radius: 0;
  font-size: 0;
}

body.sidebar-collapsed .nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item.active {
  border-left-color: var(--orange);
  background: #30343c;
  color: #fff;
}

.nav-item.muted {
  color: #8f9bb2;
}

.workspace {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent 180px),
    var(--bg);
}

body.editor-mode .app-shell {
  grid-template-columns: 1fr;
}

body.editor-mode .sidebar,
body.editor-mode .topbar {
  display: none;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(260px, 410px) auto;
  align-items: center;
  height: 35px;
  gap: 12px;
  padding: 0 8px 0 32px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #171c24;
  color: #dfe5f3;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.user-chip.active,
.user-chip:hover {
  border-color: rgba(87, 148, 242, 0.72);
  background: #1d2530;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 74px;
  z-index: 80;
  display: grid;
  gap: 12px;
  width: min(320px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171c24;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu-head {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.profile-menu-head strong {
  color: #f3f6fb;
}

.profile-menu-head span,
.profile-menu-label {
  color: var(--muted);
  font-size: 12px;
}

.profile-menu-section {
  display: grid;
  gap: 8px;
}

.language-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.language-toggle button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111720;
  color: #dfe5f3;
  font-weight: 800;
  cursor: pointer;
}

.language-toggle button.active {
  border-color: rgba(255, 139, 26, 0.85);
  background: rgba(255, 139, 26, 0.16);
  color: #fff;
}

.profile-password-form {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.profile-password-form label {
  display: grid;
  gap: 6px;
}

.profile-password-form label span {
  color: #c9d4e8;
  font-size: 12px;
  font-weight: 700;
}

.profile-password-form input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #10151c;
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.profile-password-form input:focus {
  border-color: var(--blue);
}

.breadcrumb {
  font-size: 13px;
  color: #b9c2d7;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111118;
  color: var(--muted);
  padding: 0 9px;
}

.field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

select {
  color-scheme: dark;
}

textarea {
  resize: vertical;
}

kbd {
  color: #aeb7cb;
  font-size: 12px;
}

.view {
  display: none;
  padding: 30px 32px 44px;
}

.view.active {
  display: block;
}

.view.editor-view {
  min-height: 100vh;
  padding: 0;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.page-heading.compact {
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #eef2fb;
  font-size: 29px;
  line-height: 1.2;
  font-weight: 500;
}

h2 {
  color: #eef2fb;
  font-size: 15px;
  font-weight: 600;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.page-heading p {
  margin-top: 8px;
}

.heading-actions,
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-heading.compact .heading-actions {
  align-items: flex-start;
}

.detail-heading-actions {
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-height: 50px;
}

.detail-heading-actions .date-range-wrap,
.detail-heading-actions .refresh-control,
.detail-heading-actions > .button {
  flex: 0 0 auto;
}

.detail-heading-actions .date-range-wrap .button {
  min-width: 96px;
}

.detail-heading-actions .refresh-control {
  min-width: 108px;
  max-width: none;
}

.detail-heading-actions .refresh-control small {
  right: 0;
  left: auto;
  transform: none;
  width: max-content;
  max-width: min(640px, calc(100vw - 24px));
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.refresh-control {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  align-self: flex-start;
  padding-bottom: 16px;
}

.refresh-control .button {
  min-width: 92px;
}

.refresh-control small {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
}

.refresh-control.is-running small {
  color: #f0b35a;
}

.refresh-control.is-cooling small {
  color: #8fb8ff;
}

.filter-row {
  position: relative;
}

.dashboard-search-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
  max-width: 440px;
  min-width: 240px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111820;
  color: #dfe5f3;
}

.dashboard-search-control svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-search-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eef2fb;
  font: inherit;
}

.dashboard-search-control input::placeholder {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #262b34;
  color: #dfe5f3;
  font-weight: 600;
}

.button.primary {
  border-color: #e87710;
  background: #f5821f;
  color: #171717;
}

.button.secondary,
.button.filter {
  background: #242932;
}

.button.filter.active {
  border-color: #5794f2;
  box-shadow: 0 0 0 1px rgba(87, 148, 242, 0.48);
}

.button.secondary.active {
  border-color: #59d7cd;
  box-shadow: 0 0 0 1px rgba(89, 215, 205, 0.35);
}

.button.primary.active {
  background: #d96f12;
}

.menu-button::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.menu-button.active::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.button.danger-button,
.danger-button {
  border-color: rgba(242, 73, 92, 0.7);
  background: #e02f72;
  color: #fff;
}

.new-menu-wrap {
  position: relative;
}

.new-menu {
  position: absolute;
  top: 39px;
  right: 0;
  z-index: 16;
  width: 144px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #20242c;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.new-menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #dfe5f3;
  text-align: left;
  font-weight: 600;
}

.new-menu button:hover {
  background: #30343c;
  color: #fff;
}

.button.mini {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent;
}

.button.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: syncSpin 0.75s linear infinite;
}

.text-button {
  border: 0;
  background: transparent;
  color: #dfe5f3;
  font-weight: 700;
  text-align: left;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8fb3ff;
  font-weight: 600;
}

.filter-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.button.filter {
  min-width: 0;
}

.button.filter.has-tag {
  gap: 7px;
  padding-right: 7px;
}

.tag-filter-label {
  color: #cbd5e6;
}

.tag-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px 0 5px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.tag-filter-chip .chip-x {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: -1px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.95);
}

.tag-filter-chip .chip-x svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.tag-filter-chip .chip-x:hover {
  background: rgba(255, 255, 255, 0.18);
}

.tag-filter-chip.green {
  background: rgba(115, 191, 105, 0.22);
  border-color: rgba(115, 191, 105, 0.45);
  color: #b9d9b4;
}

.tag-filter-chip.red {
  background: rgba(242, 73, 92, 0.2);
  border-color: rgba(242, 73, 92, 0.45);
  color: #f2b1b8;
}

.tag-filter-chip.amber,
.tag-filter-chip.orange {
  background: rgba(255, 152, 48, 0.2);
  border-color: rgba(255, 152, 48, 0.42);
  color: #f1c18d;
}

.tag-filter-chip.purple {
  background: rgba(184, 119, 217, 0.2);
  border-color: rgba(184, 119, 217, 0.42);
  color: #d2b9e5;
}

.tag-filter-chip.blue {
  background: rgba(87, 148, 242, 0.22);
  border-color: rgba(87, 148, 242, 0.45);
  color: #bdd3f5;
}

.tag-filter-chip.olive {
  background: rgba(180, 190, 70, 0.2);
  border-color: rgba(180, 190, 70, 0.42);
  color: #d1d7a3;
}

.tag-popover {
  position: absolute;
  top: 38px;
  left: 0;
  z-index: 15;
  width: 230px;
  max-height: 330px;
  overflow: hidden;
  border: 1px solid #303846;
  border-radius: 6px;
  background: #20242c;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(17, 21, 28, 0.86);
}

.bulk-actions[hidden] {
  display: none;
}

.bulk-actions .button {
  min-width: 70px;
  min-height: 30px;
}

.bulk-actions span {
  padding: 0 6px 0 2px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.tag-popover-search {
  display: grid;
  grid-template-columns: 1fr 20px;
  align-items: center;
  min-height: 35px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  background: #111118;
  color: var(--muted);
}

.tag-popover-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.tag-options {
  display: grid;
  max-height: 254px;
  overflow-y: auto;
  padding: 4px;
}

.tag-option {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}

.tag-option.highlighted,
.tag-option:hover,
.tag-option.selected {
  background: #3a3d46;
}

.tag-option-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-clear {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #181d24;
  color: #dfe5f3;
  font-weight: 600;
}

.tag-empty {
  min-height: 54px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.date-range-wrap {
  position: relative;
}

.detail-range-left {
  display: inline-flex;
  margin-top: 16px;
}

.detail-range-left .button {
  min-width: 156px;
}

.date-range-popover {
  position: absolute;
  top: 40px;
  left: 0;
  z-index: 24;
  width: 540px;
  color: var(--text);
}

.heading-actions .date-range-popover {
  right: 0;
  left: auto;
}

.date-range-popover[hidden] {
  display: none;
}

.date-range-popover.date-input-popover {
  position: fixed;
  z-index: 80;
  width: 292px;
}

.date-range-popover.date-input-range-popover {
  position: fixed;
  z-index: 80;
}

.date-input-range-popover .range-presets {
  display: none;
}

.date-input-range-popover .range-picker-shell {
  grid-template-columns: minmax(0, 1fr);
}

[data-custom-date-input] {
  cursor: pointer;
  caret-color: auto;
}

[data-custom-date-input].active {
  border-color: rgba(255, 139, 26, 0.82);
  box-shadow: 0 0 0 3px rgba(255, 139, 26, 0.16);
}

.range-picker-shell {
  display: grid;
  grid-template-columns: 172px 340px;
  gap: 10px;
  align-items: start;
}

.range-picker-main {
  min-width: 0;
}

.range-presets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 0;
  padding: 10px;
  border: 1px solid rgba(255, 139, 26, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 139, 26, 0.12), transparent 42%),
    rgba(14, 18, 25, 0.98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.range-presets button {
  min-height: 36px;
  border: 1px solid rgba(255, 139, 26, 0.18);
  border-radius: 9px;
  background: rgba(255, 139, 26, 0.08);
  color: #d9e2f2;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.range-presets button:hover,
.range-presets button.active {
  border-color: rgba(255, 139, 26, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.34), rgba(255, 139, 26, 0.16)),
    #151a22;
  color: #fff4e8;
  box-shadow: 0 0 0 2px rgba(255, 139, 26, 0.1);
}

.range-fields {
  display: grid;
  grid-template-columns: 1fr 20px 1fr;
  align-items: center;
  gap: 8px;
}

.range-field {
  display: grid;
  grid-template-columns: 1fr 18px;
  align-items: center;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid #323b48;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.035), transparent),
    #11161d;
  color: var(--text);
  text-align: left;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.range-field span {
  color: #d49a61;
  font-size: 10px;
  font-weight: 800;
}

.range-field strong {
  color: #f3f6fb;
  font-size: 13px;
  grid-column: 1;
}

.range-field svg {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 17px;
  height: 17px;
  color: #d6a46d;
}

.range-field.active {
  border-color: rgba(255, 139, 26, 0.82);
  box-shadow:
    0 0 0 3px rgba(255, 139, 26, 0.18),
    0 16px 32px rgba(0, 0, 0, 0.32);
}

.range-arrow {
  display: grid;
  place-items: center;
  color: #d89048;
  font-size: 24px;
}

.calendar-card {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 139, 26, 0.42);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 139, 26, 0.16), transparent 38%),
    linear-gradient(180deg, #171c24, #11161d);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
}

.single-calendar-card {
  margin-top: 0;
}

.calendar-head,
.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-head {
  margin-bottom: 12px;
}

.calendar-head strong {
  color: #f3f6fb;
  font-size: 14px;
}

.calendar-head button,
.calendar-actions button {
  min-height: 30px;
  border: 1px solid rgba(255, 139, 26, 0.18);
  border-radius: 9px;
  background: rgba(255, 139, 26, 0.1);
  color: #ffd0a0;
  font-weight: 800;
}

.calendar-head button:hover,
.calendar-actions button:hover {
  border-color: rgba(255, 139, 26, 0.52);
  background: rgba(255, 139, 26, 0.18);
}

.calendar-actions button.primary {
  border-color: rgba(255, 139, 26, 0.72);
  background: linear-gradient(180deg, #ff9b2d, #ff7f11);
  color: #170d05;
  box-shadow: 0 10px 24px rgba(255, 127, 17, 0.2);
}

.calendar-actions button.primary:hover {
  border-color: rgba(255, 182, 98, 0.9);
  background: linear-gradient(180deg, #ffab4d, #ff861a);
}

.calendar-head button {
  width: 34px;
  font-size: 22px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 5px;
  color: #a9b2c2;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #dfe5f3;
  font-size: 13px;
  font-weight: 800;
}

.calendar-day:hover {
  border-color: rgba(255, 139, 26, 0.42);
  background: rgba(255, 139, 26, 0.11);
}

.calendar-day.outside {
  color: #667184;
}

.calendar-day.in-range {
  background: rgba(255, 139, 26, 0.13);
  color: #ffd9b3;
}

.calendar-day.selected-start,
.calendar-day.selected-end {
  background:
    linear-gradient(180deg, #ff9d2e, #f47b15);
  color: #160d05;
  box-shadow:
    0 0 18px rgba(255, 139, 26, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.calendar-day.today:not(.selected-start):not(.selected-end) {
  border-color: rgba(255, 139, 26, 0.72);
  color: #ffd0a0;
}

.calendar-actions {
  margin-top: 10px;
}

.calendar-actions::before {
  content: "GMT +3";
  order: 2;
  min-width: 86px;
  text-align: center;
  color: #d49a61;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.calendar-actions.single-calendar-actions::before {
  content: none;
}

.calendar-actions button:first-child {
  order: 1;
}

.calendar-actions button.primary {
  order: 3;
}

.calendar-actions button {
  padding: 0 10px;
  font-size: 12px;
}

.field.wide {
  width: 100%;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: #e5e9f2;
  font-weight: 600;
}

.custom-check-line {
  padding: 0 2px;
}

.custom-check-line span {
  line-height: 1;
}

.spacer {
  flex: 1;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.segmented button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.segmented button + button {
  margin-left: 2px;
}

.segmented .active {
  background: #303743;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.segmented button:not(.active):hover {
  background: #222832;
  color: #dfe5f3;
}

.table-panel,
.panel,
.metric-card,
.alert-card {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-panel {
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}

.table-head,
.dashboard-row {
  display: grid;
  grid-template-columns: 54px minmax(360px, 1fr) minmax(320px, 0.9fr) 78px;
  align-items: center;
  min-height: 36px;
}

.table-head {
  background: #22262e;
  color: #dce2f0;
  font-weight: 600;
}

.dashboard-row {
  border-top: 1px solid transparent;
  color: #c4cad8;
  position: relative;
  overflow: hidden;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.dashboard-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.dashboard-row:hover {
  background: linear-gradient(90deg, rgba(87, 148, 242, 0.08), #1b2028 34%, #171c23);
  color: #eef2fb;
}

.dashboard-row:hover::before {
  background: rgba(255, 139, 26, 0.72);
  opacity: 1;
}

.dashboard-row.selected {
  background: linear-gradient(90deg, rgba(87, 148, 242, 0.15), #202632);
}

.dashboard-row.selected::before {
  background: var(--blue);
  opacity: 1;
}

.check-cell {
  display: grid;
  place-items: center;
}

.visual-check {
  appearance: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #586172;
  border-radius: 4px;
  background: #171b22;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.visual-check::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  opacity: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

.visual-check:checked {
  border-color: #5794f2;
  background: #2766d8;
  box-shadow: 0 0 0 3px rgba(87, 148, 242, 0.16);
}

.visual-check:checked::after {
  opacity: 1;
}

.visual-check:indeterminate {
  border-color: #5794f2;
  background: #2766d8;
  box-shadow: 0 0 0 3px rgba(87, 148, 242, 0.16);
}

.visual-check:indeterminate::after {
  width: 8px;
  height: 2px;
  border: 0;
  background: #fff;
  opacity: 1;
  transform: none;
}

.read-only-role #selectAllDashboards,
.read-only-role .row-check {
  display: none;
}

.read-only-role .check-cell {
  pointer-events: none;
}

.read-only-role .table-head,
.read-only-role .dashboard-row {
  grid-template-columns: minmax(360px, 1fr) minmax(280px, 0.72fr) 78px;
}

.read-only-role .check-cell {
  display: none;
}

.read-only-role #dashboards .dashboard-row {
  padding-left: 28px;
}

.read-only-role #dashboards .name-cell {
  margin-left: calc(var(--tree-depth, 0) * 40px);
  max-width: calc(100% - calc(var(--tree-depth, 0) * 40px));
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  width: 100%;
  margin-left: calc(var(--tree-depth, 0) * 22px);
  max-width: calc(100% - calc(var(--tree-depth, 0) * 22px));
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 600;
  text-align: left;
}

.name-cell.folder {
  color: #dbe2f0;
}

.indent-1 {
  padding-left: 6px;
}

.chevron {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #9eb4d6;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.chevron svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  transform-origin: 50% 50%;
}

.name-cell:hover .chevron {
  border-color: #384150;
  background: #242a34;
}

.chevron.open {
  color: var(--orange);
  transform: rotate(90deg);
}

.chevron.empty {
  visibility: hidden;
}

.row-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid #313a47;
  border-radius: 7px;
  background: #11161d;
  color: #aab4c8;
}

.row-icon.folder {
  border-color: rgba(255, 139, 26, 0.32);
  background: rgba(255, 139, 26, 0.08);
  color: #ffb35c;
}

.row-icon.dashboard {
  border-color: rgba(87, 148, 242, 0.28);
  background: rgba(87, 148, 242, 0.08);
  color: #8fb8ff;
}

.row-title-wrap {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.row-title-wrap strong {
  overflow: hidden;
  color: #e6ebf5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title-wrap small {
  color: #78849a;
  font-size: 12px;
}

.row-rename-button,
.row-code-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1px solid #354052;
  border-radius: 6px;
  background: #161d27;
  color: #9fb0c8;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease,
    background 0.14s ease;
}

.row-actions-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  gap: 6px;
  justify-self: end;
  width: 62px;
  height: 100%;
  min-height: 36px;
  min-width: 0;
}

.row-actions-right:empty {
  pointer-events: none;
}

.row-rename-button svg,
.row-code-button svg {
  display: block;
  width: 14px;
  height: 14px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-row:hover .row-rename-button,
.dashboard-row:hover .row-code-button,
.row-rename-button:focus-visible,
.row-code-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.row-rename-button:hover,
.row-code-button:hover {
  border-color: rgba(255, 139, 26, 0.72);
  background: rgba(255, 139, 26, 0.1);
  color: #ffb35c;
}

.owner-chip,
.updated-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #151a22;
  color: #cbd3e2;
  font-size: 12px;
  font-weight: 700;
}

.updated-chip {
  color: #99a5ba;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.tag,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag {
  border: 1px solid transparent;
  cursor: pointer;
}

.tag-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 139, 26, 0.45);
  border-radius: 5px;
  background: #19202b;
  color: #9eb4d6;
  font-size: 13px;
  font-weight: 800;
  line-height: 22px;
  font-family: Arial, sans-serif;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.tag-add-button:hover {
  border-color: rgba(255, 139, 26, 0.9);
  background: rgba(255, 139, 26, 0.16);
  color: #ffd0a0;
  box-shadow: 0 0 0 3px rgba(255, 139, 26, 0.12);
  transform: translateY(-1px);
}

.tag-add-button.tag-add-left {
  margin-right: 2px;
}

.tag-manager {
  display: grid;
  gap: 18px;
}

.tag-manager-section,
.tag-manager-new {
  display: grid;
  gap: 9px;
}

.tag-manager-section > span,
.tag-manager-new > span {
  color: #c7d2e6;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-manager-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid #27303c;
  border-radius: 8px;
  background: #10151d;
}

.tag-manager-cloud em {
  align-self: center;
  color: #78849a;
  font-style: normal;
}

.tag-manager-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.tag-manager-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tag-manager-chip i {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-style: normal;
  line-height: 1;
  text-align: center;
}

.tag-manager-chip.active {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(255, 139, 26, 0.12);
}

.tag-manager-chip.green {
  border-color: rgba(115, 191, 105, 0.38);
  background: rgba(115, 191, 105, 0.18);
  color: #b9d9b4;
}

.tag-manager-chip.red {
  border-color: rgba(242, 73, 92, 0.38);
  background: rgba(242, 73, 92, 0.17);
  color: #f2b1b8;
}

.tag-manager-chip.blue {
  border-color: rgba(87, 148, 242, 0.4);
  background: rgba(87, 148, 242, 0.18);
  color: #bdd3f5;
}

.tag-manager-chip.amber {
  border-color: rgba(242, 204, 12, 0.34);
  background: rgba(242, 204, 12, 0.16);
  color: #e8dfa2;
}

.tag-manager-chip.purple {
  border-color: rgba(184, 119, 217, 0.38);
  background: rgba(184, 119, 217, 0.18);
  color: #d2b9e5;
}

.tag-manager-chip.orange {
  border-color: rgba(255, 152, 48, 0.36);
  background: rgba(255, 152, 48, 0.17);
  color: #f1c18d;
}

.tag-manager-chip.olive {
  border-color: rgba(180, 190, 70, 0.34);
  background: rgba(180, 190, 70, 0.17);
  color: #d1d7a3;
}

.tag-manager-new > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.tag-manager-new input {
  min-height: 36px;
  border: 1px solid #303947;
  border-radius: 6px;
  background: #0f131b;
  color: var(--text);
  padding: 0 10px;
}

.tag-manager-new input:focus {
  border-color: #ff8b1a;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255, 139, 26, 0.14);
}

.team-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 14px;
}

.team-settings-card {
  border: 1px solid #293241;
  border-radius: 8px;
  background: #111720;
  padding: 12px;
}

.team-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.team-settings-head strong {
  color: #f4f7ff;
  font-size: 14px;
}

.team-settings-head span {
  color: #9fb0ca;
  font-size: 12px;
}

.team-settings-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #303949;
  border-radius: 7px;
  background: #0e1219;
  color: #e6ebf7;
  padding: 0 10px;
}

.team-buyer-list {
  max-height: 310px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #293241;
  border-radius: 7px;
  scrollbar-color: rgba(255, 133, 27, 0.65) #161c25;
}

.team-buyer-option {
  display: grid;
  grid-template-columns: 18px 54px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid #232b38;
  cursor: pointer;
}

.team-buyer-option:last-child {
  border-bottom: 0;
}

.team-buyer-option:hover {
  background: rgba(255, 133, 27, 0.08);
}

.team-buyer-option input {
  accent-color: var(--orange);
}

.team-buyer-option span {
  width: max-content;
  min-width: 34px;
  border: 1px solid rgba(255, 133, 27, 0.46);
  border-radius: 999px;
  background: rgba(255, 133, 27, 0.13);
  color: #ffd4aa;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  padding: 3px 8px;
}

.team-buyer-option small {
  color: #c6d1e4;
  font-size: 12px;
  font-weight: 700;
}

.team-settings-note {
  margin-top: 12px;
  border: 1px solid rgba(255, 133, 27, 0.28);
  border-radius: 7px;
  background: rgba(255, 133, 27, 0.08);
  color: #c8d3e7;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px;
}

@media (max-width: 820px) {
  .team-settings-grid {
    grid-template-columns: 1fr;
  }
}

.star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #20252d;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.star.active {
  border-color: rgba(242, 204, 12, 0.45);
  background: #5a490b;
  color: #fff1a8;
}

.empty-state {
  min-height: 84px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

.tag.green,
.pill.green {
  background: #3f7940;
}

.tag.red,
.pill.red {
  background: #d92d15;
}

.tag.blue,
.pill.blue {
  background: #1f60d1;
}

.tag.amber,
.pill.amber {
  background: #926f00;
}

.tag.purple {
  background: #8065b7;
}

.tag.orange {
  background: #c45d16;
}

.tag.olive {
  background: #657a12;
}

.tag.green {
  border-color: rgba(115, 191, 105, 0.38);
  background: rgba(115, 191, 105, 0.18);
  color: #b9d9b4;
}

.tag.red {
  border-color: rgba(242, 73, 92, 0.38);
  background: rgba(242, 73, 92, 0.17);
  color: #f2b1b8;
}

.tag.blue {
  border-color: rgba(87, 148, 242, 0.4);
  background: rgba(87, 148, 242, 0.18);
  color: #bdd3f5;
}

.tag.amber {
  border-color: rgba(242, 204, 12, 0.34);
  background: rgba(242, 204, 12, 0.16);
  color: #e8dfa2;
}

.tag.purple {
  border-color: rgba(184, 119, 217, 0.38);
  background: rgba(184, 119, 217, 0.18);
  color: #d2b9e5;
}

.tag.orange {
  border-color: rgba(255, 152, 48, 0.36);
  background: rgba(255, 152, 48, 0.17);
  color: #f1c18d;
}

.tag.olive {
  border-color: rgba(180, 190, 70, 0.34);
  background: rgba(180, 190, 70, 0.17);
  color: #d1d7a3;
}

.tag:hover,
.tag:focus-visible {
  filter: brightness(1.12);
}

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

.metric-card {
  position: relative;
  min-height: 106px;
  padding: 16px;
  border-radius: 6px;
}

.metric-card span,
.panel-title span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  color: #fff;
  font-size: 29px;
  line-height: 1.1;
}

.metric-card.danger {
  border-color: rgba(242, 73, 92, 0.55);
}

.up {
  color: #73bf69 !important;
}

.down {
  color: #f2495c !important;
}

.dashboard-grid,
.home-grid,
.access-layout,
.alert-grid,
.formula-layout,
.builder-layout,
.security-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.home-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.7fr);
}

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

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

.home-wide {
  grid-column: 1 / -1;
}

.home-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.home-control-panel h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.home-control-panel span {
  color: var(--muted);
}

.home-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-range-control {
  position: relative;
}

.overview-control {
  position: relative;
}

.home-range-menu {
  position: absolute;
  z-index: 35;
  top: calc(100% + 6px);
  right: 0;
  min-width: 224px;
  overflow: hidden;
  border: 1px solid #343c49;
  border-radius: 6px;
  background: #242932;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  padding: 5px;
}

.home-range-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d8deea;
  padding: 0 10px;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.home-range-menu button:hover {
  background: #343941;
  color: #fff;
}

.home-range-menu button.active {
  border-left: 3px solid var(--orange);
  background: #343941;
  color: #fff;
}

.buyer-menu {
  min-width: 170px;
}

.overview-custom-buyers {
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.overview-custom-buyers label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 4px;
  color: #d8deea;
  font-weight: 700;
  cursor: pointer;
}

.overview-custom-buyers label:hover {
  background: #343941;
}

.overview-custom-buyers input {
  width: 14px;
  height: 14px;
  accent-color: var(--orange);
}

.overview-custom-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.overview-custom-picker label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #10141b;
  cursor: pointer;
}

.overview-custom-picker label:hover {
  border-color: rgba(255, 139, 26, 0.55);
}

.overview-custom-picker input {
  width: 14px;
  height: 14px;
  accent-color: var(--orange);
}

.overview-custom-picker span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-widget-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.home-widget-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding-top: 18px;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.home-widget-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 139, 26, 0.08), transparent 42%);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.home-widget-card:hover {
  border-color: rgba(255, 139, 26, 0.42);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.home-widget-card:hover::before {
  opacity: 1;
}

.home-widget-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.home-widget-head > span {
  color: #b9c9e6;
  font-size: 13px;
}

.home-widget-actions {
  display: inline-flex;
  gap: 5px;
  opacity: 0.68;
  transition: opacity 0.16s ease;
}

.home-widget-card:hover .home-widget-actions {
  opacity: 1;
}

.home-widget-action {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(143, 155, 178, 0.16);
  border-radius: 7px;
  background: rgba(22, 27, 35, 0.82);
  color: #96a1b5;
}

.home-widget-action svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-widget-action:hover {
  border-color: rgba(255, 139, 26, 0.42);
  background: rgba(255, 139, 26, 0.12);
  color: #ffb66b;
}

.home-widget-action.danger:hover {
  border-color: rgba(255, 85, 85, 0.45);
  background: rgba(255, 85, 85, 0.12);
  color: #ff8e8e;
}

.home-widget-card em {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 139, 26, 0.24);
  border-radius: 999px;
  background: rgba(255, 139, 26, 0.08);
  color: #ffbf7a;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.home-widget-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-widget-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #11161d;
}

.home-widget-option:hover {
  border-color: rgba(255, 139, 26, 0.48);
  background: #151a22;
}

.home-widget-option span {
  display: grid;
  gap: 4px;
}

.home-widget-option small {
  color: var(--muted);
}

.home-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-dashboard-link,
.home-task {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 139, 26, 0.035), transparent 42%),
    #13171d;
  color: #dfe5f3;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.home-dashboard-link {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.home-task {
  grid-template-columns: 1fr;
}

.home-dashboard-link:hover,
.home-task:hover {
  border-color: rgba(255, 139, 26, 0.45);
  background:
    linear-gradient(135deg, rgba(255, 139, 26, 0.08), transparent 45%),
    #1a2028;
  transform: translateY(-1px);
}

.home-dashboard-link span:not(.pill),
.home-task span {
  color: var(--muted);
}

.home-dashboard-link strong,
.home-dashboard-link span,
.home-task strong,
.home-task span {
  display: block;
}

.home-dashboard-link strong,
.home-dashboard-link span:not(.mini-dashboard-icon):not(.home-open-arrow) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-dashboard-icon {
  display: block;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(87, 148, 242, 0.55);
  border-radius: 6px;
  background-color: rgba(87, 148, 242, 0.1);
  background:
    linear-gradient(90deg, transparent 45%, rgba(143, 177, 230, 0.9) 45%, rgba(143, 177, 230, 0.9) 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(143, 177, 230, 0.9) 45%, rgba(143, 177, 230, 0.9) 55%, transparent 55%),
    rgba(87, 148, 242, 0.1);
}

.home-open-arrow {
  display: grid !important;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(87, 148, 242, 0.36);
  border-radius: 6px;
  background: rgba(87, 148, 242, 0.08);
  color: #bcd4ff !important;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  flex: 0 0 32px;
}

.home-open-arrow::before {
  content: ">";
  transform: translateY(-1px);
}

.home-dashboard-link:hover .home-open-arrow {
  border-color: rgba(87, 148, 242, 0.72);
  background: rgba(87, 148, 242, 0.16);
  color: #fff;
}

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

.readiness-grid div {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
}

.readiness-grid small {
  color: var(--muted);
  line-height: 1.45;
}

.readiness-grid .pill {
  justify-self: start;
}

.builder-layout {
  grid-template-columns: 360px 1fr;
}

.builder-preview,
.audit-wide {
  min-width: 0;
}

.builder-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.builder-canvas {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
  align-items: stretch;
}

.builder-widget {
  display: grid;
  gap: 14px;
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #13171d;
  grid-column: span 6;
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    opacity 0.16s ease;
}

.builder-widget.size-full,
.builder-widget.wide {
  grid-column: 1 / -1;
}

.builder-widget.size-third {
  grid-column: span 4;
}

.builder-widget.size-half {
  grid-column: span 6;
}

.builder-widget.dragging {
  opacity: 0.46;
  border-color: var(--blue);
  transform: scale(0.99);
}

.widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.widget-head strong,
.widget-head span {
  display: block;
}

.widget-head span,
.builder-widget small {
  margin-top: 4px;
  color: var(--muted);
}

.widget-actions {
  display: flex;
  gap: 4px;
}

.mini-icon {
  min-width: 26px;
  width: auto;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 800;
}

.size-icon {
  min-width: 38px;
  color: #dfe5f3;
  font-size: 11px;
}

.widget-value {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.builder-placeholder-chart {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  gap: 7px;
  min-height: 120px;
  padding: 10px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.builder-placeholder-chart span {
  height: var(--h);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #5794f2, #73bf69);
}

.builder-status-list {
  display: grid;
  gap: 8px;
}

.builder-status-list div,
.builder-widget-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.builder-status-list div {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #10141b;
}

.builder-status-list span,
.builder-widget-foot span {
  color: var(--muted);
}

.builder-widget-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
}

.builder-model {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.builder-model pre {
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10141b;
  color: #dfe5f3;
  font: 12px/1.5 "Cascadia Mono", Consolas, monospace;
}

.compact-bars {
  height: 126px;
  padding-top: 12px;
}

.mini-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
}

.mini-table span,
.mini-table strong {
  min-height: 34px;
  padding: 9px 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.mini-table span {
  background: #22262e;
  color: #dce2f0;
  font-weight: 700;
}

.detail-filters {
  display: block;
  margin-bottom: 14px;
}

.detail-variable-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(48, 56, 70, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 139, 26, 0.07), transparent 42%),
    #10141b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hidden-panels-notice {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  min-width: min(100%, 360px);
  margin: 0;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(76, 91, 112, 0.78);
  border-radius: 8px;
  background: #121820;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hidden-panels-notice div {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.hidden-panels-notice strong {
  color: #f3f6ff;
  font-size: 13px;
  white-space: nowrap;
}

.hidden-panels-notice span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 139, 26, 0.38);
  border-radius: 999px;
  background: rgba(255, 139, 26, 0.08);
  color: #f5c089;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.hidden-panels-notice .button {
  min-height: 30px;
  padding-inline: 12px;
}

.detail-variable {
  position: relative;
  display: flex;
  min-height: 36px;
  border: 1px solid #343c49;
  border-radius: 6px;
  background: #111720;
}

.detail-variable[data-detail-variable="platform"] {
  width: 280px;
}

.detail-variable > span {
  display: grid;
  place-items: center;
  min-width: 78px;
  padding: 0 10px;
  border-right: 1px solid #343c49;
  color: #dce2f0;
  font-size: 12px;
  font-weight: 800;
}

.detail-variable-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 178px;
  border: 0;
  background: transparent;
  color: #dfe5f3;
  padding: 0 10px 0 12px;
}

.detail-variable-button[aria-expanded="true"] {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--orange);
}

.detail-variable-button strong {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-variable-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #8f9bb2;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-team-settings {
  display: none !important;
}

.detail-team-settings:hover {
  border-color: rgba(255, 133, 27, 0.72);
  background: linear-gradient(180deg, rgba(255, 133, 27, 0.2), rgba(17, 22, 29, 0.98));
}

.detail-team-settings span {
  font-size: 13px;
  font-weight: 800;
}

.detail-team-settings strong {
  color: #9fb0ca;
  font-size: 11px;
  font-weight: 700;
}

.detail-variable-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  left: 78px;
  width: max(220px, calc(100% - 78px));
  max-height: 310px;
  overflow: hidden;
  border: 1px solid #343c49;
  border-radius: 7px;
  background: #20252e;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.detail-variable-search {
  display: block;
  padding: 8px;
  border-bottom: 1px solid #343c49;
}

.detail-variable-search input {
  width: 100%;
  min-height: 32px;
  border: 1px solid #343c49;
  border-radius: 6px;
  background: #11161d;
  color: #dfe5f3;
  padding: 0 9px;
}

.detail-variable-options {
  max-height: 250px;
  overflow: auto;
  scrollbar-width: thin;
}

.detail-variable-options button {
  display: block;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #d8deea;
  padding: 0 12px;
  text-align: left;
  font-weight: 700;
}

.detail-variable-options button:hover,
.detail-variable-options button.active {
  border-left-color: var(--orange);
  background: #343941;
  color: #fff;
}

.editor-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 48px;
  padding: 0 8px 0 20px;
  border-bottom: 1px solid var(--line);
  background: #15191f;
}

.editor-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aeb7cb;
}

.editor-breadcrumb button {
  border: 0;
  background: transparent;
  color: #dfe5f3;
  font-weight: 600;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 520px);
  min-height: calc(100vh - 48px);
  background: #0f1117;
}

.editor-shell:has(.editor-sidepanel.collapsed) {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.editor-shell.sidepanel-collapsed {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.editor-canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 64px 24px;
}

.editor-floating-add {
  position: absolute;
  top: 54px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15191f;
  color: #dfe5f3;
  font-size: 0;
  line-height: 1;
}

.editor-floating-add::before {
  content: "+";
  display: block;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.editor-empty {
  display: grid;
  justify-items: center;
  gap: 18px;
  color: #dfe5f3;
  text-align: center;
}

.editor-empty-icon {
  width: 34px;
  height: 34px;
  background:
    linear-gradient(90deg, var(--orange) 0 6px, transparent 6px 10px, var(--orange) 10px 16px, transparent 16px),
    linear-gradient(0deg, var(--orange) 0 6px, transparent 6px 10px, var(--orange) 10px 16px, transparent 16px);
  background-size: 16px 16px;
}

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

.layout-toggle button {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #242932;
  color: #dfe5f3;
  font-weight: 600;
}

.layout-toggle button.active {
  border-color: var(--orange);
  background: #1a1d25;
}

.editor-empty p,
.editor-empty span {
  color: var(--muted);
}

.editor-panel-grid {
  align-self: start;
  width: min(100%, 1280px);
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 8px;
}

.editor-panel-card,
.editor-group,
.editor-control-pill {
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #15191f;
}

.editor-panel-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-column: span var(--editor-span, 12);
  min-height: var(--editor-height, 210px);
  min-width: 0;
  overflow: hidden;
  padding: 14px 14px 42px;
  container-type: inline-size;
}

.editor-group,
.editor-control-pill {
  grid-column: 1 / -1;
}

.editor-panel-card.selected-editor-panel {
  border-color: rgba(255, 139, 26, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 139, 26, 0.14),
    0 0 28px rgba(255, 139, 26, 0.1);
}

.editor-panel-chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: clamp(3px, 2cqw, 8px);
  height: clamp(48px, calc(var(--editor-height, 210px) - 104px), 240px);
  min-width: 0;
  padding: 10px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.editor-panel-meta em {
  grid-column: 1 / -1;
  color: #ffb25c;
  font-size: 11px;
  font-style: normal;
}

.editor-panel-chart span {
  height: var(--h);
  background: linear-gradient(180deg, #5794f2, #73bf69);
}

.editor-panel-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.editor-panel-meta span,
.editor-panel-meta strong {
  min-height: 22px;
  min-width: 0;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #11161d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dashboard-panel {
  min-height: 250px;
}

.custom-panel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.custom-panel-meta span,
.custom-panel-meta strong {
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #11161d;
  color: var(--muted);
  font-size: 12px;
}

.custom-panel-meta strong {
  color: #dfe5f3;
}

.custom-panel-note {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.custom-stat-value {
  display: grid;
  gap: 6px;
  min-height: 118px;
  align-content: end;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 139, 26, 0.16), transparent 42%),
    #0f141b;
}

.custom-stat-value strong {
  color: #ffb15f;
  font-size: 30px;
}

.custom-stat-value.up strong {
  color: var(--green);
}

.custom-stat-value.down strong {
  color: var(--red);
}

.custom-stat-value span {
  color: var(--muted);
}

.grafana-dashboard {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: start;
  gap: 8px;
  width: 100%;
}

.grafana-row-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.grafana-row-section summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #dce4f5;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
  font-weight: 700;
}

.grafana-row-section summary::-webkit-details-marker {
  display: none;
}

.grafana-row-section summary span {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #a7b1c6;
  transform: rotate(90deg);
  transition: transform 0.16s ease;
}

.grafana-row-section:not([open]) summary span {
  transform: rotate(0deg);
}

.grafana-row-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: start;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid #2b333f;
}

.grafana-panel {
  position: relative;
  grid-column: span var(--panel-span, 6);
  min-width: 0;
  min-height: var(--panel-height, 118px);
  padding: 9px 10px;
  border: 1px solid #303846;
  border-radius: 5px;
  background: #171c22;
  box-shadow: none;
}

.grafana-panel[draggable="true"] {
  cursor: grab;
}

.grafana-panel.dragging {
  cursor: grabbing;
  opacity: 0.58;
  outline: 1px solid rgba(255, 139, 26, 0.7);
  outline-offset: 2px;
}

.grafana-panel.panel-size-xs {
  grid-column: span 1;
}

.grafana-panel.panel-size-sm {
  grid-column: span 2;
}

.grafana-panel.panel-size-md {
  grid-column: span 3;
}

.grafana-panel.panel-size-lg {
  grid-column: span 4;
}

.grafana-panel.panel-size-xl {
  grid-column: span 6;
}

.grafana-panel.panel-size-full {
  grid-column: 1 / -1;
}

.grafana-panel.wide {
  grid-column: span 2;
}

.grafana-panel.third {
  grid-column: span 3;
}

.grafana-panel.full {
  grid-column: 1 / -1;
}

.grafana-panel.panel-size-xs {
  grid-column: span 1;
}

.grafana-panel.panel-size-sm {
  grid-column: span 2;
}

.grafana-panel.panel-size-md {
  grid-column: span 3;
}

.grafana-panel.panel-size-lg {
  grid-column: span 4;
}

.grafana-panel.panel-size-xl {
  grid-column: span 6;
}

.grafana-panel.panel-size-full {
  grid-column: 1 / -1;
}

.grafana-panel[data-grafana-panel] {
  grid-column: span var(--panel-span, 6);
  min-height: var(--panel-height, 118px);
}

.grafana-panel[data-grafana-panel].panel-size-full {
  grid-column: span var(--panel-span, 24);
}

.grafana-panel.is-resizing {
  z-index: 4;
  outline: 1px solid rgba(255, 139, 26, 0.9);
  outline-offset: 2px;
  user-select: none;
}

.panel-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 5px 0 4px;
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(255, 139, 26, 0.95) 46% 54%, transparent 55%),
    linear-gradient(135deg, transparent 0 62%, rgba(255, 139, 26, 0.55) 63% 70%, transparent 71%);
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.14s ease, background-color 0.14s ease;
}

.grafana-panel:hover .panel-resize-handle,
.grafana-panel.is-resizing .panel-resize-handle {
  opacity: 1;
}

.grafana-panel.aio-overview-panel {
  grid-column: span 6;
  padding: 10px 12px;
}

.grafana-row-section:has(.aio-overview-panel) .grafana-row-grid {
  grid-template-columns: repeat(24, minmax(28px, 1fr));
}

.grafana-panel.aio-overview-panel.panel-size-lg,
.grafana-panel.aio-overview-panel.panel-size-xl,
.grafana-panel.aio-overview-panel.panel-size-full {
  grid-column: span 6;
}

.grafana-panel-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin-bottom: 6px;
  padding-right: 28px;
}

.grafana-panel-title h2 {
  min-width: 0;
  overflow: hidden;
  color: #dfe7f7;
  font-size: calc(13px * var(--panel-font-scale, 1));
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grafana-panel.aio-overview-panel .grafana-panel-title h2 {
  font-size: 12px;
  white-space: normal;
  line-height: 1.15;
}

.grafana-panel-title span {
  margin-left: auto;
  color: #8f9bb2;
  font-size: 12px;
}

.grafana-stat-panel {
  min-height: 96px;
}

.grafana-stat-value {
  display: flex;
  align-items: center;
  min-height: 54px;
  font-size: clamp(24px, calc(1.9vw * var(--panel-font-scale, 1)), calc(34px * var(--panel-font-scale, 1)));
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.grafana-panel.aio-overview-panel .grafana-stat-value {
  min-height: 66px;
  font-size: clamp(28px, 2.4vw, 42px);
}

.grafana-stat-value.orange {
  color: #ff8b1a;
}

.grafana-stat-value.blue {
  color: #5794f2;
}

.grafana-stat-value.green {
  color: #73bf69;
}

.grafana-stat-value.purple {
  color: #b877f2;
}

.grafana-stat-value.yellow {
  color: #ffe119;
}

.grafana-data-table {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(118px, 1fr));
  max-height: 226px;
  overflow: auto;
  scrollbar-color: #687285 #151a21;
  scrollbar-width: thin;
  font-size: calc(12px * var(--panel-font-scale, 1));
}

.grafana-data-table.short {
  max-height: 112px;
}

.grafana-data-table.tall {
  max-height: 310px;
}

.grafana-panel.panel-size-xs .grafana-data-table {
  max-height: 128px;
}

.grafana-panel.panel-size-sm .grafana-data-table {
  max-height: 186px;
}

.grafana-panel.panel-size-md .grafana-data-table {
  max-height: 230px;
}

.grafana-panel.panel-size-lg .grafana-data-table {
  max-height: 280px;
}

.grafana-panel.panel-size-xl .grafana-data-table {
  max-height: 340px;
}

.grafana-panel.panel-size-full .grafana-data-table {
  max-height: 430px;
}

.grafana-data-table::-webkit-scrollbar,
.grafana-hbar-chart::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.grafana-data-table::-webkit-scrollbar-track,
.grafana-hbar-chart::-webkit-scrollbar-track {
  background: #151a21;
}

.grafana-data-table::-webkit-scrollbar-thumb,
.grafana-hbar-chart::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #687285;
}

.grafana-data-table strong,
.grafana-data-table span {
  min-height: 31px;
  padding: 7px 10px;
  border-right: 1px solid #2a313b;
  border-bottom: 1px solid #2a313b;
  overflow: hidden;
  color: #dce4f5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grafana-data-table strong {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #171c22;
  color: #9ea8bd;
  font-weight: 800;
}

.grafana-sort-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.grafana-sort-button:hover,
.grafana-sort-button.active {
  color: #eef2fb;
}

.grafana-sort-button em {
  display: inline-block;
  width: 0;
  height: 0;
  min-width: 0;
  margin-left: 2px;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  font-style: normal;
  opacity: 0;
}

.grafana-sort-button.active em.asc {
  border-bottom: 6px solid #ff8b1a;
  opacity: 1;
}

.grafana-sort-button.active em.desc {
  border-top: 6px solid #ff8b1a;
  opacity: 1;
}

.grafana-empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: #a4aec3;
  font-size: 20px;
}

.grafana-hbar-chart {
  display: grid;
  gap: 5px;
  min-height: 92px;
  max-height: 290px;
  overflow-y: auto;
  padding: 10px 8px 2px;
}

.grafana-echart {
  width: 100%;
  height: 290px;
}

.grafana-echart.compact {
  height: 112px;
}

.grafana-panel.panel-size-xs .grafana-echart {
  height: 110px;
}

.grafana-panel.panel-size-sm .grafana-echart {
  height: 170px;
}

.grafana-panel.panel-size-md .grafana-echart {
  height: 240px;
}

.grafana-panel.panel-size-lg .grafana-echart {
  height: 310px;
}

.grafana-panel.panel-size-xl .grafana-echart {
  height: 360px;
}

.grafana-panel.panel-size-full .grafana-echart {
  height: 440px;
}

.grafana-panel.panel-size-xs .grafana-echart.compact {
  height: 72px;
}

.grafana-panel.panel-size-sm .grafana-echart.compact {
  height: 86px;
}

.grafana-panel.panel-size-md .grafana-echart.compact {
  height: 104px;
}

.grafana-panel.panel-size-lg .grafana-echart.compact {
  height: 130px;
}

.grafana-panel.panel-size-xl .grafana-echart.compact,
.grafana-panel.panel-size-full .grafana-echart.compact {
  height: 160px;
}

.grafana-panel[data-grafana-panel] .grafana-echart {
  height: clamp(72px, calc(var(--panel-height, 260px) - 62px), 640px);
}

.grafana-panel.compact-line .grafana-echart {
  height: clamp(108px, calc(var(--panel-height, 152px) - 38px), 240px);
}

.grafana-panel[data-grafana-panel] .grafana-echart.compact {
  height: clamp(96px, calc(var(--panel-height, 150px) - 48px), 280px);
}

.grafana-panel[data-grafana-panel] .grafana-data-table {
  max-height: clamp(78px, calc(var(--panel-height, 260px) - 62px), 620px);
}

.echart-tooltip {
  display: grid;
  gap: 8px;
  min-width: 190px;
  max-width: 260px;
}

.echart-tooltip div {
  display: grid;
  grid-template-columns: 14px minmax(52px, 1fr) auto;
  align-items: center;
  column-gap: 8px;
}

.echart-tooltip .echart-tooltip-title {
  grid-template-columns: 1fr;
  padding-bottom: 2px;
}

.echart-tooltip span {
  color: #aeb7c8;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
}

.echart-tooltip strong {
  color: #dfe6f4;
  font-weight: 800;
  justify-self: end;
  white-space: nowrap;
}

.echart-tooltip i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #73bf69;
}

.grafana-panel.compact .grafana-hbar-chart {
  min-height: 74px;
  max-height: 86px;
  padding-top: 4px;
}

.grafana-panel.platform-panel .grafana-hbar-chart {
  min-height: 112px;
  max-height: 148px;
  padding: 12px 10px 4px;
}

.grafana-panel.platform-panel .grafana-echart.compact {
  min-height: 112px;
}

.grafana-panel.compact .grafana-hbar-row {
  grid-template-columns: 72px minmax(120px, 1fr);
  min-height: 16px;
}

.grafana-panel.platform-panel .grafana-hbar-row {
  grid-template-columns: 78px minmax(150px, 1fr);
  min-height: 25px;
}

.grafana-panel.compact .grafana-hbar-row > span {
  font-size: 12px;
}

.grafana-panel.compact .grafana-hbar-row i {
  height: 13px;
}

.grafana-panel.platform-panel .grafana-hbar-row i {
  height: 14px;
}

.grafana-panel.compact .grafana-hbar-row > div {
  padding-right: 74px;
}

.grafana-panel.platform-panel .grafana-hbar-row > div {
  padding-right: 58px;
}

.grafana-panel.compact .grafana-hbar-row em {
  left: min(calc(var(--w) + 8px), calc(100% - 70px));
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grafana-panel.compact .grafana-axis {
  margin-left: 81px;
  font-size: 11px;
}

.grafana-panel.platform-panel .grafana-axis {
  margin-left: 87px;
  padding-right: 6px;
  font-size: 11px;
}

.grafana-hbar-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 17px;
}

.grafana-hbar-row > span {
  overflow: hidden;
  color: #c5cedf;
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grafana-hbar-row > div {
  position: relative;
  min-height: 16px;
  padding-right: 78px;
  background:
    repeating-linear-gradient(90deg, transparent 0 18%, rgba(255, 255, 255, 0.06) 18% calc(18% + 1px), transparent calc(18% + 1px) 20%),
    transparent;
}

.grafana-hbar-row i {
  display: block;
  width: var(--w);
  height: 14px;
  background: var(--bar-color, #73bf69);
}

.grafana-hbar-row em {
  position: absolute;
  left: min(calc(var(--w) + 8px), calc(100% - 68px));
  top: 1px;
  color: #dbe3f2;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.grafana-axis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-left: 141px;
  color: #b4bdcf;
  font-size: 12px;
}

.grafana-axis span:nth-child(2) {
  text-align: center;
}

.grafana-axis span:last-child {
  text-align: right;
}

.editor-panel-meta strong {
  max-width: 240px;
  overflow: hidden;
  color: #dfe5f3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-panel-actions {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}

.editor-panel-card:hover .editor-panel-actions,
.editor-panel-card:focus-within .editor-panel-actions,
.editor-panel-card.selected-editor-panel .editor-panel-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.editor-group,
.editor-control-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
}

.editor-group > div,
.editor-control-pill > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.editor-group strong,
.editor-group span,
.editor-control-pill em,
.editor-control-pill strong,
.editor-control-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-control-pill {
  cursor: pointer;
}

.editor-control-pill.selected-editor-control {
  border-color: rgba(255, 139, 26, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 139, 26, 0.14),
    0 0 24px rgba(255, 139, 26, 0.08);
}

.editor-control-pill em {
  color: #ffb25c;
  font-size: 11px;
  font-style: normal;
}

.editor-pill-remove {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #202633;
  color: #ff6b9c;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.editor-pill-remove:hover {
  border-color: rgba(255, 107, 156, 0.75);
  background: rgba(255, 107, 156, 0.1);
}

.editor-group {
  grid-column: 1 / -1;
}

.editor-panel-card,
.editor-panel-card.size-half,
.editor-panel-card.size-third,
.editor-panel-card.size-full {
  grid-column: span var(--editor-span, 12);
}

.editor-panel-card .panel-title {
  min-width: 0;
  margin-bottom: 6px;
}

.editor-panel-card .panel-title h2 {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.editor-panel-card .panel-title span {
  flex: 0 0 auto;
  color: #9fb2d1;
  font-size: 12px;
}

@container (max-width: 175px) {
  .editor-panel-card {
    padding: 12px 12px 36px;
  }

  .editor-panel-card .panel-title {
    display: block;
  }

  .editor-panel-card .panel-title h2 {
    display: -webkit-box;
    min-height: 34px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  .editor-panel-card .panel-title span,
  .editor-panel-meta span,
  .editor-panel-meta strong {
    display: none;
  }

  .editor-panel-meta {
    margin: 4px 0 8px;
  }

  .editor-panel-meta em {
    max-width: 100%;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .editor-panel-chart {
    height: clamp(44px, calc(var(--editor-height, 210px) - 96px), 160px);
    padding: 8px;
  }

  .editor-panel-actions {
    right: 8px;
    bottom: 8px;
    left: 8px;
    justify-content: center;
    gap: 4px;
  }

  .editor-panel-actions .button {
    min-height: 26px;
    padding: 0 7px;
    font-size: 11px;
  }
}

.editor-control-pill {
  grid-column: span 8;
}

.editor-import-code-card {
  margin-top: 10px;
}

.editor-sidepanel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  grid-template-rows: 48px 1fr;
  border-left: 1px solid var(--line);
  background: #15191f;
}

.editor-sidepanel.collapsed {
  width: 42px;
  min-width: 42px;
  grid-template-columns: 0 42px;
}

.editor-shell:has(.editor-sidepanel.collapsed) .selected-editor-control,
.editor-shell:has(.editor-sidepanel.collapsed) .selected-editor-panel {
  border-color: var(--line-soft);
  box-shadow: none;
}

.editor-sidepanel.collapsed .editor-side-head,
.editor-sidepanel.collapsed .editor-side-content {
  display: none;
}

.editor-side-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.editor-side-tabs {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-left: 1px solid var(--line);
}

.editor-side-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.editor-side-tabs button.active {
  background: #1f60d1;
  color: #fff;
}

.editor-side-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-width: 0;
  padding: 16px 18px;
}

.editor-add-section {
  margin: 4px 0 12px;
}

.editor-add-section h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.editor-add-section p {
  font-size: 13px;
}

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

.editor-panel-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 72px;
  overflow: hidden;
  border: 1px solid #303846;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(87, 148, 242, 0.05), rgba(13, 18, 25, 0.2)),
    #11161d;
  color: #5794f2;
}

.editor-panel-hero:hover {
  border-color: rgba(87, 148, 242, 0.62);
  background:
    linear-gradient(180deg, rgba(87, 148, 242, 0.1), rgba(255, 139, 26, 0.03)),
    #141a22;
}

.editor-panel-hero strong {
  position: relative;
  z-index: 1;
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
}

.panel-hero-chart {
  position: absolute;
  inset: 11px 10px 9px;
  opacity: 0.42;
  background:
    linear-gradient(140deg, transparent 14%, rgba(143, 155, 178, 0.22) 15% 17%, transparent 18% 24%, rgba(143, 155, 178, 0.3) 25% 27%, transparent 28% 36%, rgba(143, 155, 178, 0.22) 37% 39%, transparent 40%),
    linear-gradient(180deg, transparent 64%, rgba(143, 155, 178, 0.24) 65% 67%, transparent 68%);
}

.panel-hero-chart i {
  position: absolute;
  left: 40%;
  top: 12%;
  width: 2px;
  height: 48px;
  border-radius: 999px;
  background: #5794f2;
  transform: rotate(2deg);
}

.editor-add-divider {
  height: 1px;
  margin: 4px -16px;
  background: #28313c;
}

.grafana-add-list {
  gap: 8px;
  padding: 0;
}

.grafana-add-card {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 49px;
  margin: 0;
  padding: 11px 12px;
  border-radius: 6px;
  background: #141920;
}

.grafana-add-card:hover {
  border-color: rgba(255, 139, 26, 0.48);
  background: #181f28;
}

.grafana-add-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-card-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #c4cedf;
}

.editor-card-icon.rows {
  background:
    linear-gradient(#aab4c8 0 0) 4px 6px / 14px 2px no-repeat,
    linear-gradient(#aab4c8 0 0) 4px 11px / 14px 2px no-repeat,
    linear-gradient(#aab4c8 0 0) 4px 16px / 14px 2px no-repeat;
}

.editor-card-icon.tabs {
  border: 1px solid #8f9bb2;
  border-radius: 4px;
  box-shadow: 4px 4px 0 -2px #141920, 4px 4px 0 -1px #8f9bb2;
}

.editor-card-icon.annotation {
  border: 2px solid #aab4c8;
  border-radius: 4px;
}

.editor-card-icon.link {
  border-radius: 999px;
  background:
    radial-gradient(circle at 7px 11px, transparent 0 4px, #aab4c8 4px 5px, transparent 6px),
    radial-gradient(circle at 15px 11px, transparent 0 4px, #aab4c8 4px 5px, transparent 6px);
}

.editor-panel-preview,
.editor-add-card {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #12161d;
  color: #dfe5f3;
  text-align: left;
}

.editor-panel-preview {
  display: grid;
  place-items: center;
  height: 72px;
  font-size: 36px;
  color: #5794f2;
}

.editor-add-card {
  display: grid;
  gap: 6px;
  min-height: 48px;
  padding: 12px;
}

.editor-add-card span,
.editor-outline span {
  color: var(--muted);
}

.editor-template-library {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.compact-section {
  margin-bottom: 8px;
}

.template-search {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #303846;
  border-radius: 7px;
  background: #10141b;
  color: var(--muted);
}

.template-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.template-folder-stack {
  display: grid;
  gap: 7px;
}

.template-folder {
  overflow: hidden;
  border: 1px solid #303846;
  border-radius: 8px;
  background: #11161d;
}

.template-folder[open] {
  border-color: rgba(255, 139, 26, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 139, 26, 0.06), transparent 40%),
    #11161d;
}

.template-folder summary {
  display: grid;
  grid-template-columns: 14px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.template-folder summary::-webkit-details-marker {
  display: none;
}

.template-folder-chevron {
  color: #8f9bb2;
  font-size: 18px;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.template-folder[open] .template-folder-chevron {
  transform: rotate(90deg);
}

.template-folder-icon {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 139, 26, 0.26);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 139, 26, 0.46), rgba(255, 139, 26, 0.06)),
    #0d1118;
}

.template-folder-icon.postback {
  border-color: rgba(225, 40, 20, 0.28);
  background: linear-gradient(135deg, rgba(225, 40, 20, 0.45), rgba(225, 40, 20, 0.06)), #0d1118;
}

.template-folder-icon.runtime,
.template-folder-icon.widgets {
  border-color: rgba(87, 148, 242, 0.3);
  background: linear-gradient(135deg, rgba(87, 148, 242, 0.46), rgba(87, 148, 242, 0.06)), #0d1118;
}

.template-folder-icon.binom {
  border-color: rgba(143, 119, 255, 0.32);
  background: linear-gradient(135deg, rgba(143, 119, 255, 0.46), rgba(143, 119, 255, 0.06)), #0d1118;
}

.template-folder-icon.buyer {
  border-color: rgba(115, 191, 105, 0.32);
  background: linear-gradient(135deg, rgba(115, 191, 105, 0.46), rgba(115, 191, 105, 0.06)), #0d1118;
}

.template-folder-icon.custom,
.template-folder-icon.controls {
  border-color: rgba(143, 155, 178, 0.24);
  background: linear-gradient(135deg, rgba(143, 155, 178, 0.28), rgba(143, 155, 178, 0.04)), #0d1118;
}

.template-folder-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.template-folder-copy strong,
.editor-template-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.template-folder-copy small,
.editor-template-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: normal;
}

.template-folder summary em {
  min-width: 42px;
  padding: 3px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #0d1219;
  color: #aeb8cc;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.template-folder-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
}

.editor-template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid rgba(48, 56, 70, 0.72);
  border-radius: 7px;
  background: rgba(13, 18, 25, 0.72);
  color: #dfe5f3;
}

.editor-template-row:hover,
.editor-template-row.active {
  border-color: rgba(255, 139, 26, 0.68);
  background: rgba(255, 139, 26, 0.08);
}

.template-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  align-self: center;
}

.icon-text-button {
  min-height: 30px;
  min-width: 58px;
  padding: 0 10px;
  border: 1px solid #303846;
  border-radius: 6px;
  background: #171d25;
  color: #dfe5f3;
  font-size: 12px;
  font-weight: 800;
}

.icon-text-button.primary {
  border-color: rgba(255, 139, 26, 0.45);
  background: rgba(255, 139, 26, 0.14);
  color: #ffd0a0;
}

.icon-text-button:hover {
  border-color: rgba(255, 139, 26, 0.7);
  color: #fff;
}

.utility-folder {
  margin-top: 8px;
}

.template-library-collapsed {
  margin-top: 0;
}

.template-library-collapsed .editor-template-library {
  gap: 9px;
  padding: 0 8px 8px;
  margin-bottom: 0;
}

.template-library-collapsed .template-folder {
  background: rgba(13, 18, 25, 0.72);
}

.template-library-collapsed .template-search {
  margin-top: 2px;
}

.quick-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.quick-panel-grid.compact {
  grid-template-columns: 1fr;
  padding: 0 8px 8px;
  margin-bottom: 0;
}

.quick-panel-grid.compact .quick-panel-card {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
}

.quick-panel-grid.compact .quick-panel-card small {
  display: none;
}

.quick-panel-grid.compact .quick-panel-card em {
  justify-self: end;
}

.editor-utility-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
}

.editor-utility-list .editor-add-card {
  margin-bottom: 0;
  min-height: 46px;
  padding: 10px;
}

.quick-panel-card {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 10px;
  border: 1px solid #303846;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.08), transparent 55%),
    #10141b;
  color: #dfe5f3;
  text-align: left;
}

.quick-panel-card:hover {
  border-color: rgba(255, 139, 26, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.16), transparent 58%),
    #15191f;
  box-shadow: 0 0 20px rgba(255, 139, 26, 0.08);
}

.quick-panel-card small,
.quick-panel-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.quick-panel-icon {
  width: 34px;
  height: 24px;
  border: 1px solid rgba(255, 139, 26, 0.38);
  border-radius: 5px;
  background: #0d1118;
}

.quick-panel-icon.stat {
  background: linear-gradient(135deg, rgba(255, 139, 26, 0.88), rgba(255, 139, 26, 0.12));
}

.quick-panel-icon.timeseries {
  background:
    linear-gradient(145deg, transparent 44%, rgba(255, 139, 26, 0.9) 45% 51%, transparent 52%),
    #0d1118;
}

.quick-panel-icon.table {
  background:
    linear-gradient(#303846 1px, transparent 1px) 0 0 / 100% 8px,
    linear-gradient(90deg, #303846 1px, transparent 1px) 0 0 / 11px 100%,
    #0d1118;
}

.quick-panel-icon.status {
  background:
    radial-gradient(circle at 30% 50%, #73bf69 0 4px, transparent 5px),
    radial-gradient(circle at 68% 50%, #ff8b1a 0 4px, transparent 5px),
    #0d1118;
}

.quick-panel-icon.barchart {
  background:
    linear-gradient(to top, rgba(255, 139, 26, 0.84) 0 72%, transparent 72%) 5px bottom / 5px 100% no-repeat,
    linear-gradient(to top, rgba(255, 139, 26, 0.58) 0 48%, transparent 48%) 15px bottom / 5px 100% no-repeat,
    linear-gradient(to top, rgba(255, 139, 26, 0.74) 0 62%, transparent 62%) 25px bottom / 5px 100% no-repeat,
    #0d1118;
}

.metric-preset-preview {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 139, 26, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 139, 26, 0.1), rgba(87, 148, 242, 0.05)),
    #10141b;
}

.metric-preset-preview strong {
  color: #fff;
}

.metric-preset-preview span,
.metric-preset-preview small {
  color: var(--muted);
}

.table-column-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10151c;
  min-width: 0;
  grid-template-rows: auto minmax(96px, 240px) auto auto;
  overflow: hidden;
}

.table-column-editor-head {
  position: sticky;
  top: -1px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  padding-bottom: 2px;
  background: #10151c;
}

.table-column-editor-head strong {
  color: #f3f6fb;
}

.table-column-editor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table-column-grid {
  display: grid;
  gap: 6px;
  height: 100%;
  min-height: 96px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  align-content: start;
}

.editor-sidepanel .table-column-row {
  grid-template-columns: 58px minmax(108px, 1fr) minmax(108px, 1fr) 46px 30px;
  gap: 6px;
}

.editor-sidepanel .table-column-row input {
  padding: 0 8px;
}

.editor-sidepanel .table-column-toggle,
.editor-sidepanel .summary-toggle,
.editor-sidepanel .table-column-remove {
  padding: 0 6px;
}

.editor-sidepanel .table-column-add-row {
  grid-template-columns: minmax(0, 1fr) 128px;
}

.table-column-row {
  display: grid;
  grid-template-columns: 58px minmax(136px, 1fr) minmax(136px, 1fr) 58px 34px;
  align-items: center;
  gap: 7px;
  height: 40px;
  min-height: 40px;
  padding: 4px 6px;
  border: 1px solid rgba(49, 56, 68, 0.82);
  border-radius: 5px;
  background: #141a22;
  box-sizing: border-box;
  overflow: hidden;
}

.table-column-row > * {
  min-width: 0;
}

.table-column-row.enabled {
  border-color: rgba(255, 127, 17, 0.34);
  background: #151b24;
}

.table-column-row input {
  width: 100%;
  height: 34px;
  min-width: 0;
  padding: 0 10px;
  box-sizing: border-box;
}

.table-column-row input[data-table-column-order],
.table-column-row input[data-editor-table-column-order] {
  width: 100%;
  padding: 0 6px;
  text-align: center;
}

.table-column-toggle,
.summary-toggle,
.table-column-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(70, 82, 102, 0.88);
  border-radius: 5px;
  background: #202734;
  color: #b7c2d6;
  font-weight: 900;
  cursor: pointer;
}

.table-column-toggle[aria-pressed="true"],
.summary-toggle.enabled {
  border-color: rgba(255, 127, 17, 0.78);
  background: rgba(255, 127, 17, 0.16);
  color: #fff2e0;
}

.table-column-row.disabled {
  opacity: 0.58;
}

.table-column-remove {
  width: 100%;
  padding: 0;
  color: #ff7aa8;
  font-size: 15px;
  line-height: 1;
}

.table-column-add {
  justify-self: stretch;
}

.table-column-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding-right: 4px;
}

.table-column-add-row input {
  height: 36px;
}

.table-summary-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
  min-height: 38px;
  padding-right: 4px;
}

.summary-toggle {
  width: 100%;
  padding: 0 12px;
}

.modal-card:has(.table-column-editor) {
  width: min(100vw - 32px, 920px);
}

.modal-card:has(.table-column-editor) .modal-body {
  max-height: calc(100vh - 148px);
  overflow: auto;
}

.modal-card:has(.table-column-editor) .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.grafana-data-table .grafana-table-summary {
  border-top: 1px solid rgba(117, 130, 154, 0.28);
  background: rgba(21, 28, 38, 0.92);
  color: #f2f6ff;
  font-weight: 900;
}

.grafana-data-table .grafana-table-summary.average {
  color: #bcd1f3;
}

.grafana-data-table .grafana-table-summary.total {
  background: rgba(29, 39, 53, 0.98);
}

.save-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.save-dashboard-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 139, 26, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(255, 139, 26, 0.16), transparent 42%),
    #11161d;
}

.save-dashboard-summary strong {
  color: #fff;
  font-size: 18px;
}

.save-dashboard-summary span {
  color: var(--muted);
  font-size: 12px;
}

.editor-json {
  max-width: 100%;
  overflow: auto;
  color: #dfe5f3;
  font: 12px/1.5 "Cascadia Mono", Consolas, monospace;
}

.editor-outline {
  display: grid;
  gap: 8px;
}

.editor-outline div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #12161d;
}

.editor-buyer-limit {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #111820;
}

.editor-buyer-limit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-buyer-limit-head span {
  color: #f3f6fb;
  font-weight: 700;
}

.editor-buyer-limit-head .button {
  min-height: 28px;
  padding: 0 10px;
}

.editor-buyer-limit > small {
  color: var(--muted);
}

.editor-buyer-limit-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.editor-buyer-limit-option {
  display: grid;
  grid-template-columns: 18px minmax(42px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #253040;
  border-radius: 5px;
  background: #151c25;
  cursor: pointer;
}

.editor-buyer-limit-option:hover {
  border-color: rgba(255, 139, 26, 0.55);
}

.editor-buyer-limit-option:has(input:checked) {
  border-color: rgba(255, 139, 26, 0.72);
  background: linear-gradient(180deg, rgba(255, 139, 26, 0.12), rgba(255, 139, 26, 0.05)), #151c25;
}

.editor-buyer-limit-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--orange);
}

.editor-buyer-limit-option span,
.editor-buyer-limit-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-buyer-limit-option span {
  color: #f3f6fb;
  font-weight: 700;
}

.editor-buyer-limit-option small {
  color: var(--muted);
}

.detail-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr);
}

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

.table-card {
  min-width: 0;
  overflow-x: auto;
}

.data-table {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  min-width: max(100%, calc(var(--cols) * 132px));
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #12171e;
}

.data-table strong,
.data-table span {
  min-height: 34px;
  padding: 9px 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table strong:nth-child(n),
.data-table span:nth-child(n) {
  min-width: 0;
}

.data-table strong {
  background: #22262e;
  color: #dce2f0;
}

.data-table span {
  color: #c7cfdf;
}

.empty-state.compact {
  min-height: 120px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
}

.panel {
  border-radius: 6px;
  padding: 16px;
}

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

.panel-title h2 {
  margin-right: auto;
}

.panel-menu-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  display: inline-grid;
  place-items: center;
  grid-auto-flow: row;
  gap: 2px;
  width: 21px;
  height: 21px;
  border: 0;
  border-radius: 6px;
  background: rgba(39, 46, 57, 0.86);
  color: #9da8bb;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-2px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    background-color 0.14s ease,
    color 0.14s ease;
}

.panel:hover > .panel-menu-trigger,
.panel:focus-within > .panel-menu-trigger,
.metric-card:hover > .panel-menu-trigger,
.metric-card:focus-within > .panel-menu-trigger,
.panel:hover .panel-title > .panel-menu-trigger,
.panel:focus-within .panel-title > .panel-menu-trigger,
.grafana-panel:hover .grafana-panel-title > .panel-menu-trigger,
.grafana-panel:focus-within .grafana-panel-title > .panel-menu-trigger,
.panel-menu-trigger:focus-visible,
.panel-menu-trigger[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.panel-menu-trigger i {
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: currentColor;
}

.panel-menu-trigger:hover,
.panel-menu-trigger:focus-visible,
.panel-menu-trigger[aria-expanded="true"] {
  background: rgba(58, 66, 79, 0.96);
  color: #fff;
}

.panel-context-menu {
  position: fixed;
  z-index: 90;
  width: 190px;
  overflow: hidden;
  border: 1px solid #303640;
  border-radius: 6px;
  background: #242932;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.5);
  padding: 6px;
}

.panel-context-menu button {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #c8cedb;
  padding: 0 8px;
  text-align: left;
}

.panel-action-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(255, 139, 26, 0.12);
  color: #ff9b32;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.detail-move-mode #dashboardDetail .panel,
.detail-move-mode #dashboardDetail .metric-card,
.editor-panel-card[draggable="true"] {
  cursor: grab;
}

.detail-move-mode #dashboardDetail .panel:hover,
.detail-move-mode #dashboardDetail .metric-card:hover,
.editor-panel-card[draggable="true"]:hover {
  border-color: rgba(255, 139, 26, 0.52);
  box-shadow: 0 0 0 1px rgba(255, 139, 26, 0.08), 0 14px 36px rgba(0, 0, 0, 0.22);
}

.dragging {
  opacity: 0.58;
}

.panel-context-menu button:hover {
  background: #313741;
  color: #fff;
}

.panel-context-menu button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.panel-context-menu kbd,
.panel-context-menu em {
  color: #9ca6b8;
  font-style: normal;
  font-size: 12px;
}

.panel-action-preview {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #10141b;
}

.panel-action-preview strong {
  color: #ffb15f;
}

.chart-panel {
  min-height: 280px;
}

.overview-trend-chart {
  width: 100%;
  height: 268px;
  min-height: 268px;
  min-width: 0;
}

.overview-trend-chart canvas,
.overview-trend-chart > div {
  max-width: 100%;
}

.overview-trend-chart .empty-state {
  height: 100%;
  display: grid;
  place-items: center;
}

.bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 10px;
  height: 205px;
  padding: 20px 12px 0;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to top, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 /
      100% 25%;
}

.bars span {
  display: block;
  height: var(--h);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #5794f2, #73bf69);
}

.formula-list,
.user-list,
.permission-grid,
.timeline {
  display: grid;
  gap: 10px;
}

.formula-list div,
.timeline div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #13171d;
}

.formula-list span,
.timeline span,
.timeline time {
  color: var(--muted);
}

.formula-editor {
  min-height: 290px;
}

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

.formula-hidden-control,
.formula-form,
.formula-editor-titlebar,
.formula-preview-panel {
  display: none !important;
}

.formula-workflow {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.formula-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.formula-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.formula-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.formula-step {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(87, 148, 242, 0.045), transparent),
    #11161d;
}

.formula-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.formula-step-head > div:not(.formula-step-actions) {
  display: grid;
  gap: 3px;
}

.formula-step-head strong {
  color: var(--text);
}

.formula-step-head span {
  color: var(--muted);
  font-size: 12px;
}

.formula-step-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  justify-self: end;
  width: auto;
  min-width: max-content;
}

.formula-step-actions .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.formula-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.formula-picker select {
  min-width: 220px;
  height: 34px;
  border: 1px solid #2d3645;
  border-radius: 6px;
  background: #0f141b;
  color: var(--text);
  padding: 0 10px;
  font-weight: 700;
}

.formula-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.formula-field-chip {
  display: grid;
  gap: 3px;
  min-height: 74px;
  padding: 9px 10px;
  border: 1px solid #263141;
  border-radius: 6px;
  color: var(--text);
  text-align: left;
  background: #0f141b;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.formula-field-chip:hover,
.formula-field-chip:focus-visible {
  border-color: #5794f2;
  background: #121b27;
}

.formula-field-chip.custom-source {
  border-color: rgba(255, 139, 26, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.08), transparent),
    #10141b;
}

.formula-field-chip strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  color: #dfe7f7;
}

.formula-field-chip span,
.formula-field-chip small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.custom-source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.custom-source-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.3fr) 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--text);
  text-align: left;
  background: #10141b;
  cursor: pointer;
}

.custom-source-row:hover,
.custom-source-row:focus-visible {
  border-color: rgba(255, 139, 26, 0.62);
}

.custom-source-row strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  color: #f3f6ff;
}

.custom-source-row span {
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-template-row {
  display: grid;
  grid-template-columns: minmax(180px, 320px) auto 1fr;
  gap: 8px;
  align-items: center;
}

.formula-template-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #10141b;
  color: var(--text);
}

.metric-input-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #10141b;
}

.metric-input-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(180px, 0.32fr) minmax(90px, 0.18fr) minmax(150px, auto);
  gap: 14px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

.formula-list-row {
  grid-template-columns: minmax(220px, 0.24fr) minmax(360px, 1fr) minmax(110px, auto);
  cursor: pointer;
}

.metric-catalog-row {
  grid-template-columns: minmax(180px, 0.24fr) minmax(220px, 0.28fr) minmax(260px, 1fr) minmax(78px, auto);
}

.metric-catalog-type {
  justify-self: end;
  min-width: 72px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 139, 26, 0.35);
  border-radius: 999px;
  color: #ffd6ad;
  text-align: center;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0;
}

.formula-list-row:hover,
.formula-list-row.active {
  background: rgba(87, 148, 242, 0.06);
}

.formula-list-row.active {
  box-shadow: inset 3px 0 0 var(--orange);
}

.formula-row-expression {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
}

.metric-input-row:last-child {
  border-bottom: 0;
}

.metric-input-row strong,
.metric-input-row code {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.metric-input-key,
.metric-input-label,
.metric-input-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-input-row span {
  color: var(--muted);
}

.metric-input-value {
  color: #dfe7f7;
  font-weight: 700;
}

.metric-input-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.formula-line-builder {
  display: grid;
  gap: 8px;
  max-height: 424px;
  overflow-y: auto;
  padding-right: 4px;
}

.formula-line {
  display: grid;
  grid-template-columns: 34px minmax(120px, 0.5fr) minmax(220px, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0f141b;
}

.formula-line label {
  display: grid;
  gap: 0;
}

.formula-line label span,
.formula-advanced label span {
  color: var(--muted);
  font-size: 11px;
}

.formula-line input {
  width: 100%;
  height: 34px;
  border: 1px solid #2a3442;
  border-radius: 5px;
  color: var(--text);
  background: #0b1017;
  padding: 0 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.formula-line-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 34px;
  border-radius: 5px;
  color: var(--muted);
  background: #151b24;
}

.formula-line-remove {
  width: 34px;
  height: 34px;
  color: var(--muted);
}

.formula-advanced {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0f141b;
}

.formula-advanced summary {
  padding: 10px 12px;
  color: var(--muted);
  cursor: pointer;
}

.formula-advanced label {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.small-button {
  min-height: 30px;
  padding: 0 10px;
}

.code-box {
  display: grid;
  grid-template-columns: 34px 1fr;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #0f1319;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.code-box span,
.code-box code {
  min-height: 38px;
  padding: 10px 12px;
  border-bottom: 1px solid #1d242d;
}

.code-box span:nth-last-child(2),
.code-box code:last-child {
  border-bottom: 0;
}

.line-no {
  color: var(--muted-2);
  text-align: right;
  background: #121821;
}

.code-box code {
  color: #dfe7f7;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.table-head.formula-history,
.formula-history-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.7fr;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
}

.formula-history-row {
  border-top: 1px solid var(--line-soft);
}

#formulaHistory {
  display: contents;
}

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

.admin-wide {
  grid-column: 1 / -1;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  min-height: 38px;
  padding: 0 12px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.admin-tabs button:hover,
.admin-tabs button.active {
  color: #f3f6fb;
  border-bottom-color: var(--accent);
}

.aio-subtabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.aio-subtabs button {
  min-height: 38px;
  padding: 0 12px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.aio-subtabs button:hover,
.aio-subtabs button.active {
  color: #f3f6fb;
  border-bottom-color: var(--accent);
}

.admin-sync-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: stretch;
}

.admin-ops-console {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: stretch;
}

.telegram-console {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.sync-control-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.035), transparent),
    #13171d;
}

.sync-control-card span,
.sync-control-card small {
  color: var(--muted);
}

.sync-control-card strong {
  color: #f3f6fb;
  font-size: 20px;
  line-height: 1.15;
}

.sync-control-actions {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 148px;
}

.aio-worker-actions {
  min-width: 154px;
}

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

.aio-backfill-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.aio-backfill-range-trigger {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label icon"
    "value icon";
  align-items: center;
  gap: 2px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111821;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.aio-backfill-range-trigger span {
  grid-area: label;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.aio-backfill-range-trigger strong {
  grid-area: value;
  font-size: 14px;
  line-height: 1.2;
}

.aio-backfill-range-trigger svg {
  grid-area: icon;
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  stroke-width: 1.8;
  fill: none;
}

.aio-backfill-range-trigger:hover,
.aio-backfill-range-trigger.active {
  border-color: rgba(255, 139, 26, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 139, 26, 0.16);
}

.aio-backfill-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-pipeline-grid,
.telegram-rules-grid,
.admin-endpoint-grid {
  display: grid;
  gap: 10px;
}

.admin-pipeline-grid,
.telegram-rules-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.admin-endpoint-grid {
  margin-top: 12px;
}

.ops-pipeline-card,
.telegram-rule-card,
.admin-endpoint-row {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #11161c;
}

.ops-pipeline-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
}

.ops-step {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 139, 26, 0.55);
  border-radius: 6px;
  background: rgba(255, 139, 26, 0.1);
  color: #ffd7a8;
  font-weight: 900;
}

.ops-pipeline-card strong,
.telegram-rule-card strong,
.admin-endpoint-row strong {
  color: #f3f6fb;
}

.ops-pipeline-card small,
.telegram-rule-card span,
.admin-endpoint-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.telegram-rule-card {
  padding: 12px;
}

.telegram-delivery-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #11161c;
}

.compact-title {
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.compact-title h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.compact-title small {
  color: var(--muted);
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.telegram-delivery-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.telegram-delivery-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0f141a;
}

.telegram-delivery-row.sent {
  border-color: rgba(111, 199, 105, 0.24);
}

.telegram-delivery-row.failed {
  border-color: rgba(255, 91, 126, 0.32);
}

.telegram-delivery-head,
.telegram-delivery-meta {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.telegram-delivery-head strong {
  color: #f3f6fb;
}

.telegram-delivery-head small,
.telegram-delivery-meta {
  color: var(--muted);
}

.telegram-delivery-meta b {
  color: #cfe0ff;
}

.telegram-delivery-pill {
  display: inline-grid;
  min-width: 58px;
  min-height: 24px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: #cfe0ff;
  font-size: 12px;
  font-weight: 900;
}

.telegram-delivery-pill.sent {
  border-color: rgba(111, 199, 105, 0.45);
  color: #78d474;
}

.telegram-delivery-pill.failed {
  border-color: rgba(255, 91, 126, 0.48);
  color: #ff7a9a;
}

.telegram-delivery-message summary {
  width: fit-content;
  cursor: pointer;
  color: #9db8dd;
  font-weight: 800;
}

.telegram-delivery-message pre {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0b1016;
  color: #d8e5f7;
}

.admin-endpoint-row {
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 11px 12px;
}

.admin-endpoint-row strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.aio-run-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.aio-run-total-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #11161c;
}

.aio-run-total-card span,
.aio-run-total-card small {
  color: var(--muted);
}

.aio-run-total-card strong {
  color: #f3f6fb;
  font-size: 22px;
  line-height: 1.1;
}

.aio-run-journal {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.aio-run-row {
  display: grid;
  grid-template-columns: 96px minmax(240px, 1.2fr) minmax(260px, 1fr) 132px;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 9px 12px;
  border-top: 1px solid var(--line-soft);
  background: #11161c;
}

.aio-run-row:first-child {
  border-top: 0;
}

.aio-run-row strong,
.aio-run-row span,
.aio-run-row time {
  min-width: 0;
}

.aio-run-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aio-run-row time {
  color: var(--muted);
  text-align: right;
}

.aio-run-kind {
  display: inline-grid;
  width: max-content;
  min-width: 70px;
  min-height: 24px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(87, 148, 255, 0.45);
  border-radius: 999px;
  color: #cfe1ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.aio-run-kind.completed {
  border-color: rgba(111, 196, 106, 0.45);
  color: #bff2b8;
}

.aio-run-kind.ingest {
  border-color: rgba(255, 139, 26, 0.45);
  color: #ffd6a5;
}

@media (max-width: 1180px) {
  .admin-ops-console {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-ops-console .sync-control-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-pipeline-grid,
  .telegram-rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .aio-run-row {
    grid-template-columns: 82px minmax(180px, 1fr);
  }

  .aio-run-row > span:not(.aio-run-kind),
  .aio-run-row time {
    grid-column: 2;
    text-align: left;
  }
}

.backup-dashboard {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.backup-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.backup-insights-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.4fr);
  gap: 10px;
}

.backup-summary-card,
.backup-insight-card,
.backup-settings-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.045), transparent 62%),
    #13171d;
}

.backup-summary-card span,
.backup-summary-card small,
.backup-insight-card span,
.backup-insight-card small,
.backup-insight-card p,
.backup-settings-card span {
  color: var(--muted);
}

.backup-insight-card {
  min-height: 138px;
}

.backup-insight-head,
.backup-insight-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.backup-insight-head strong {
  color: #f3f6fb;
  font-size: 18px;
}

.backup-insight-head strong.good {
  color: var(--green);
}

.backup-insight-head strong.warning {
  color: #ffb357;
}

.backup-insight-head strong.danger {
  color: var(--danger);
}

.backup-insight-metrics {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.backup-insight-metrics div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(10, 14, 20, 0.42);
}

.backup-insight-metrics b {
  min-width: 0;
  overflow: hidden;
  color: #f3f6fb;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-timeline-bars {
  display: flex;
  align-items: end;
  gap: 7px;
  min-height: 82px;
  padding: 8px 0 2px;
}

.backup-timeline-bars span {
  width: 100%;
  min-width: 9px;
  max-width: 26px;
  height: var(--h);
  border-radius: 5px 5px 2px 2px;
  background: #ff8b1a;
  box-shadow: 0 0 0 1px rgba(255, 139, 26, 0.24) inset;
}

.backup-timeline-bars span.auto {
  background: #5794f2;
  box-shadow: 0 0 0 1px rgba(87, 148, 242, 0.24) inset;
}

.backup-timeline-bars span.restored {
  background: #bb7af7;
}

.backup-timeline-bars em {
  color: var(--muted);
  font-style: normal;
}

.backup-timeline-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.backup-timeline-legend span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff8b1a;
}

.backup-timeline-legend span.auto {
  background: #5794f2;
}

.backup-timeline-legend span.restored {
  background: #bb7af7;
}

.backup-summary-card strong {
  color: #f3f6fb;
  font-size: 20px;
  line-height: 1.15;
}

.backup-settings-card {
  grid-template-columns: minmax(180px, 1fr) auto minmax(150px, 190px) minmax(120px, 150px) auto;
  align-items: end;
}

.backup-settings-card label {
  display: grid;
  gap: 6px;
}

.backup-settings-card input,
.backup-settings-card select,
.backup-time-filter select,
.backup-type-filter select,
.server-trend-controls select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111720;
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.toggle-row {
  display: inline-flex !important;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px !important;
  min-height: 34px;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.backup-toolbar,
.backup-center-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.backup-toolbar {
  justify-content: flex-end;
}

.backup-center-actions {
  gap: 8px;
}

.backup-time-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.backup-center-list {
  display: grid;
  gap: 12px;
}

.backup-day-group {
  display: grid;
  gap: 7px;
}

.backup-day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
}

.backup-day-title strong {
  color: #dfe5f3;
}

.backup-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 20, 28, 0.72);
}

.backup-row.auto {
  border-color: rgba(87, 148, 242, 0.28);
  background:
    linear-gradient(90deg, rgba(87, 148, 242, 0.06), transparent 52%),
    rgba(15, 20, 28, 0.72);
}

.backup-row-time {
  color: #ffb357;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.backup-row-main {
  min-width: 0;
}

.backup-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #eef2fb;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.backup-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.backup-row-badges em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(255, 139, 26, 0.34);
  border-radius: 999px;
  color: #ffd0a3;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.backup-row-badges em.auto {
  border-color: rgba(87, 148, 242, 0.42);
  color: #9fc2ff;
}

.backup-row-badges em.restored {
  border-color: rgba(187, 122, 247, 0.44);
  color: #d9b4ff;
}

.backup-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.admin-server-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.server-status-card {
  display: grid;
  gap: 7px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(87, 148, 242, 0.05), transparent 58%),
    #13171d;
}

.server-status-card span,
.server-status-card small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-status-card strong {
  color: #f3f6fb;
  font-size: 24px;
  line-height: 1.1;
}

.server-trend-chart {
  width: 100%;
  min-height: 330px;
}

.server-trend-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.aio-journal-date-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  min-width: 146px;
  padding: 0 10px;
  border: 1px solid #2b3543;
  border-radius: 6px;
  background: #0f151d;
  box-shadow: inset 0 0 0 1px rgba(255, 152, 31, 0.05);
  color: var(--text);
  cursor: pointer;
}

.aio-journal-date-control:focus-within,
.aio-journal-date-control:hover {
  border-color: rgba(255, 152, 31, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 152, 31, 0.16);
}

.aio-journal-date-control svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  stroke: var(--orange);
  stroke-width: 1.9;
  fill: none;
}

.aio-journal-date-control input {
  width: 96px;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.aio-journal-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(17, 23, 32, 0.78);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-log-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-log-toolbar select,
.admin-log-toolbar input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111720;
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.admin-log-toolbar input:disabled {
  opacity: 0.55;
}

.admin-log-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.admin-log-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 20, 28, 0.72);
}

.admin-log-time {
  color: #ffb357;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.admin-log-main {
  min-width: 0;
}

.admin-log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.admin-log-title strong,
.admin-log-title span,
.admin-log-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-log-title strong {
  color: #eef2fb;
  font-size: 13px;
}

.admin-log-title span,
.admin-log-meta {
  color: var(--muted);
  font-size: 12px;
}

.admin-log-payload {
  max-height: 96px;
  margin: 7px 0 0;
  overflow: auto;
  color: #a8d4ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.danger-inline {
  border-color: rgba(220, 58, 112, 0.45);
  color: #ff9fbd;
}

.status-list,
.storage-bars,
.roadmap,
.sync-checklist {
  display: grid;
  gap: 10px;
}

.status-list div,
.storage-bars div,
.roadmap div,
.sync-checklist div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
}

.status-list div {
  grid-template-columns: 1fr auto;
}

.status-list small {
  grid-column: 1 / -1;
  color: var(--muted);
}

meter {
  width: 100%;
  height: 8px;
}

.roadmap div {
  grid-template-columns: 30px 1fr;
  align-items: center;
}

.roadmap strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #303844;
  color: #fff;
}

.sync-checklist div {
  grid-template-columns: 170px 1fr;
  align-items: center;
}

.sync-checklist span {
  color: var(--muted);
  line-height: 1.45;
}

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

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

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

.wide-form-field {
  grid-column: 1 / -1;
}

.settings-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.settings-form label span {
  color: #c7cfdf;
  font-weight: 600;
}

.settings-form .editor-buyer-limit-option {
  display: grid;
  grid-template-columns: 18px 54px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.settings-form .editor-buyer-limit-option input[type="checkbox"] {
  justify-self: center;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid #7a8394;
  border-radius: 3px;
  background: #202630;
  accent-color: var(--orange);
}

.settings-form .editor-team-limit-option {
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.settings-form .editor-team-limit-option span {
  max-width: none;
  white-space: nowrap;
}

.settings-form .editor-team-limit-option small {
  justify-self: end;
  max-width: 86px;
}

.settings-form .editor-buyer-limit-option span,
.settings-form .editor-buyer-limit-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: #10141b;
  color: var(--text);
}

.settings-form input,
.settings-form select {
  min-height: 36px;
  padding: 0 10px;
}

.settings-form textarea {
  min-height: 120px;
  padding: 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
  line-height: 1.55;
}

.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus,
.field input:focus {
  box-shadow: 0 0 0 2px rgba(245, 130, 31, 0.28);
}

.settings-form input.input-error,
.field input.input-error {
  border-color: #ff5c7a;
  box-shadow: 0 0 0 2px rgba(255, 92, 122, 0.2);
}

.buyer-access-picker {
  display: grid;
  gap: 8px;
}

.buyer-access-hint {
  margin: -3px 0 2px;
  color: #9fb0c8;
  font-size: 12px;
  line-height: 1.35;
}

.buyer-access-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #dfe5f3;
  font-weight: 700;
}

.buyer-search {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111118;
  color: var(--muted);
}

.buyer-search input {
  min-width: 0;
  height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.buyer-access-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid rgba(255, 139, 26, 0.22);
  border-radius: 7px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 139, 26, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(87, 148, 242, 0.045), rgba(9, 13, 18, 0.16)),
    #10141b;
}

.buyer-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 3px 6px 3px 4px;
  border: 1px solid rgba(255, 139, 26, 0.52);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.28), rgba(255, 139, 26, 0.1)),
    #201712;
  color: #ffe3c4;
  font-size: 12px;
  font-weight: 800;
  box-shadow:
    0 0 18px rgba(255, 139, 26, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.buyer-chip.all {
  border-color: rgba(255, 139, 26, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 139, 26, 0.2), rgba(255, 139, 26, 0.08)),
    #211914;
  color: #ffd8ae;
}

.buyer-chip-mark {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange);
  color: #1a1007;
  font-size: 10px;
  line-height: 1;
}

.buyer-chip-text {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buyer-chip-remove {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1;
}

.buyer-chip:hover .buyer-chip-remove {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.buyer-access-list {
  display: grid;
  max-height: min(360px, 42vh);
  overflow-y: auto;
  gap: 6px;
  padding: 6px;
  border: 1px solid #28313d;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent),
    #0f141b;
  scrollbar-color: rgba(255, 139, 26, 0.72) #171d25;
  scrollbar-width: thin;
}

.buyer-access-picker.is-locked .buyer-search,
.buyer-access-picker.is-locked .buyer-access-list,
.buyer-access-picker.is-locked .buyer-access-selected {
  opacity: 0.78;
}

.buyer-access-picker.is-locked .buyer-access-option {
  cursor: default;
}

.buyer-access-picker.is-locked .buyer-chip-remove {
  display: none;
}

.buyer-access-option {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid #252d38;
  border-radius: 7px;
  background: linear-gradient(180deg, #151a22, #111720);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.buyer-access-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(50%);
}

.buyer-access-option:hover {
  border-color: #394455;
  background: linear-gradient(180deg, #19202a, #131a23);
}

.buyer-access-option.pinned {
  background: linear-gradient(180deg, #191b21, #131820);
}

.buyer-access-option:has(input:checked) {
  border-color: rgba(255, 139, 26, 0.72);
  background:
    radial-gradient(circle at 9% 50%, rgba(255, 139, 26, 0.24), transparent 38%),
    linear-gradient(180deg, rgba(255, 139, 26, 0.14), rgba(255, 139, 26, 0.055)),
    #161b22;
  box-shadow:
    0 0 0 1px rgba(255, 139, 26, 0.1),
    0 0 26px rgba(255, 139, 26, 0.12),
    inset 3px 0 0 var(--orange);
}

.buyer-option-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #334052;
  border-radius: 8px;
  background: #101823;
  color: #aeb8c9;
  font-size: 11px;
  font-weight: 900;
}

.buyer-option-icon.all {
  border-color: #4a3a24;
  background: #1e1711;
  color: #d6a367;
}

.buyer-access-option:has(input:checked) .buyer-option-icon {
  border-color: rgba(255, 139, 26, 0.7);
  background:
    linear-gradient(135deg, rgba(255, 195, 109, 0.34), transparent 48%),
    #2a1808;
  color: #ffe0b8;
  box-shadow: 0 0 18px rgba(255, 139, 26, 0.22);
}

.buyer-access-option strong,
.buyer-access-option small {
  display: block;
}

.buyer-access-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.buyer-access-option:has(input:checked) small {
  color: #d5b38f;
}

.buyer-access-list::-webkit-scrollbar {
  width: 10px;
}

.buyer-access-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #171d25;
}

.buyer-access-list::-webkit-scrollbar-thumb {
  border: 2px solid #171d25;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #ffb15c, #ff8b1a 48%, #9b5212);
  box-shadow: 0 0 12px rgba(255, 139, 26, 0.28);
}

.buyer-access-list::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, #ffc275, #ff9b2c 48%, #b86418);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.settings-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #20252d;
  color: #f2f5fb;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.68);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 42px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #161a20;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head p {
  margin-top: 6px;
  font-size: 13px;
}

.modal-body {
  min-width: 0;
  overflow: auto;
  padding: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  background: #12161d;
}

.modal-form {
  max-width: none;
}

.modal-metric-hint {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.modal-metric-hint strong {
  color: var(--text);
  font-size: 12px;
}

.modal-metric-hint code {
  display: block;
  max-height: 84px;
  overflow: auto;
  padding: 9px 10px;
  border: 1px solid #2d3645;
  border-radius: 6px;
  background: #0f141b;
  color: #c9d8f2;
  white-space: normal;
  word-break: break-word;
}

.user-edit-form {
  gap: 14px;
}

.user-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

@media (max-width: 760px) {
  .user-edit-grid,
  .panel-settings-grid {
    grid-template-columns: 1fr;
  }
}

.confirm-copy {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
  color: #dce2f0;
  line-height: 1.5;
}

.modal-table {
  display: grid;
  gap: 10px;
}

.modal-table div,
.control-item {
  display: grid;
  gap: 6px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
}

.modal-table span,
.control-item span {
  color: var(--muted);
  line-height: 1.45;
}

.control-list {
  display: grid;
  gap: 10px;
}

.control-item {
  width: 100%;
  color: #dfe5f3;
  text-align: left;
}

.table-panel.slim {
  border-radius: 6px;
}

.section-breadcrumb {
  margin: 0 0 18px;
  color: #c2cbe0;
  font-weight: 600;
}

.users-admin-shell {
  display: grid;
  gap: 18px;
}

.users-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.users-tabs button {
  min-height: 34px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.users-tabs button.active {
  border-bottom-color: var(--orange);
  color: #fff;
}

.users-toolbar {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.user-search-field {
  width: 100%;
}

.users-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(48, 56, 70, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent),
    #10151c;
}

.user-role-select {
  width: 172px;
}

.user-status-select {
  width: 156px;
}

.user-new-button {
  min-width: 170px;
}

.custom-select {
  position: relative;
}

.custom-select-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #242932;
  color: #dfe5f3;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.custom-select-button::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.8;
}

.custom-select-button.active {
  border-color: #5794f2;
  box-shadow: 0 0 0 1px rgba(87, 148, 242, 0.35);
}

.custom-select-button.active::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 28;
  min-width: 100%;
  overflow: hidden;
  border: 1px solid #3a4351;
  border-radius: 6px;
  background: #20252d;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-menu button {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #dfe5f3;
  text-align: left;
}

.custom-select-menu button:hover,
.custom-select-menu button.active {
  background: #303743;
  color: #fff;
}

.users-table {
  display: grid;
  overflow-x: auto;
  border-top: 1px solid var(--line-soft);
}

.grafana-user-row {
  display: grid;
  grid-template-columns: 52px minmax(140px, 0.6fr) minmax(240px, 1.1fr) minmax(170px, 0.85fr) minmax(160px, 0.75fr) 140px minmax(190px, 0.8fr) 58px;
  align-items: center;
  gap: 10px;
  min-width: 1180px;
  min-height: 62px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: #dfe5f3;
}

.grafana-user-row.organization-user-row {
  grid-template-columns: 48px minmax(280px, 1.2fr) minmax(180px, 0.8fr) 100px 140px minmax(200px, 0.85fr) 58px;
  min-width: 1080px;
}

.grafana-user-row.organization-groups-head {
  grid-template-columns: 48px minmax(280px, 1fr) auto;
}

.grafana-user-row:hover {
  background: #171c24;
}

.grafana-users-head {
  min-height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  color: #dce2f0;
  background: transparent;
}

.grafana-users-head:hover {
  background: transparent;
}

.user-team-group {
  min-width: 1080px;
  border-bottom: 1px solid var(--line-soft);
  background: #0f1419;
}

.user-team-header {
  display: grid;
  grid-template-columns: 48px minmax(460px, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
  width: 100%;
  min-height: 62px;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid rgba(255, 139, 26, 0.12);
  background:
    linear-gradient(90deg, rgba(255, 139, 26, 0.07), rgba(17, 24, 32, 0.7) 42%, transparent),
    #111821;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-team-header.has-lead {
  background:
    linear-gradient(90deg, rgba(255, 139, 26, 0.08), rgba(18, 25, 33, 0.82) 42%, transparent),
    #101821;
}

.user-team-caret {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 139, 26, 0.36);
  border-radius: 5px;
  background: rgba(255, 139, 26, 0.06);
  justify-self: center;
  align-self: center;
}

.user-team-caret::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  top: 50%;
  left: 50%;
  border-right: 2px solid #d99a5e;
  border-bottom: 2px solid #d99a5e;
  transform: translate(-50%, -50%) rotate(45deg);
  transform-origin: center;
  transition: transform 0.14s ease;
}

.user-team-caret.open::before {
  transform: translate(-50%, -50%) rotate(-135deg);
}

.user-team-group.collapsed .org-children {
  display: none;
}

.user-team-lead-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-team-lead-main > div {
  min-width: 0;
}

.user-team-placeholder {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 139, 26, 0.22);
  border-radius: 6px;
  background: rgba(255, 139, 26, 0.04);
}

.user-team-header strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.user-team-lead-main span,
.user-team-name,
.user-team-last-active,
.user-team-origin {
  display: block;
  margin-top: 5px;
  color: #9fb0c8;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-team-name,
.user-team-last-active,
.user-team-origin {
  margin-top: 0;
  color: #dfe5f3;
}

.user-team-origin {
  color: #d7e8ff;
}

.user-team-role-spacer {
  display: block;
  min-height: 1px;
}

.user-team-header em {
  justify-self: end;
  padding: 5px 10px;
  border: 1px solid rgba(255, 139, 26, 0.2);
  border-radius: 999px;
  background: rgba(255, 139, 26, 0.045);
  color: #e8bd91;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.user-team-header .pill,
.org-user-child .pill,
.organization-standalone-row .pill {
  min-height: 22px;
  width: 92px;
  min-width: 0;
  justify-content: center;
  border: 1px solid rgba(159, 176, 200, 0.2);
  border-radius: 5px;
  background: rgba(159, 176, 200, 0.08);
  color: #cbd6e6;
  font-size: 11px;
}

.user-team-header .pill.green,
.org-user-child .pill.green,
.organization-standalone-row .pill.green {
  border-color: rgba(115, 191, 105, 0.26);
  background: rgba(115, 191, 105, 0.1);
  color: #bfe5b9;
}

.user-team-header .pill.blue,
.org-user-child .pill.blue,
.organization-standalone-row .pill.blue {
  border-color: rgba(87, 148, 242, 0.28);
  background: rgba(87, 148, 242, 0.11);
  color: #bdd4ff;
}

.user-team-header .pill.amber,
.org-user-child .pill.amber,
.organization-standalone-row .pill.amber {
  border-color: rgba(255, 184, 77, 0.26);
  background: rgba(255, 184, 77, 0.1);
  color: #f1c98e;
}

.org-children {
  position: relative;
  padding: 10px 0 12px 56px;
}

.org-children::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 14px;
  left: 24px;
  width: 1px;
  background: rgba(255, 139, 26, 0.18);
}

.org-user-child {
  position: relative;
  display: grid;
  grid-template-columns: 24px 40px minmax(360px, 2fr) minmax(220px, 1fr) 92px 140px minmax(210px, 1fr) 58px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid rgba(36, 43, 54, 0.55);
  color: #dfe5f3;
}

.org-user-child:last-child {
  border-bottom: 0;
}

.org-user-child:hover {
  background: rgba(87, 148, 242, 0.035);
}

.org-user-self-buyer {
  background: rgba(87, 148, 242, 0.025);
}

.org-user-self-buyer .row-actions {
  min-height: 1px;
}

.org-tree-line {
  width: 22px;
  height: 1px;
  background: rgba(255, 139, 26, 0.24);
}

.org-user-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.org-user-main strong,
.org-user-main span,
.org-user-child > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-user-main span {
  color: var(--muted);
  font-size: 12px;
}

.organization-standalone-row {
  background: #10141b;
}

.organization-standalone-row .avatar {
  justify-self: center;
}

.team-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(87, 148, 242, 0.28);
  border-radius: 999px;
  background: rgba(87, 148, 242, 0.08);
  color: #bcd3ff;
  font-size: 12px;
  font-weight: 800;
}

.team-pill.team-tone-orange,
.user-team-header.team-tone-orange em {
  border-color: rgba(255, 139, 26, 0.34);
  background: rgba(255, 139, 26, 0.1);
  color: #ffc28a;
}

.team-pill.team-tone-blue,
.user-team-header.team-tone-blue em {
  border-color: rgba(87, 148, 242, 0.32);
  background: rgba(87, 148, 242, 0.11);
  color: #bdd4ff;
}

.team-pill.team-tone-green,
.user-team-header.team-tone-green em {
  border-color: rgba(115, 191, 105, 0.32);
  background: rgba(115, 191, 105, 0.1);
  color: #bfe5b9;
}

.team-pill.team-tone-purple,
.user-team-header.team-tone-purple em {
  border-color: rgba(184, 119, 217, 0.34);
  background: rgba(184, 119, 217, 0.1);
  color: #ddb8ef;
}

.team-pill.team-tone-cyan,
.user-team-header.team-tone-cyan em {
  border-color: rgba(86, 191, 214, 0.34);
  background: rgba(86, 191, 214, 0.1);
  color: #b8edf7;
}

.team-pill.team-tone-pink,
.user-team-header.team-tone-pink em {
  border-color: rgba(240, 112, 170, 0.34);
  background: rgba(240, 112, 170, 0.1);
  color: #f4b8d2;
}

.team-pill.team-tone-teal,
.user-team-header.team-tone-teal em {
  border-color: rgba(45, 212, 191, 0.34);
  background: rgba(45, 212, 191, 0.1);
  color: #adf0e7;
}

.team-pill.team-tone-lime,
.user-team-header.team-tone-lime em {
  border-color: rgba(163, 230, 53, 0.34);
  background: rgba(163, 230, 53, 0.1);
  color: #d8f6a5;
}

.team-pill.team-tone-rose,
.user-team-header.team-tone-rose em {
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.1);
  color: #ffc0ca;
}

.team-pill.team-tone-indigo,
.user-team-header.team-tone-indigo em {
  border-color: rgba(129, 140, 248, 0.36);
  background: rgba(129, 140, 248, 0.11);
  color: #c7ccff;
}

.team-pill.team-tone-yellow,
.user-team-header.team-tone-yellow em {
  border-color: rgba(250, 204, 21, 0.34);
  background: rgba(250, 204, 21, 0.1);
  color: #f8e89d;
}

.team-pill.team-tone-slate,
.user-team-header.team-tone-slate em {
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(148, 163, 184, 0.1);
  color: #d5deea;
}

.team-pill.team-tone-admin,
.user-team-header.team-tone-admin em {
  border-color: rgba(115, 191, 105, 0.32);
  background: rgba(115, 191, 105, 0.1);
  color: #bfe5b9;
}

.team-pill.team-tone-finance,
.user-team-header.team-tone-finance em {
  border-color: rgba(87, 148, 242, 0.32);
  background: rgba(87, 148, 242, 0.11);
  color: #bdd4ff;
}

.team-pill.team-tone-muted,
.user-team-header.team-tone-muted em {
  border-color: rgba(159, 176, 200, 0.24);
  background: rgba(159, 176, 200, 0.08);
  color: #cbd6e6;
}

.users-footer {
  color: var(--muted);
  font-weight: 700;
}

.user-identity {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
}

.user-identity small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.avatar.mosaic {
  overflow: hidden;
  border: 1px solid rgba(255, 139, 26, 0.28);
  background:
    var(--avatar) center / cover no-repeat,
    #101722;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.3);
  image-rendering: pixelated;
}

.muted-pill {
  background: #666;
  color: #fff;
}

.danger-item {
  border-color: rgba(242, 73, 92, 0.42);
}

.danger-item strong {
  color: #ff9aa5;
}

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

.session-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
}

.session-card span:not(.pill) {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.session-card .button {
  grid-column: 1 / -1;
  justify-self: end;
}

.checkbox-line.inline {
  display: flex;
  min-height: 36px;
  align-items: center;
  align-self: end;
}

.modal-form .checkbox-line.inline {
  justify-content: flex-start;
  gap: 8px;
}

.modal-form .checkbox-line.inline input {
  flex: 0 0 16px;
}

.table-head.buyers,
.buyer-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr 0.7fr 0.8fr;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
}

.buyer-row {
  border-top: 1px solid var(--line-soft);
}

.user-list > div {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
}

.user-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #303844;
  color: #fff;
  font-weight: 800;
  flex: 0 0 32px;
}

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

.permission-grid div {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
}

.permission-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.security-layout {
  grid-template-columns: minmax(360px, 0.7fr) minmax(320px, 0.45fr);
}

.audit-wide {
  grid-column: 1 / -1;
}

.security-policy {
  display: grid;
  gap: 10px;
}

.security-toggle {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
  color: #dce2f0;
  font-weight: 600;
}

.table-head.audit-head,
.audit-row {
  display: grid;
  grid-template-columns: 150px 150px minmax(240px, 1fr) minmax(220px, 0.9fr) 120px;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
}

.audit-row {
  border-top: 1px solid var(--line-soft);
  color: #c7cfdf;
}

.audit-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.alert-card {
  min-height: 146px;
  padding: 15px;
  border-radius: 6px;
}

.alert-card.firing {
  border-color: rgba(242, 73, 92, 0.65);
}

.alert-card div {
  display: flex;
  gap: 9px;
  align-items: center;
}

.alert-card p {
  margin: 12px 0 14px;
}

.alert-card small {
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(242, 73, 92, 0.12);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(115, 191, 105, 0.12);
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 76px 1fr;
  }

  .brand-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-row span,
  .sidebar-toggle,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

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

  .dashboard-grid,
  .home-grid,
  .home-list,
  .access-layout,
  .formula-layout,
  .builder-layout,
  .security-layout,
  .detail-grid,
  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .table-head,
  .dashboard-row {
    grid-template-columns: 44px minmax(250px, 1fr) minmax(260px, 0.8fr);
  }

  .grafana-row-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .grafana-panel,
  .grafana-panel.wide,
  .grafana-panel.third {
    grid-column: span 3;
  }

  .grafana-panel.full {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  .app-shell {
    display: block;
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    border-right: 0;
  }

  body.sidebar-collapsed .sidebar {
    overflow: visible;
  }

  .brand-row {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    min-height: 54px;
    padding: 6px;
    border-bottom: 1px solid var(--line);
  }

  .nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border-left: 0;
    border-bottom: 0;
    border-radius: 5px;
    font-size: 0;
    line-height: 0;
    box-sizing: border-box;
  }

  body.sidebar-collapsed .nav-item {
    flex: 0 0 44px;
    width: 44px;
    height: 42px;
    min-height: 42px;
    border-radius: 5px;
  }

  .nav-item svg {
    display: block;
    width: 18px;
    height: 18px;
  }

  .nav-item span {
    display: none;
  }

  .nav-item.active {
    border-bottom-color: transparent;
  }

  .nav-item.active::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 0;
    left: 8px;
    height: 2px;
    border-radius: 999px;
    background: var(--orange);
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding-left: 12px;
  }

  .view {
    padding: 22px 12px 34px;
  }

  .page-heading,
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .heading-actions {
    flex-wrap: wrap;
  }

  .users-toolbar {
    grid-template-columns: 1fr;
  }

  .users-toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .user-role-select,
  .user-status-select {
    flex: 1 1 140px;
    width: auto;
  }

  .users-tabs {
    overflow-x: auto;
  }

  .date-range-wrap,
  .date-range-wrap .button {
    width: 100%;
  }

  .date-range-popover {
    right: auto;
    left: 0;
    width: min(540px, calc(100vw - 24px));
  }

  .range-picker-shell {
    grid-template-columns: 1fr;
  }

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

  .range-presets button {
    text-align: center;
  }

  .metric-grid,
  .alert-grid,
  .permission-grid,
  .readiness-grid,
  .breakdown-grid,
  .builder-canvas,
  .session-grid,
  .admin-grid,
  .admin-server-grid,
  .backup-summary-grid,
  .backup-insights-grid,
  .backup-settings-card,
  .admin-sync-panel,
  .admin-ops-console,
  .telegram-console,
  .admin-pipeline-grid,
  .telegram-rules-grid,
  .admin-endpoint-row,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .backup-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .backup-row-actions,
  .backup-toolbar {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .builder-widget,
  .builder-widget.size-third,
  .builder-widget.size-half,
  .builder-widget.size-full {
    grid-column: 1 / -1;
  }

  .sync-checklist div {
    grid-template-columns: 1fr;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .button {
    flex: 1;
  }

  .table-panel {
    overflow-x: auto;
  }

  .users-table,
  .formula-workflow,
  .formula-panel,
  .formula-section,
  .admin-panel,
  .backup-panel,
  .dashboard-list-shell,
  .workspace,
  .view {
    min-width: 0;
    max-width: 100%;
  }

  .table-head,
  .dashboard-row {
    min-width: 720px;
  }

  .grafana-row-grid {
    grid-template-columns: 1fr;
    padding-left: 8px;
  }

  .grafana-panel,
  .grafana-panel.wide,
  .grafana-panel.third,
  .grafana-panel.full,
  .grafana-panel[data-grafana-panel],
  .grafana-panel[data-grafana-panel].panel-size-full,
  .grafana-panel.aio-overview-panel,
  .grafana-panel.aio-overview-panel.panel-size-lg,
  .grafana-panel.aio-overview-panel.panel-size-xl,
  .grafana-panel.aio-overview-panel.panel-size-full {
    grid-column: 1 / -1;
  }

  .grafana-row-section:has(.aio-overview-panel) .grafana-row-grid {
    grid-template-columns: 1fr;
  }

  .grafana-panel[data-grafana-panel] {
    width: 100%;
    min-width: 0;
  }

  .grafana-hbar-row {
    grid-template-columns: 94px minmax(220px, 1fr);
  }

  .grafana-axis {
    margin-left: 103px;
    min-width: 220px;
  }

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

  .formula-line {
    grid-template-columns: 28px 1fr 34px;
  }

  .formula-line label:nth-of-type(2) {
    grid-column: 2 / -1;
  }

  .table-head.buyers,
  .buyer-row,
  .table-head.formula-history,
  .formula-history-row,
  .table-head.audit-head,
  .audit-row,
  .users-row {
    min-width: 680px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    font-size: 13px;
  }

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

  .sidebar {
    background: rgba(17, 20, 26, 0.98);
  }

  .formula-chip-grid {
    grid-template-columns: 1fr;
  }

  .formula-step-head {
    display: grid;
  }

  .formula-step-actions {
    justify-self: start;
    min-width: 0;
  }

  .formula-line-builder {
    max-height: none;
    padding-right: 0;
  }

  .formula-line {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    align-items: start;
    gap: 8px;
    padding: 8px;
  }

  .formula-line-index {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 28px;
    height: 34px;
  }

  .formula-line label:first-of-type {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .formula-line label:nth-of-type(2) {
    grid-column: 2 / 4;
    grid-row: 2;
    min-width: 0;
  }

  .formula-line-remove {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    place-items: center;
    align-self: start;
    justify-self: end;
    width: 32px;
    height: 34px;
    min-width: 32px;
    padding: 0;
    line-height: 1;
  }

  .nav-list {
    gap: 4px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex-basis: 48px;
    min-height: 42px;
  }

  body.sidebar-collapsed .nav-item {
    flex-basis: 48px;
  }

  .topbar {
    position: sticky;
    top: 55px;
    z-index: 9;
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 8px;
    background: rgba(13, 15, 20, 0.96);
    backdrop-filter: blur(10px);
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
  }

  .topbar-actions .icon-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 7px;
  }

  .topbar-actions .button.mini {
    height: 34px;
    min-height: 34px;
    padding-inline: 12px;
    border-radius: 7px;
  }

  .breadcrumb {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #currentUserChip {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .button {
    min-height: 34px;
    padding-inline: 10px;
  }

  .view {
    padding: 18px 10px 28px;
  }

  .page-heading {
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-heading h1 {
    font-size: 26px;
    line-height: 1.08;
  }

  .page-heading p {
    max-width: none;
    font-size: 13px;
    line-height: 1.45;
  }

  .heading-actions,
  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .detail-heading-actions {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .detail-heading-actions .date-range-wrap,
  .detail-heading-actions .refresh-control,
  .detail-heading-actions > .button {
    width: 100%;
  }

  .detail-heading-actions .date-range-wrap .button,
  .detail-heading-actions .refresh-control .button {
    width: 100%;
  }

  .detail-heading-actions .refresh-control {
    max-width: none;
  }

  .detail-heading-actions .refresh-control small {
    left: 0;
    right: 0;
    max-width: 100%;
    transform: none;
    text-align: center;
  }

  .heading-actions > *,
  .filter-row > * {
    min-width: 0;
  }

  .heading-actions .button,
  .filter-row .button,
  .new-menu-wrap,
  .overview-control,
  .overview-control .button {
    width: 100%;
  }

  .detail-variable-bar,
  .detail-variable,
  .detail-variable[data-detail-variable="platform"] {
    width: 100%;
  }

  .detail-variable-button {
    min-width: 0;
  }

  .spacer {
    display: none;
  }

  .metric-grid {
    gap: 10px;
  }

  .metric-card {
    min-height: 108px;
    padding: 14px 16px;
  }

  .metric-card strong {
    font-size: clamp(24px, 8vw, 34px);
  }

  .home-control-panel {
    display: grid;
    gap: 12px;
  }

  .home-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .home-controls .button,
  .home-range-control {
    width: 100%;
  }

  .home-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-widget-card {
    min-height: 168px;
    padding: 14px;
  }

  .home-widget-card strong {
    margin: 12px 0 8px;
    font-size: clamp(21px, 6.4vw, 27px);
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: normal;
  }

  .home-widget-card small {
    display: -webkit-box;
    overflow: hidden;
    min-height: 34px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .home-widget-head {
    gap: 6px;
  }

  .home-widget-head > span {
    min-width: 0;
    font-size: 12px;
    line-height: 1.25;
  }

  .home-widget-actions {
    opacity: 1;
  }

  .admin-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    max-width: 100%;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tabs button {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    padding-right: 4px;
    padding-left: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .aio-subtabs {
    flex-wrap: wrap;
    overflow: visible;
    gap: 6px;
    max-width: 100%;
    padding-bottom: 1px;
  }

  .aio-subtabs button {
    flex: 1 1 calc(50% - 6px);
    min-width: min(100%, 142px);
    max-width: none;
    padding-right: 8px;
    padding-left: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .sync-control-actions,
  .aio-worker-actions {
    min-width: 0;
  }

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

  .aio-backfill-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #users .users-table {
    overflow-x: visible;
  }

  #users .grafana-users-head:not(.organization-user-row) {
    display: none;
  }

  #users .grafana-user-row:not(.grafana-users-head):not(.organization-user-row) {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    padding: 12px 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    margin-bottom: 8px;
    background: #111821;
  }

  #users .grafana-user-row:not(.grafana-users-head):not(.organization-user-row) > span:not(.avatar) {
    display: none;
  }

  #users .grafana-user-row:not(.grafana-users-head):not(.organization-user-row) .row-actions {
    display: flex;
    justify-self: end;
    gap: 6px;
  }

  #users .grafana-users-head.organization-user-row,
  #users .grafana-users-head.organization-groups-head {
    display: none;
  }

  #users .user-team-group {
    min-width: 0;
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    overflow: hidden;
  }

  #users .user-team-header {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 0;
    padding: 12px;
    gap: 8px;
  }

  #users .user-team-header em {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
    margin-top: 4px;
    white-space: normal;
  }

  #users .user-team-name,
  #users .user-team-last-active,
  #users .user-team-origin,
  #users .user-team-role-spacer,
  #users .user-team-header .pill {
    display: none;
  }

  #users .user-team-lead-main {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  #users .user-team-lead-main strong,
  #users .user-team-lead-main span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #users .org-children {
    padding: 8px 10px 10px 38px;
  }

  #users .org-children::before {
    left: 20px;
  }

  #users .org-user-child {
    grid-template-columns: 18px 34px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    padding: 9px 0;
  }

  #users .org-tree-line {
    width: 16px;
  }

  #users .org-user-child > span:not(.org-tree-line):not(.avatar),
  #users .org-user-child .pill,
  #users .org-user-child .user-team-last-active,
  #users .org-user-child .user-team-origin {
    display: none;
  }

  #users .org-user-child .org-tree-line {
    grid-column: 1;
  }

  #users .org-user-child .avatar {
    grid-column: 2;
  }

  #users .org-user-child .org-user-main {
    grid-column: 3;
  }

  #users .org-user-main strong,
  #users .org-user-main span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #users .org-user-child .row-actions {
    grid-column: 4;
    display: flex;
    justify-self: end;
    gap: 6px;
  }

  #users .org-user-child .row-actions .button,
  #users .org-user-child .row-actions .icon-button {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .metric-input-row,
  .formula-list-row,
  .metric-catalog-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    padding: 10px;
  }

  .metric-input-key,
  .metric-input-label,
  .metric-input-value,
  .formula-row-expression {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .formula-row-expression {
    grid-column: auto;
    line-height: 1.35;
  }

  .metric-input-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .metric-input-actions .button {
    width: 100%;
  }

  .overview-trend-chart {
    height: 310px;
    min-height: 310px;
  }

  .chart-panel {
    min-height: 368px;
  }

  .table-panel {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  #dashboards .table-head {
    display: none;
  }

  #dashboardRows {
    display: grid;
    gap: 8px;
  }

  #dashboards .dashboard-row,
  .read-only-role #dashboards .dashboard-row {
    min-width: 0;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: start;
    gap: 8px;
    min-height: 64px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    background: #151a21;
  }

  #dashboards .dashboard-row:hover {
    background: #19202a;
  }

  #dashboards .tags {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
  }

  #dashboards .row-actions-right {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: start;
    justify-self: end;
    width: 60px;
    padding-top: 1px;
  }

  #dashboards .row-rename-button,
  #dashboards .row-code-button {
    opacity: 1;
    pointer-events: auto;
  }

  #dashboards .check-cell {
    padding-top: 7px;
  }

  .read-only-role #dashboards .dashboard-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .read-only-role #dashboards .tags {
    grid-column: 1;
  }

  .read-only-role #dashboards .row-actions-right {
    display: none;
  }

  .name-cell {
    align-items: flex-start;
    margin-left: calc(var(--tree-depth, 0) * 12px);
    max-width: calc(100% - calc(var(--tree-depth, 0) * 12px));
  }

  .row-title-wrap strong {
    white-space: normal;
    line-height: 1.25;
  }

  .row-title-wrap small {
    font-size: 12px;
  }

  .row-icon {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
  }

  .tag-chip {
    max-width: 100%;
  }

  .detail-variable-bar {
    grid-template-columns: 1fr;
  }

  .detail-variable,
  .detail-variable-button,
  .detail-variable-menu {
    left: 0;
    right: 0;
    width: auto;
    max-height: 52vh;
  }

  body.editor-mode {
    overflow-x: hidden;
  }

  .editor-view {
    padding: 0;
    overflow-x: hidden;
  }

  .editor-topbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    min-height: auto;
    padding: 8px 10px;
  }

  .editor-breadcrumb {
    min-width: 0;
    gap: 6px;
  }

  .editor-breadcrumb button,
  .editor-breadcrumb strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .editor-breadcrumb button {
    max-width: 116px;
  }

  .editor-breadcrumb strong {
    flex: 1 1 auto;
  }

  .editor-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .editor-toolbar .button {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    white-space: normal;
    line-height: 1.15;
  }

  .editor-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100vh - 92px);
  }

  .editor-canvas {
    align-items: start;
    padding: 18px 10px;
  }

  .editor-panel-grid {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .editor-panel-card,
  .editor-panel-card.size-half,
  .editor-panel-card.size-third,
  .editor-panel-card.size-full,
  .editor-group,
  .editor-control-pill {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .editor-panel-card {
    min-height: min(var(--editor-height, 210px), 240px);
  }

  .editor-panel-meta em {
    display: none;
  }

  .editor-panel-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .editor-floating-add {
    position: relative;
    top: auto;
    left: auto;
    justify-self: start;
    align-self: start;
    margin-bottom: 14px;
  }

  .editor-sidepanel {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .editor-sidepanel.collapsed {
    display: grid;
    grid-template-rows: auto;
    min-height: 44px;
  }

  .editor-sidepanel.collapsed .editor-side-head,
  .editor-sidepanel.collapsed .editor-side-content {
    display: none;
  }

  .editor-side-tabs {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
  }

  .editor-side-tabs button {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 42px;
    padding: 0 12px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    font-size: 0;
  }

  .editor-side-tabs button::after {
    content: attr(data-mobile-label);
    font-size: 12px;
  }

  .editor-side-head {
    grid-column: 1;
    grid-row: 2;
  }

  .editor-side-content {
    grid-column: 1;
    grid-row: 3;
  }

  .grafana-dashboard {
    gap: 10px;
  }

  .grafana-row-section {
    border-left-width: 1px;
  }

  .grafana-row-grid {
    gap: 10px;
    padding-left: 0;
  }

  .grafana-panel {
    min-height: 132px;
    padding: 12px;
  }

  .grafana-stat-panel {
    min-height: 116px;
  }

  .grafana-stat-value {
    font-size: clamp(28px, 11vw, 38px);
  }

  .grafana-panel-title {
    align-items: start;
    gap: 8px;
  }

  .grafana-panel-title h2 {
    white-space: normal;
    line-height: 1.25;
  }

  .grafana-echart,
  .grafana-panel[data-grafana-panel] .grafana-echart {
    width: 100%;
    min-width: 0;
    height: 230px;
  }

  .grafana-echart > div,
  .grafana-echart canvas {
    max-width: 100%;
  }

  .grafana-echart.compact,
  .grafana-panel[data-grafana-panel] .grafana-echart.compact {
    height: 150px;
  }

  .grafana-bar-panel .grafana-echart,
  .grafana-bar-panel[data-grafana-panel] .grafana-echart {
    height: min(260px, calc(var(--panel-height, 280px) - 58px));
  }

  .echart-tooltip {
    min-width: 0;
    max-width: 190px;
    gap: 6px;
  }

  .echart-tooltip div {
    grid-template-columns: 10px minmax(42px, 1fr) auto;
    column-gap: 6px;
  }

  .echart-tooltip span,
  .echart-tooltip strong {
    font-size: 11px;
  }

  .echart-tooltip i {
    width: 8px;
    height: 8px;
  }

  .grafana-data-table {
    width: 100%;
    grid-template-columns: repeat(var(--cols), minmax(96px, 1fr));
    max-height: 320px;
    overflow: auto;
  }

  .table-column-editor-head,
  .table-column-row {
    grid-template-columns: 1fr;
  }

  .table-column-row {
    align-items: stretch;
  }

  .modal-card {
    width: min(100vw - 20px, 640px);
    max-height: calc(100vh - 20px);
  }
}

@media (max-width: 480px) {
  .heading-actions,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .dashboard-search-control {
    width: 100%;
    max-width: none;
  }

  .topbar {
    top: 54px;
  }

  #currentUserChip {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .home-widget-card {
    min-height: 156px;
    padding: 12px;
  }

  .home-widget-card strong {
    font-size: clamp(20px, 6vw, 25px);
  }

  .overview-trend-chart {
    height: 280px;
    min-height: 280px;
  }

  .chart-panel {
    min-height: 338px;
  }

  .home-range-menu {
    left: 0;
    right: auto;
    width: min(260px, calc(100vw - 20px));
  }

  .date-range-popover {
    width: calc(100vw - 20px);
  }

  .range-presets {
    grid-template-columns: 1fr;
  }

  .date-range-popover.date-input-range-popover {
    top: 8px !important;
    right: auto !important;
    left: 10px !important;
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .date-input-range-popover .range-picker-shell {
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(255, 139, 26, 0.34);
    border-radius: 14px;
    background: #10141b;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.52);
  }

  .date-input-range-popover .range-fields {
    gap: 6px;
  }

  .date-input-range-popover .range-field {
    min-height: 40px;
    padding: 6px 8px;
  }

  .date-input-range-popover .range-field strong {
    font-size: 12px;
  }

  .date-input-range-popover .range-arrow {
    font-size: 18px;
  }

  .date-input-range-popover .calendar-card {
    margin-top: 6px;
    padding: 9px;
  }

  .date-input-range-popover .calendar-head {
    margin-bottom: 8px;
  }

  .date-input-range-popover .calendar-head button {
    width: 30px;
    min-height: 28px;
    font-size: 18px;
  }

  .date-input-range-popover .calendar-weekdays,
  .date-input-range-popover .calendar-grid {
    gap: 2px;
  }

  .date-input-range-popover .calendar-day {
    width: auto;
    height: 28px;
    border-radius: 7px;
    font-size: 12px;
  }

  .date-input-range-popover .calendar-actions {
    margin-top: 8px;
  }

  .date-input-range-popover .calendar-actions button {
    min-height: 30px;
    padding: 0 9px;
  }

  .grafana-hbar-row {
    grid-template-columns: 72px minmax(160px, 1fr);
  }

  .grafana-axis {
    margin-left: 80px;
    min-width: 160px;
  }
}

@media (max-width: 360px) {
  .home-controls,
  .home-widget-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .telegram-delivery-panel {
    padding: 10px;
  }

  .telegram-delivery-panel .compact-title,
  .telegram-delivery-panel .inline-actions {
    align-items: stretch;
  }

  .telegram-delivery-panel .compact-title {
    flex-direction: column;
  }

  .telegram-delivery-panel .inline-actions {
    width: 100%;
    justify-content: space-between;
  }

  .telegram-delivery-head,
  .telegram-delivery-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
