:root {
  --bg: #1d211f;
  --panel: #252a28;
  --panel-muted: #202522;
  --text: #161b1f;
  --muted: #9d9688;
  --line: #3a3932;
  --strong-line: #5b543f;
  --accent: #c9922a;
  --accent-hi: #d8a43d;
  --accent-dark: #9f721d;
  --accent-soft: #332a18;
  --graphite: #171d21;
  --graphite-2: #242b30;
  --graphite-3: #30383d;
  --cream: #f7f2e5;
  --green: #39b86f;
  --green-dark: #1f8d55;
  --green-soft: rgba(57, 184, 111, 0.14);
  --green-bg: #dcebc8;
  --amber: #d8a43d;
  --red: #d94d42;
  --red-bg: #ffe6df;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
  --shadow-strong: 0 28px 80px rgba(0, 0, 0, 0.42);
  --brand-font: "Arial Black", "Arial Bold", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --ui-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --title-caption-gap: 4px;
  --card-row-gap: 12px;
  --field-label-gap: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: #ede7d8;
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: auto;
  text-rendering: auto;
}

::selection {
  color: var(--graphite);
  background: var(--accent);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(201, 146, 42, 0.28);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.landing-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #f4f8ff;
  background: #050607;
}

.landing-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 6, 7, 0.98) 0%, rgba(7, 8, 8, 0.94) 42%, rgba(9, 10, 10, 0.68) 58%, rgba(25, 22, 14, 0.06) 82%),
    linear-gradient(180deg, rgba(5, 6, 7, 0.16) 0%, rgba(5, 6, 7, 0) 42%, rgba(7, 8, 8, 0.48) 100%);
}

.car-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.landing-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 44px 8px 34px;
}

.login-button {
  margin-left: auto;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(255, 38, 52, 0.5);
  border-radius: 999px;
  color: #f7f2e5;
  background: rgba(9, 11, 12, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
}

.login-button:hover {
  color: #ffffff;
  border-color: rgba(255, 38, 52, 0.9);
  background: #d6181f;
  box-shadow: 0 14px 32px rgba(214, 24, 31, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.brand-line {
  display: flex;
  align-items: flex-start;
  text-align: left;
  line-height: 0;
}

.brand-logo {
  display: block;
  width: clamp(156px, 15vw, 220px);
  height: auto;
}

.hero-copy {
  position: relative;
  z-index: 3;
  width: min(690px, calc(100% - 68px));
  padding: clamp(108px, 14vh, 148px) 0 0 34px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  color: #ff2a35;
  font-size: 11px;
  font-weight: 750;
  font-family: var(--ui-font);
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(40px, 4.45vw, 64px);
  line-height: 0.98;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 900;
  color: #ffffff;
  text-wrap: balance;
}

.hero-copy p:last-child {
  width: min(520px, 100%);
  margin: 24px 0 0;
  color: rgba(247, 242, 229, 0.74);
  font-size: clamp(15px, 1.08vw, 17px);
  line-height: 1.62;
  font-weight: 500;
  text-wrap: pretty;
}

.landing-legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 44px) 20px;
  border-top: 1px solid rgba(247, 242, 229, 0.08);
  background: #050607;
  color: rgba(216, 210, 198, 0.56);
  font-size: 11px;
  line-height: 1.45;
}

.landing-legal-footer p {
  margin: 0;
}

.landing-legal-footer a,
.legal-back-link {
  flex: 0 0 auto;
  color: #ff2a35;
  font-weight: 800;
  text-decoration: none;
}

.auth-processing {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f7f2e5;
  background:
    linear-gradient(90deg, rgba(5, 6, 7, 0.98), rgba(10, 12, 12, 0.92)),
    radial-gradient(circle at 72% 32%, rgba(241, 11, 8, 0.2), transparent 360px);
}

.auth-processing__panel {
  display: grid;
  justify-items: center;
  gap: 9px;
  width: min(380px, 100%);
  padding: 26px 24px;
  border: 1px solid rgba(255, 42, 53, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, #202628, #141919);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  text-align: center;
}

.auth-processing__lamp {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ff5c50;
  box-shadow: 0 0 0 6px rgba(255, 92, 80, 0.12), 0 0 24px rgba(241, 11, 8, 0.45);
  animation: authLampPulse 1.1s ease-in-out infinite;
}

.auth-processing__panel p {
  margin: 0;
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 17px;
  font-weight: 780;
}

.auth-processing__panel strong {
  max-width: 280px;
  color: #b9b09e;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.38;
}

@keyframes authLampPulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.72;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.landing-legal-footer a:hover,
.legal-back-link:hover {
  color: #ff8a8f;
}

.legal-page-body {
  min-height: 100vh;
  color: #f7f2e5;
  background:
    radial-gradient(circle at 84% 4%, rgba(214, 24, 31, 0.18), transparent 300px),
    linear-gradient(135deg, #060708, #101211 58%, #070808);
}

.legal-page {
  width: 100%;
  margin: 0;
  padding: 0 0 56px;
}

.legal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 44px 8px 34px;
  margin-bottom: clamp(56px, 10vh, 92px);
}

.legal-page-header > a:first-child {
  display: block;
  line-height: 0;
}

.legal-page-logo {
  display: block;
  width: clamp(136px, 13vw, 190px);
  height: auto;
}

.legal-document {
  width: min(920px, calc(100% - 68px));
  margin: 0 auto;
  max-width: 920px;
}

.legal-document .eyebrow {
  color: #ff2a35;
}

.legal-document h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.98;
  font-weight: 900;
}

.legal-updated {
  margin: 18px 0 34px;
  color: rgba(247, 242, 229, 0.56);
  font-size: 12px;
  line-height: 1.4;
}

.legal-copy {
  display: grid;
  gap: 14px;
  color: rgba(247, 242, 229, 0.72);
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.62;
}

.legal-copy p {
  margin: 0;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(201, 146, 42, 0.06), rgba(201, 146, 42, 0) 34%),
    radial-gradient(circle at top right, rgba(201, 146, 42, 0.08), transparent 440px),
    var(--bg);
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  gap: 18px;
  padding: 12px 28px;
  color: #f6f2e7;
  background:
    linear-gradient(180deg, rgba(16, 20, 23, 0.98), rgba(20, 25, 26, 0.94));
  border-bottom: 1px solid rgba(201, 146, 42, 0.16);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  min-width: 168px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #f7f2e5;
  border: 1px solid rgba(216, 164, 61, 0.68);
  background: linear-gradient(180deg, #333b40, #191e1f);
  font-weight: 800;
  font-family: var(--brand-font);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #b9b0a0;
  font-size: 13px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid rgba(201, 146, 42, 0.16);
  border-radius: 8px;
  background: rgba(13, 17, 17, 0.58);
  scrollbar-width: none;
}

.shell-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.shell-top-meta > *,
.shell-access-pill {
  min-height: 44px;
  border: 1px solid rgba(201, 146, 42, 0.34);
  border-radius: 8px;
  color: #f7f2e5;
  background: linear-gradient(180deg, #1d2324, #121718);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.shell-access-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 132px;
  padding: 7px 11px;
}

.shell-access-pill span,
.shell-access-pill small {
  color: #c9bfac;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
}

.shell-access-pill small {
  display: none;
}

.shell-access-pill strong {
  color: #fff7e8;
  font-size: 15px;
  line-height: 1.05;
}

.shell-status-pill {
  min-height: 44px;
  white-space: nowrap;
  color: #f7f2e5;
  background: linear-gradient(180deg, #1d2324, #121718);
  border: 1px solid rgba(201, 146, 42, 0.34);
  font-weight: 700;
}

.shell-api-status {
  min-height: 44px;
  white-space: nowrap;
  background: linear-gradient(180deg, #1d2324, #121718);
  border-color: rgba(201, 146, 42, 0.34);
}

.shell-top-meta .secondary-button {
  min-height: 44px;
  color: #f7f2e5;
  background: linear-gradient(180deg, #1d2324, #121718);
  border-color: rgba(201, 146, 42, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.shell-top-meta .client-status-pill.active,
.shell-top-meta .client-status-pill.limit,
.shell-top-meta .client-status-pill.paused {
  min-height: 44px;
  color: #f7f2e5;
  background: linear-gradient(180deg, #1d2324, #121718);
  border: 1px solid rgba(201, 146, 42, 0.34);
}

.shell-top-meta .shell-api-status {
  min-height: 44px;
  color: #f7f2e5;
  background: linear-gradient(180deg, #1d2324, #121718);
  border-color: rgba(201, 146, 42, 0.34);
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 6px;
  color: #cfc6b6;
  background: rgba(23, 29, 29, 0.72);
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 560;
  line-height: 1;
}

.nav-item span {
  width: 20px;
  color: var(--accent);
  text-align: center;
}

.nav-item:hover {
  color: #f7f2e5;
  border-color: rgba(201, 146, 42, 0.34);
  background: rgba(31, 37, 37, 0.92);
}

.nav-item.is-active {
  color: #fff7e8;
  border-color: rgba(201, 146, 42, 0.7);
  background: rgba(201, 146, 42, 0.14);
  box-shadow: inset 0 -2px 0 rgba(216, 164, 61, 0.9);
}

.nav-item.is-active span,
.nav-item:hover span {
  color: var(--accent-hi);
}

.sidebar-note {
  display: none;
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(201, 146, 42, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-note span,
.sidebar-note p {
  color: #b9b0a0;
}

.sidebar-note span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
}

.sidebar-note strong {
  display: block;
  margin-bottom: 8px;
}

.sidebar-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  flex: 1 1 auto;
  min-width: 0;
  padding: 24px 28px 36px;
  background:
    linear-gradient(180deg, rgba(201, 146, 42, 0.05), rgba(255, 255, 255, 0) 260px),
    radial-gradient(circle at top right, rgba(201, 146, 42, 0.1), transparent 340px);
}

.topbar,
.panel-header,
.topbar-actions,
.panel-actions,
.api-status,
.modal-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(201, 146, 42, 0.13);
  border-radius: 8px;
  background: linear-gradient(180deg, #252c2f, #1b2020);
  box-shadow: var(--shadow);
}

#workspaceHeaderContent {
  flex: 1 1 auto;
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: var(--title-caption-gap);
  font-size: 28px;
  line-height: 1.15;
  font-family: var(--brand-font);
  color: #f7f2e5;
}

.panel h2,
.modal-panel h2 {
  font-size: 18px;
}

h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.topbar-actions {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-actions {
  flex: 0 0 auto;
  gap: 10px;
  justify-content: flex-end;
}

.clients-panel-actions {
  flex-wrap: wrap;
}

.api-status {
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(201, 146, 42, 0.2);
  border-radius: 8px;
  color: #d4c9b3;
  background: rgba(18, 22, 22, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.16);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
}

.primary-button {
  color: #f7f2e5;
  background: linear-gradient(180deg, #30383d, #191e1f);
  border-color: rgba(201, 146, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.primary-button:hover {
  color: var(--graphite);
  background: linear-gradient(180deg, #d8a43d, var(--accent));
  border-color: #d8a43d;
  box-shadow: 0 12px 26px rgba(201, 146, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.secondary-button {
  color: var(--cream);
  background: linear-gradient(180deg, #20272a, #151a1b);
  border-color: rgba(201, 146, 42, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.secondary-button:hover {
  color: var(--graphite);
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.settings-save-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(201, 146, 42, 0.28);
  border-radius: 8px;
  color: #d8cfbf;
  background: linear-gradient(180deg, #202629, #151a1b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.settings-save-button.is-dirty {
  color: #171d21;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 48%),
    linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent-hi);
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.14), 0 14px 32px rgba(201, 146, 42, 0.24);
}

.settings-save-button:hover {
  border-color: var(--accent-hi);
}

.danger-button {
  color: var(--red);
  background: var(--red-bg);
  border-color: #ffc7c2;
}

.danger-button:hover {
  color: #ffffff;
  background: var(--red);
}

.icon-button {
  display: grid;
  width: 40px;
  min-width: 40px;
  padding: 0;
  place-items: center;
  color: #e8d5a2;
  background: #1a1f20;
  border-color: rgba(201, 146, 42, 0.34);
  font-size: 18px;
}

.icon-button:hover {
  color: var(--graphite);
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

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

#adminDashboard .metrics-grid {
  margin-bottom: 16px;
}

.metric-card,
.panel {
  border: 1px solid rgba(201, 146, 42, 0.13);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(48, 56, 61, 0.96), rgba(31, 36, 34, 0.94));
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-hi));
}

.metric-card:hover {
  border-color: rgba(201, 146, 42, 0.38);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
}

.metric-card.is-negative::before {
  background: linear-gradient(90deg, #9f2d25, #f06b5e);
}

.metric-card.is-negative strong {
  color: #ffd7d1;
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: #c2b79f;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1;
  font-family: var(--brand-font);
  color: #ffffff;
}

.metric-card__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.metric-card__line strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-card__line small {
  color: #ded6c8;
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 600;
}

.metric-card__line em {
  color: #d9d0bf;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  text-align: right;
}

.metric-status-track {
  display: flex;
  height: 9px;
  overflow: hidden;
  margin-top: 13px;
  border: 1px solid rgba(201, 146, 42, 0.18);
  border-radius: 999px;
  background: #111616;
}

.metric-status-track__active,
.metric-status-track__risk {
  position: relative;
  min-width: 0;
  height: 100%;
}

.metric-status-track__active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 52%),
    linear-gradient(90deg, #b88714, var(--accent-hi));
  box-shadow: 0 0 12px rgba(255, 190, 32, 0.22);
}

.metric-status-track__risk {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(90deg, rgba(192, 59, 47, 0.62), rgba(192, 59, 47, 0.92));
  animation: riskPulse 1.8s ease-in-out infinite;
}

.metric-card__meta {
  margin-top: 8px;
  color: #d9d0bf;
  font-size: 12px;
  font-weight: 500;
}

.metric-card__value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.metric-card__value strong {
  flex: 0 0 auto;
}

.metric-card__value small {
  min-width: 0;
  overflow: hidden;
  color: #bfb39f;
  font-size: 12px;
  font-weight: 540;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card__trend {
  display: grid;
  max-width: 100%;
  gap: 8px;
  margin-top: 9px;
  color: #9f9688;
  --spark-rgb: 185, 174, 157;
  --spark-line: #d7cab5;
}

.metric-card__trend p {
  margin: 0;
  overflow: hidden;
  color: #b8ad9b;
  font-size: 11px;
  font-weight: 420;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card__trend b {
  color: #f7f2e5;
  font-weight: 760;
}

.metric-card__sparkline {
  position: relative;
  display: block;
  width: min(100%, 190px);
  height: 38px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 76% 28%, rgba(var(--spark-rgb), 0.16), transparent 34%),
    linear-gradient(180deg, rgba(var(--spark-rgb), 0.075), rgba(247, 242, 229, 0.018));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.026),
    inset 0 -10px 18px rgba(0, 0, 0, 0.16);
}

.metric-card__sparkline::after {
  position: absolute;
  right: 12px;
  bottom: 6px;
  left: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--spark-rgb), 0.18), transparent);
  content: "";
}

.metric-card__sparkline svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.metric-card__spark-area {
  fill: rgba(var(--spark-rgb), 0.14);
}

.metric-card__spark-glow,
.metric-card__spark-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.metric-card__spark-glow {
  stroke: rgba(var(--spark-rgb), 0.22);
  stroke-width: 8;
  filter: blur(5px);
}

.metric-card__spark-line {
  stroke: var(--spark-line);
  stroke-width: 2.15;
  filter: drop-shadow(0 0 6px rgba(var(--spark-rgb), 0.28));
}

.metric-card__trend.is-up {
  --spark-rgb: 105, 224, 166;
  --spark-line: #69e0a6;
}

.metric-card__trend.is-down {
  --spark-rgb: 255, 143, 133;
  --spark-line: #ff8f85;
}

.metric-card__trend.is-up p,
.metric-card__trend.is-up b {
  color: #69e0a6;
}

.metric-card__trend.is-down p,
.metric-card__trend.is-down b {
  color: #ffaaa1;
}

.metric-card__trend.is-flat {
  --spark-rgb: 201, 146, 42;
  --spark-line: #d2a23d;
}

.metric-card__split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.metric-card__split strong {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.metric-card__split small {
  overflow: hidden;
  color: #9f9688;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes riskPulse {
  0%,
  100% {
    filter: saturate(0.9);
    opacity: 0.62;
  }
  50% {
    filter: saturate(1.25);
    opacity: 1;
  }
}

.client-limit-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.24fr);
  gap: 12px;
  margin-bottom: 16px;
}

.limit-card,
.users-mini-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(48, 56, 61, 0.96), rgba(31, 36, 34, 0.94));
  box-shadow: var(--shadow);
}

.limit-card::before,
.users-mini-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-hi));
}

.limit-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.limit-card__head,
.limit-card__meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.limit-card__head span,
.users-mini-card span {
  display: block;
  margin-bottom: 6px;
  color: #c2b79f;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.limit-card__head strong,
.users-mini-card strong {
  font-size: 30px;
  line-height: 1;
  font-family: var(--brand-font);
  color: #ffffff;
}

.limit-card__head em {
  color: #e8d9b8;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
}

.limit-progress {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.22);
  border-radius: 999px;
  background: #111616;
}

.limit-progress__fill {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(90deg, #b88714, var(--accent), var(--accent-hi));
  box-shadow:
    0 0 12px rgba(255, 191, 38, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.limit-progress__fill::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 235, 0.72), transparent);
  filter: blur(2px);
  opacity: 0.72;
  animation: limitPulse 2.7s ease-in-out infinite;
}

.limit-card__meta {
  color: #ded6c8;
  font-size: 14px;
  font-weight: 500;
}

.users-mini-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 16px;
}

.users-mini-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  margin-bottom: 7px;
  font-size: 26px;
  line-height: 1;
}

.users-mini-card strong small {
  color: #ded6c8;
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
}

.users-mini-card span {
  margin-bottom: 0;
}

.users-mini-card em {
  display: block;
  margin-top: 21px;
  color: #d9d0bf;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.users-capacity {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: center;
  gap: 5px;
}

.users-capacity i {
  display: block;
  height: 7px;
  border: 1px solid rgba(201, 146, 42, 0.16);
  border-radius: 999px;
  background: #111616;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.users-capacity i.is-filled {
  border-color: rgba(255, 203, 70, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 52%),
    linear-gradient(90deg, #b88714, var(--accent-hi));
  box-shadow: 0 0 10px rgba(255, 190, 32, 0.22);
}

@keyframes limitPulse {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(250%);
  }
}

.view-panel,
.panel {
  min-width: 0;
}

.panel-header {
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.12);
  background: linear-gradient(180deg, #30383d, #252a28);
}

.clients-panel {
  overflow: hidden;
}

.system-settings-page {
  display: grid;
  gap: 16px;
}

.system-settings-shell {
  display: grid;
  gap: 16px;
}

.system-settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 2px 2px 0;
}

.system-settings-header h2 {
  margin: 0;
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 24px;
  font-weight: 730;
  line-height: 1.14;
}

.system-settings-header p {
  margin: 7px 0 0;
  max-width: 760px;
  color: #b8ad9b;
  font-size: 13px;
  line-height: 1.4;
}

.system-settings-module {
  align-self: start;
}

.backup-module-header h3 {
  margin: 0;
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 20px;
  font-weight: 720;
  line-height: 1.18;
}

.system-settings-module-label {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-hi);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.expense-panel {
  overflow: hidden;
}

.super-admin-panel {
  overflow: hidden;
}

.super-admin-actions {
  flex-wrap: wrap;
}

.super-admin-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #101414;
}

.super-admin-add-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.super-admin-add-row label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.super-admin-add-row label span {
  color: #bfb39f;
  font-size: 12px;
}

.super-admin-add-row input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
}

.super-admin-add-row input:hover {
  border-color: rgba(216, 164, 61, 0.72);
}

.super-admin-add-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 146, 42, 0.12);
}

.super-admin-list {
  display: grid;
  gap: 10px;
}

.super-admin-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(201, 146, 42, 0.1);
  border-radius: 8px;
  background: #171d1d;
}

.super-admin-row.is-current {
  border-color: rgba(59, 190, 130, 0.28);
  background: linear-gradient(180deg, rgba(22, 47, 36, 0.36), #171d1d);
}

.super-admin-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.super-admin-row strong {
  overflow: hidden;
  color: #fff7e8;
  font-size: 14px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.super-admin-row span,
.super-admin-empty,
.super-admin-footer span {
  color: #9f9688;
  font-size: 12px;
  font-weight: 430;
  line-height: 1.35;
}

.super-admin-empty {
  padding: 12px 0;
}

.super-admin-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(201, 146, 42, 0.1);
  background: #151a1a;
}

.expense-actions {
  flex-wrap: wrap;
}

.expense-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(201, 146, 42, 0.08);
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
}

.expense-summary-grid article {
  min-width: 0;
  padding: 14px 16px;
  background: #1b2020;
}

