: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 {
  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 {
  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;
}

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

.global-search,
.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;
}

.global-search input,
.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;
}

.filter-row {
  position: relative;
}

.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: #37872d;
}

.tag-filter-chip.red {
  background: #e02f1f;
}

.tag-filter-chip.amber,
.tag-filter-chip.orange {
  background: #e07513;
}

.tag-filter-chip.purple {
  background: #7d61c8;
}

.tag-filter-chip.blue {
  background: #2b66d9;
}

.tag-filter-chip.olive {
  background: #77950b;
}

.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: 340px;
  color: var(--text);
}

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

.range-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  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: 32px;
  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: center;
}

.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);
}

.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 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(360px, 0.9fr);
  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;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.dashboard-row:hover {
  background: linear-gradient(90deg, rgba(87, 148, 242, 0.08), #1b2028 34%, #171c23);
  box-shadow: inset 3px 0 0 rgba(255, 139, 26, 0.65);
  color: #eef2fb;
}

.dashboard-row.selected {
  background: linear-gradient(90deg, rgba(87, 148, 242, 0.15), #202632);
  box-shadow: inset 3px 0 0 var(--blue);
}

.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);
}

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

.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;
}

.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;
  gap: 5px;
}

.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: 0;
  cursor: pointer;
}

.tag-add-button {
  display: inline-grid;
  place-items: 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: 14px;
  font-weight: 800;
  line-height: 1;
  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;
  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: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-style: normal;
  line-height: 1;
}

.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-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-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #20252d;
  color: var(--muted);
  font-weight: 800;
}

.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;
}

.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);
}

.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: 150px;
  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;
}

.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;
}

.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;
  gap: 10px;
}

.home-dashboard-link,
.home-task {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #13171d;
  color: #dfe5f3;
  text-align: left;
}

.home-dashboard-link {
  grid-template-columns: 26px 1fr auto;
}

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

.home-dashboard-link:hover,
.home-task:hover {
  background: #1b2028;
}

.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;
}

.mini-dashboard-icon {
  width: 16px;
  height: 16px;
  border: 1px solid #8f9bb2;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 45%, #8f9bb2 45%, #8f9bb2 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, #8f9bb2 45%, #8f9bb2 55%, transparent 55%);
}

.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);
}

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

.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;
  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 {
  min-width: 154px;
  border: 1px solid rgba(255, 133, 27, 0.38);
  background: linear-gradient(180deg, rgba(255, 133, 27, 0.13), rgba(17, 22, 29, 0.94));
  color: #dfe5f3;
  border-radius: 7px;
  padding: 7px 12px;
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.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: 1fr 320px;
  min-height: calc(100vh - 48px);
  background: #0f1117;
}

.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: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15191f;
  color: #dfe5f3;
  font-size: 22px;
}

.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%, 1040px);
  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 {
  grid-column: span var(--editor-span, 12);
  min-height: var(--editor-height, 210px);
  padding: 14px;
}

.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: 8px;
  height: clamp(64px, calc(var(--editor-height, 210px) - 92px), 240px);
  padding: 12px;
  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;
  gap: 8px;
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.editor-panel-meta span,
.editor-panel-meta strong {
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #11161d;
}

.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;
  gap: 8px;
  width: 100%;
}

.grafana-row-section {
  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 {
  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: 13px;
  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(26px, 1.9vw, 34px);
  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;
}

.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-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: 10px;
  min-width: 156px;
}

.echart-tooltip div {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 8px;
}

.echart-tooltip div:first-child {
  grid-template-columns: 1fr auto;
}

.echart-tooltip span {
  color: #aeb7c8;
  font-weight: 600;
}

.echart-tooltip strong {
  color: #dfe6f4;
  font-weight: 800;
}

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

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

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

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

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

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

.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-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: right;
  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: #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 {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
}

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

.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-control-pill {
  grid-column: span 8;
}

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

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

.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;
  padding: 16px;
}

.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 26px 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: nowrap;
}

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

.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);
  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;
}

.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);
}

.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;
}

.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;
  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: none;
  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;
}

.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;
}

.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;
}

.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;
}

.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 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,
.global-search input:focus,
.field input:focus {
  box-shadow: 0 0 0 2px rgba(245, 130, 31, 0.28);
}

.buyer-access-picker {
  display: grid;
  gap: 8px;
}

.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: 210px;
  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-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;
}

.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(320px, 1fr) 96px 150px auto;
  gap: 8px;
  align-items: center;
}

.user-search-field {
  width: 100%;
}

.custom-select {
  position: relative;
}

.custom-select-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #242932;
  color: #dfe5f3;
  font-weight: 700;
}

.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(150px, 0.6fr) minmax(260px, 1.2fr) minmax(180px, 0.9fr) 150px 120px 140px 58px;
  align-items: center;
  gap: 10px;
  min-width: 1120px;
  min-height: 42px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line-soft);
  color: #dfe5f3;
}

.grafana-user-row:hover {
  background: #171c24;
}

.grafana-users-head {
  min-height: 46px;
  color: #dce2f0;
  background: transparent;
}

.grafana-users-head:hover {
  background: transparent;
}

.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,
  .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;
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 0;
  }

  .brand-row {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
    border-bottom: 1px solid var(--line);
  }

  .nav-item {
    flex: 0 0 44px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 5px;
  }

  .nav-item.active {
    border-bottom-color: var(--orange);
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding-left: 12px;
  }

  .global-search {
    display: none;
  }

  .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-tabs {
    overflow-x: auto;
  }

  .date-range-wrap,
  .date-range-wrap .button {
    width: 100%;
  }

  .date-range-popover {
    right: auto;
    left: 0;
    width: min(340px, calc(100vw - 24px));
  }

  .metric-grid,
  .alert-grid,
  .permission-grid,
  .readiness-grid,
  .breakdown-grid,
  .builder-canvas,
  .session-grid,
  .admin-grid,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .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;
  }

  .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 {
    grid-column: 1 / -1;
  }

  .grafana-hbar-row {
    grid-template-columns: 94px minmax(220px, 1fr);
  }

  .grafana-axis {
    margin-left: 103px;
    min-width: 220px;
  }

  .table-head.buyers,
  .buyer-row,
  .table-head.formula-history,
  .formula-history-row,
  .table-head.audit-head,
  .audit-row,
  .users-row {
    min-width: 680px;
  }
}
