:root {
  --ui: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --d-bg: #f3f4f8;
  --d-side: #fafbfd;
  --d-card: #ffffff;
  --d-line: #e4e7ef;
  --d-line-soft: #eef0f5;
  --d-hover: #f1f3f8;
  --d-text: #0f1830;
  --d-muted: #646d86;
  --d-faint: #98a0b5;
  --d-ok: #2b3a63;
  --d-ok-bg: rgba(43, 58, 99, 0.08);
  --d-err-bg: rgba(225, 6, 0, 0.08);
  --d-shadow: 0 1px 2px rgba(15, 24, 48, 0.04), 0 8px 24px rgba(15, 24, 48, 0.05);
  --d-shadow-lift: 0 2px 4px rgba(15, 24, 48, 0.05), 0 18px 40px rgba(15, 24, 48, 0.1);
  --d-glass: rgba(243, 244, 248, 0.78);
  --d-fill: #2b3a63;
  --d-line-start: #1a2744;
}

:root[data-theme="dark"] {
  --d-bg: #060913;
  --d-side: #090d1a;
  --d-card: #0d1324;
  --d-line: rgba(255, 255, 255, 0.07);
  --d-line-soft: rgba(255, 255, 255, 0.04);
  --d-hover: rgba(255, 255, 255, 0.04);
  --d-text: #eef1f8;
  --d-muted: #8b95ae;
  --d-faint: #5d6782;
  --d-ok: #c4cff0;
  --d-ok-bg: rgba(196, 207, 240, 0.08);
  --d-err-bg: rgba(225, 6, 0, 0.14);
  --d-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.35);
  --d-shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 50px rgba(0, 0, 0, 0.55);
  --d-glass: rgba(6, 9, 19, 0.72);
  --d-fill: #8d9ac0;
  --d-line-start: #c4cff0;
}

body.in-dash {
  overflow: hidden;
}

.in-dash .top,
.in-dash .scroll-progress {
  display: none;
}

.dash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  background: var(--d-bg);
  color: var(--d-text);
  font-family: var(--ui);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] .dash {
  color-scheme: dark;
}

.dash[hidden] {
  display: none;
}

.dash button {
  font-family: inherit;
}

.dash .ico {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash .muted {
  color: var(--d-muted);
}

.dash .mono {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-ligatures: none;
  letter-spacing: -0.01em;
}

/* Sidebar */

.dash-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px 14px;
  overflow-y: auto;
  background: var(--d-side);
  border-right: 1px solid var(--d-line);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--d-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dash-brand .mark {
  width: 26px;
  height: 26px;
}

.dash-label {
  margin: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--d-faint);
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--d-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition:
    color 0.25s,
    background 0.25s;
}

.dash-link:hover {
  color: var(--d-text);
  background: var(--d-hover);
}

.dash-link.current {
  color: var(--d-text);
  background: transparent;
}

.dash-link.current .ico {
  color: var(--red);
}

.dash-indicator {
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  z-index: 0;
  height: var(--h, 36px);
  border: 1px solid var(--d-line);
  border-radius: 10px;
  background: var(--d-card);
  box-shadow: var(--d-shadow);
  opacity: 0;
  transform: translateY(var(--y, 0));
  transition:
    transform 0.5s var(--ease),
    height 0.5s var(--ease),
    opacity 0.3s;
  pointer-events: none;
}

.dash-indicator::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--red);
}

.dash-indicator.on {
  opacity: 1;
}

.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dash-side-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.dash-prefs {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--d-line);
  border-radius: 14px;
  background: var(--d-card);
  box-shadow: var(--d-shadow);
}

.dash-user-text {
  min-width: 0;
  flex: 1;
}

.dash-user-email {
  margin: 0 0 3px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(140deg, #1a2744 0%, #2b3a63 60%, #e10600 140%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 0 2px var(--d-card),
    0 0 0 3px rgba(225, 6, 0, 0.35);
}

.avatar-sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
  box-shadow: none;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 16px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--d-ok-bg);
  color: var(--d-ok);
  font-size: 11px;
  font-weight: 600;
}

.role-badge.is-admin {
  background: var(--d-err-bg);
  color: var(--red);
}