.expense-summary-grid span,
.platform-expense-row label span {
  display: block;
  color: #bfb39f;
  font-size: 12px;
}

.expense-summary-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #f7f2e5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #101414;
}

.expense-list-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) 40px;
  gap: 10px;
  align-items: center;
}

.expense-list-header span {
  color: #9f9688;
  font-size: 11px;
  font-weight: 580;
}

.platform-expense-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) 40px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid rgba(201, 146, 42, 0.1);
  border-radius: 8px;
  background: #171d1d;
}

.platform-expense-row label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.platform-expense-row input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
}

.platform-expense-row input:hover {
  border-color: rgba(216, 164, 61, 0.72);
}

.platform-expense-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 146, 42, 0.12);
}

.platform-expense-row.is-invalid {
  border-color: rgba(217, 77, 66, 0.48);
  background: linear-gradient(180deg, rgba(35, 25, 24, 0.98), #171d1d);
}

.platform-expense-row input[aria-invalid="true"] {
  border-color: rgba(217, 77, 66, 0.72);
  box-shadow: 0 0 0 4px rgba(217, 77, 66, 0.12);
}

.platform-expense-remove {
  min-height: 38px;
  color: #d8d0c0;
}

.platform-expense-remove:hover {
  color: #fff7f5;
  border-color: rgba(217, 77, 66, 0.72);
  background: linear-gradient(180deg, #66312d, #351c1a);
}

.platform-expense-row-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #f1b6af;
  font-size: 12px;
  font-weight: 560;
}

.expense-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid rgba(201, 146, 42, 0.1);
  background: #151a1a;
}

.expense-panel-footer span {
  color: #9f9688;
  font-size: 12px;
  font-weight: 520;
}

.expense-panel-footer strong {
  color: #f7f2e5;
  font-weight: 700;
}

.backup-panel {
  overflow: hidden;
}

.backup-actions {
  flex-wrap: wrap;
}

.backup-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(201, 146, 42, 0.08);
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
}

.backup-summary-grid article {
  min-width: 0;
  padding: 14px 16px;
  background: #1b2020;
}

.backup-summary-grid span,
.backup-row span {
  display: block;
  color: #bfb39f;
  font-size: 12px;
}

.backup-summary-grid strong,
.backup-row strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #f7f2e5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-list {
  display: grid;
  gap: 1px;
  background: rgba(201, 146, 42, 0.08);
}

.backup-list-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 10px 16px;
  background: #151a1a;
}

.backup-list-toolbar--top {
  justify-content: space-between;
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
}

.backup-list-toolbar--bottom {
  justify-content: center;
  border-top: 1px solid rgba(201, 146, 42, 0.1);
}

.backup-list-toolbar > span {
  color: #9f9688;
  font-size: 12px;
  font-weight: 520;
}

.backup-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.backup-pagination button,
.backup-pagination span {
  display: inline-flex;
  min-width: 34px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 8px;
  color: #d8d0c0;
  font-size: 12px;
  font-weight: 520;
}

.backup-pagination button {
  border: 1px solid rgba(201, 146, 42, 0.24);
  background: #151a1a;
}

.backup-pagination button:hover:not(:disabled),
.backup-pagination button.is-active {
  color: #fff7e8;
  border-color: rgba(201, 146, 42, 0.68);
  background: rgba(201, 146, 42, 0.13);
}

.backup-pagination button.is-active {
  cursor: default;
  opacity: 1;
}

.backup-pagination span {
  min-width: 22px;
  padding: 0 2px;
  color: #756d61;
}

.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: #171c1c;
}

.backup-row > div {
  min-width: 0;
}

.backup-row-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.backup-empty {
  padding: 16px;
  color: #bfb39f;
  background: #171c1c;
}

.system-status-panel {
  overflow: hidden;
}

.system-status-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #101414;
}

.system-status-alert {
  padding: 11px 14px;
  border: 1px solid rgba(217, 77, 66, 0.3);
  border-radius: 8px;
  color: #ffd7d1;
  background: rgba(217, 77, 66, 0.1);
  font-size: 13px;
  font-weight: 650;
}

.system-status-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.system-status-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  padding: 13px 14px 14px;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(33, 39, 38, 0.98), rgba(22, 27, 27, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.system-status-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: #746b5e;
}

.system-status-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.system-status-card.is-ok::before,
.system-status-pill.is-ok {
  background: var(--green);
}

.system-status-card.is-warning::before,
.system-status-pill.is-warning {
  background: var(--accent-hi);
}

.system-status-card.is-danger::before,
.system-status-pill.is-danger {
  background: var(--red);
}

.system-status-card.is-ok {
  border-color: rgba(57, 184, 111, 0.2);
}

.system-status-card.is-warning {
  border-color: rgba(216, 164, 61, 0.28);
}

.system-status-card.is-danger {
  border-color: rgba(217, 77, 66, 0.28);
}

.system-status-card__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  color: #bfb39f;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-card__label i {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #746b5e;
}

.system-status-card.is-ok .system-status-card__label i {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(57, 184, 111, 0.1);
}

.system-status-card.is-warning .system-status-card__label i {
  background: var(--accent-hi);
  box-shadow: 0 0 0 3px rgba(216, 164, 61, 0.1);
}

.system-status-card.is-danger .system-status-card__label i {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(217, 77, 66, 0.1);
}

.system-status-card__badge {
  flex: 0 0 auto;
  max-width: 92px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.16);
  border-radius: 999px;
  color: #a99f8e;
  background: rgba(12, 16, 16, 0.42);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-card.is-ok .system-status-card__badge {
  color: #9fe4bc;
  border-color: rgba(57, 184, 111, 0.18);
  background: rgba(57, 184, 111, 0.08);
}

.system-status-card.is-warning .system-status-card__badge {
  color: #e8ca78;
  border-color: rgba(216, 164, 61, 0.2);
  background: rgba(216, 164, 61, 0.09);
}

.system-status-card.is-danger .system-status-card__badge {
  color: #f0a09a;
  border-color: rgba(217, 77, 66, 0.22);
  background: rgba(217, 77, 66, 0.09);
}

.system-status-card strong {
  display: block;
  min-width: 0;
  margin-top: 17px;
  overflow: hidden;
  color: #f7f2e5;
  font-size: 24px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-card small {
  display: block;
  min-height: 15px;
  margin-top: 7px;
  overflow: hidden;
  color: #c5baaa;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-card em {
  display: block;
  min-height: 14px;
  margin-top: 5px;
  overflow: hidden;
  color: #8f8779;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-meter {
  position: absolute;
  right: 14px;
  bottom: 6px;
  left: 14px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(8, 11, 11, 0.68);
}

.system-status-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #746b5e;
}

.system-status-card.is-ok .system-status-meter span {
  background: linear-gradient(90deg, var(--green-dark), var(--green));
}

.system-status-card.is-warning .system-status-meter span {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-hi));
}

.system-status-card.is-danger .system-status-meter span {
  background: linear-gradient(90deg, #a8322b, var(--red));
}

.system-status-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.system-status-section {
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #181e1e, #141919);
}

.system-status-section h3 {
  margin: 0;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
  color: #fff7e8;
  font-size: 15px;
  line-height: 1.2;
}

.system-status-rows {
  display: grid;
  gap: 1px;
  background: rgba(201, 146, 42, 0.08);
}

.system-status-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(110px, 0.7fr) minmax(0, 1.2fr) 10px;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 14px;
  background: #171c1c;
}

.system-status-row span,
.system-status-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-row span {
  color: #bfb39f;
  font-size: 12px;
  font-weight: 650;
}

.system-status-row strong {
  min-width: 0;
  overflow: hidden;
  color: #f7f2e5;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-row small {
  color: #8f8779;
  font-size: 11px;
}

.system-status-pill {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #746b5e;
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.1);
}

.diagnostic-logs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 10, 10, 0.72);
}

.diagnostic-logs-panel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.18);
  border-radius: 8px;
  background: #111616;
  box-shadow: var(--shadow-strong);
}

.diagnostic-logs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.12);
  background:
    linear-gradient(180deg, rgba(40, 48, 48, 0.98), rgba(28, 34, 34, 0.98));
}

.diagnostic-logs-header h2 {
  margin: 0;
  color: #fff7e8;
  font-size: 22px;
  line-height: 1.15;
}

.diagnostic-logs-header p:last-child {
  margin: 6px 0 0;
  color: #bfb39f;
  font-size: 13px;
}

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

.diagnostic-log-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 14px 0;
}

.diagnostic-log-summary-item {
  position: relative;
  min-width: 0;
  padding: 12px 13px;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.12);
  border-radius: 8px;
  background: #171d1d;
}

.diagnostic-log-summary-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: #746b5e;
}

.diagnostic-log-summary-item.is-ok::before {
  background: var(--green);
}

.diagnostic-log-summary-item.is-warning::before {
  background: var(--accent-hi);
}

.diagnostic-log-summary-item.is-danger::before {
  background: var(--red);
}

.diagnostic-log-summary-item span {
  display: block;
  color: #bfb39f;
  font-size: 12px;
  font-weight: 520;
}

.diagnostic-log-summary-item strong {
  display: block;
  margin-top: 7px;
  color: #f7f2e5;
  font-size: 24px;
  font-weight: 620;
  line-height: 1;
}

.diagnostic-log-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 10px;
  padding: 12px 14px;
}

.diagnostic-log-filter-group {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(201, 146, 42, 0.12);
  border-radius: 8px;
  background: #151a1a;
  scrollbar-width: none;
}

.diagnostic-log-filter-group button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid rgba(201, 146, 42, 0.1);
  color: #bfb39f;
  background: transparent;
  font-size: 12px;
  font-weight: 560;
}

.diagnostic-log-filter-group button:last-child {
  border-right: 0;
}

.diagnostic-log-filter-group button:hover,
.diagnostic-log-filter-group button.is-active {
  color: #f7f2e5;
  background: rgba(201, 146, 42, 0.1);
}

.diagnostic-log-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 0 14px 14px;
}

.diagnostic-log-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.diagnostic-log-pagination.is-top {
  justify-self: end;
  padding-bottom: 2px;
}

.diagnostic-log-pagination.is-bottom {
  justify-self: center;
  padding-top: 2px;
}

.diagnostic-log-pagination button {
  min-width: 34px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(201, 146, 42, 0.34);
  border-radius: 8px;
  color: #d8d0c0;
  background: #151a1a;
  cursor: pointer;
  font-size: 12px;
  font-weight: 520;
}

.diagnostic-log-pagination button:hover:not(:disabled),
.diagnostic-log-pagination button.is-active {
  color: #fff7e8;
  border-color: rgba(201, 146, 42, 0.74);
  background: rgba(201, 146, 42, 0.13);
}

.diagnostic-log-pagination button.is-active {
  cursor: default;
}

.diagnostic-log-pagination button:disabled {
  color: #7f7769;
  border-color: rgba(201, 146, 42, 0.14);
  cursor: not-allowed;
  opacity: 0.72;
}

.diagnostic-log-pagination span {
  min-width: 24px;
  color: #8f8779;
  font-size: 13px;
  text-align: center;
}

.diagnostic-log-empty {
  padding: 18px;
  border: 1px solid rgba(201, 146, 42, 0.12);
  border-radius: 8px;
  color: #bfb39f;
  background: #171d1d;
  font-size: 13px;
  font-weight: 650;
}

.diagnostic-log-entry {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  height: auto !important;
  min-height: 64px;
  min-width: 0;
  padding: 12px 14px 12px 16px;
  overflow: visible;
  border: 1px solid rgba(201, 146, 42, 0.1);
  border-radius: 8px;
  background: #171d1d;
}

.diagnostic-log-entry::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #746b5e;
}

.diagnostic-log-entry.is-ok::before {
  background: var(--green);
}

.diagnostic-log-entry.is-warning::before {
  background: var(--accent-hi);
}

.diagnostic-log-entry.is-danger::before {
  background: var(--red);
}

.diagnostic-log-entry header {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.diagnostic-log-entry header span,
.diagnostic-log-entry header strong,
.diagnostic-log-entry header time,
.diagnostic-log-entry p,
.diagnostic-log-entry code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diagnostic-log-entry header span {
  color: #afa593;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.diagnostic-log-entry header strong {
  color: #e8dfcf;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
}

.diagnostic-log-entry header time {
  color: #8f8779;
  font-size: 11px;
  white-space: nowrap;
}

.diagnostic-log-entry p {
  margin: 0;
  padding-left: 162px;
  color: #9f9688;
  font-size: 12px;
  line-height: 1.4;
  min-height: 17px;
  white-space: nowrap;
}

.diagnostic-log-entry details {
  margin: 0;
  padding-left: 162px;
  min-height: 13px;
}

.diagnostic-log-entry summary {
  width: max-content;
  max-width: 100%;
  color: #c99f4f;
  cursor: pointer;
  font-size: 11px;
  font-weight: 450;
}

.diagnostic-log-entry code {
  display: block;
  margin-top: 7px;
  padding: 9px;
  border: 1px solid rgba(201, 146, 42, 0.1);
  border-radius: 6px;
  color: #d8d2c6;
  background: #0d1111;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.power-panel {
  overflow: hidden;
}

.power-sections {
  display: grid;
  gap: 14px;
  padding: 12px;
  background: #101414;
}

.power-section {
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #181e1e, #141919);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.power-toast {
  position: fixed;
  z-index: 120;
  top: 18px;
  left: 50%;
  width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(57, 184, 111, 0.45);
  border-radius: 8px;
  color: #f4fff8;
  background: rgba(25, 94, 58, 0.96);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
}

.power-toast--warning {
  border-color: rgba(216, 164, 61, 0.5);
  color: #fff7e1;
  background: rgba(102, 72, 20, 0.97);
}

.power-toast--error {
  border-color: rgba(217, 77, 66, 0.52);
  color: #fff4f2;
  background: rgba(108, 42, 37, 0.97);
}

.power-actions {
  flex-wrap: wrap;
}

.power-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 11, 0.72);
  backdrop-filter: blur(10px);
}

.power-confirm-panel {
  display: grid;
  gap: 16px;
  width: min(540px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(255, 146, 134, 0.28);
  border-radius: 8px;
  color: #f2eadc;
  background: linear-gradient(180deg, #202628, #141919);
  box-shadow: var(--shadow-strong);
}

.power-confirm-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.power-confirm-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(217, 77, 66, 0.36);
  border-radius: 8px;
  color: #ffd4ce;
  background: rgba(217, 77, 66, 0.12);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.power-confirm-header h3 {
  margin: 0;
  color: #fff7e8;
  font-size: 22px;
  line-height: 1.2;
}

.power-confirm-header p {
  margin: 6px 0 0;
  color: #d7cebd;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.power-confirm-car {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(201, 146, 42, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #1d2324, #121718);
}

.power-confirm-car strong {
  overflow-wrap: anywhere;
  color: #fff7e8;
  font-size: 16px;
  line-height: 1.3;
}

.power-confirm-car span {
  color: #bfb39f;
  font-size: 12px;
  line-height: 1.35;
}

.power-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.power-confirm-actions button {
  min-width: 132px;
}

.power-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: rgba(201, 146, 42, 0.08);
}

.power-summary-grid article {
  min-width: 0;
  padding: 14px 16px;
  background: #1b2020;
}

.power-summary-grid article.power-summary-cache {
  background: linear-gradient(180deg, #1d2424, #171d1d);
}

.power-summary-grid span {
  display: block;
  color: #bfb39f;
  font-size: 12px;
}

.power-summary-grid strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  color: #f7f2e5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.power-summary-grid small {
  display: block;
  margin-top: 2px;
  color: #8f8779;
  font-size: 11px;
}

.power-summary-cache strong {
  margin-top: 6px;
}

.power-summary-cache strong span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.power-summary-cache small {
  padding-left: 16px;
}

.power-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9bfaa;
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.08);
}

.power-status-dot.is-ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 184, 111, 0.11), 0 0 14px rgba(57, 184, 111, 0.45);
}

.power-status-dot.is-warning {
  background: var(--accent-hi);
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.14);
}

.power-entry-list {
  display: grid;
  gap: 1px;
  background: rgba(201, 146, 42, 0.08);
}

.power-add-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  background: #171c1c;
}

.power-add-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #c9bfac;
  font-size: 12px;
  font-weight: 600;
}

.power-add-form input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
}

.power-add-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 146, 42, 0.12);
}

.power-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 54px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
  background: #141a1a;
}

.power-list-range {
  color: #928977;
  font-size: 12px;
  font-weight: 650;
}

.power-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.power-pagination button,
.power-pagination span {
  display: inline-flex;
  min-width: 34px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 8px;
  color: #d9cfbd;
  font-size: 12px;
  font-weight: 750;
}

.power-pagination button {
  border: 1px solid rgba(201, 146, 42, 0.22);
  background: linear-gradient(180deg, #1d2425, #121717);
}

.power-pagination button.is-active {
  border-color: rgba(201, 146, 42, 0.74);
  color: #fff7e8;
  background: linear-gradient(180deg, #35302a, #171b1b);
}

.power-pagination span {
  min-width: 22px;
  padding: 0 2px;
  color: #756d61;
}

.power-entry-row {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.08);
  background: #171c1c;
}

.power-entry-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.power-entry-main {
  display: grid;
  min-width: 0;
}

.power-entry-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 290px) minmax(210px, 250px);
  gap: 14px;
  align-items: stretch;
}

.power-entry-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.power-entry-title strong {
  overflow: hidden;
  color: #fff7e8;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.power-entry-title span {
  color: #bfb39f;
  font-size: 12px;
}

.power-entry-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.power-entry-status span {
  max-width: 220px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid rgba(201, 146, 42, 0.22);
  border-radius: 6px;
  color: #f0e3c8;
  background: #202622;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.power-entry-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.12);
  border-radius: 8px;
  background: rgba(201, 146, 42, 0.1);
}

.power-entry-details div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 8px 11px;
  background: #1b2120;
}

.power-entry-details div.is-wide {
  grid-column: 1 / -1;
}

.power-entry-details dt {
  margin: 0 0 4px;
  color: #928977;
  font-size: 11px;
  font-weight: 600;
}

.power-entry-details dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #f1e8d7;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.power-entry-tools {
  display: grid;
  grid-template-columns: 1fr;
  align-content: stretch;
  gap: 8px;
  height: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #1d2324, #131818);
}

.power-entry-tools .secondary-button {
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  overflow: hidden;
  border-color: rgba(201, 146, 42, 0.24);
  color: #eee2cd;
  background: linear-gradient(180deg, #20272a, #151a1b);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.power-entry-tools .secondary-button:last-child {
  grid-column: 1 / -1;
}

.power-entry-form {
  display: grid;
  align-content: stretch;
  gap: 8px;
  height: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #1d2324, #131818);
}

.power-entry-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #c9bfac;
  font-size: 12px;
  font-weight: 600;
}

.power-entry-form label.has-manual-power {
  color: #efb4ad;
}

.power-entry-form input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
}

.power-entry-form input.is-manual-power {
  border-color: rgba(217, 77, 66, 0.5);
  color: #ff665b;
  background: linear-gradient(180deg, #1f1919, #111616);
  font-weight: 850;
}

.power-entry-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 146, 42, 0.12);
}

.power-entry-form input.is-manual-power:focus {
  border-color: rgba(217, 77, 66, 0.78);
  box-shadow: 0 0 0 4px rgba(217, 77, 66, 0.14);
}

.power-entry-tools button,
.power-entry-tools .secondary-button {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
}

.power-entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.power-entry-actions button {
  width: 100%;
  min-width: 0;
}

