:root {
  color-scheme: dark;
  --bg: #090a0f;
  --surface: #101218;
  --surface-2: #151821;
  --surface-3: #1b1f2a;
  --line: #252a36;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f5f7fb;
  --text-soft: #c7cede;
  --muted: #858da3;
  --blue: #6d7df2;
  --blue-soft: rgba(109, 125, 242, 0.14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.13);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.13);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.13);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  font-family: var(--font, Montserrat), Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.btn,
.ghost-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  min-height: 40px;
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.btn {
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(74, 90, 220, 0.24);
}

.btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.btn--wide {
  width: 100%;
}

.ghost-btn {
  background: var(--surface-2);
  border-color: var(--line);
}

.icon-btn {
  width: 40px;
  padding: 0;
  background: var(--surface-2);
  border-color: var(--line);
}

.btn svg,
.ghost-btn svg,
.icon-btn svg,
.nav-item svg,
.status-icon svg,
.code-action svg {
  width: 18px;
  height: 18px;
}

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

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: #86efac;
  font-size: 13px;
  font-weight: 750;
}

.message[data-bad="true"] {
  color: #fca5a5;
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
}

.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-intro,
.auth-card {
  padding: clamp(28px, 5vw, 52px);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 44px;
  border-right: 1px solid var(--line);
  background: #0d0f15;
}