.role-badge.is-admin::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Controls */

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--d-line);
  border-radius: 11px;
  background: var(--d-hover);
}

.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--d-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition:
    background 0.25s var(--ease),
    color 0.25s,
    box-shadow 0.25s;
}

.seg button:hover {
  color: var(--d-text);
}

.seg button.current {
  background: var(--d-card);
  color: var(--d-text);
  box-shadow: 0 1px 3px rgba(15, 24, 48, 0.12);
}

.seg-sm button {
  padding: 4px 9px;
  font-size: 11.5px;
}

.seg-sm .ico {
  width: 15px;
  height: 15px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  background: var(--d-card);
  color: var(--d-muted);
  transition:
    color 0.2s,
    border-color 0.2s,
    transform 0.3s var(--ease);
}

.icon-btn:hover {
  color: var(--d-text);
  border-color: var(--d-faint);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn.spin .ico {
  animation: spin 0.7s var(--ease);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--d-line);
  border-radius: 999px;
  background: var(--d-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition:
    border-color 0.2s,
    transform 0.3s var(--ease);
}

.btn-ghost:hover {
  border-color: var(--d-faint);
  transform: translateY(-1px);
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

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

.btn-pill .ico {
  transition: transform 0.3s var(--ease);
}

.btn-pill:hover .ico {
  transform: translateX(3px);
}

.btn-primary {
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(26, 39, 68, 0.25);
}

:root[data-theme="dark"] .btn-primary {
  background: #ffffff;
  color: var(--ink);
}

.btn-danger {
  background: var(--d-err-bg);
  color: var(--red);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--d-muted);
  font-size: 13px;
  font-weight: 600;
}

.link-btn:hover {
  color: var(--d-text);
}

.link-btn .ico {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease);
}

.link-btn:hover .ico {
  transform: translateX(3px);
}

/* Main column */

.dash-main {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.dash-main::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -120px;
  width: 620px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(225, 6, 0, 0.09), transparent);
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}

.dash-main::after {
  content: "";
  position: absolute;
  top: -120px;
  left: 10%;
  width: 560px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(43, 58, 99, 0.12), transparent);
  pointer-events: none;
}

.dash-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 32px;
  border-bottom: 1px solid var(--d-line);
  background: var(--d-glass);
  backdrop-filter: blur(16px) saturate(1.5);
}

.dash-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--d-muted);
  font-size: 13.5px;
  font-weight: 500;
}

.crumb-sep {
  width: 14px !important;
  height: 14px !important;
  color: var(--d-faint);
}

.crumb-current {
  color: var(--d-text);
  font-weight: 650;
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 10px;
  margin-right: 2px;
  border-right: 1px solid var(--d-line);
}

.preview-bar[hidden] {
  display: none;
}

.preview-label {
  color: var(--d-muted);
  font-size: 12px;
}

.chip-sample {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px dashed rgba(225, 6, 0, 0.45);
  border-radius: 999px;
  color: var(--red);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chip-sample i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: beacon 1.8s ease-in-out infinite;
}

.dash-body {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 32px 56px;
}

.dash-page[hidden],
.dash-view[hidden] {
  display: none;
}

.dash-view {
  display: grid;
  gap: 18px;
}

.dash-view > * {
  animation: rise-in 0.65s var(--ease) both;
}

.dash-view > :nth-child(2) {
  animation-delay: 0.06s;
}

.dash-view > :nth-child(3) {
  animation-delay: 0.12s;
}

.dash-view > :nth-child(4) {
  animation-delay: 0.18s;
}

.dash-view > :nth-child(5) {
  animation-delay: 0.24s;
}

.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 4px;
}

.dash-h {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.dash-sub {
  max-width: 44rem;
  margin: 0;
  color: var(--d-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Upsell */

.upsell[hidden],
.plan-status[hidden] {
  display: none;
}

.upsell {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(225, 6, 0, 0.35), transparent 45%),
    linear-gradient(120deg, #1a2744 0%, #111a33 100%);
  color: #ffffff;
  box-shadow: 0 20px 40px rgba(15, 24, 48, 0.2);
}

.upsell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.08) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sweep 6s ease-in-out 1.2s infinite;
  pointer-events: none;
}

.upsell-art {
  display: grid;
  grid-template-columns: repeat(2, 14px);
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: #ffffff;
  flex: 0 0 auto;
}

.upsell-art i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1a2744;
  animation: dots 2.6s var(--ease) infinite;
}