.power-entry-actions .primary-button {
  color: #fff7e8;
  background: linear-gradient(180deg, #30383d, #181e1f);
  border-color: rgba(201, 146, 42, 0.62);
}

.power-entry-actions .danger-button {
  color: #f3c7c0;
  background: linear-gradient(180deg, #2a1f1e, #1a1717);
  border-color: rgba(217, 77, 66, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.power-entry-actions .danger-button:hover {
  color: #fff6f4;
  background: linear-gradient(180deg, #6f302b, #3c1d1b);
  border-color: rgba(217, 77, 66, 0.72);
}

.power-empty {
  padding: 16px;
  color: #bfb39f;
  background: #171c1c;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgba(201, 146, 42, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #171d1e, #111616);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #c9bfaa;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.segmented-control button.is-selected {
  color: #171d21;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 14px rgba(201, 146, 42, 0.18);
}

.table-wrap {
  overflow-x: auto;
  background: #171c1c;
}

table {
  width: 100%;
  min-width: 1110px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.08);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #d6cbb8;
  background: #151a1b;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

tbody tr {
  background: #202622;
  transition: background 160ms ease, box-shadow 160ms ease;
}

tbody tr:nth-child(even) {
  background: #1b211f;
}

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(201, 146, 42, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

.client-name {
  display: grid;
  gap: 3px;
}

.client-name strong,
.key-chip,
.telegram-chip,
.user-chip {
  white-space: nowrap;
}

.client-name span,
.muted-cell {
  color: var(--muted);
  font-size: 13px;
}

.key-chip,
.telegram-chip,
.user-chip {
  display: inline-flex;
  max-width: 190px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid #d8cda8;
  border-radius: 6px;
  font-size: 12px;
  text-overflow: ellipsis;
  font-weight: 500;
}

.key-chip {
  color: #f3ddb0;
  background: #171b1a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.telegram-chip,
.user-chip {
  color: #f4ead1;
  background: #2d332f;
  border-color: rgba(201, 146, 42, 0.58);
  font-weight: 600;
}

.usage-cell {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 170px;
}

.usage-cell strong {
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.usage-cell strong.is-warning {
  color: var(--accent-hi);
}

.usage-cell strong.is-danger {
  color: #ff9b8f;
}

.usage-cell span {
  color: #aeb7b4;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
}

.usage-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 999px;
  background: #111616;
}

.usage-fill {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 52%),
    linear-gradient(90deg, var(--green-dark), var(--green));
}

.usage-fill.is-warning {
  background: var(--amber);
}

.usage-fill.is-danger {
  background: var(--red);
}

.users-cell {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 170px;
}

.users-cell strong {
  color: var(--green);
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.users-cell small {
  color: #c9bfac;
  font-size: 12px;
  font-weight: 700;
}

.users-cell span {
  color: #aeb7b4;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.users-cell.is-full span {
  color: #ff9b8f;
}

.users-cell.is-full strong {
  color: #ff9b8f;
}

.users-cell-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 999px;
  background: #111616;
}

.users-cell-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 52%),
    linear-gradient(90deg, var(--green-dark), var(--green));
}

.users-cell.is-full .users-cell-track i {
  background: var(--red);
}

.client-payment-cell {
  display: grid;
  gap: 3px;
  min-width: 92px;
}

.client-payment-cell strong {
  color: #fff7e8;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.05;
  white-space: nowrap;
}

.client-payment-cell span {
  color: #aeb7b4;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.client-payment-cell.is-empty strong,
.client-payment-cell.is-empty span {
  color: #8f887b;
}

.access-date-cell {
  display: grid;
  gap: 3px;
}

.access-date-cell strong {
  color: #fff7e8;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.access-date-cell span {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.access-date-cell span.is-ok {
  color: var(--green);
}

.access-date-cell span.is-warning {
  color: var(--accent-hi);
}

.access-date-cell span.is-danger {
  color: #ff9b8f;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  padding: 0;
  color: #f7f2e5;
  font-size: 13px;
  font-weight: 650;
  background: transparent;
  border: 0;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9bfaa;
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.08);
}

.status-badge.active {
  color: #fff7e8;
  background: transparent;
}

.status-badge.active::before {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 184, 111, 0.11), 0 0 14px rgba(57, 184, 111, 0.5);
  animation: statusLampPulse 1.75s ease-in-out infinite;
}

.status-badge.limit,
.status-badge.paused,
.status-badge.stopped {
  color: #ffd4ce;
  background: transparent;
}

.status-badge.limit::before,
.status-badge.paused::before,
.status-badge.stopped::before {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 59, 47, 0.12);
}

.clients-actions-head,
.client-row-actions {
  width: 58px;
  padding-left: 8px;
  padding-right: 12px;
  text-align: right;
}

.client-delete-button {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid rgba(201, 146, 42, 0.18);
  border-radius: 8px;
  color: #d8cfbd;
  background: linear-gradient(180deg, #1d2324, #121718);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.client-delete-button:hover {
  color: #ffd4ce;
  border-color: rgba(255, 146, 134, 0.4);
  background: rgba(192, 59, 47, 0.14);
}

.client-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.client-panel {
  align-self: start;
}

.client-settings-panel {
  grid-column: 1 / -1;
}

.extension-token-panel {
  grid-column: 1 / -1;
  min-height: 84px;
  border-color: rgba(201, 146, 42, 0.22);
  background: linear-gradient(180deg, rgba(47, 56, 58, 0.94), rgba(22, 28, 27, 0.98));
}

.extension-token-panel__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 18px;
}

.extension-token-panel__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.extension-token-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.extension-token-panel__title h2 {
  margin: 0;
  color: #fff9ed;
  font-size: 22px;
  line-height: 1.05;
}

.extension-token-panel__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.extension-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(201, 146, 42, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.extension-status-pill.is-connected {
  color: #96f0bb;
  border-color: rgba(60, 197, 115, 0.34);
  background: rgba(44, 151, 91, 0.13);
}

.extension-status-pill.is-disconnected {
  color: #d8d0bd;
  border-color: rgba(201, 146, 42, 0.24);
  background: rgba(201, 146, 42, 0.08);
}

.extension-token-panel__actions {
  flex: 0 0 auto;
  max-width: min(360px, 42%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.extension-token-panel__actions .primary-button {
  min-width: 214px;
  min-height: 44px;
}

.client-detail-list {
  padding: 8px 18px 18px;
}

.workspace-client-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(760px, 100%);
  flex: 0 1 760px;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #30383d, #252a28);
  box-shadow: var(--shadow);
}

.workspace-client-card__head {
  min-width: 210px;
}

.workspace-client-card__head h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.workspace-client-card__head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.workspace-client-card__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.access-pill {
  display: grid;
  gap: 2px;
  min-width: 190px;
  padding: 10px 14px;
  border: 1px solid #decf9b;
  border-radius: 8px;
  background: #191d1b;
}

.access-pill span,
.access-pill small {
  color: var(--muted);
  font-size: 12px;
}

.access-pill strong {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.client-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #f7f2e5;
  background: transparent;
  font-weight: 650;
}

.client-status-pill span {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.client-status-pill.active {
  color: #fff7e8;
  background: transparent;
}

.client-status-pill.active span {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 184, 111, 0.11), 0 0 16px rgba(57, 184, 111, 0.5);
  animation: statusLampPulse 1.75s ease-in-out infinite;
}

.client-status-pill.limit,
.client-status-pill.paused,
.client-status-pill.stopped {
  color: #ffd4ce;
  background: transparent;
}

.client-status-pill.limit span,
.client-status-pill.paused span,
.client-status-pill.stopped span {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(192, 59, 47, 0.12);
}

@keyframes statusLampPulse {
  0%,
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 4px rgba(57, 184, 111, 0.1), 0 0 12px rgba(57, 184, 111, 0.42);
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(57, 184, 111, 0.18), 0 0 22px rgba(57, 184, 111, 0.72);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 11, 0.66);
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  width: min(920px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(201, 146, 42, 0.2);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow-strong);
  scrollbar-color: rgba(201, 146, 42, 0.58) rgba(20, 25, 26, 0.88);
  scrollbar-width: thin;
}

.modal-panel::-webkit-scrollbar {
  width: 10px;
}

.modal-panel::-webkit-scrollbar-track {
  background: rgba(20, 25, 26, 0.88);
}

.modal-panel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(20, 25, 26, 0.88);
  border-radius: 999px;
  background: rgba(201, 146, 42, 0.58);
}

.details-modal-panel {
  width: min(1120px, 100%);
  height: min(780px, calc(100vh - 48px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: #f2eadc;
  background: linear-gradient(180deg, #202628, #141919);
  border-color: rgba(201, 146, 42, 0.28);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.delete-client-panel {
  width: min(560px, 100%);
  color: #f2eadc;
  background: linear-gradient(180deg, #202628, #141919);
  border-color: rgba(255, 146, 134, 0.28);
}

.delete-client-panel .modal-header {
  align-items: center;
  border-bottom: 1px solid rgba(255, 146, 134, 0.14);
  background: linear-gradient(180deg, #252d30, #1c2222);
}

.delete-client-panel .modal-header h2 {
  color: #fff7e8;
}

.delete-client-panel .modal-header p {
  color: #d7cebd;
  font-weight: 650;
}

.delete-client-panel .close-button {
  color: #e8d9b8;
  background: #1a1f20;
  border-color: rgba(201, 146, 42, 0.34);
}

.delete-client-panel .close-button:hover {
  color: var(--graphite);
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.delete-client-content {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 146, 134, 0.12);
}

.delete-client-content strong {
  color: #ffd4ce;
  font-size: 20px;
}

.delete-client-content p {
  margin: 0;
  color: #d7cebd;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.delete-client-panel .modal-actions {
  border-top: 1px solid rgba(255, 146, 134, 0.14);
  background: linear-gradient(180deg, #202522, #171c1c);
}

.delete-client-panel .secondary-button {
  color: #fff7e8;
  background: linear-gradient(180deg, #1d2324, #121718);
  border-color: rgba(201, 146, 42, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.delete-client-panel .secondary-button:hover {
  color: #171d21;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 52%),
    linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent-hi);
}

.delete-client-panel .danger-button {
  color: #ffd4ce;
  background: rgba(192, 59, 47, 0.16);
  border-color: rgba(255, 146, 134, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.delete-client-panel .danger-button:hover {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 12px 26px rgba(192, 59, 47, 0.22);
}

.details-modal-panel .modal-header {
  align-items: center;
  border-bottom: 1px solid rgba(201, 146, 42, 0.14);
  background:
    linear-gradient(180deg, #252d30, #1c2222);
}

.details-modal-panel .modal-header h2 {
  color: #fff7e8;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 800;
}

.details-modal-panel .modal-header p {
  color: #d7cebd;
  font-weight: 650;
}

.details-modal-panel .close-button {
  color: #e8d9b8;
  background: #1a1f20;
  border-color: rgba(201, 146, 42, 0.34);
}

.details-modal-panel .close-button:hover {
  color: var(--graphite);
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.auth-panel {
  width: min(620px, 100%);
  color: #f2eadc;
  background: linear-gradient(180deg, #202628, #141919);
  border-color: rgba(201, 146, 42, 0.28);
  font-family: var(--ui-font);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.auth-panel .modal-header {
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.14);
  background: linear-gradient(180deg, #252d30, #1c2222);
}

.auth-panel .modal-header h2 {
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.auth-panel .modal-header p {
  max-width: 430px;
  color: #b9b09e;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.35;
}

.auth-panel .close-button {
  width: 40px;
  height: 40px;
  color: #e8d9b8;
  background: #1a1f20;
  border-color: rgba(201, 146, 42, 0.34);
}

.auth-panel .close-button:hover {
  color: var(--graphite);
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.create-client-panel {
  color: #f2eadc;
  background: linear-gradient(180deg, #202628, #141919);
  border-color: rgba(201, 146, 42, 0.28);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.create-client-panel .modal-header {
  align-items: center;
  border-bottom: 1px solid rgba(201, 146, 42, 0.14);
  background: linear-gradient(180deg, #252d30, #1c2222);
}

.create-client-panel .modal-header h2 {
  color: #fff7e8;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 800;
}

.create-client-panel .modal-header p {
  color: #d7cebd;
  font-weight: 650;
}

.create-client-panel .close-button {
  color: #e8d9b8;
  background: #1a1f20;
  border-color: rgba(201, 146, 42, 0.34);
}

.create-client-panel .close-button:hover {
  color: var(--graphite);
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid rgba(22, 27, 31, 0.1);
  background: linear-gradient(180deg, #ffffff, #fbf4df);
}

.modal-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.close-button {
  color: var(--muted);
  background: #ffffff;
  border-color: #d8cda8;
  font-size: 18px;
  line-height: 1;
}

.close-button:hover {
  color: var(--graphite);
  background: var(--accent-hi);
}

.create-grid,
.settings-grid {
  display: grid;
  gap: 14px;
}

.create-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.modal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 20px;
}

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

.form-hint {
  min-height: 34px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #d8cda8;
  border-radius: 8px;
  color: #5c543f;
  background: #f4edd8;
  font-size: 13px;
  font-weight: 700;
}

.create-client-panel .form-hint {
  color: #f0e2c0;
  background: rgba(201, 146, 42, 0.1);
  border-color: rgba(201, 146, 42, 0.28);
}

.create-grid label,
.settings-block label {
  display: grid;
  gap: var(--field-label-gap);
  color: #c9bfac;
  font-size: 13px;
  font-weight: 500;
}

.create-grid input,
.settings-block input,
.settings-block select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.settings-block select option,
.create-grid select option {
  color: #fff7e8;
  background: #121718;
}

.settings-block select option:checked,
.create-grid select option:checked {
  color: #fff7e8;
  background: #2c2416;
}

.create-grid input:hover,
.settings-block input:hover,
.settings-block select:hover,
.subaccount-add-row input:hover {
  border-color: rgba(216, 164, 61, 0.72);
}

.create-grid input:focus,
.settings-block input:focus,
.settings-block select:focus,
.subaccount-add-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 146, 42, 0.12);
}

.settings-block input[readonly] {
  color: #ded3bf;
  background: linear-gradient(180deg, #1c2222, #161b1b);
  border-color: rgba(201, 146, 42, 0.22);
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select__trigger {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  font-weight: 600;
}

.custom-select__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__chevron {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: rgba(247, 246, 242, 0.74);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 50% 50%;
  transition: color 0.16s ease, transform 0.16s ease;
}

.custom-select__trigger:hover,
.custom-select.is-open .custom-select__trigger {
  border-color: rgba(216, 164, 61, 0.72);
}

.custom-select.is-open .custom-select__trigger {
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.14);
}

.custom-select__trigger:hover .custom-select__chevron,
.custom-select.is-open .custom-select__chevron {
  color: #ffffff;
}

.custom-select.is-open .custom-select__chevron {
  transform: rotate(180deg);
}

.custom-select__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 12;
  display: none;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.42);
  border-radius: 8px;
  background: #121718;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.custom-select.is-open .custom-select__menu {
  display: grid;
}

.custom-select__option {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  color: #f7f2e5;
  background: #121718;
  text-align: left;
  font-weight: 500;
}

.custom-select__option:hover,
.custom-select__option.is-selected {
  color: #fff7e8;
  background: #2c2416;
}

.rate-fields-slot,
.rate-fields {
  display: grid;
  gap: 10px;
}

.expense-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.expenses-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 14px;
}

.expense-card h3 {
  margin: 0;
  line-height: 1.25;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  min-width: 0;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(22, 27, 31, 0.1);
  background: #eee6d1;
}

.create-client-panel .modal-actions {
  border-top: 1px solid rgba(201, 146, 42, 0.14);
  background: linear-gradient(180deg, #202522, #171c1c);
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, #171d1d, #121717);
}

.telegram-login-card {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid rgba(201, 146, 42, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, #19201f, #141918);
  color: #f2eadc;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.telegram-login-card:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 146, 42, 0.54);
  background: linear-gradient(180deg, #1d2524, #151b1a);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.telegram-login-card span {
  color: #c99f4a;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.telegram-login-card strong {
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 760;
}

.account-choice-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #171d1d, #121717);
}

.account-choice-heading {
  display: grid;
  gap: 5px;
  padding-bottom: 2px;
}

.account-choice-heading span {
  color: #c99f4a;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-choice-heading strong {
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 780;
}

.account-choice-heading p {
  margin: 0;
  max-width: 500px;
  color: #b9b09e;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.38;
}

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

.account-choice-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 126px;
  padding: 15px 16px 16px;
  border: 1px solid rgba(201, 146, 42, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #19201f, #141918);
  color: #f2eadc;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.account-choice-card::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  opacity: 0.76;
}

.account-choice-card::after {
  content: "Открыть";
  justify-self: start;
  align-self: end;
  margin-top: 4px;
  color: #d8a43d;
  font-size: 12px;
  font-weight: 700;
}

.account-choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 146, 42, 0.58);
  background: linear-gradient(180deg, #1e2625, #151b1a);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
}

.account-choice-card span {
  color: #c99f4a;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-choice-card strong {
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.28;
}

.account-choice-card small {
  color: #b9b09e;
  font-size: 12px;
  font-weight: 520;
  line-height: 1.42;
}

.account-choice-back {
  justify-self: start;
  color: #fff7e8;
  background: linear-gradient(180deg, #1d2324, #121718);
  border-color: rgba(201, 146, 42, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.account-choice-back:hover {
  color: #171d21;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 52%),
    linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent-hi);
}

.details-modal-content {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
  scrollbar-color: rgba(201, 146, 42, 0.58) rgba(20, 25, 26, 0.88);
  scrollbar-width: thin;
}

.details-modal-content::-webkit-scrollbar {
  width: 10px;
}

.details-modal-content::-webkit-scrollbar-track {
  background: rgba(20, 25, 26, 0.88);
}

.details-modal-content::-webkit-scrollbar-thumb {
  border: 2px solid rgba(20, 25, 26, 0.88);
  border-radius: 999px;
  background: rgba(201, 146, 42, 0.58);
}

.client-record-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.client-record-summary {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.18fr)
    repeat(6, minmax(118px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.client-record-title,
.client-record-stat {
  min-width: 0;
  min-height: 90px;
  padding: 12px;
  border: 1px solid rgba(201, 146, 42, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #242b2d, #1b2020);
}

.client-record-title {
  display: grid;
  align-content: center;
}

.client-record-title h3 {
  margin: 0 0 5px;
  color: #fff7e8;
  font-size: 20px;
  line-height: 1.15;
}

.client-record-title p {
  margin: 0;
  color: #d7cebd;
  font-size: 13px;
  font-weight: 650;
}

.client-record-stat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.client-record-stat span,
.client-record-stat small {
  color: #c9bfac;
  font-size: 12px;
  font-weight: 600;
  justify-self: center;
  text-align: center;
}

.client-record-stat strong {
  color: #fff7e8;
  font-size: 15px;
}

.client-record-stat .status-badge {
  justify-self: center;
}

.client-record-stat .telegram-chip {
  max-width: 100%;
  justify-self: center;
}

.client-record-telegram > strong,
.client-record-status > strong {
  align-self: center;
  justify-self: center;
}

.client-record-access > strong,
.client-record-access > small,
.client-record-price > strong,
.client-record-price > small {
  justify-self: center;
  text-align: center;
}

.client-record-price > strong {
  align-self: end;
  color: #fff7e8;
  font-size: 18px;
  line-height: 1;
}

.client-record-stat small.is-ok {
  color: var(--green);
}

.client-record-stat small.is-warning {
  color: var(--amber);
}

.client-record-stat small.is-danger {
  color: #ff9b8f;
}

.client-record-usage .usage-cell {
  width: 100%;
  max-width: 170px;
  justify-self: center;
}

.client-record-users .users-cell {
  width: 100%;
  max-width: 170px;
  justify-self: center;
}

.client-details-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(201, 146, 42, 0.16);
  border-radius: 8px;
  background: #121718;
}

.client-details-tabs button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #c9bfaa;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.client-details-tabs button.is-active,
.client-details-tabs button:hover {
  color: #171d21;
  border-color: rgba(216, 164, 61, 0.58);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
}

.details-modal-content .detail-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin-bottom: 14px;
}

.detail-list div {
  display: grid;
  gap: 5px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 146, 42, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #242b2d, #1b2020);
}

.detail-list dt {
  color: #c9bfac;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
  text-align: left;
  color: #fff7e8;
  overflow: hidden;
  text-overflow: ellipsis;
}

.details-modal-panel .key-chip {
  max-width: 100%;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 500;
}

.details-modal-panel .settings-grid {
  display: block;
  gap: 14px;
}

.details-modal-panel .settings-block {
  padding: 14px;
  background: linear-gradient(180deg, #252d30, #1b2020);
  border-color: rgba(201, 146, 42, 0.2);
}

.details-modal-panel .settings-block + .settings-block,
.details-modal-panel .settings-block + .calc-settings-column,
.details-modal-panel .calc-settings-column + .settings-block {
  margin-top: 14px;
}

.details-modal-panel .rates-row > .settings-block + .settings-block,
.details-modal-panel .expenses-row > .settings-block + .settings-block {
  margin-top: 0;
}

.client-form-block {
  align-content: start;
}

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

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

.client-fields-grid label,
.subscription-actions-card label {
  display: grid;
  gap: var(--field-label-gap);
  color: #c9bfac;
  font-size: 13px;
  font-weight: 500;
}

.client-fields-grid input,
.client-fields-grid select,
.subscription-actions-card textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
}

.client-fields-grid select option {
  color: #fff7e8;
  background: #121718;
}

.subscription-actions-card textarea {
  min-height: 86px;
  padding: 10px;
  resize: vertical;
}

.client-fields-grid input:focus,
.client-fields-grid select:focus,
.subscription-actions-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 146, 42, 0.12);
}

.subscription-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(340px, 0.68fr);
  gap: 14px;
}

.subscription-state-card,
.subscription-actions-card {
  align-content: start;
}

.subscription-log-card {
  grid-column: 1 / -1;
}

.subscription-simple-layout {
  display: grid;
  gap: 14px;
  align-items: start;
}

.subscription-console {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.subscription-rail {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 14px;
  border-right: 1px solid rgba(201, 146, 42, 0.16);
  background: rgba(17, 22, 22, 0.36);
}

.subscription-rail-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(201, 146, 42, 0.16);
  border-radius: 8px;
  background: rgba(17, 22, 22, 0.58);
}

.subscription-rail-status .client-status-pill {
  min-height: 24px;
}

.subscription-rail-status strong {
  color: #fff7e8;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.subscription-rail-status small {
  color: #d7cebd;
  font-size: 13px;
  font-weight: 600;
}

.subscription-side-tabs {
  display: grid;
  gap: 7px;
}

.subscription-side-tabs button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(201, 146, 42, 0.18);
  border-radius: 8px;
  color: #e7decd;
  background: rgba(17, 22, 22, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
}

.subscription-side-tabs button:hover,
.subscription-side-tabs button.is-active {
  color: #171d21;
  border-color: var(--accent-hi);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 50%),
    linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: 0 10px 24px rgba(201, 146, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.subscription-side-tabs button.is-danger {
  color: #ffc9c1;
  border-color: rgba(255, 146, 134, 0.22);
  background: rgba(192, 59, 47, 0.08);
}

.subscription-side-tabs button.is-danger:hover,
.subscription-side-tabs button.is-danger.is-active {
  color: #fff2ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 50%),
    rgba(192, 59, 47, 0.22);
  border-color: rgba(255, 146, 134, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.subscription-action-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
}

.subscription-action-panel > p {
  margin: 0;
  color: #d7cebd;
  font-size: 13px;
  font-weight: 650;
}

.subscription-action-panel.is-danger {
  border-color: rgba(255, 146, 134, 0.34);
}

.subscription-action-panel label {
  display: grid;
  gap: var(--field-label-gap);
  color: #c9bfac;
  font-size: 13px;
  font-weight: 500;
}

.subscription-action-panel textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  resize: vertical;
}

.subscription-billing-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.subscription-billing-grid label {
  min-width: 0;
}

.subscription-billing-grid input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
}

.subscription-billing-grid input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 146, 42, 0.12);
}

.subscription-billing-total {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: rgba(17, 22, 22, 0.55);
}

.subscription-billing-total span {
  color: #afa593;
  font-size: 12px;
  font-weight: 520;
}

.subscription-billing-total strong {
  overflow: hidden;
  color: #fff7e8;
  font-size: 18px;
  font-weight: 690;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subscription-extension-controls {
  display: grid;
  gap: 10px;
}

.subscription-term-options {
  display: grid;
  grid-template-columns: minmax(230px, 1.45fr) repeat(4, minmax(104px, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 10px;
  background: rgba(17, 22, 22, 0.34);
}

.subscription-date-segment,
.subscription-term-options button {
  position: relative;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(201, 146, 42, 0.24);
  border-radius: 8px;
  color: #eadfce;
  background: rgba(17, 22, 22, 0.58);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.subscription-date-segment {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 6px;
}

.subscription-date-label {
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  padding: 0 4px;
}

.subscription-date-segment input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 7px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  color-scheme: dark;
}

.subscription-date-segment input:focus {
  border-color: var(--accent-hi);
  box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.12);
}

.subscription-term-options button.is-selected,
.subscription-term-options button:hover,
.subscription-date-segment.is-selected,
.subscription-date-segment:hover,
.subscription-date-segment:focus-within {
  color: #171d21;
  border-color: var(--accent-hi);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 50%),
    linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: 0 8px 18px rgba(201, 146, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.subscription-manual-date {
  display: grid;
  gap: var(--field-label-gap);
  color: #c9bfac;
  font-size: 13px;
  font-weight: 500;
}

.subscription-manual-date input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
  color-scheme: dark;
}

.subscription-apply-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.subscription-status-line {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: rgba(17, 22, 22, 0.55);
}

.subscription-status-line strong {
  color: #fff7e8;
  font-size: 18px;
}

.subscription-status-line em {
  color: #d7cebd;
  font-size: 13px;
  font-style: normal;
  font-weight: 650;
}

.extension-plan-grid,
.subscription-command-grid,
.inline-actions-row {
  display: grid;
  gap: 8px;
}

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

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

.extension-plan-button {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 146, 42, 0.22);
  border-radius: 8px;
  color: #fff7e8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 48%),
    linear-gradient(180deg, #22292b, #151a1b);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.extension-plan-button:hover {
  border-color: rgba(216, 164, 61, 0.72);
  background:
    linear-gradient(180deg, rgba(216, 164, 61, 0.16), transparent 54%),
    linear-gradient(180deg, #2b312e, #171c1c);
}

.extension-plan-button strong {
  font-size: 16px;
  line-height: 1.1;
}

.extension-plan-button span {
  color: #c9bfac;
  font-size: 12px;
  font-weight: 650;
}

.subscription-control-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: rgba(17, 22, 22, 0.5);
}

.subscription-control-panel > span {
  color: #c9bfac;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.subscription-action-button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.24);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #1d2324, #121718);
  font-weight: 900;
}

.subscription-action-button:hover {
  border-color: rgba(216, 164, 61, 0.72);
}

.subscription-action-button.is-danger {
  color: #ffd4ce;
  background: rgba(192, 59, 47, 0.16);
  border-color: rgba(255, 146, 134, 0.38);
}

.subscription-action-button.is-danger:hover {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

.subscription-command-grid button,
.inline-actions-row button {
  min-height: 36px;
}

.subscription-command-grid button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.subscription-log-title {
  align-items: center;
}

.subscription-log-list {
  display: grid;
  gap: 8px;
}

.subscription-log-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(201, 146, 42, 0.12);
  border-radius: 8px;
  background: rgba(17, 22, 22, 0.55);
}

.subscription-log-row time {
  color: #e8d9b8;
  font-size: 13px;
  font-weight: 800;
}

.subscription-log-row strong {
  color: #fff7e8;
  font-size: 14px;
}

.subscription-log-row p {
  margin: 3px 0 0;
  color: #d7cebd;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.subscription-log-row small {
  display: block;
  margin-top: 4px;
  color: #9f9484;
  font-size: 12px;
  font-weight: 700;
}

.subscription-log-row em {
  color: #fff7e8;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.subscription-log-empty {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(201, 146, 42, 0.12);
  border-radius: 8px;
  color: #c9bfac;
  background: rgba(17, 22, 22, 0.55);
  font-size: 13px;
  font-weight: 650;
}

[data-client-save].is-dirty,
.settings-save-button.is-dirty {
  color: #171d21;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent-hi);
}

.details-modal-panel .modal-actions {
  border-top: 1px solid rgba(201, 146, 42, 0.14);
  background: linear-gradient(180deg, #202522, #171c1c);
}

.settings-grid {
  grid-template-columns: minmax(300px, 0.72fr) minmax(640px, 1.6fr);
  align-items: start;
}

.client-settings-grid {
  padding: 18px;
}

.calc-settings-column {
  display: grid;
  gap: 14px;
}

.rates-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 14px;
}

.rates-row > .settings-block,
.expenses-row > .settings-block {
  min-width: 0;
  height: 100%;
  align-content: start;
}

.settings-block {
  display: grid;
  gap: var(--card-row-gap);
  padding: 16px;
  border: 1px solid rgba(201, 146, 42, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #30383d, #252a28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.settings-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.settings-title h3 {
  margin: 0;
  line-height: 1.25;
}

.info-tooltip {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  place-items: center;
  border: 1px solid #d1b659;
  border-radius: 50%;
  color: #f7f2e5;
  background: #30383d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  outline: none;
}

.info-tooltip__bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: min(360px, 72vw);
  padding: 12px;
  border: 1px solid rgba(201, 146, 42, 0.34);
  border-radius: 8px;
  color: #f7f2e5;
  background: linear-gradient(180deg, #1d2324, #121718);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.info-tooltip:hover .info-tooltip__bubble,
.info-tooltip:focus .info-tooltip__bubble,
.info-tooltip:focus-visible .info-tooltip__bubble,
.info-tooltip:focus-within .info-tooltip__bubble {
  opacity: 1;
  transform: translate(-50%, 0);
}

.users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.subaccounts-block {
  align-content: start;
  gap: 5px;
}

.subaccounts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
}

.subaccounts-head h3 {
  margin: 0;
}

.subaccounts-head p {
  align-self: end;
  margin: 0;
  color: #c9bfac;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.subaccounts-head > div {
  display: grid;
  min-height: 50px;
}

.subaccount-row small {
  margin: 0;
  color: #ded6c8;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}

.subaccounts-head > span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  color: #e8d9b8;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.subaccount-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.subaccount-add-row input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(201, 146, 42, 0.3);
  border-radius: 8px;
  color: #fff7e8;
  background: linear-gradient(180deg, #171d1e, #111616);
}

.subaccounts-list {
  display: grid;
  gap: 8px;
  margin-top: 7px;
}

.subaccount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(201, 146, 42, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, #202729, #171d1d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.12);
}

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

.subaccount-usage div {
  display: grid;
  gap: 2px;
  text-align: right;
}

.subaccount-row strong {
  font-size: 16px;
  color: #fff7e8;
  font-weight: 800;
}

.subaccount-remove {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b7ad9c;
  background: rgba(255, 255, 255, 0.02);
  font-size: 20px;
  line-height: 1;
}

.subaccount-remove:hover {
  color: var(--red);
  background: var(--red-bg);
  border-color: #ffc7c2;
}

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

/* Unified admin panel surfaces */
#adminDashboard {
  display: grid;
  align-content: start;
  gap: 16px;
}

#adminDashboard .panel,
#adminDashboard .metric-card {
  border-color: rgba(201, 146, 42, 0.14);
  background: linear-gradient(180deg, #171d1d, #121717);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

#adminDashboard .panel {
  overflow: hidden;
}

#adminDashboard .panel-header,
#adminDashboard .diagnostic-logs-header {
  gap: 18px;
  min-height: 74px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.12);
  background: linear-gradient(180deg, #202727, #171d1d);
}

#adminDashboard .panel-header h2,
#adminDashboard .diagnostic-logs-header h2 {
  margin: 0;
  color: #fff7e8;
  font-family: var(--ui-font);
  font-size: 20px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.18;
}

#adminDashboard .panel-header p,
#adminDashboard .diagnostic-logs-header p:last-child {
  margin-top: 6px;
  color: #b8ad9b;
  font-size: 13px;
  font-weight: 440;
  line-height: 1.35;
}

#adminDashboard .panel-actions {
  gap: 8px;
}

#adminDashboard .primary-button,
#adminDashboard .secondary-button,
#adminDashboard .danger-button,
#adminDashboard .settings-save-button,
#adminDashboard .client-delete-button,
#adminDashboard .power-entry-tools .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 590;
  letter-spacing: 0;
}

#adminDashboard .danger-button {
  color: #f1b6af;
  border-color: rgba(217, 77, 66, 0.36);
  background: linear-gradient(180deg, #2a1f1e, #171615);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#adminDashboard .danger-button:hover {
  color: #fff7f5;
  border-color: rgba(217, 77, 66, 0.72);
  background: linear-gradient(180deg, #66312d, #351c1a);
}

#adminDashboard .metrics-grid,
#adminDashboard .system-status-overview,
#adminDashboard .power-summary-grid,
#adminDashboard .expense-summary-grid,
#adminDashboard .backup-summary-grid,
#adminDashboard .diagnostic-log-summary {
  gap: 10px;
}

#adminDashboard .metrics-grid {
  margin-bottom: 0;
}

#adminDashboard .system-status-overview,
#adminDashboard .power-summary-grid,
#adminDashboard .expense-summary-grid,
#adminDashboard .backup-summary-grid,
#adminDashboard .diagnostic-log-summary {
  padding: 14px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.08);
  background: #101414;
}

#adminDashboard .diagnostic-log-summary {
  padding-bottom: 0;
  border-bottom: 0;
}

#adminDashboard .metric-card,
#adminDashboard .system-status-card,
#adminDashboard .power-summary-grid article,
#adminDashboard .expense-summary-grid article,
#adminDashboard .backup-summary-grid article,
#adminDashboard .diagnostic-log-summary-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(201, 146, 42, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, #181f1e, #141918);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#adminDashboard .metric-card,
#adminDashboard .power-summary-grid article,
#adminDashboard .expense-summary-grid article,
#adminDashboard .backup-summary-grid article,
#adminDashboard .diagnostic-log-summary-item {
  padding: 13px 14px;
}

#adminDashboard .metric-card {
  min-height: 116px;
}

#adminDashboard .metric-card::before,
#adminDashboard .system-status-card::before,
#adminDashboard .diagnostic-log-summary-item::before {
  height: 2px;
  opacity: 0.9;
}

#adminDashboard .metric-card:hover,
#adminDashboard .system-status-card:hover,
#adminDashboard .power-summary-grid article:hover,
#adminDashboard .expense-summary-grid article:hover,
#adminDashboard .backup-summary-grid article:hover {
  border-color: rgba(201, 146, 42, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#adminDashboard .metric-card span,
#adminDashboard .power-summary-grid span,
#adminDashboard .expense-summary-grid span,
#adminDashboard .backup-summary-grid span,
#adminDashboard .diagnostic-log-summary-item span,
#adminDashboard .system-status-card__label {
  color: #afa593;
  font-size: 12px;
  font-weight: 520;
  text-transform: none;
}

#adminDashboard .metric-card strong,
#adminDashboard .metric-card__line strong,
#adminDashboard .system-status-card strong,
#adminDashboard .power-summary-grid strong,
#adminDashboard .expense-summary-grid strong,
#adminDashboard .backup-summary-grid strong,
#adminDashboard .diagnostic-log-summary-item strong {
  color: #f7f2e5;
  font-family: var(--ui-font);
  font-weight: 710;
  letter-spacing: 0;
}

#adminDashboard .metric-card.is-negative strong {
  color: #ffd7d1;
}

#adminDashboard .metric-card strong,
#adminDashboard .system-status-card strong,
#adminDashboard .diagnostic-log-summary-item strong {
  font-size: 24px;
}

#adminDashboard .metric-card__split strong {
  font-size: 22px;
}

#adminDashboard .metric-card__line small {
  font-family: var(--ui-font);
  font-weight: 520;
}

#adminDashboard .metric-card__trend {
  margin-top: 10px;
}

#adminDashboard .metric-card__trend b {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 760;
}

#adminDashboard .metric-card__trend p {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 420;
}