.auth-intro h1,
.page-title h1 {
  margin: 0;
  font-size: clamp(30px, 4.3vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.auth-intro p,
.page-title p,
.card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.kicker,
.eyebrow {
  display: inline-flex;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-copy {
  display: grid;
  gap: 18px;
  max-width: 620px;
}

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

.proof-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.proof-item b {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.proof-item span {
  color: var(--muted);
  font-size: 12px;
}

.auth-card {
  background: var(--surface);
}

.auth-card .btn {
  margin-top: 4px;
}

.auth-card__head {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-copy__hint {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(124, 92, 255, 0.08);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.auth-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.auth-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.auth-steps li::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}

.auth-steps li:last-child::after {
  display: none;
}

.auth-steps li span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0c0e14;
  color: var(--muted);
  font-size: 12px;
}

.auth-steps li.is-active {
  color: var(--text);
}

.auth-steps li.is-active span {
  border-color: transparent;
  background: linear-gradient(135deg, #7c5cff, #4f46e5);
  color: #fff;
}

.link-btn {
  margin-top: -2px;
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
  justify-self: start;
}

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

.auth-card__head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0e14;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(109, 125, 242, 0.8);
  box-shadow: 0 0 0 4px rgba(109, 125, 242, 0.13);
}

/* App shell */
.app-body {
  --sidebar-w: 264px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: var(--bg);
  transition: grid-template-columns 0.2s ease;
}

.app-body.sidebar-collapsed {
  --sidebar-w: 76px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #0b0d12;
  overflow: hidden;
}

.sidebar-collapsed .nav-item__label,
.sidebar-collapsed .brand__text,
.sidebar-collapsed .endpoint-card {
  display: none;
}

.sidebar-collapsed .sidebar__brand {
  justify-content: center;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  position: relative;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.sidebar-collapsed .nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
}

.sidebar__brand {
  padding: 6px 6px 20px;
}

.sidebar__nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar__foot {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.endpoint-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.endpoint-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.endpoint-card code {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  color: var(--text-soft);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 10, 15, 0.88);
  backdrop-filter: blur(14px);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.status-dot[data-level="warn"] {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.status-dot[data-level="down"] {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.topbar__toggle {
  flex: none;
}

.topbar__title {
  min-width: 0;
}

.topbar-switcher {
  margin-left: 8px;
  display: inline-flex;
}

.topbar-switcher select {
  min-height: 36px;
  max-width: 220px;
}

.topbar__title strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__title span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.topbar__actions {
  display: inline-flex;
  gap: 10px;
}

.content {
  width: min(1220px, calc(100% - 48px));
  margin-inline: auto;
  padding: 32px 0 56px;
}

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

.page-title > div {
  display: grid;
  gap: 12px;
}

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

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.stat strong {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  font-size: clamp(17px, 1.6vw, 22px);
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  gap: 18px;
}

.card,
.feed-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card {
  padding: 20px;
}

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

.card__head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.project-id {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0e14;
}

.project-id code {
  overflow: hidden;
  color: var(--text-soft);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-id code::selection,
.code-row code::selection,
.endpoint-card code::selection {
  background: rgba(109, 125, 242, 0.35);
}

.code-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.code-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #0c0e14;
}

.code-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.code-row code {
  overflow: hidden;
  color: var(--text-soft);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}

.publish-form {
  display: grid;
  gap: 14px;
}

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

.feed-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.feed-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.notices {
  display: grid;
}

.notice {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 120px;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.notice:last-child {
  border-bottom: 0;
}

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

.notice h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.notice b {
  color: var(--text);
}

.notice p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.badge--resolved {
  background: var(--green-soft);
  color: #86efac;
}

.badge--investigating {
  background: var(--amber-soft);
  color: #fbbf24;
}

.badge--update,
.badge--info {
  background: var(--blue-soft);
  color: #aab5ff;
}

.badge--detected {
  background: rgba(167, 139, 250, 0.16);
  color: #c4b5fd;
}

.badge--fixing {
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
}

.badge--monitoring {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.badge--impact-informational {
  background: var(--blue-soft);
  color: #aab5ff;
}

.badge--impact-minor {
  background: rgba(234, 179, 8, 0.16);
  color: #fde047;
}

.badge--impact-major {
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
}

.badge--impact-critical {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.feed-head__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.form-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(109, 125, 242, 0.08);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.notice--incident {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.notice--incident .notice__main {
  display: grid;
  gap: 16px;
}

.notice--incident .notice__actions {
  display: flex;
}

.incident-head h3 {
  margin: 10px 0 8px;
  font-size: 18px;
}

.incident-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.incident-timeline {
  display: grid;
  gap: 0;
  padding-left: 4px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 14px;
  position: relative;
  padding-bottom: 18px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
}

.timeline-item.is-current .timeline-dot {
  border-color: #ef4444;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.timeline-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.timeline-top strong {
  font-size: 14px;
}

.timeline-top time,
.timeline-body p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.timeline-body p {
  margin: 0;
}

.empty-feed {
  padding: 30px 20px;
  color: var(--muted);
}

/* Admin badge */
.role-badge {
  align-self: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(109, 125, 242, 0.4);
  background: var(--blue-soft);
  color: #aab5ff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Project switcher (admin) */
.project-switcher {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
}

.project-switcher > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Inline action buttons in admin lists */
.notice__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.ghost-btn--sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.ghost-btn--danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.notices--inset {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

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

/* Password field with visibility toggle */
.field-password {
  position: relative;
}

.field-password input {
  padding-right: 46px;
}

.field-password__toggle {
  position: absolute;
  right: 8px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.field-password__toggle:hover {
  color: var(--text);
}

.field-password__toggle svg {
  width: 18px;
  height: 18px;
}

/* ───────── Views & overview ───────── */
.view:not(.is-active) {
  display: none;
}

.page-title--row {
  align-items: center;
}

.page-title__actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.view-lead {
  margin: -8px 0 20px;
  color: var(--text-soft);
  max-width: 720px;
}

.btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* Status banner */
.status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.status-banner[data-level="ok"] {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.1), transparent 70%), var(--surface);
}

.status-banner[data-level="warn"] {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), transparent 70%), var(--surface);
}

.status-banner[data-level="down"] {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), transparent 70%), var(--surface);
}

.status-banner__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
}

.status-banner__icon svg {
  width: 24px;
  height: 24px;
}

.status-banner[data-level="ok"] .status-banner__icon {
  background: var(--green-soft);
  color: #86efac;
}

.status-banner[data-level="warn"] .status-banner__icon {
  background: var(--amber-soft);
  color: #fbbf24;
}

.status-banner[data-level="down"] .status-banner__icon {
  background: var(--red-soft);
  color: #fca5a5;
}

.status-banner__text {
  min-width: 0;
}

.status-banner__text strong {
  display: block;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.status-banner__text span {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 13px;
}

/* KPI strip */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.kpi__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.kpi__value {
  display: block;
  margin-top: 10px;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi__value--sm {
  font-size: 15px;
  font-weight: 750;
}

.kpi__value[data-level="ok"] { color: #86efac; }
.kpi__value[data-level="warn"] { color: #fbbf24; }
.kpi__value[data-level="down"] { color: #fca5a5; }

.kpi__hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.project-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

/* Quick actions */
.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.quick-action:hover {
  border-color: rgba(109, 125, 242, 0.5);
  transform: translateY(-1px);
}

.quick-action__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
}

.quick-action__icon svg {
  width: 20px;
  height: 20px;
}

.quick-action__icon--incident {
  color: #fca5a5;
  background: var(--red-soft);
}

.quick-action__icon--whats {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.16);
}

.quick-action strong {
  display: block;
  font-size: 14px;
}

.quick-action small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* Mini notice (overview preview) */
.mini-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.mini-notice:last-child {
  border-bottom: 0;
}

.mini-notice__badge {
  flex: none;
}

.mini-notice__body {
  min-width: 0;
}

.mini-notice__body strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-notice__body span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.snippet-details {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.snippet-details summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.snippet-details[open] summary {
  margin-bottom: 12px;
}

.inline-form--stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

body.modal-open {
  overflow: hidden;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.66);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.modal__head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal__head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.modal .publish-form {
  padding: 20px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* Field / uploader / tariffs */
.card-lead {
  margin: -8px 0 18px;
  color: var(--text-soft);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

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

.field__label {
  font-size: 13px;
  font-weight: 700;
}

.field__hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.banner-uploader {
  display: grid;
  gap: 12px;
}

.banner-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 2;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background-color: #0c0e14;
  background-size: cover;
  background-position: center;
  color: var(--muted);
  font-size: 12px;
}

.banner-preview--sm {
  aspect-ratio: 16 / 9;
  max-width: 280px;
}

.banner-uploader__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tg-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0e14;
  overflow: hidden;
}

.tg-input span {
  padding: 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.tg-input input {
  border: none;
  background: transparent;
  border-radius: 0;
  padding-left: 0;
}

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

.tariff-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.tariff-row input {
  min-height: 40px;
}

.tariff-del {
  min-height: 40px;
  width: 40px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--muted);
}

.tariff-del:hover {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.twofa-setup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin: 14px 0 16px;
}

.twofa-qr {
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.twofa-qr img,
.twofa-qr canvas {
  display: block;
}

.twofa-secret {
  display: grid;
  gap: 6px;
}

.twofa-secret code {
  display: inline-block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0e14;
  color: var(--text);
  font-size: 15px;
  letter-spacing: 2px;
  word-break: break-all;
}

.notice-thumb {
  display: block;
  width: 100%;
  max-height: 180px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* Live publication preview */
.preview-block {
  display: grid;
  gap: 8px;
}

.app-preview {
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #0c0e14;
  padding: 14px;
}

.pv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.pv-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.pv-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  font-size: 18px;
}

.pv-title {
  font-weight: 800;
  font-size: 15px;
}

.pv-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.pv-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.pv-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  font-size: 11px;
  font-weight: 800;
}

.pv-img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.pv-body {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.pv-body p { margin: 0 0 6px; }
.pv-body p:last-child { margin-bottom: 0; }
.pv-body ul.pv-ul { margin: 4px 0; padding-left: 18px; }
.pv-body code,
.notice__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
}
.pv-body a,
.notice__body a { color: var(--blue); }

/* Markdown formatting toolbar (notice body) */
.fmt-toolbar {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
}
.fmt-btn {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fmt-btn:hover {
  background: var(--surface-3);
  border-color: var(--blue);
}

/* Notice feed body + promo */
.notice__type { margin: 6px 0 4px; color: var(--text-soft); font-size: 13px; }
.notice__body {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}
.notice__body p { margin: 0 0 6px; }
.notice__body p:last-child { margin-bottom: 0; }
.notice__body ul.pv-ul { margin: 4px 0; padding-left: 18px; }
.promo-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.promo-code {
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px dashed #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.promo-until { color: var(--text-soft); font-size: 12px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

.toast[data-bad="true"] {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

@media (max-width: 1100px) {
  .app-body {
    --sidebar-w: 76px;
  }

  .nav-item__label,
  .brand__text,
  .endpoint-card {
    display: none;
  }

  .sidebar__brand {
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .topbar__toggle {
    display: none;
  }

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

  .overview-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }
}

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

  .auth-intro {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-proof {
    grid-template-columns: 1fr;
  }

  .topbar,
  .page-title {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    padding: 14px 18px;
  }

  .content {
    width: min(100% - 28px, 1220px);
    padding-top: 22px;
  }

  .stats,
  .kpis,
  .two,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .page-title--row {
    flex-direction: column;
    align-items: stretch;
  }

  .notice {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tariff-row {
    grid-template-columns: 1fr 1fr;
  }

  .tariff-del {
    grid-column: 2;
    justify-self: end;
  }
}

/* ───────────────────────────────────────────────────────────────────────────
   Auth visual refresh (login / registration / admin console)
   Premium dark split-screen: gradient glow, depth, staggered entrance.
   ─────────────────────────────────────────────────────────────────────────── */
.auth-page {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(920px 620px at 10% -12%, rgba(109, 125, 242, 0.20), transparent 60%),
    radial-gradient(720px 520px at 102% 4%, rgba(34, 197, 94, 0.10), transparent 55%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
}

.auth-shell {
  position: relative;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 0 44px 130px rgba(0, 0, 0, 0.55);
  animation: auth-rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.auth-intro {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(620px 420px at 0% 0%, rgba(109, 125, 242, 0.18), transparent 60%),
    #0b0d13;
}

.auth-shell--admin .auth-intro {
  background:
    radial-gradient(620px 420px at 0% 0%, rgba(34, 197, 94, 0.16), transparent 60%),
    radial-gradient(420px 320px at 110% 120%, rgba(109, 125, 242, 0.16), transparent 60%),
    #0b0d13;
}

.auth-intro::after {
  content: "";
  position: absolute;
  right: -38%;
  bottom: -52%;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(109, 125, 242, 0.24), transparent 65%);
  pointer-events: none;
}

.auth-intro > * {
  position: relative;
  z-index: 1;
}

.brand img {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(109, 125, 242, 0.34);
}

.kicker {
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(109, 125, 242, 0.3);
  background: var(--blue-soft);
}

.auth-card {
  position: relative;
  background:
    radial-gradient(620px 320px at 100% 0%, rgba(109, 125, 242, 0.07), transparent 60%),
    var(--surface);
}

.auth-card input {
  min-height: 48px;
  background: #0a0c12;
  border-color: rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-card input:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.auth-card .btn {
  min-height: 48px;
  background: linear-gradient(135deg, #7888f5, #5563e6);
  box-shadow: 0 16px 34px rgba(74, 90, 220, 0.36);
}

.auth-card .btn:hover {
  filter: brightness(1.06);
}

.proof-item {
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.proof-item:hover {
  border-color: rgba(109, 125, 242, 0.4);
  background: var(--surface-2);
  transform: translateY(-2px);
}

/* Staggered entrance for the form + intro contents */
.auth-card__head,
.auth-card .form > *,
.auth-copy > *,
.auth-proof .proof-item {
  animation: auth-fade 0.5s ease both;
}

.auth-card .form > *:nth-child(1) { animation-delay: 0.05s; }
.auth-card .form > *:nth-child(2) { animation-delay: 0.10s; }
.auth-card .form > *:nth-child(3) { animation-delay: 0.15s; }
.auth-card .form > *:nth-child(4) { animation-delay: 0.20s; }
.auth-card .form > *:nth-child(5) { animation-delay: 0.25s; }
.auth-proof .proof-item:nth-child(1) { animation-delay: 0.12s; }
.auth-proof .proof-item:nth-child(2) { animation-delay: 0.18s; }
.auth-proof .proof-item:nth-child(3) { animation-delay: 0.24s; }

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.992); }
  to { opacity: 1; transform: none; }
}

@keyframes auth-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell,
  .auth-card__head,
  .auth-card .form > *,
  .auth-copy > *,
  .auth-proof .proof-item {
    animation: none;
  }
}

/* ───────── Поддержка (remote support) ───────── */
.support-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.support-request + .support-request {
  margin-top: 10px;
}
.support-request__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.support-request__info strong {
  font-size: 15px;
}
.support-request__sub {
  color: var(--muted);
  font-size: 12.5px;
}
.support-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--blue-soft);
  color: var(--text-soft);
  margin: 2px 6px 2px 0;
}
.support-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-soft);
  font-size: 13px;
  margin: 6px 0 12px;
}
.support-meta span b {
  color: var(--text);
}
.support-scopes {
  margin-bottom: 14px;
}
.support-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
}
.support-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.support-tab:hover {
  color: var(--text-soft);
}
.support-tab.is-active {
  color: #fff;
  background: var(--blue);
}
.support-pane__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.support-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
}
.support-inline select {
  padding: 6px 10px;
  border-radius: 9px;
}

/* Settings editor: groups of aligned label/control rows. */
.support-settings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
  align-items: start;
}
@media (max-width: 560px) {
  .support-settings {
    grid-template-columns: 1fr;
  }
}
.support-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden;
}
.support-group__title {
  margin: 0;
  padding: 11px 16px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.support-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.support-field + .support-field {
  border-top: 1px solid var(--line);
}
.support-field.is-changed {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}
.support-field__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.3;
}
.support-field__label code {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.support-field.is-changed .support-field__label {
  color: var(--text);
}
.support-field.is-changed .support-field__label code {
  color: var(--blue);
}
.support-field input[type="text"],
.support-field input[type="number"],
.support-field select,
.support-field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.support-field input:focus,
.support-field select:focus,
.support-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
/* Compact right-aligned controls with predictable widths. */
.support-field input[type="number"] {
  width: 110px;
  flex: none;
}
.support-field select {
  width: 170px;
  flex: none;
}
.support-field--wide input[type="text"] {
  width: 220px;
  flex: none;
}
/* Multiline values: label on top, control under it, full width. */
.support-field--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.support-field--stack textarea {
  width: 100%;
  resize: vertical;
  min-height: 68px;
  line-height: 1.45;
}

/* Boolean fields rendered as toggle switches. */
.support-field--bool input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 25px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.support-field--bool input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: left 0.18s ease;
}
.support-field--bool input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.support-field--bool input[type="checkbox"]:checked::after {
  left: 22px;
}
.support-logs {
  max-height: 460px;
  overflow: auto;
  background: #0b0d13;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-soft);
}