.upsell-art i:nth-child(2) {
  background: var(--red);
  animation-delay: 0.15s;
}

.upsell-art i:nth-child(3) {
  animation-delay: 0.3s;
}

.upsell-art i:nth-child(4) {
  animation-delay: 0.45s;
}

.upsell-copy {
  flex: 1;
}

.upsell h3 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.upsell p {
  margin: 0;
  color: #c4cde3;
  font-size: 13.5px;
  line-height: 1.5;
}

.upsell .btn-primary {
  position: relative;
  z-index: 1;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* KPI cards */

.kpis {
  display: grid;
  gap: 14px;
}

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

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

.kpi {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border: 1px solid var(--d-line);
  border-radius: 16px;
  background: var(--d-card);
  box-shadow: var(--d-shadow);
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0;
  transform: scaleX(0.3);
  transition:
    opacity 0.4s,
    transform 0.6s var(--ease);
}

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--d-shadow-lift);
}

.kpi:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.kpi-label {
  margin: 0 0 10px;
  color: var(--d-muted);
  font-size: 12.5px;
  font-weight: 550;
}

.kpi-value {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kpi-trend {
  margin: 0;
  color: var(--d-muted);
  font-size: 12px;
}

.trend {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trend.up {
  background: var(--d-ok-bg);
  color: var(--d-ok);
}

.trend.down {
  background: var(--d-err-bg);
  color: var(--red);
}

.kpi-meter {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--d-line-soft);
}

.kpi-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy-2), #4b5c8f);
  transform: scaleX(var(--v, 0));
  transform-origin: 0 50%;
  transition: transform 1.2s var(--ease) 0.2s;
}

:root[data-theme="dark"] .kpi-meter i {
  background: linear-gradient(90deg, #8d9ac0, #c4cff0);
}

.kpi-meter-red i,
:root[data-theme="dark"] .kpi-meter-red i {
  background: linear-gradient(90deg, #ff5a4f, var(--red));
}

/* Cards */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 18px;
}

.card-p {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--d-line);
  border-radius: 18px;
  background: var(--d-card);
  box-shadow: var(--d-shadow);
}

.card-p h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.card-h p {
  margin: 3px 0 0;
  font-size: 12.5px;
}

.empty-state {
  margin: 0;
  padding: 26px 16px;
  border: 1px dashed var(--d-line);
  border-radius: 12px;
  color: var(--d-muted);
  font-size: 13.5px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.desk-card {
  overflow: hidden;
}

.desk-card h3 {
  position: relative;
  margin-bottom: 8px;
}

.desk-card > p {
  position: relative;
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
}

.desk-glow {
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(225, 6, 0, 0.18), transparent);
  animation: drift 10s ease-in-out infinite alternate;
}

.ticks {
  position: relative;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.ticks li::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--red) 0 3px, transparent 3.5px),
    var(--d-err-bg);
}

/* Chart */

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

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--d-line);
  stroke-dasharray: 3 5;
}

.chart-tick {
  fill: var(--d-faint);
  font-family: var(--ui);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cg-fill-0 {
  stop-color: var(--d-fill);
  stop-opacity: 0.26;
}

.cg-fill-1 {
  stop-color: var(--d-fill);
  stop-opacity: 0;
}

.cg-line-0 {
  stop-color: var(--d-line-start);
}

.cg-line-1 {
  stop-color: var(--red);
}

.chart-area {
  animation: fade-in 1.2s var(--ease) 0.5s both;
}

.chart-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 1.6s var(--ease) both;
}

.chart-end {
  fill: var(--red);
  stroke: var(--d-card);
  stroke-width: 2;
}

.chart-pulse {
  fill: var(--red);
  opacity: 0.25;
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse-ring 2s ease-out 1.6s infinite;
}

.chart-guide {
  stroke: var(--d-faint);
  stroke-dasharray: 2 3;
  opacity: 0;
  transition: opacity 0.2s;
}