#adminDashboard .metric-card__value small {
  color: #afa593;
  font-family: var(--ui-font);
  font-weight: 520;
}

#adminDashboard .metric-card__line em,
#adminDashboard .metric-card__meta,
#adminDashboard .system-status-card small,
#adminDashboard .system-status-card em,
#adminDashboard .power-summary-grid small,
#adminDashboard .backup-row span {
  color: #8f8779;
  font-weight: 440;
}

#adminDashboard .system-status-body,
#adminDashboard .power-sections {
  gap: 12px;
  padding: 14px;
  background: #101414;
}

#adminDashboard .system-status-sections {
  gap: 12px;
}

#adminDashboard .system-status-section,
#adminDashboard .power-section {
  border-color: rgba(201, 146, 42, 0.12);
  background: linear-gradient(180deg, #151b1b, #121717);
  box-shadow: none;
}

#adminDashboard .system-status-section h3 {
  padding: 12px 14px;
  color: #e8dfcf;
  background: #151a1a;
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 650;
}

#adminDashboard .system-status-rows,
#adminDashboard .power-entry-list,
#adminDashboard .expense-list,
#adminDashboard .backup-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #101414;
}

#adminDashboard .system-status-row,
#adminDashboard .power-entry-row,
#adminDashboard .backup-row,
#adminDashboard .diagnostic-log-entry,
#adminDashboard .power-add-form,
#adminDashboard .power-list-toolbar,
#adminDashboard .power-entry-form,
#adminDashboard .power-entry-tools,
#adminDashboard .power-entry-details,
#adminDashboard .settings-block {
  border: 1px solid rgba(201, 146, 42, 0.1);
  border-radius: 8px;
  background: #171d1d;
  box-shadow: none;
}

#adminDashboard .system-status-row,
#adminDashboard .backup-row,
#adminDashboard .power-entry-row {
  min-height: 54px;
}

#adminDashboard .system-status-row strong,
#adminDashboard .backup-row strong,
#adminDashboard .power-entry-title strong,
#adminDashboard .power-entry-details dd {
  color: #f1e8d7;
  font-weight: 620;
}

#adminDashboard .power-entry-title strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

#adminDashboard .system-status-row span,
#adminDashboard .power-entry-title span,
#adminDashboard .power-entry-details dt,
#adminDashboard .power-list-range {
  color: #9f9688;
  font-weight: 440;
}

#adminDashboard .power-entry-title span {
  font-size: 11.5px;
  line-height: 1.3;
}

#adminDashboard .power-add-form {
  padding: 14px;
}

#adminDashboard .power-list-toolbar {
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: #151a1a;
}

#adminDashboard .power-entry-details {
  gap: 0;
  overflow: hidden;
  background: rgba(201, 146, 42, 0.08);
}

#adminDashboard .power-entry-details div {
  background: #171d1d;
}

#adminDashboard .table-wrap {
  border-top: 1px solid rgba(201, 146, 42, 0.08);
  background: #101414;
}

#adminDashboard th {
  color: #afa593;
  background: #151a1a;
  font-size: 12px;
  font-weight: 520;
  text-transform: none;
}

#adminDashboard td {
  border-bottom-color: rgba(201, 146, 42, 0.07);
}

#adminDashboard tbody tr {
  background: #171d1d;
}

#adminDashboard tbody tr:nth-child(even) {
  background: #151b1a;
}

#adminDashboard tbody tr:hover,
#adminDashboard tbody tr.is-selected {
  background: rgba(201, 146, 42, 0.09);
  box-shadow: inset 3px 0 0 rgba(216, 164, 61, 0.86);
}

#adminDashboard .segmented-control,
#adminDashboard .diagnostic-log-filter-group {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(201, 146, 42, 0.16);
  border-radius: 8px;
  background: #101414;
  box-shadow: none;
}

#adminDashboard .diagnostic-log-filter-group {
  overflow-x: auto;
}

#adminDashboard .segmented-control button,
#adminDashboard .diagnostic-log-filter-group button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #bfb39f;
  background: transparent;
  font-size: 12px;
  font-weight: 560;
}

#adminDashboard .segmented-control button:hover,
#adminDashboard .diagnostic-log-filter-group button:hover {
  color: #f7f2e5;
  background: rgba(201, 146, 42, 0.08);
}

#adminDashboard .segmented-control button.is-selected,
#adminDashboard .diagnostic-log-filter-group button.is-active {
  color: #fff7e8;
  background: rgba(201, 146, 42, 0.13);
  box-shadow: inset 0 -2px 0 rgba(216, 164, 61, 0.78);
}

#adminDashboard .power-pagination button,
#adminDashboard .diagnostic-log-pagination button {
  height: 32px;
  border-color: rgba(201, 146, 42, 0.24);
  border-radius: 8px;
  color: #d8d0c0;
  background: #151a1a;
  font-weight: 520;
}

#adminDashboard .power-pagination button:hover:not(:disabled),
#adminDashboard .power-pagination button.is-active,
#adminDashboard .diagnostic-log-pagination button:hover:not(:disabled),
#adminDashboard .diagnostic-log-pagination button.is-active {
  color: #fff7e8;
  border-color: rgba(201, 146, 42, 0.68);
  background: rgba(201, 146, 42, 0.13);
}

#adminDashboard .telegram-chip,
#adminDashboard .user-chip,
#adminDashboard .power-entry-status span {
  border-color: rgba(201, 146, 42, 0.22);
  color: #e4dac8;
  background: #151a1a;
  font-weight: 520;
}

/* Flatter system settings modules */
#adminDashboard .system-settings-shell {
  gap: 18px;
}

#adminDashboard .system-settings-header {
  min-height: 64px;
}

#adminDashboard .system-settings-header h2 {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
}

#adminDashboard .system-settings-header p {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 420;
}

#adminDashboard .system-settings-module {
  border-color: rgba(201, 146, 42, 0.16);
  background: linear-gradient(180deg, #151b1b, #111616);
  box-shadow: none;
}

#adminDashboard .system-settings-module .panel-header {
  min-height: 0;
  padding: 16px 18px;
  border-bottom-color: rgba(201, 146, 42, 0.14);
  background: transparent;
}

#adminDashboard .system-settings-module .panel-header h3 {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.25;
}

#adminDashboard .system-settings-module .panel-header p {
  margin-top: 0;
  font-size: 12.5px;
  font-weight: 420;
}

#adminDashboard .system-settings-module-label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 650;
}

#adminDashboard .expense-summary-grid,
#adminDashboard .backup-summary-grid {
  gap: 0;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
  background: #121717;
}

#adminDashboard .expense-summary-grid article,
#adminDashboard .backup-summary-grid article {
  min-height: 48px;
  padding: 4px 16px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#adminDashboard .expense-summary-grid article + article,
#adminDashboard .backup-summary-grid article + article {
  padding-left: 16px;
  border-left: 1px solid rgba(201, 146, 42, 0.1);
}

#adminDashboard .expense-summary-grid article:hover,
#adminDashboard .backup-summary-grid article:hover {
  border-color: rgba(201, 146, 42, 0.1);
  box-shadow: none;
}

#adminDashboard .expense-list,
#adminDashboard .backup-list,
#adminDashboard .super-admin-body {
  gap: 0;
  padding: 0 18px;
  background: #121717;
}

#adminDashboard .expense-list-header {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) 40px;
  padding: 10px 0 7px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
}

#adminDashboard .expense-list-header span {
  color: #afa593;
  font-size: 11px;
  font-weight: 560;
}

#adminDashboard .platform-expense-row,
#adminDashboard .backup-row,
#adminDashboard .super-admin-row {
  border: 0;
  border-bottom: 1px solid rgba(201, 146, 42, 0.09);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#adminDashboard .platform-expense-row {
  padding: 12px 0;
}

#adminDashboard .super-admin-add-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(201, 146, 42, 0.09);
}

#adminDashboard .super-admin-add-row label {
  position: relative;
}

#adminDashboard .super-admin-add-row label span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#adminDashboard .super-admin-add-row input {
  border-color: rgba(201, 146, 42, 0.22);
  background: rgba(16, 21, 20, 0.9);
  font-size: 14px;
  font-weight: 460;
}

#adminDashboard .super-admin-row {
  padding: 13px 0;
}

#adminDashboard .super-admin-row:hover {
  background: rgba(201, 146, 42, 0.035);
}

#adminDashboard .platform-expense-row label {
  position: relative;
}

#adminDashboard .platform-expense-row label span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#adminDashboard .platform-expense-row input {
  border-color: rgba(201, 146, 42, 0.22);
  background: rgba(16, 21, 20, 0.9);
  font-size: 14px;
  font-weight: 460;
}

#adminDashboard .backup-row {
  padding: 13px 0;
}

#adminDashboard .backup-summary-grid strong,
#adminDashboard .backup-row strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

#adminDashboard .backup-row span,
#adminDashboard .backup-list-toolbar > span,
#adminDashboard .expense-panel-footer span,
#adminDashboard .super-admin-row span,
#adminDashboard .super-admin-footer span {
  font-size: 11.5px;
  font-weight: 430;
}

#adminDashboard .super-admin-row strong {
  font-size: 14px;
  font-weight: 620;
}

#adminDashboard .expense-panel-footer strong {
  font-weight: 620;
}

#adminDashboard .platform-expense-row:hover,
#adminDashboard .backup-row:hover {
  background: rgba(201, 146, 42, 0.035);
}

#adminDashboard .platform-expense-row.is-invalid {
  border-color: rgba(217, 77, 66, 0.36);
  background: rgba(217, 77, 66, 0.07);
}

#adminDashboard .backup-list-toolbar {
  min-height: 48px;
  margin: 0 -18px;
  padding: 8px 18px;
  border: 0;
  background: #101514;
}

#adminDashboard .super-admin-footer {
  padding: 12px 18px;
  background: #101514;
}

#adminDashboard .backup-list-toolbar--top {
  border-bottom: 1px solid rgba(201, 146, 42, 0.1);
}

#adminDashboard .backup-list-toolbar--bottom {
  border-top: 1px solid rgba(201, 146, 42, 0.1);
}

#adminDashboard .expense-panel-footer {
  justify-content: flex-end;
  padding: 10px 18px;
  border-top: 0;
  background: #101514;
  text-align: right;
}

@media (max-width: 1100px) {
  .metrics-grid,
  .backup-summary-grid,
  .system-status-overview,
  .power-summary-grid,
  .client-home-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-status-sections {
    grid-template-columns: 1fr;
  }

  .diagnostic-log-filters {
    grid-template-columns: 1fr;
  }

  .power-entry-content {
    grid-template-columns: 1fr;
  }

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

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

  .client-limit-summary {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.28fr);
  }

  .rates-row {
    grid-template-columns: 1fr;
  }

  .expenses-row {
    grid-template-columns: 1fr;
  }

  .client-record-summary,
  .subscription-layout,
  .subscription-simple-layout,
  .subscription-console {
    grid-template-columns: 1fr;
  }

  .subscription-rail {
    border-right: 0;
    border-bottom: 1px solid rgba(201, 146, 42, 0.16);
  }
}

@media (max-width: 760px) {
  .landing-header {
    padding: 18px 18px 8px 18px;
  }

  .brand-logo {
    width: 142px;
  }

  .hero-copy {
    padding: 16vh 18px 0;
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 12vw, 56px);
    line-height: 1;
  }

  .hero-copy p:last-child {
    width: 100%;
    font-size: 15px;
    line-height: 1.5;
  }

  .landing-legal-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .legal-page-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 18px 8px 18px;
    margin-bottom: 44px;
  }

  .legal-page-logo {
    width: 124px;
  }

  .landing-screen::after {
    background:
      linear-gradient(90deg, rgba(5, 7, 12, 0.96) 0%, rgba(5, 7, 12, 0.76) 58%, rgba(5, 7, 12, 0.16) 100%),
      linear-gradient(180deg, rgba(5, 7, 12, 0.18) 0%, rgba(5, 7, 12, 0.24) 52%, rgba(5, 7, 12, 0.7) 100%);
  }

  .sidebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .brand {
    min-height: 40px;
  }

  .nav-list {
    width: 100%;
  }

  .shell-top-meta {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .shell-access-pill,
  .shell-api-status,
  .shell-top-meta .secondary-button {
    flex: 1 1 160px;
    justify-content: center;
  }

  .nav-item {
    min-height: 36px;
    padding: 0 12px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .panel-actions {
    width: 100%;
  }

  .api-status,
  .primary-button,
  .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .settings-save-button {
    width: 100%;
  }

  .extension-token-panel__body {
    align-items: stretch;
    flex-direction: column;
  }

  .extension-token-panel__actions {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  .extension-token-panel__actions .primary-button {
    min-width: 0;
  }

  .metrics-grid,
  .backup-summary-grid,
  .system-status-overview,
  .diagnostic-log-summary,
  .power-summary-grid,
  .client-limit-summary,
  .client-home-grid,
  .auth-actions,
  .account-choice-list,
  .modal-grid,
  .details-modal-content .detail-list,
  .client-record-summary,
  .client-fields-grid,
  .client-fields-grid.two-col,
  .subscription-layout,
  .subscription-simple-layout,
  .subscription-console,
  .subscription-status-line,
  .subscription-extension-controls,
  .subscription-term-options,
  .subscription-billing-grid,
  .subscription-apply-row,
  .extension-plan-grid,
  .subscription-command-grid,
  .subscription-log-row,
  .settings-grid,
  .calc-settings-column,
  .subaccount-add-row,
  .super-admin-add-row,
  .super-admin-row,
  .expense-row,
  .two-col {
    grid-template-columns: 1fr;
  }

  .system-status-row {
    grid-template-columns: minmax(0, 1fr) auto 8px;
  }

  .system-status-row small {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .diagnostic-logs-backdrop {
    padding: 12px;
  }

  .diagnostic-logs-panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .diagnostic-logs-header {
    align-items: stretch;
    flex-direction: column;
  }

  .diagnostic-logs-actions {
    width: 100%;
  }

  .diagnostic-logs-actions .secondary-button {
    flex: 1 1 auto;
  }

  .diagnostic-log-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .diagnostic-log-pagination.is-top {
    justify-self: stretch;
  }

  .diagnostic-log-entry header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .diagnostic-log-entry header span {
    grid-column: 1 / -1;
  }

  .diagnostic-log-entry p {
    padding-left: 0;
    white-space: normal;
  }

  .diagnostic-log-entry details {
    padding-left: 0;
  }

  .backup-row {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-expense-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #adminDashboard .expense-list-header {
    display: none;
  }

  #adminDashboard .platform-expense-row label span {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .platform-expense-remove {
    width: 100%;
  }

  .system-settings-header,
  .expense-panel-footer,
  .backup-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-list-toolbar--top,
  .backup-list-toolbar--bottom {
    justify-content: center;
  }

  .backup-pagination {
    justify-content: center;
  }

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

  .power-list-toolbar {
    grid-template-columns: 1fr;
  }

  .power-pagination {
    justify-content: flex-start;
  }

  .power-entry-details {
    grid-template-columns: 1fr;
  }

  .power-entry-title strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .power-entry-tools .secondary-button {
    width: 100%;
  }

  .power-add-form button,
  .power-entry-actions button {
    width: 100%;
  }

  .backup-row-actions .secondary-button,
  .backup-row-actions .danger-button {
    width: 100%;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 12px;
  }

  .details-modal-panel {
    height: calc(100vh - 24px);
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .subscription-date-segment,
  .subscription-term-options button,
  .subscription-term-options button:last-child {
    border-left: 1px solid rgba(201, 146, 42, 0.24);
    border-radius: 8px;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
  }
}

/* CarAuto neo-retro cabinet theme */
:root {
  --accent: #f10b08;
  --accent-hi: #ff4a3f;
  --accent-dark: #990000;
  --accent-soft: rgba(241, 11, 8, 0.14);
  --graphite: #252a2d;
  --graphite-2: #1b2023;
  --graphite-3: #30383d;
  --panel: #ffffff;
  --panel-muted: #f7f6f2;
  --cream: #f7f6f2;
  --muted: #6f7273;
  --line: rgba(37, 42, 45, 0.14);
  --strong-line: rgba(153, 0, 0, 0.22);
  --amber: #d50000;
  --red: #d50000;
  --red-bg: rgba(241, 11, 8, 0.11);
  --shadow: 0 18px 42px rgba(19, 23, 26, 0.12);
  --shadow-strong: 0 28px 80px rgba(19, 23, 26, 0.28);
  --retro-chrome: #f7f6f2;
  --retro-paper: #fffaf4;
  --retro-graphite: #252a2d;
  --retro-deep-graphite: #13171a;
  --retro-red: #f10b08;
  --retro-deep-red: #d50000;
  --retro-cherry: #990000;
}

::selection {
  color: #ffffff;
  background: var(--retro-red);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgba(241, 11, 8, 0.28);
}

.app-shell {
  color: var(--retro-graphite);
  background:
    linear-gradient(112deg, rgba(37, 42, 45, 0.08) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, #fffaf4 0%, #f7f6f2 48%, #ecebe7 100%);
}

.sidebar {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.14), transparent 34%),
    linear-gradient(180deg, #252a2d, #13171a);
  border-bottom: 1px solid rgba(241, 11, 8, 0.34);
  box-shadow: 0 12px 26px rgba(19, 23, 26, 0.24);
}

.brand {
  color: #ffffff;
}

.brand-mark {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 46%),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red) 58%, var(--retro-cherry));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -2px 8px rgba(153, 0, 0, 0.62),
    0 10px 24px rgba(153, 0, 0, 0.25);
}

.brand span,
.shell-access-pill span,
.shell-access-pill small {
  color: rgba(247, 246, 242, 0.72);
}

.brand strong,
.shell-access-pill strong {
  color: #ffffff;
}

.nav-list,
.segmented-control,
.diagnostic-log-filter-group {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(19, 23, 26, 0.58);
}

.nav-item {
  color: rgba(247, 246, 242, 0.76);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item span {
  color: #ff6b60;
}

.nav-item:hover,
.nav-item.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.04)),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 10px 22px rgba(153, 0, 0, 0.2);
}

.nav-item.is-active span,
.nav-item:hover span {
  color: #ffffff;
}

.shell-top-meta > *,
.shell-access-pill,
.shell-status-pill,
.shell-api-status,
.shell-top-meta .secondary-button,
.shell-top-meta .client-status-pill.active,
.shell-top-meta .client-status-pill.limit,
.shell-top-meta .client-status-pill.paused,
.shell-top-meta .shell-api-status {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.workspace {
  background:
    linear-gradient(112deg, rgba(37, 42, 45, 0.065) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, rgba(241, 11, 8, 0.08), rgba(255, 255, 255, 0) 220px);
}

.topbar {
  color: var(--retro-graphite);
  border-color: rgba(37, 42, 45, 0.1);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.14), transparent 42%),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

h2,
.system-settings-header h2,
.panel h2,
.modal-panel h2,
.backup-module-header h3,
.client-record-title h3,
.settings-title h3,
.expense-card h3 {
  color: var(--retro-graphite);
}

.topbar p,
.panel-header p,
.system-settings-header p,
.client-name span,
.muted-cell,
.metric-card__meta,
.metric-card__trend p,
.metric-card__split small,
.backup-summary-grid span,
.backup-row span,
.expense-summary-grid span,
.platform-expense-row label span,
.system-status-row span,
.system-status-card small,
.system-status-card em,
.power-summary-grid span,
.power-list-range,
.client-record-title p,
.client-record-stat span,
.client-record-stat small,
.detail-list dt,
.subscription-action-panel > p,
.subscription-log-row small,
.subscription-log-empty {
  color: #666b6d;
}

.metric-card,
.panel,
.limit-card,
.users-mini-card,
.workspace-client-card,
.system-status-card,
.power-summary-grid article,
.settings-block,
.client-record-title,
.client-record-stat,
.subscription-state-card,
.subscription-actions-card,
.subscription-action-panel,
.subscription-log-card,
.diagnostic-log-summary-item,
.diagnostic-log-entry,
.power-entry-row,
.power-add-form,
.power-list-toolbar,
.power-entry-form,
.power-entry-details,
.super-admin-row,
.platform-expense-row,
.backup-row,
.telegram-login-card,
.account-choice-card {
  position: relative;
  overflow: hidden;
  color: var(--retro-graphite);
  border: 1px solid rgba(37, 42, 45, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 246, 242, 0.96));
  box-shadow: 0 14px 34px rgba(19, 23, 26, 0.1);
}

.metric-card::before,
.panel::before,
.limit-card::before,
.users-mini-card::before,
.workspace-client-card::before,
.system-status-card::before,
.power-summary-grid article::before,
.settings-block::before,
.subscription-action-panel::before,
.diagnostic-log-summary-item::before,
.diagnostic-log-entry::before,
.power-entry-row::before,
.telegram-login-card::before,
.account-choice-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--retro-cherry), var(--retro-red), #ff6b60);
}

.panel-header,
.modal-header,
.details-modal-panel .modal-header,
.create-client-panel .modal-header,
.auth-panel .modal-header,
.delete-client-panel .modal-header,
.diagnostic-logs-header {
  border-bottom-color: rgba(37, 42, 45, 0.1);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.12), transparent 46%),
    linear-gradient(180deg, #ffffff, var(--retro-chrome));
}

.metric-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(180deg, var(--retro-graphite), var(--retro-deep-graphite));
  border-color: rgba(153, 0, 0, 0.2);
}

.metric-card span,
.metric-card__line small,
.metric-card__line em,
.metric-card__value small,
.limit-card__head span,
.users-mini-card span {
  color: rgba(247, 246, 242, 0.72);
}

.metric-card strong,
.metric-card__trend b,
.limit-card__head strong,
.users-mini-card strong {
  color: #ffffff;
}

.metric-card:hover,
.panel:hover,
.system-status-card:hover,
.power-summary-grid article:hover {
  border-color: rgba(241, 11, 8, 0.28);
  box-shadow: 0 18px 42px rgba(19, 23, 26, 0.14);
}

.metric-status-track,
.limit-progress,
.usage-track,
.users-cell-track,
.system-status-meter {
  border-color: rgba(37, 42, 45, 0.1);
  background: rgba(19, 23, 26, 0.12);
}

.metric-status-track__active,
.limit-progress__fill,
.usage-fill,
.users-cell-track i {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 50%),
    linear-gradient(90deg, var(--retro-cherry), var(--retro-red), #ff4a3f);
  box-shadow: 0 0 16px rgba(241, 11, 8, 0.24);
}

.primary-button,
.settings-save-button.is-dirty,
.subscription-action-button,
.power-entry-actions .primary-button {
  color: #ffffff;
  border-color: rgba(153, 0, 0, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red) 58%, var(--retro-cherry));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 12px 28px rgba(213, 0, 0, 0.2);
}

.primary-button:hover,
.settings-save-button.is-dirty:hover,
.subscription-action-button:hover,
.power-entry-actions .primary-button:hover {
  color: #ffffff;
  border-color: rgba(153, 0, 0, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 50%),
    linear-gradient(180deg, #ff2a1f, var(--retro-deep-red) 58%, var(--retro-cherry));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 16px 34px rgba(213, 0, 0, 0.26);
}

.secondary-button,
.settings-save-button,
.icon-button,
.close-button,
.backup-pagination button,
.power-pagination button,
.diagnostic-log-pagination button,
.segmented-control button,
.client-details-tabs button,
.subscription-side-tabs button,
.subscription-term-options button,
.subscription-date-segment,
.account-choice-back {
  color: var(--retro-graphite);
  border-color: rgba(37, 42, 45, 0.16);
  background: linear-gradient(180deg, #ffffff, #ecebe7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.secondary-button:hover,
.settings-save-button:hover,
.icon-button:hover,
.close-button:hover,
.backup-pagination button:hover:not(:disabled),
.power-pagination button:hover:not(:disabled),
.diagnostic-log-pagination button:hover:not(:disabled),
.segmented-control button.is-selected,
.segmented-control button:hover,
.client-details-tabs button.is-active,
.client-details-tabs button:hover,
.subscription-side-tabs button:hover,
.subscription-side-tabs button.is-active,
.subscription-term-options button.is-selected,
.subscription-term-options button:hover,
.subscription-date-segment.is-selected,
.subscription-date-segment:hover,
.subscription-date-segment:focus-within,
.account-choice-back:hover {
  color: #ffffff;
  border-color: rgba(153, 0, 0, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 48%),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red));
  box-shadow: 0 10px 24px rgba(213, 0, 0, 0.16);
}

.danger-button,
.subscription-side-tabs button.is-danger,
.power-entry-actions .danger-button,
.delete-client-panel .danger-button {
  color: var(--retro-cherry);
  border-color: rgba(153, 0, 0, 0.28);
  background: rgba(241, 11, 8, 0.08);
}

.danger-button:hover,
.subscription-side-tabs button.is-danger:hover,
.subscription-side-tabs button.is-danger.is-active,
.power-entry-actions .danger-button:hover,
.delete-client-panel .danger-button:hover {
  color: #ffffff;
  border-color: var(--retro-cherry);
  background: linear-gradient(180deg, var(--retro-deep-red), var(--retro-cherry));
}

.api-status,
.status-badge,
.client-status-pill,
.extension-status-pill,
.access-pill,
.key-chip,
.telegram-chip,
.user-chip,
.power-entry-status,
.system-status-card__badge {
  color: var(--retro-graphite);
  border-color: rgba(37, 42, 45, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.status-dot,
.status-badge::before,
.client-status-pill span,
.power-status-dot {
  background: var(--retro-red);
  box-shadow: 0 0 0 4px rgba(241, 11, 8, 0.12), 0 0 16px rgba(241, 11, 8, 0.32);
}

.status-badge.active::before,
.client-status-pill.active span,
.power-status-dot.is-ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 184, 111, 0.12), 0 0 16px rgba(57, 184, 111, 0.38);
}

.status-badge.limit::before,
.status-badge.paused::before,
.status-badge.stopped::before,
.client-status-pill.limit span,
.client-status-pill.paused span,
.client-status-pill.stopped span,
.power-status-dot.is-warning {
  background: var(--retro-red);
}

.table-wrap,
.backup-list,
.expense-list,
.super-admin-body,
.system-status-rows,
.power-entry-list,
.diagnostic-log-list,
.auth-actions,
.account-choice-panel,
.details-modal-content {
  background: rgba(247, 246, 242, 0.72);
}

table {
  color: var(--retro-graphite);
}

th {
  color: #ffffff;
  background:
    linear-gradient(180deg, #30383d, var(--retro-graphite));
}

td {
  border-bottom-color: rgba(37, 42, 45, 0.08);
}

tbody tr,
tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.86);
}

tbody tr:hover,
tbody tr.is-selected {
  color: var(--retro-graphite);
  background: rgba(241, 11, 8, 0.08);
  box-shadow: inset 4px 0 0 var(--retro-red);
}

.client-name strong,
.client-payment-cell strong,
.access-date-cell strong,
.backup-summary-grid strong,
.backup-row strong,
.expense-summary-grid strong,
.system-status-row strong,
.system-status-card strong,
.power-summary-grid strong,
.power-entry-title strong,
.power-entry-details dd,
.subscription-billing-total strong,
.subscription-status-line strong,
.subscription-log-row strong,
.detail-list dd,
.client-record-stat strong {
  color: var(--retro-graphite);
}

.key-chip {
  color: #ffffff;
  background: var(--retro-graphite);
  border-color: rgba(37, 42, 45, 0.2);
}

.telegram-chip,
.user-chip {
  color: var(--retro-graphite);
  background: rgba(241, 11, 8, 0.08);
  border-color: rgba(241, 11, 8, 0.22);
}

.extension-token-panel {
  border-color: rgba(153, 0, 0, 0.2);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.18), transparent 48%),
    linear-gradient(180deg, #ffffff, var(--retro-chrome));
}