.chart-focus {
  fill: var(--d-card);
  stroke: var(--red);
  stroke-width: 2.5;
  opacity: 0;
  transition: opacity 0.2s;
}

.chart-hit {
  fill: transparent;
  cursor: crosshair;
}

.chart.is-hover .chart-guide,
.chart.is-hover .chart-focus,
.chart.is-hover .chart-tip {
  opacity: 1;
}

.chart-tip {
  position: absolute;
  left: calc(var(--x, 0) * 100%);
  top: calc(var(--y, 0) * 100%);
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #0f1830;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  transition:
    opacity 0.2s,
    left 0.18s var(--ease),
    top 0.18s var(--ease);
  pointer-events: none;
}

:root[data-theme="dark"] .chart-tip {
  background: #ffffff;
  color: var(--ink);
}

.chart-tip-day {
  font-size: 11px;
  opacity: 0.7;
}

.chart-tip-value {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 0 -20px -20px;
  border-radius: 0 0 17px 17px;
}

.card-p > .table-wrap:first-child {
  margin-top: -20px;
  border-radius: 17px;
}

.card-p > .table-wrap:first-child .dt th {
  border-top: 0;
}

.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.dt[hidden] {
  display: none;
}

.dt th {
  padding: 10px 20px;
  border-top: 1px solid var(--d-line);
  border-bottom: 1px solid var(--d-line);
  background: var(--d-hover);
  color: var(--d-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.dt td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--d-line-soft);
  white-space: nowrap;
}

.dt tbody tr {
  animation: row-in 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 35ms);
  transition: background 0.2s;
}

.dt tbody tr:last-child td {
  border-bottom: 0;
}

.dt tbody tr:hover {
  background: var(--d-hover);
}

.dt .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.model-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 2px;
  background: var(--navy-2);
  vertical-align: 1px;
}

:root[data-theme="dark"] .model-dot {
  background: #8d9ac0;
}

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

.tag {
  display: inline-flex;
  padding: 2px 8px;
  border: 1px solid var(--d-line);
  border-radius: 6px;
  color: var(--d-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.s-ok {
  background: var(--d-ok-bg);
  color: var(--d-ok);
}

.s-err {
  background: var(--d-err-bg);
  color: var(--red);
}

.s-wait {
  background: var(--d-hover);
  color: var(--d-muted);
}

.s-wait i {
  animation: beacon 1.4s ease-in-out infinite;
}

.err-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.err-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  animation: row-in 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
  transition: background 0.2s;
}

.err-item:hover {
  background: var(--d-hover);
}

.err-text {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  font-size: 12.5px;
}

.err-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px var(--d-err-bg);
}

.err-item .err-dot {
  margin-right: 0;
}

.err-item,
.alert-row {
  cursor: pointer;
}

.err-item.open,
.alert-row.open {
  background: var(--d-hover);
}

.err-reason {
  margin: 6px 0 0;
  color: var(--muted, #9a9a9a);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
}

.err-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #9a9a9a);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.err-dismiss:hover {
  background: var(--d-hover);
  color: var(--text, #f2f2f2);
}

.alert-actions {
  width: 40px;
  text-align: right;
}

.alert-model-line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.dt tbody tr.alert-row:hover {
  background: var(--d-hover);
}

/* Settings and forms */

.settings {
  display: grid;
  gap: 14px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.set-grow {
  flex: 1;
  margin: 0;
}

.set-row p {
  margin: 0;
}

.strong {
  font-weight: 650;
}

.admin-expense-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 1fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--d-line-soft);
}

.admin-expense-form label {
  display: grid;
  gap: 6px;
  color: var(--d-muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-expense-form input,
.admin-expense-form select {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  background: var(--d-bg);
  color: var(--d-text);
  font: inherit;
  font-size: 13.5px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.admin-expense-form input:focus,
.admin-expense-form select:focus {
  outline: none;
  border-color: var(--navy-2);
  box-shadow: 0 0 0 4px rgba(43, 58, 99, 0.14);
}

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

/* Plan, payment banner, catalog */

.pay-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--d-line);
  border-left: 4px solid var(--navy-2);
  border-radius: 14px;
  background: var(--d-card);
}

.pay-banner[hidden],
.pay-banner [hidden] {
  display: none;
}

.pay-banner p {
  flex: 1;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.pay-banner.is-ok {
  border-left-color: var(--d-ok);
}

.pay-banner.is-err {
  border-left-color: var(--red);
}

.plan-status .card-h h3 {
  margin: 0;
  font-size: 20px;
}

.plan-meter {
  height: 8px;
  margin: 14px 0 12px;
}

.plan-meter.is-full i {
  background: var(--red);
}

.plan-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13.5px;
}

.plan-figures p {
  margin: 0;
}

.plan-figures strong {
  font-variant-numeric: tabular-nums;
}

.plan-exhausted {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--d-err-bg);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}