.extension-token-panel__title h2,
.extension-token-panel__copy p,
.extension-status-pill,
.workspace-client-card h2,
.access-pill strong {
  color: var(--retro-graphite);
}

.create-grid label,
.settings-block label,
.client-fields-grid label,
.subscription-actions-card label,
.subscription-action-panel label,
.subscription-billing-grid label,
.power-add-form label,
.power-entry-form label,
.platform-expense-row label,
.super-admin-add-row label {
  color: #4a4f51;
}

.create-grid input,
.settings-block input,
.settings-block select,
.client-fields-grid input,
.client-fields-grid select,
.subscription-actions-card textarea,
.subscription-action-panel textarea,
.subscription-billing-grid input,
.subscription-manual-date input,
.power-add-form input,
.power-entry-form input,
.platform-expense-row input,
.super-admin-add-row input,
.custom-select__trigger {
  color: var(--retro-graphite);
  border-color: rgba(37, 42, 45, 0.16);
  background: #ffffff;
  color-scheme: light;
}

.create-grid input:hover,
.settings-block input:hover,
.settings-block select:hover,
.client-fields-grid input:hover,
.client-fields-grid select:hover,
.subscription-actions-card textarea:hover,
.subscription-action-panel textarea:hover,
.subscription-billing-grid input:hover,
.subscription-manual-date input:hover,
.power-add-form input:hover,
.power-entry-form input:hover,
.platform-expense-row input:hover,
.super-admin-add-row input:hover,
.custom-select__trigger:hover,
.custom-select.is-open .custom-select__trigger {
  border-color: rgba(241, 11, 8, 0.38);
}

.create-grid input:focus,
.settings-block input:focus,
.settings-block select:focus,
.client-fields-grid input:focus,
.client-fields-grid select:focus,
.subscription-actions-card textarea:focus,
.subscription-action-panel textarea:focus,
.subscription-billing-grid input:focus,
.subscription-manual-date input:focus,
.power-add-form input:focus,
.power-entry-form input:focus,
.platform-expense-row input:focus,
.super-admin-add-row input:focus,
.custom-select.is-open .custom-select__trigger {
  border-color: var(--retro-red);
  box-shadow: 0 0 0 4px rgba(241, 11, 8, 0.12);
}

.settings-block input[readonly] {
  color: #5f6567;
  background: #f0efeb;
  border-color: rgba(37, 42, 45, 0.1);
}

.custom-select__menu,
.custom-select__option,
.settings-block select option,
.create-grid select option,
.client-fields-grid select option {
  color: var(--retro-graphite);
  background: #ffffff;
}

.custom-select__option:hover,
.custom-select__option.is-selected,
.settings-block select option:checked,
.create-grid select option:checked,
.client-fields-grid select option:checked {
  color: #ffffff;
  background: var(--retro-deep-red);
}

.modal-backdrop,
.power-confirm-backdrop,
.diagnostic-logs-backdrop {
  background: rgba(19, 23, 26, 0.72);
}

.modal-panel,
.details-modal-panel,
.create-client-panel,
.auth-panel,
.delete-client-panel,
.diagnostic-logs-panel,
.power-confirm-panel {
  color: var(--retro-graphite);
  border-color: rgba(241, 11, 8, 0.2);
  background:
    linear-gradient(112deg, rgba(37, 42, 45, 0.055) 0 1px, transparent 1px 32px),
    linear-gradient(180deg, #ffffff, var(--retro-chrome));
  box-shadow: var(--shadow-strong);
  scrollbar-color: rgba(241, 11, 8, 0.48) rgba(247, 246, 242, 0.88);
}

.modal-actions,
.create-client-panel .modal-actions,
.delete-client-panel .modal-actions {
  border-top-color: rgba(37, 42, 45, 0.1);
  background: #f1f0ec;
}

.modal-header p,
.auth-panel .modal-header p,
.create-client-panel .modal-header p,
.delete-client-panel .modal-header p,
.details-modal-panel .modal-header p,
.diagnostic-logs-header p:last-child,
.account-choice-heading p,
.account-choice-card small {
  color: #666b6d;
}

.auth-panel .modal-header h2,
.create-client-panel .modal-header h2,
.delete-client-panel .modal-header h2,
.details-modal-panel .modal-header h2,
.diagnostic-logs-header h2,
.account-choice-heading strong,
.telegram-login-card strong,
.account-choice-card strong {
  color: var(--retro-graphite);
}

.telegram-login-card span,
.account-choice-heading span,
.account-choice-card span,
.system-settings-module-label {
  color: var(--retro-red);
}

.form-hint,
.create-client-panel .form-hint,
.power-toast {
  color: var(--retro-graphite);
  border-color: rgba(241, 11, 8, 0.18);
  background: rgba(241, 11, 8, 0.08);
}

.client-details-tabs {
  border-color: rgba(37, 42, 45, 0.12);
  background: rgba(255, 255, 255, 0.66);
}

.subscription-rail,
.subscription-billing-total,
.subscription-status-line,
.detail-list div,
.subaccount-row,
.extension-plan-card,
.subscription-control-panel {
  color: var(--retro-graphite);
  border-color: rgba(37, 42, 45, 0.1);
  background: rgba(255, 255, 255, 0.74);
}

.subscription-action-panel.is-danger {
  border-color: rgba(153, 0, 0, 0.3);
  background:
    linear-gradient(180deg, rgba(241, 11, 8, 0.1), rgba(255, 255, 255, 0.9));
}

.subscription-log-row,
.power-section,
.system-status-section {
  border-color: rgba(37, 42, 45, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.system-status-section h3 {
  color: var(--retro-graphite);
  border-bottom-color: rgba(37, 42, 45, 0.08);
}

.diagnostic-log-entry code {
  color: #ffffff;
  background: var(--retro-graphite);
}

#adminDashboard .clients-panel .table-wrap {
  background: var(--retro-deep-graphite);
}

#adminDashboard .clients-panel tbody tr,
#adminDashboard .clients-panel tbody tr:nth-child(even) {
  color: var(--retro-chrome);
  background: linear-gradient(180deg, #1b2023, #13171a);
}

#adminDashboard .clients-panel tbody tr:hover,
#adminDashboard .clients-panel tbody tr.is-selected {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.18), transparent 46%),
    linear-gradient(180deg, #242a2d, #171c1f);
}

#adminDashboard .clients-panel .client-name strong,
#adminDashboard .clients-panel .client-payment-cell strong,
#adminDashboard .clients-panel .access-date-cell strong,
#adminDashboard .clients-panel .backup-row strong,
#adminDashboard .clients-panel .status-badge,
#adminDashboard .clients-panel .users-cell strong,
#adminDashboard .clients-panel .usage-cell strong {
  color: #ffffff;
}

#adminDashboard .clients-panel .client-name span,
#adminDashboard .clients-panel .muted-cell,
#adminDashboard .clients-panel .client-payment-cell span,
#adminDashboard .clients-panel .access-date-cell span,
#adminDashboard .clients-panel .users-cell span,
#adminDashboard .clients-panel .users-cell small,
#adminDashboard .clients-panel .usage-cell span {
  color: rgba(247, 246, 242, 0.72);
}

#adminDashboard .clients-panel .access-date-cell span.is-ok,
#adminDashboard .clients-panel .status-badge.active {
  color: #69e0a6;
}

#adminDashboard .clients-panel .access-date-cell span.is-warning,
#adminDashboard .clients-panel .status-badge.limit,
#adminDashboard .clients-panel .status-badge.paused,
#adminDashboard .clients-panel .status-badge.stopped {
  color: #ffb7b0;
}

#adminDashboard .clients-panel .telegram-chip,
#adminDashboard .clients-panel .user-chip {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(247, 246, 242, 0.18);
}

#adminDashboard .clients-panel .client-delete-button {
  color: #ffffff;
  border-color: rgba(247, 246, 242, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

#adminDashboard .clients-panel .client-delete-button:hover {
  color: #ffffff;
  border-color: rgba(241, 11, 8, 0.5);
  background: rgba(241, 11, 8, 0.18);
}

#clientDashboard .limit-card,
#clientDashboard .users-mini-card {
  color: var(--retro-graphite);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.08), transparent 48%),
    linear-gradient(180deg, #ffffff, var(--retro-chrome));
}

#clientDashboard .limit-card__head span,
#clientDashboard .users-mini-card span,
#clientDashboard .limit-card__meta,
#clientDashboard .limit-card__meta span,
#clientDashboard .users-mini-card em,
#clientDashboard .users-mini-card strong small,
#clientDashboard .subaccount-row small {
  color: #666b6d;
}

#clientDashboard .limit-card__head strong,
#clientDashboard .limit-card__head em,
#clientDashboard .users-mini-card strong,
#clientDashboard .subaccount-row strong,
#clientDashboard .subaccounts-head h3,
#clientDashboard .subaccounts-head p {
  color: var(--retro-graphite);
}

#clientDashboard .subaccount-row {
  color: var(--retro-graphite);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.06), transparent 52%),
    #ffffff;
  border-color: rgba(37, 42, 45, 0.1);
  box-shadow: 0 8px 18px rgba(19, 23, 26, 0.08);
}

#clientDashboard .subaccount-remove {
  color: #666b6d;
  border-color: rgba(37, 42, 45, 0.1);
  background: #f7f6f2;
}

#clientDashboard .subaccount-remove:hover {
  color: #ffffff;
  border-color: var(--retro-deep-red);
  background: var(--retro-deep-red);
}

#clientDashboard .users-capacity i {
  background: var(--retro-deep-graphite);
}

#clientDashboard .users-capacity i.is-filled {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 48%),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red));
}

.diagnostic-log-entry.is-warning::before,
.system-status-card.is-warning::before,
.diagnostic-log-summary-item.is-warning::before {
  background: linear-gradient(90deg, var(--retro-cherry), var(--retro-red));
}

.diagnostic-log-entry.is-danger::before,
.system-status-card.is-danger::before,
.diagnostic-log-summary-item.is-danger::before {
  background: linear-gradient(90deg, #610000, var(--retro-cherry));
}

.diagnostic-log-entry.is-ok::before,
.system-status-card.is-ok::before,
.diagnostic-log-summary-item.is-ok::before {
  background: linear-gradient(90deg, var(--green-dark), var(--green));
}

.power-confirm-mark {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red));
}

@media (max-width: 720px) {
  .workspace {
    background:
      linear-gradient(112deg, rgba(37, 42, 45, 0.06) 0 1px, transparent 1px 28px),
      linear-gradient(180deg, rgba(241, 11, 8, 0.08), rgba(255, 255, 255, 0) 180px);
  }

  .topbar,
  .panel-header,
  .extension-token-panel__body {
    align-items: stretch;
  }
}

/* CarAuto dark lacquer cabinet refinement */
.app-shell {
  color: var(--retro-chrome);
  background:
    linear-gradient(112deg, rgba(247, 246, 242, 0.035) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, #0d1011 0%, #13171a 42%, #191d1f 100%);
}

.workspace {
  background:
    linear-gradient(112deg, rgba(247, 246, 242, 0.035) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, rgba(241, 11, 8, 0.08), rgba(241, 11, 8, 0) 210px),
    linear-gradient(180deg, #15191b, #101314);
}

.topbar,
.panel,
.limit-card,
.users-mini-card,
.workspace-client-card,
.system-status-card,
.power-summary-grid article,
.settings-block,
.client-record-title,
.client-record-stat,
.subscription-state-card,
.subscription-actions-card,
.subscription-action-panel,
.subscription-log-card,
.diagnostic-log-summary-item,
.diagnostic-log-entry,
.power-entry-row,
.power-add-form,
.power-list-toolbar,
.power-entry-form,
.power-entry-details,
.super-admin-row,
.platform-expense-row,
.backup-row,
.telegram-login-card,
.account-choice-card,
.extension-token-panel,
.subscription-rail,
.subscription-billing-total,
.subscription-status-line,
.detail-list div,
.extension-plan-card,
.subscription-control-panel,
.subscription-log-row,
.power-section,
.system-status-section {
  color: var(--retro-chrome);
  border-color: rgba(241, 11, 8, 0.22);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.08), transparent 44%),
    linear-gradient(180deg, #20262a, #141819);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 18px 42px rgba(0, 0, 0, 0.26);
}

.panel-header,
.modal-header,
.details-modal-panel .modal-header,
.create-client-panel .modal-header,
.auth-panel .modal-header,
.delete-client-panel .modal-header,
.diagnostic-logs-header {
  border-bottom-color: rgba(241, 11, 8, 0.18);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.16), transparent 46%),
    linear-gradient(180deg, #252a2d, #171b1d);
}

h2,
.system-settings-header h2,
.panel h2,
.modal-panel h2,
.backup-module-header h3,
.client-record-title h3,
.settings-title h3,
.expense-card h3,
.extension-token-panel__title h2,
.workspace-client-card h2,
.auth-panel .modal-header h2,
.create-client-panel .modal-header h2,
.delete-client-panel .modal-header h2,
.details-modal-panel .modal-header h2,
.diagnostic-logs-header h2,
.account-choice-heading strong,
.telegram-login-card strong,
.account-choice-card strong,
.system-status-section h3,
#clientDashboard .limit-card__head strong,
#clientDashboard .limit-card__head em,
#clientDashboard .users-mini-card strong,
#clientDashboard .subaccount-row strong,
#clientDashboard .subaccounts-head h3,
#clientDashboard .subaccounts-head p {
  color: #ffffff;
}

.topbar p,
.panel-header p,
.system-settings-header p,
.client-name span,
.muted-cell,
.metric-card__meta,
.metric-card__trend p,
.metric-card__split small,
.backup-summary-grid span,
.backup-row span,
.expense-summary-grid span,
.platform-expense-row label span,
.system-status-row span,
.system-status-card small,
.system-status-card em,
.power-summary-grid span,
.power-list-range,
.client-record-title p,
.client-record-stat span,
.client-record-stat small,
.detail-list dt,
.subscription-action-panel > p,
.subscription-log-row small,
.subscription-log-empty,
.modal-header p,
.auth-panel .modal-header p,
.create-client-panel .modal-header p,
.delete-client-panel .modal-header p,
.details-modal-panel .modal-header p,
.diagnostic-logs-header p:last-child,
.account-choice-heading p,
.account-choice-card small,
.extension-token-panel__copy p,
.limit-card__head span,
.users-mini-card span,
#clientDashboard .limit-card__head span,
#clientDashboard .users-mini-card span,
#clientDashboard .limit-card__meta,
#clientDashboard .limit-card__meta span,
#clientDashboard .users-mini-card em,
#clientDashboard .users-mini-card strong small,
#clientDashboard .subaccount-row small {
  color: rgba(247, 246, 242, 0.68);
}

.metric-card strong,
.metric-card__trend b,
.limit-card__head strong,
.users-mini-card strong,
.client-name strong,
.client-payment-cell strong,
.access-date-cell strong,
.backup-summary-grid strong,
.backup-row strong,
.expense-summary-grid strong,
.system-status-row strong,
.system-status-card strong,
.power-summary-grid strong,
.power-entry-title strong,
.power-entry-details dd,
.subscription-billing-total strong,
.subscription-status-line strong,
.subscription-log-row strong,
.detail-list dd,
.client-record-stat strong,
.access-pill strong {
  color: #ffffff;
}

.client-home-grid,
.settings-grid,
.table-wrap,
.backup-list,
.expense-list,
.super-admin-body,
.system-status-rows,
.power-entry-list,
.diagnostic-log-list,
.auth-actions,
.account-choice-panel,
.details-modal-content {
  background:
    linear-gradient(112deg, rgba(247, 246, 242, 0.025) 0 1px, transparent 1px 28px),
    #101314;
}

.client-settings-panel {
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.07), transparent 42%),
    linear-gradient(180deg, #20262a, #131719);
}

#clientDashboard .limit-card,
#clientDashboard .users-mini-card,
#clientDashboard .subaccount-row {
  color: var(--retro-chrome);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.1), transparent 48%),
    linear-gradient(180deg, #20262a, #141819);
  border-color: rgba(241, 11, 8, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 14px 34px rgba(0, 0, 0, 0.24);
}

.extension-token-panel {
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.16), transparent 48%),
    linear-gradient(180deg, #242a2d, #15191b);
}

.extension-status-pill,
.api-status,
.status-badge,
.client-status-pill,
.access-pill,
.key-chip,
.telegram-chip,
.user-chip,
.power-entry-status,
.system-status-card__badge {
  color: var(--retro-chrome);
  border-color: rgba(247, 246, 242, 0.16);
  background: rgba(255, 255, 255, 0.055);
}

.telegram-chip,
.user-chip,
#clientDashboard .telegram-chip,
#clientDashboard .user-chip {
  color: #ffffff;
  background: rgba(241, 11, 8, 0.16);
  border-color: rgba(255, 82, 72, 0.34);
}

.secondary-button,
.settings-save-button,
.icon-button,
.close-button,
.backup-pagination button,
.power-pagination button,
.diagnostic-log-pagination button,
.segmented-control button,
.client-details-tabs button,
.subscription-side-tabs button,
.subscription-term-options button,
.subscription-date-segment,
.account-choice-back,
#clientDashboard .subaccount-remove {
  color: var(--retro-chrome);
  border-color: rgba(247, 246, 242, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, #252a2d, #171b1d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.secondary-button:hover,
.settings-save-button:hover,
.icon-button:hover,
.close-button:hover,
.backup-pagination button:hover:not(:disabled),
.power-pagination button:hover:not(:disabled),
.diagnostic-log-pagination button:hover:not(:disabled),
.segmented-control button.is-selected,
.segmented-control button:hover,
.client-details-tabs button.is-active,
.client-details-tabs button:hover,
.subscription-side-tabs button:hover,
.subscription-side-tabs button.is-active,
.subscription-term-options button.is-selected,
.subscription-term-options button:hover,
.subscription-date-segment.is-selected,
.subscription-date-segment:hover,
.subscription-date-segment:focus-within,
.account-choice-back:hover {
  color: #ffffff;
  border-color: rgba(255, 82, 72, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 48%),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red));
}

.create-grid label,
.settings-block label,
.client-fields-grid label,
.subscription-actions-card label,
.subscription-action-panel label,
.subscription-billing-grid label,
.power-add-form label,
.power-entry-form label,
.platform-expense-row label,
.super-admin-add-row label {
  color: rgba(247, 246, 242, 0.72);
}

.create-grid input,
.settings-block input,
.settings-block select,
.client-fields-grid input,
.client-fields-grid select,
.subscription-actions-card textarea,
.subscription-action-panel textarea,
.subscription-billing-grid input,
.subscription-manual-date input,
.power-add-form input,
.power-entry-form input,
.platform-expense-row input,
.super-admin-add-row input,
.subaccount-add-row input,
.custom-select__trigger {
  color: #ffffff;
  border-color: rgba(247, 246, 242, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    #101314;
  color-scheme: dark;
}

.settings-block input[readonly] {
  color: rgba(247, 246, 242, 0.72);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(247, 246, 242, 0.12);
}

.custom-select__menu,
.custom-select__option,
.settings-block select option,
.create-grid select option,
.client-fields-grid select option {
  color: #ffffff;
  background: #15191b;
}

.modal-panel,
.details-modal-panel,
.create-client-panel,
.auth-panel,
.delete-client-panel,
.diagnostic-logs-panel,
.power-confirm-panel {
  color: var(--retro-chrome);
  border-color: rgba(241, 11, 8, 0.26);
  background:
    linear-gradient(112deg, rgba(247, 246, 242, 0.03) 0 1px, transparent 1px 32px),
    linear-gradient(180deg, #20262a, #121617);
  scrollbar-color: rgba(241, 11, 8, 0.52) rgba(19, 23, 26, 0.88);
}

.modal-actions,
.create-client-panel .modal-actions,
.delete-client-panel .modal-actions {
  border-top-color: rgba(241, 11, 8, 0.16);
  background: #15191b;
}

tbody tr,
tbody tr:nth-child(even) {
  color: var(--retro-chrome);
  background: linear-gradient(180deg, #1b2023, #13171a);
}

tbody tr:hover,
tbody tr.is-selected {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.18), transparent 46%),
    linear-gradient(180deg, #242a2d, #171c1f);
}

@media (max-width: 720px) {
  .workspace {
    background:
      linear-gradient(112deg, rgba(247, 246, 242, 0.032) 0 1px, transparent 1px 28px),
      linear-gradient(180deg, rgba(241, 11, 8, 0.08), rgba(241, 11, 8, 0) 180px),
      linear-gradient(180deg, #15191b, #101314);
  }
}

/* CarAuto showroom restraint pass */
.workspace {
  background:
    linear-gradient(112deg, rgba(247, 246, 242, 0.028) 0 1px, transparent 1px 36px),
    linear-gradient(180deg, #171b1d, #101314 34%, #0d1011);
}

.sidebar {
  border-bottom-color: rgba(247, 246, 242, 0.1);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.topbar,
.panel,
.limit-card,
.users-mini-card,
.workspace-client-card,
.system-status-card,
.power-summary-grid article,
.settings-block,
.client-record-title,
.client-record-stat,
.subscription-state-card,
.subscription-actions-card,
.subscription-action-panel,
.subscription-log-card,
.diagnostic-log-summary-item,
.diagnostic-log-entry,
.power-entry-row,
.power-add-form,
.power-list-toolbar,
.power-entry-form,
.power-entry-details,
.super-admin-row,
.platform-expense-row,
.backup-row,
.telegram-login-card,
.account-choice-card,
.extension-token-panel,
.subscription-rail,
.subscription-billing-total,
.subscription-status-line,
.detail-list div,
.extension-plan-card,
.subscription-control-panel,
.subscription-log-row,
.power-section,
.system-status-section,
#clientDashboard .limit-card,
#clientDashboard .users-mini-card,
#clientDashboard .subaccount-row {
  border-color: rgba(247, 246, 242, 0.105);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    linear-gradient(180deg, #202529, #141819);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 18px 42px rgba(0, 0, 0, 0.28);
}

.panel::before,
.limit-card::before,
.users-mini-card::before,
.workspace-client-card::before,
.settings-block::before,
.subscription-action-panel::before,
.power-entry-row::before,
.telegram-login-card::before,
.account-choice-card::before,
.power-summary-grid article::before {
  display: none;
}

.system-status-card::before,
.diagnostic-log-summary-item::before,
.diagnostic-log-entry::before {
  height: 2px;
  opacity: 0.7;
}

.panel-header,
.modal-header,
.details-modal-panel .modal-header,
.create-client-panel .modal-header,
.auth-panel .modal-header,
.delete-client-panel .modal-header,
.diagnostic-logs-header {
  border-bottom-color: rgba(247, 246, 242, 0.095);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    linear-gradient(180deg, #22272a, #171b1d);
}

.client-settings-panel {
  border-color: rgba(247, 246, 242, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
    linear-gradient(180deg, #202529, #131719);
}

.extension-token-panel {
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.045), transparent 52%),
    linear-gradient(180deg, #202529, #141819);
}

.telegram-chip,
.user-chip,
#clientDashboard .telegram-chip,
#clientDashboard .user-chip {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(247, 246, 242, 0.16);
}

#clientDashboard .subaccount-row {
  border-color: rgba(247, 246, 242, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    #15191b;
}

.primary-button,
.settings-save-button.is-dirty,
.subscription-action-button,
.power-entry-actions .primary-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 24px rgba(213, 0, 0, 0.16);
}

.limit-progress__fill,
.usage-fill,
.users-cell-track i,
#clientDashboard .users-capacity i.is-filled {
  box-shadow: 0 0 12px rgba(241, 11, 8, 0.2);
}

.client-home-grid,
.settings-grid,
.table-wrap,
.backup-list,
.expense-list,
.super-admin-body,
.system-status-rows,
.power-entry-list,
.diagnostic-log-list,
.auth-actions,
.account-choice-panel,
.details-modal-content {
  background:
    linear-gradient(112deg, rgba(247, 246, 242, 0.018) 0 1px, transparent 1px 30px),
    #101314;
}

@media (max-width: 720px) {
  .workspace {
    background:
      linear-gradient(112deg, rgba(247, 246, 242, 0.024) 0 1px, transparent 1px 30px),
      linear-gradient(180deg, #171b1d, #101314 34%, #0d1011);
  }
}

/* CarAuto select polish */
.client-settings-panel,
.client-settings-panel .settings-grid,
.client-settings-panel .settings-block,
.calc-settings-column,
.rates-row,
.expenses-row,
.details-modal-panel .settings-block,
.details-modal-panel .settings-grid,
.details-modal-panel .client-fields-grid,
.details-modal-panel .rates-row,
.details-modal-panel .expenses-row {
  overflow: visible;
}

.custom-select {
  z-index: 1;
}

.custom-select.is-open {
  z-index: 80;
}

.custom-select.is-open .custom-select__trigger {
  border-color: rgba(255, 92, 80, 0.34);
  box-shadow:
    0 0 0 1px rgba(255, 92, 80, 0.11),
    0 0 18px rgba(153, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.custom-select__menu {
  z-index: 160;
  max-height: min(260px, 42vh);
  overflow-y: auto;
  border-color: rgba(255, 88, 78, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    linear-gradient(180deg, #1f2427, #111516);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.36),
    0 0 24px rgba(241, 11, 8, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  scrollbar-color: rgba(255, 88, 78, 0.42) rgba(16, 19, 20, 0.9);
}

.custom-select__option {
  color: rgba(247, 246, 242, 0.88);
  background: transparent;
}

.custom-select__option:hover {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(153, 0, 0, 0.22), rgba(153, 0, 0, 0.06) 58%, transparent);
}

.custom-select__option.is-selected,
.settings-block select option:checked,
.create-grid select option:checked,
.client-fields-grid select option:checked {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.025) 38%, rgba(0, 0, 0, 0.14)),
    linear-gradient(90deg, rgba(153, 0, 0, 0.74), rgba(72, 0, 0, 0.58));
  box-shadow:
    inset 3px 0 0 rgba(255, 92, 80, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 14px rgba(153, 0, 0, 0.12);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

.client-settings-panel .panel-actions .secondary-button,
.client-settings-panel .panel-actions .settings-save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.shell-access-pill {
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  align-items: baseline;
  column-gap: 7px;
  row-gap: 2px;
  min-width: 168px;
  padding: 6px 12px;
}

.shell-access-pill strong {
  color: rgba(247, 246, 242, 0.9);
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
}

.shell-access-pill small {
  display: block;
  grid-column: 1 / -1;
  justify-self: end;
  text-align: right;
  color: rgba(247, 246, 242, 0.56);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.05;
}

.info-tooltip {
  width: 22px;
  height: 22px;
  margin-top: 0;
  border-color: transparent;
  color: rgba(247, 246, 242, 0.72);
  background: transparent;
  box-shadow: none;
}

.info-tooltip:hover,
.info-tooltip:focus-visible {
  color: #ffffff;
  background: rgba(153, 0, 0, 0.1);
  box-shadow:
    inset 0 0 0 1px rgba(255, 92, 80, 0.16),
    0 0 18px rgba(153, 0, 0, 0.18);
}

.info-tooltip__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-tooltip__bubble {
  width: min(340px, 74vw);
  padding: 13px 14px;
  border-color: rgba(255, 92, 80, 0.24);
  color: rgba(247, 246, 242, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    linear-gradient(180deg, #202529, #121617);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(153, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
}

.info-tooltip__bubble::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(255, 92, 80, 0.2);
  border-bottom: 1px solid rgba(255, 92, 80, 0.2);
  background: #121617;
  transform: translateX(-50%) rotate(45deg);
}

.custom-select__trigger {
  align-items: center;
}

.custom-select__chevron {
  width: 15px;
  height: 15px;
  color: rgba(247, 246, 242, 0.62);
  stroke-width: 2.35;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3));
}

.custom-select__trigger:hover .custom-select__chevron,
.custom-select.is-open .custom-select__chevron {
  color: rgba(255, 255, 255, 0.96);
}

.subaccount-usage {
  gap: 7px;
}

.subaccount-usage div {
  gap: 1px;
}

.subaccount-row strong {
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
}

.subaccount-row small {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.05;
}

.subaccount-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  font-size: 0;
  line-height: 0;
}

.subaccount-remove__icon {
  display: block;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

#clientDashboard .subaccount-row strong {
  color: rgba(247, 246, 242, 0.9);
}

#clientDashboard .subaccount-row small {
  color: rgba(247, 246, 242, 0.58);
}

#clientDashboard .subaccount-remove {
  color: rgba(247, 246, 242, 0.62);
  border-color: rgba(247, 246, 242, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    #1a1e20;
}

#clientDashboard .subaccount-remove:hover {
  color: #ffffff;
  border-color: rgba(255, 92, 80, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 92, 80, 0.22), rgba(153, 0, 0, 0.18)),
    #1a1e20;
  box-shadow: 0 0 14px rgba(153, 0, 0, 0.16);
}

.rate-settings-block .settings-title {
  align-items: center;
  gap: 6px;
}

.client-settings-panel .subaccounts-head h3,
.client-settings-panel .settings-title h3,
.client-settings-panel .expense-card h3 {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.18;
}

.rate-settings-block .settings-title h3 {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.rate-settings-block .info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border-color: transparent;
  border-radius: 999px;
  color: rgba(247, 246, 242, 0.68);
  background: transparent;
  box-shadow: none;
  line-height: 0;
}

.rate-settings-block .info-tooltip:hover,
.rate-settings-block .info-tooltip:focus-visible {
  color: rgba(247, 246, 242, 0.96);
  background: transparent;
  box-shadow: none;
}

.rate-settings-block .info-tooltip__icon {
  display: block;
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

.rate-settings-block .info-tooltip:hover .info-tooltip__icon,
.rate-settings-block .info-tooltip:focus-visible .info-tooltip__icon {
  filter: drop-shadow(0 0 6px rgba(255, 92, 80, 0.24));
}

.rates-row .rate-settings-block:nth-child(2) .info-tooltip__bubble {
  left: auto;
  right: -8px;
  transform: translate(0, 6px);
}

.rates-row .rate-settings-block:nth-child(2) .info-tooltip:hover .info-tooltip__bubble,
.rates-row .rate-settings-block:nth-child(2) .info-tooltip:focus .info-tooltip__bubble,
.rates-row .rate-settings-block:nth-child(2) .info-tooltip:focus-visible .info-tooltip__bubble,
.rates-row .rate-settings-block:nth-child(2) .info-tooltip:focus-within .info-tooltip__bubble {
  transform: translate(0, 0);
}

.rates-row .rate-settings-block:nth-child(2) .info-tooltip__bubble::before {
  left: auto;
  right: 12px;
  transform: rotate(45deg);
}

@media (max-width: 760px) {
  .rate-settings-block .settings-title h3 {
    white-space: normal;
  }
}

/* Keep calculator settings readable inside resized panels. */
.client-settings-panel .settings-grid,
.details-modal-panel .settings-grid,
.calc-settings-column,
.rates-row,
.expenses-row,
.rate-settings-block,
.expense-card,
.rate-fields-slot,
.rate-fields,
.expense-row,
.settings-block label,
.custom-select,
.custom-select__trigger {
  min-width: 0;
  max-width: 100%;
}

.rates-row,
.expenses-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.rate-fields.two-col {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}

.rate-settings-block .settings-title {
  min-width: 0;
}

.rate-settings-block .settings-title h3 {
  white-space: normal;
  overflow-wrap: anywhere;
}

#clientDashboard .limit-progress {
  position: relative;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(247, 246, 242, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.28)),
    linear-gradient(180deg, #101314, #080a0b);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

#clientDashboard .limit-progress::after {
  content: "";
  position: absolute;
  inset: 2px;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 -1px 2px rgba(0, 0, 0, 0.55);
}

#clientDashboard .limit-progress__fill {
  z-index: 1;
  min-width: 4px;
  border-right: 1px solid rgba(255, 196, 188, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04) 42%, rgba(153, 0, 0, 0.2)),
    linear-gradient(90deg, #990000, #f10b08 72%, #ff8b7f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 14px rgba(241, 11, 8, 0.28);
}

.app-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 3000;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(247, 246, 242, 0.15);
  border-radius: 8px;
  color: rgba(247, 246, 242, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    linear-gradient(180deg, #202529, #121617);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 1;
  transform: translateY(0);
  animation: appToastIn 0.18s ease-out both;
}

.app-toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.app-toast__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #69e0a6;
  box-shadow: 0 0 0 4px rgba(105, 224, 166, 0.12), 0 0 14px rgba(105, 224, 166, 0.3);
}

.app-toast--error {
  border-color: rgba(255, 92, 80, 0.28);
}

.app-toast--error .app-toast__dot {
  background: #ff5c50;
  box-shadow: 0 0 0 4px rgba(255, 92, 80, 0.12), 0 0 14px rgba(241, 11, 8, 0.32);
}

.app-toast--warning .app-toast__dot {
  background: #ffb15f;
  box-shadow: 0 0 0 4px rgba(255, 177, 95, 0.12), 0 0 14px rgba(255, 177, 95, 0.26);
}

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

@media (max-width: 720px) {
  .app-toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

/* CarAuto super-admin lacquer alignment */
#adminDashboard {
  --admin-line: rgba(247, 246, 242, 0.105);
  --admin-line-soft: rgba(247, 246, 242, 0.075);
  --admin-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    linear-gradient(180deg, #202529, #141819);
  --admin-surface-flat: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.008)),
    #15191b;
  --admin-recess: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.26)),
    linear-gradient(180deg, #101314, #080a0b);
  --admin-red-gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04) 42%, rgba(153, 0, 0, 0.2)),
    linear-gradient(90deg, #990000, #f10b08 72%, #ff8b7f);
  gap: 16px;
  color: var(--retro-chrome);
}

#adminDashboard .metrics-grid,
#adminDashboard .system-status-overview,
#adminDashboard .power-summary-grid,
#adminDashboard .expense-summary-grid,
#adminDashboard .backup-summary-grid,
#adminDashboard .diagnostic-log-summary {
  gap: 12px;
}

#adminDashboard .panel,
#adminDashboard .metric-card,
#adminDashboard .system-status-card,
#adminDashboard .power-summary-grid article,
#adminDashboard .expense-summary-grid article,
#adminDashboard .backup-summary-grid article,
#adminDashboard .diagnostic-log-summary-item,
#adminDashboard .system-status-section,
#adminDashboard .power-section,
#adminDashboard .power-entry-row,
#adminDashboard .power-add-form,
#adminDashboard .power-list-toolbar,
#adminDashboard .power-entry-form,
#adminDashboard .power-entry-details,
#adminDashboard .super-admin-row,
#adminDashboard .platform-expense-row,
#adminDashboard .backup-row {
  border-color: var(--admin-line);
  background: var(--admin-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 18px 42px rgba(0, 0, 0, 0.28);
}

#adminDashboard .metric-card,
#adminDashboard .system-status-card,
#adminDashboard .power-summary-grid article,
#adminDashboard .expense-summary-grid article,
#adminDashboard .backup-summary-grid article,
#adminDashboard .diagnostic-log-summary-item,
#adminDashboard .system-status-section,
#adminDashboard .power-section {
  border-radius: 8px;
}

#adminDashboard .metric-card::before,
#adminDashboard .panel::before,
#adminDashboard .system-status-card::before,
#adminDashboard .power-section::before,
#adminDashboard .system-status-section::before,
#adminDashboard .system-settings-module::before,
#adminDashboard .power-summary-grid article::before,
#adminDashboard .expense-summary-grid article::before,
#adminDashboard .backup-summary-grid article::before,
#adminDashboard .diagnostic-log-summary-item::before,
#adminDashboard .diagnostic-log-entry::before {
  display: none;
}

#adminDashboard .panel-header,
#adminDashboard .diagnostic-logs-header,
#adminDashboard .system-settings-header,
#adminDashboard .system-status-section h3 {
  border-bottom-color: var(--admin-line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    linear-gradient(180deg, #22272a, #171b1d);
}

#adminDashboard .system-settings-page,
#adminDashboard .system-settings-shell {
  min-width: 0;
}

#adminDashboard .system-settings-header {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 14px 34px rgba(0, 0, 0, 0.22);
}

#adminDashboard .panel-header h2,
#adminDashboard .diagnostic-logs-header h2,
#adminDashboard .system-settings-header h2,
#adminDashboard .system-status-section h3,
#adminDashboard .backup-module-header h3,
#adminDashboard .super-admin-module-header h3 {
  color: #ffffff;
  font-family: var(--ui-font);
  letter-spacing: 0;
}

#adminDashboard .panel-header p,
#adminDashboard .diagnostic-logs-header p:last-child,
#adminDashboard .system-settings-header p,
#adminDashboard .metric-card__meta,
#adminDashboard .metric-card__trend p,
#adminDashboard .metric-card__split small,
#adminDashboard .system-status-card small,
#adminDashboard .system-status-card em,
#adminDashboard .power-summary-grid small,
#adminDashboard .backup-row span,
#adminDashboard .backup-list-toolbar > span,
#adminDashboard .expense-panel-footer span,
#adminDashboard .super-admin-row span,
#adminDashboard .super-admin-footer span,
#adminDashboard .power-list-range {
  color: rgba(247, 246, 242, 0.66);
}

#adminDashboard .metric-card,
#adminDashboard .system-status-card {
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.035), transparent 52%),
    var(--admin-surface);
}

#adminDashboard .metric-card:hover,
#adminDashboard .system-status-card:hover,
#adminDashboard .power-summary-grid article:hover,
#adminDashboard .expense-summary-grid article:hover,
#adminDashboard .backup-summary-grid article:hover,
#adminDashboard .power-entry-row:hover,
#adminDashboard .super-admin-row:hover,
#adminDashboard .platform-expense-row:hover,
#adminDashboard .backup-row:hover {
  border-color: rgba(247, 246, 242, 0.17);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.055), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
    linear-gradient(180deg, #22272a, #15191b);
}

#adminDashboard .metric-card strong,
#adminDashboard .metric-card__line strong,
#adminDashboard .system-status-card strong,
#adminDashboard .power-summary-grid strong,
#adminDashboard .expense-summary-grid strong,
#adminDashboard .backup-summary-grid strong,
#adminDashboard .diagnostic-log-summary-item strong,
#adminDashboard .client-name strong,
#adminDashboard .client-payment-cell strong,
#adminDashboard .access-date-cell strong,
#adminDashboard .users-cell strong,
#adminDashboard .usage-cell strong {
  color: #ffffff;
  font-family: var(--ui-font);
  font-weight: 780;
}

#adminDashboard .metric-card span,
#adminDashboard .power-summary-grid span,
#adminDashboard .expense-summary-grid span,
#adminDashboard .backup-summary-grid span,
#adminDashboard .diagnostic-log-summary-item span,
#adminDashboard .system-status-card__label,
#adminDashboard th {
  color: rgba(247, 246, 242, 0.7);
}

#adminDashboard .metric-card__trend.is-up,
#adminDashboard .metric-card__trend.is-down,
#adminDashboard .metric-card__trend.is-flat {
  --spark-rgb: 255, 92, 80;
  --spark-line: rgba(255, 139, 127, 0.92);
}

#adminDashboard .metric-card__trend.is-up p,
#adminDashboard .metric-card__trend.is-up b,
#adminDashboard .metric-card__trend.is-down p,
#adminDashboard .metric-card__trend.is-down b,
#adminDashboard .metric-card__trend.is-flat p,
#adminDashboard .metric-card__trend.is-flat b {
  color: rgba(247, 246, 242, 0.74);
}

#adminDashboard .metric-card__trend {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(247, 246, 242, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.006)),
    #101314;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

#adminDashboard .metric-card__trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

#adminDashboard .metric-card__trend-label {
  min-width: 0;
  overflow: hidden;
  color: rgba(247, 246, 242, 0.62);
  font-size: 10.5px;
  font-weight: 780;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

#adminDashboard .metric-card__trend b {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 92, 80, 0.22);
  border-radius: 7px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02)),
    rgba(241, 11, 8, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  text-align: center;
}

#adminDashboard .metric-card__trend-meter {
  position: relative;
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(247, 246, 242, 0.1);
  border-radius: 999px;
  background: var(--admin-recess);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.76),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
}

#adminDashboard .metric-card__trend-meter i {
  display: block;
  width: var(--trend-strength, 8%);
  min-width: 10px;
  height: 100%;
  border-radius: inherit;
  background: var(--admin-red-gloss);
  box-shadow: 0 0 12px rgba(241, 11, 8, 0.22);
}

#adminDashboard .metric-card__trend.is-flat .metric-card__trend-meter i {
  opacity: 0.42;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02)),
    linear-gradient(90deg, #3a4144, #6d7476);
  box-shadow: none;
}

#adminDashboard .metric-card__trend p {
  margin: 0;
  color: rgba(247, 246, 242, 0.58);
  font-size: 11px;
  font-weight: 620;
  line-height: 1.1;
  white-space: nowrap;
}

#adminDashboard .metric-card__sparkline {
  border: 1px solid rgba(247, 246, 242, 0.07);
  background:
    radial-gradient(circle at 74% 22%, rgba(255, 92, 80, 0.11), transparent 35%),
    var(--admin-recess);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.64),
    inset 0 -1px 0 rgba(255, 255, 255, 0.045);
}

#adminDashboard .metric-status-track,
#adminDashboard .usage-track,
#adminDashboard .users-cell-track,
#adminDashboard .system-status-meter {
  border: 1px solid rgba(247, 246, 242, 0.12);
  background: var(--admin-recess);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.76),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
}

#adminDashboard .metric-status-track__active,
#adminDashboard .metric-status-track__risk,
#adminDashboard .usage-fill,
#adminDashboard .usage-fill.is-warning,
#adminDashboard .usage-fill.is-danger,
#adminDashboard .users-cell-track i,
#adminDashboard .users-cell.is-full .users-cell-track i,
#adminDashboard .system-status-meter span,
#adminDashboard .system-status-card.is-ok .system-status-meter span,
#adminDashboard .system-status-card.is-warning .system-status-meter span,
#adminDashboard .system-status-card.is-danger .system-status-meter span {
  background: var(--admin-red-gloss);
  box-shadow: 0 0 12px rgba(241, 11, 8, 0.2);
}