.catalog-status {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--d-line);
  border-radius: 12px;
  background: var(--d-card);
  font-size: 13.5px;
}

.catalog-status.is-err {
  color: var(--red);
}

.catalog-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--d-line-soft);
}

.catalog-form[hidden] {
  display: none;
}

.catalog-form .wide,
.catalog-form .checks {
  grid-column: 1 / -1;
}

.catalog-form label {
  display: grid;
  gap: 6px;
  color: var(--d-muted);
  font-size: 12px;
  font-weight: 600;
}

.catalog-form label.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--d-text);
  font-size: 13px;
}

.catalog-form .checks {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.catalog-form input:not([type="checkbox"]),
.catalog-form select,
.catalog-form textarea {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  background: var(--d-bg);
  color: var(--d-text);
  font: inherit;
  font-size: 13.5px;
}

.catalog-form textarea {
  height: auto;
  padding: 8px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  resize: vertical;
}

.catalog-form input:focus,
.catalog-form select:focus,
.catalog-form textarea:focus {
  outline: none;
  border-color: var(--navy-2);
  box-shadow: 0 0 0 4px rgba(43, 58, 99, 0.14);
}

.form-hint {
  margin: 0;
  font-size: 12.5px;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.row-edit {
  padding: 4px 10px;
  border: 1px solid var(--d-line);
  border-radius: 8px;
  background: transparent;
  color: var(--d-text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

/* Sign-in preview entry */

.preview-links {
  max-width: 360px;
  margin-top: 28px;
  padding: 16px;
  border: 1px dashed rgba(225, 6, 0, 0.4);
  border-radius: 14px;
}

.preview-links[hidden] {
  display: none;
}

.preview-links-title {
  margin: 0 0 4px;
  font-weight: 650;
}

.preview-links-body {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.preview-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Motion */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes pulse-ring {
  from {
    transform: scale(0.6);
    opacity: 0.45;
  }
  to {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes beacon {
  50% {
    opacity: 0.25;
  }
}

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

@keyframes drift {
  to {
    transform: translate(-60px, 40px) scale(1.1);
  }
}

@keyframes sweep {
  0%,
  60% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes dots {
  0%,
  60%,
  100% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.72);
  }
}

@media (max-width: 1180px) {
  .kpis-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .kpis-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .admin-expense-form,
  .catalog-form {
    grid-template-columns: 1fr 1fr;
  }

  .preview-label {
    display: none;
  }
}

@media (max-width: 760px) {
  body.in-dash {
    overflow: auto;
  }

  .dash {
    position: static;
    display: block;
    min-height: 100vh;
  }

  .dash-side {
    position: static;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--d-line);
  }

  .dash-brand {
    margin-bottom: 10px;
  }

  .dash-label,
  .dash-indicator {
    display: none;
  }

  .dash-nav {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .dash-crumbs {
    display: none;
  }

  .dash-top {
    justify-content: flex-end;
  }

  .dash-link {
    width: auto;
    flex: 0 0 auto;
  }

  .dash-link.current {
    background: var(--d-card);
    box-shadow: var(--d-shadow);
  }

  .dash-main {
    height: auto;
    overflow: visible;
  }

  .dash-top {
    padding: 0 16px;
  }

  .dash-top .btn-ghost span {
    display: none;
  }

  .preview-bar .chip-sample {
    display: none;
  }

  .dash-body {
    padding: 22px 16px 40px;
  }

  .kpis-4,
  .kpis-5 {
    grid-template-columns: 1fr 1fr;
  }

  .upsell {
    flex-wrap: wrap;
  }

  .dash-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