#adminDashboard .system-status-card.is-ok,
#adminDashboard .system-status-card.is-warning,
#adminDashboard .system-status-card.is-danger {
  border-color: var(--admin-line);
}

#adminDashboard .system-status-card__badge,
#adminDashboard .telegram-chip,
#adminDashboard .user-chip,
#adminDashboard .power-entry-status,
#adminDashboard .status-badge,
#adminDashboard .segmented-control {
  color: rgba(247, 246, 242, 0.9);
  border-color: rgba(247, 246, 242, 0.14);
  background: rgba(255, 255, 255, 0.055);
}

#adminDashboard .segmented-control button {
  color: rgba(247, 246, 242, 0.72);
  background: transparent;
}

#adminDashboard .segmented-control button.is-selected,
#adminDashboard .segmented-control button:hover {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(180deg, var(--retro-red), var(--retro-deep-red));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px rgba(213, 0, 0, 0.16);
}

#adminDashboard .system-status-card.is-ok .system-status-card__label i,
#adminDashboard .system-status-card.is-warning .system-status-card__label i,
#adminDashboard .system-status-card.is-danger .system-status-card__label i,
#adminDashboard .system-status-pill.is-ok,
#adminDashboard .system-status-pill.is-warning,
#adminDashboard .system-status-pill.is-danger {
  background: #ff5c50;
  box-shadow: 0 0 0 3px rgba(255, 92, 80, 0.12), 0 0 12px rgba(241, 11, 8, 0.22);
}

#adminDashboard .system-status-card.is-ok .system-status-card__badge,
#adminDashboard .access-date-cell span.is-ok,
#adminDashboard .status-badge.active {
  color: rgba(247, 246, 242, 0.88);
  border-color: rgba(105, 224, 166, 0.14);
  background: rgba(105, 224, 166, 0.055);
}

#adminDashboard .system-status-card.is-warning .system-status-card__badge,
#adminDashboard .system-status-card.is-danger .system-status-card__badge,
#adminDashboard .access-date-cell span.is-warning,
#adminDashboard .status-badge.limit,
#adminDashboard .status-badge.paused,
#adminDashboard .status-badge.stopped {
  color: #ffb7b0;
  border-color: rgba(255, 92, 80, 0.2);
  background: rgba(241, 11, 8, 0.075);
}

#adminDashboard .system-status-body,
#adminDashboard .power-sections,
#adminDashboard .system-status-rows,
#adminDashboard .power-entry-list,
#adminDashboard .expense-list,
#adminDashboard .backup-list,
#adminDashboard .super-admin-body,
#adminDashboard .diagnostic-log-list,
#adminDashboard .clients-panel .table-wrap {
  background:
    linear-gradient(112deg, rgba(247, 246, 242, 0.018) 0 1px, transparent 1px 30px),
    #101314;
}

#adminDashboard th {
  border-bottom-color: var(--admin-line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    #15191b;
  font-weight: 720;
}

#adminDashboard td {
  border-bottom-color: rgba(247, 246, 242, 0.06);
}

#adminDashboard tbody tr,
#adminDashboard tbody tr:nth-child(even) {
  color: var(--retro-chrome);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.006)),
    #15191b;
}

#adminDashboard tbody tr:hover,
#adminDashboard tbody tr.is-selected {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.09), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    #191e20;
  box-shadow: inset 3px 0 0 rgba(241, 11, 8, 0.68);
}

#adminDashboard .client-name span,
#adminDashboard .muted-cell,
#adminDashboard .client-payment-cell span,
#adminDashboard .access-date-cell span,
#adminDashboard .users-cell span,
#adminDashboard .users-cell small,
#adminDashboard .usage-cell span {
  color: rgba(247, 246, 242, 0.62);
}

#adminDashboard input,
#adminDashboard select,
#adminDashboard textarea,
#adminDashboard .custom-select__trigger,
#adminDashboard .power-add-form input,
#adminDashboard .power-entry-form input,
#adminDashboard .platform-expense-row input,
#adminDashboard .super-admin-add-row input {
  color: #ffffff;
  border-color: rgba(247, 246, 242, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    #101314;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.38),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

#adminDashboard input:hover,
#adminDashboard select:hover,
#adminDashboard textarea:hover,
#adminDashboard .custom-select__trigger:hover {
  border-color: rgba(247, 246, 242, 0.22);
}

#adminDashboard input:focus,
#adminDashboard select:focus,
#adminDashboard textarea:focus,
#adminDashboard .custom-select.is-open .custom-select__trigger {
  border-color: rgba(255, 92, 80, 0.48);
  box-shadow:
    0 0 0 3px rgba(241, 11, 8, 0.12),
    inset 0 1px 2px rgba(0, 0, 0, 0.38);
  outline: none;
}

#adminDashboard .expense-list-header,
#adminDashboard .backup-list-toolbar,
#adminDashboard .super-admin-footer,
#adminDashboard .expense-panel-footer {
  border-color: rgba(247, 246, 242, 0.075);
}

#adminDashboard .expense-list-header span,
#adminDashboard .backup-list-toolbar > span {
  color: rgba(247, 246, 242, 0.6);
}

#adminDashboard .client-delete-button,
#adminDashboard .platform-expense-remove {
  position: relative;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 7px;
  color: rgba(247, 246, 242, 0.68);
  font-size: 0;
  line-height: 0;
}

#adminDashboard .client-delete-button::before,
#adminDashboard .client-delete-button::after,
#adminDashboard .platform-expense-remove::before,
#adminDashboard .platform-expense-remove::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

#adminDashboard .client-delete-button::after,
#adminDashboard .platform-expense-remove::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#adminDashboard .client-delete-button:hover,
#adminDashboard .platform-expense-remove:hover {
  color: #ffffff;
  border-color: rgba(255, 92, 80, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 92, 80, 0.2), rgba(153, 0, 0, 0.16)),
    #1a1e20;
}

#adminDashboard .power-entry-row,
#adminDashboard .backup-row,
#adminDashboard .super-admin-row,
#adminDashboard .platform-expense-row {
  border-bottom-color: var(--admin-line-soft);
}

#adminDashboard .power-toast {
  color: rgba(247, 246, 242, 0.94);
  border-color: rgba(247, 246, 242, 0.14);
  background:
    linear-gradient(90deg, rgba(241, 11, 8, 0.08), transparent 44%),
    linear-gradient(180deg, #202529, #141819);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 18px 42px rgba(0, 0, 0, 0.34);
}

@media (max-width: 720px) {
  #adminDashboard .panel-header,
  #adminDashboard .diagnostic-logs-header,
  #adminDashboard .system-settings-header {
    align-items: stretch;
  }
}

/* Semantic admin dashboard pass */
#adminDashboard {
  --admin-ok: #46d98c;
  --admin-ok-soft: rgba(70, 217, 140, 0.13);
  --admin-ok-line: rgba(70, 217, 140, 0.34);
  --admin-warning: #f2bd4b;
  --admin-warning-soft: rgba(242, 189, 75, 0.14);
  --admin-warning-line: rgba(242, 189, 75, 0.36);
  --admin-danger: #ff5c50;
  --admin-danger-soft: rgba(255, 92, 80, 0.14);
  --admin-danger-line: rgba(255, 92, 80, 0.38);
  --admin-info: #7db7ff;
  --admin-info-soft: rgba(125, 183, 255, 0.13);
  --admin-info-line: rgba(125, 183, 255, 0.32);
  --admin-neutral: #d8ddd8;
  --admin-neutral-soft: rgba(247, 246, 242, 0.075);
  --admin-card: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.014)),
    linear-gradient(180deg, #22282a, #15191a);
  --admin-card-quiet: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.008)),
    #15191a;
  --admin-meter-ok: linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 52%),
    linear-gradient(90deg, #1f9a63, var(--admin-ok));
  --admin-meter-warning: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 52%),
    linear-gradient(90deg, #c78319, var(--admin-warning));
  --admin-meter-danger: linear-gradient(180deg, rgba(255, 255, 255, 0.27), transparent 52%),
    linear-gradient(90deg, #b51c1c, var(--admin-danger));
  --admin-meter-info: linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 52%),
    linear-gradient(90deg, #376fb4, var(--admin-info));
}

#adminDashboard .panel,
#adminDashboard .metric-card,
#adminDashboard .system-status-card,
#adminDashboard .power-summary-grid article,
#adminDashboard .expense-summary-grid article,
#adminDashboard .backup-summary-grid article,
#adminDashboard .diagnostic-log-summary-item,
#adminDashboard .system-status-section,
#adminDashboard .power-section,
#adminDashboard .power-entry-row,
#adminDashboard .power-add-form,
#adminDashboard .power-list-toolbar,
#adminDashboard .power-entry-form,
#adminDashboard .power-entry-details,
#adminDashboard .super-admin-row,
#adminDashboard .platform-expense-row,
#adminDashboard .backup-row {
  border-color: rgba(247, 246, 242, 0.12);
  background: var(--admin-card);
}

#adminDashboard .metric-card,
#adminDashboard .system-status-card {
  background:
    radial-gradient(circle at 94% 12%, var(--metric-glow, transparent), transparent 34%),
    var(--admin-card);
}

#adminDashboard .metric-card::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 13px;
  left: 14px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--metric-line, rgba(247, 246, 242, 0.16)), transparent);
  opacity: 0.7;
}

#adminDashboard .metric-card--requests {
  --metric-color: var(--admin-info);
  --metric-line: var(--admin-info-line);
  --metric-glow: rgba(125, 183, 255, 0.14);
}

#adminDashboard .metric-card--companies {
  --metric-color: var(--admin-warning);
  --metric-line: var(--admin-warning-line);
  --metric-glow: rgba(242, 189, 75, 0.12);
}

#adminDashboard .metric-card--users {
  --metric-color: #61d9cf;
  --metric-line: rgba(97, 217, 207, 0.34);
  --metric-glow: rgba(97, 217, 207, 0.12);
}

#adminDashboard .metric-card--revenue {
  --metric-color: var(--admin-ok);
  --metric-line: var(--admin-ok-line);
  --metric-glow: rgba(70, 217, 140, 0.12);
}

#adminDashboard .metric-card--revenue.is-negative {
  --metric-color: var(--admin-danger);
  --metric-line: var(--admin-danger-line);
  --metric-glow: rgba(255, 92, 80, 0.13);
}

#adminDashboard .metric-card:hover,
#adminDashboard .system-status-card:hover,
#adminDashboard .power-summary-grid article:hover,
#adminDashboard .expense-summary-grid article:hover,
#adminDashboard .backup-summary-grid article:hover,
#adminDashboard .power-entry-row:hover,
#adminDashboard .super-admin-row:hover,
#adminDashboard .platform-expense-row:hover,
#adminDashboard .backup-row:hover {
  border-color: rgba(247, 246, 242, 0.2);
  background:
    radial-gradient(circle at 94% 12%, var(--metric-glow, rgba(247, 246, 242, 0.055)), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.014)),
    linear-gradient(180deg, #242a2d, #15191b);
}

#adminDashboard .metric-card > span {
  color: rgba(247, 246, 242, 0.72);
}

#adminDashboard .metric-card__value strong,
#adminDashboard .metric-card__line strong {
  color: #ffffff;
}

#adminDashboard .metric-card__value small,
#adminDashboard .metric-card__meta {
  color: rgba(247, 246, 242, 0.64);
}

#adminDashboard .metric-card__trend {
  border-color: rgba(247, 246, 242, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.004)),
    #101314;
}

#adminDashboard .metric-card__trend.is-up {
  --trend-color: var(--admin-ok);
  --trend-line: var(--admin-ok-line);
  --trend-fill: var(--admin-meter-ok);
}

#adminDashboard .metric-card__trend.is-down {
  --trend-color: var(--admin-danger);
  --trend-line: var(--admin-danger-line);
  --trend-fill: var(--admin-meter-danger);
}

#adminDashboard .metric-card__trend.is-flat {
  --trend-color: var(--admin-neutral);
  --trend-line: rgba(247, 246, 242, 0.2);
  --trend-fill: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
    linear-gradient(90deg, #4b5355, #858b8b);
}

#adminDashboard .metric-card__trend p,
#adminDashboard .metric-card__trend-label {
  color: rgba(247, 246, 242, 0.62);
}

#adminDashboard .metric-card__trend b {
  color: #101314;
  border-color: var(--trend-line);
  background: var(--trend-color);
  box-shadow: 0 0 14px color-mix(in srgb, var(--trend-color) 25%, transparent);
}

#adminDashboard .metric-card__trend-meter i {
  background: var(--trend-fill);
  box-shadow: 0 0 12px color-mix(in srgb, var(--trend-color) 28%, transparent);
}

#adminDashboard .metric-status-track__active,
#adminDashboard .usage-fill,
#adminDashboard .users-cell-track i,
#adminDashboard .system-status-meter span {
  background: var(--admin-meter-ok);
  box-shadow: 0 0 12px rgba(70, 217, 140, 0.22);
}

#adminDashboard .metric-status-track__risk,
#adminDashboard .usage-fill.is-danger,
#adminDashboard .users-cell.is-full .users-cell-track i,
#adminDashboard .system-status-card.is-danger .system-status-meter span {
  background: var(--admin-meter-danger);
  box-shadow: 0 0 12px rgba(255, 92, 80, 0.24);
}

#adminDashboard .usage-fill.is-warning,
#adminDashboard .system-status-card.is-warning .system-status-meter span {
  background: var(--admin-meter-warning);
  box-shadow: 0 0 12px rgba(242, 189, 75, 0.22);
}

#adminDashboard .usage-cell strong,
#adminDashboard .users-cell strong,
#adminDashboard .access-date-cell span.is-ok,
#adminDashboard .status-badge.active {
  color: var(--admin-ok);
}

#adminDashboard .usage-cell strong.is-warning,
#adminDashboard .access-date-cell span.is-warning,
#adminDashboard .status-badge.paused {
  color: var(--admin-warning);
}

#adminDashboard .usage-cell strong.is-danger,
#adminDashboard .users-cell.is-full strong,
#adminDashboard .users-cell.is-full span,
#adminDashboard .access-date-cell span.is-danger,
#adminDashboard .status-badge.limit,
#adminDashboard .status-badge.stopped {
  color: var(--admin-danger);
}

#adminDashboard .status-badge,
#adminDashboard .client-status-pill,
#adminDashboard .system-status-card__badge,
#adminDashboard .power-entry-status {
  border-color: rgba(247, 246, 242, 0.14);
  background: rgba(255, 255, 255, 0.052);
}

#adminDashboard .status-badge.active::before,
#adminDashboard .client-status-pill.active span,
#adminDashboard .system-status-card.is-ok .system-status-card__label i,
#adminDashboard .system-status-pill.is-ok,
#adminDashboard .power-status-dot.is-ok {
  background: var(--admin-ok);
  box-shadow: 0 0 0 4px rgba(70, 217, 140, 0.12), 0 0 16px rgba(70, 217, 140, 0.34);
}

#adminDashboard .status-badge.paused::before,
#adminDashboard .system-status-card.is-warning .system-status-card__label i,
#adminDashboard .system-status-pill.is-warning,
#adminDashboard .power-status-dot.is-warning {
  background: var(--admin-warning);
  box-shadow: 0 0 0 4px rgba(242, 189, 75, 0.13), 0 0 16px rgba(242, 189, 75, 0.28);
}

#adminDashboard .status-badge.limit::before,
#adminDashboard .status-badge.stopped::before,
#adminDashboard .system-status-card.is-danger .system-status-card__label i,
#adminDashboard .system-status-pill.is-danger {
  background: var(--admin-danger);
  box-shadow: 0 0 0 4px rgba(255, 92, 80, 0.12), 0 0 16px rgba(255, 92, 80, 0.32);
}

#adminDashboard .system-status-card.is-ok .system-status-card__badge {
  color: var(--admin-ok);
  border-color: var(--admin-ok-line);
  background: var(--admin-ok-soft);
}

#adminDashboard .system-status-card.is-warning .system-status-card__badge {
  color: var(--admin-warning);
  border-color: var(--admin-warning-line);
  background: var(--admin-warning-soft);
}

#adminDashboard .system-status-card.is-danger .system-status-card__badge {
  color: var(--admin-danger);
  border-color: var(--admin-danger-line);
  background: var(--admin-danger-soft);
}

#adminDashboard .system-status-card.is-ok {
  border-color: rgba(70, 217, 140, 0.18);
}

#adminDashboard .system-status-card.is-warning {
  border-color: rgba(242, 189, 75, 0.2);
}

#adminDashboard .system-status-card.is-danger {
  border-color: rgba(255, 92, 80, 0.22);
}

#adminDashboard .telegram-chip,
#adminDashboard .user-chip {
  color: rgba(247, 246, 242, 0.9);
  border-color: rgba(125, 183, 255, 0.22);
  background: rgba(125, 183, 255, 0.08);
}

#adminDashboard .segmented-control {
  border-color: rgba(247, 246, 242, 0.13);
  background: rgba(255, 255, 255, 0.045);
}

#adminDashboard .segmented-control button {
  color: rgba(247, 246, 242, 0.72);
}

#adminDashboard .segmented-control button:hover {
  color: #ffffff;
  background: rgba(247, 246, 242, 0.08);
  box-shadow: none;
}

#adminDashboard .segmented-control button.is-selected {
  color: #101314;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.18)),
    var(--admin-warning);
  box-shadow: 0 8px 18px rgba(242, 189, 75, 0.14);
}

#adminDashboard .primary-button,
#adminDashboard .settings-save-button.is-dirty {
  color: #ffffff;
  border-color: rgba(255, 92, 80, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04) 46%, rgba(153, 0, 0, 0.18)),
    linear-gradient(180deg, #ff332b, #c40000 58%, #820000);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 12px 26px rgba(213, 0, 0, 0.24);
}

#adminDashboard .primary-button:hover,
#adminDashboard .settings-save-button.is-dirty:hover {
  border-color: rgba(255, 139, 127, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.06) 48%, rgba(153, 0, 0, 0.2)),
    linear-gradient(180deg, #ff4a3f, #d60000 58%, #920000);
}

#adminDashboard .secondary-button:hover,
#adminDashboard .settings-save-button:hover,
#adminDashboard .icon-button:hover,
#adminDashboard .close-button:hover,
#adminDashboard .power-pagination button:hover:not(:disabled),
#adminDashboard .power-pagination button.is-active,
#adminDashboard .diagnostic-log-pagination button:hover:not(:disabled),
#adminDashboard .diagnostic-log-pagination button.is-active {
  color: #101314;
  border-color: var(--admin-warning-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.12)),
    var(--admin-warning);
  box-shadow: 0 8px 18px rgba(242, 189, 75, 0.13);
}

#adminDashboard .danger-button,
#adminDashboard .client-delete-button:hover,
#adminDashboard .platform-expense-remove:hover {
  color: #ffffff;
  border-color: var(--admin-danger-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02)),
    rgba(255, 92, 80, 0.18);
}

#adminDashboard tbody tr:hover,
#adminDashboard tbody tr.is-selected {
  background:
    linear-gradient(90deg, rgba(242, 189, 75, 0.075), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    #191e20;
  box-shadow: inset 3px 0 0 rgba(242, 189, 75, 0.72);
}

#adminDashboard .clients-panel tbody tr:hover,
#adminDashboard .clients-panel tbody tr.is-selected {
  background:
    linear-gradient(90deg, rgba(242, 189, 75, 0.085), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    #191e20;
  box-shadow: inset 3px 0 0 rgba(242, 189, 75, 0.78);
}

#adminDashboard .clients-panel .status-badge.active {
  color: var(--admin-ok);
}

#adminDashboard .clients-panel .status-badge.limit,
#adminDashboard .clients-panel .status-badge.stopped {
  color: var(--admin-danger);
}

#adminDashboard .clients-panel .status-badge.paused {
  color: var(--admin-warning);
}

.app-shell:has(#adminDashboard:not(.is-hidden)) .nav-list {
  border-color: rgba(247, 246, 242, 0.12);
  background: rgba(255, 255, 255, 0.045);
}

.app-shell:has(#adminDashboard:not(.is-hidden)) .nav-item {
  color: rgba(247, 246, 242, 0.72);
  border-color: rgba(247, 246, 242, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012)),
    #171b1d;
}

.app-shell:has(#adminDashboard:not(.is-hidden)) .nav-item:hover {
  color: #ffffff;
  border-color: rgba(242, 189, 75, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.018)),
    #202529;
}

.app-shell:has(#adminDashboard:not(.is-hidden)) .nav-item.is-active {
  color: #101314;
  border-color: rgba(242, 189, 75, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.16)),
    #f2bd4b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 18px rgba(242, 189, 75, 0.14);
}
