:root {
  --bg: #f5f1e8;
  --ink: #17201b;
  --muted: #6d756f;
  --card: rgba(255, 252, 244, 0.92);
  --line: #ddd3c1;
  --ok: #15803d;
  --warning: #d97706;
  --critical: #dc2626;
  --unknown: #64748b;
  --shadow: 0 24px 70px rgba(61, 48, 28, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(21, 128, 61, 0.16), transparent 34rem),
    radial-gradient(circle at 80% 10%, rgba(217, 119, 6, 0.14), transparent 28rem),
    linear-gradient(135deg, #f7f1e3 0%, #eef4ed 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.hero.compact {
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.25rem;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

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

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

.actions form {
  margin: 0;
}

.primary-button,
.secondary-button,
.danger-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #17201b;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.admin-shell .primary-button,
.admin-shell .secondary-button,
.admin-shell .danger-button,
.admin-shell .link-button {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.admin-shell .danger-button {
  background: #b91c1c;
}

.admin-shell .actions {
  gap: 6px;
}

.admin-shell h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.admin-shell h2 {
  margin-bottom: 10px;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  border-radius: 10px;
  padding: 10px 11px;
}

.admin-shell textarea {
  min-height: 84px;
}

.secondary-button {
  border: 1px solid #17201b;
  color: #17201b;
  background: rgba(255, 255, 255, 0.42);
}

.danger-button {
  color: #fff;
  background: var(--critical);
}

.compact-button,
.link-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.link-button {
  color: #fff;
}

.status-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 30px;
  border-radius: 28px;
  color: #fff;
  box-shadow: var(--shadow);
}

.status-panel span {
  opacity: 0.78;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-panel strong {
  font-size: clamp(2.4rem, 8vw, 7rem);
  line-height: 0.9;
}

.ok { background-color: var(--ok); }
.warning { background-color: var(--warning); }
.critical { background-color: var(--critical); }
.unknown { background-color: var(--unknown); }

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

.metrics article,
.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.metrics article {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metrics span {
  color: var(--muted);
  font-size: 0.88rem;
}

.metrics strong {
  font-size: 2rem;
}

.metrics .small {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.card {
  padding: 22px;
}

.admin-shell {
  width: min(1420px, calc(100% - 40px));
}

.admin-hero {
  padding: 18px 22px;
  border: 1px solid #cfc2aa;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 32px rgba(61, 48, 28, 0.10);
}

.admin-overview {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.admin-panel {
  padding: 16px;
  border: 1px solid #d6c8af;
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.82);
  box-shadow: 0 14px 36px rgba(61, 48, 28, 0.10);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-heading p {
  margin: 6px 0 0;
}

.project-panel {
  position: sticky;
  top: 18px;
}

.inline-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.project-admin-list,
.managed-projects,
.managed-url-list {
  display: grid;
  gap: 12px;
}

.project-admin-row,
.managed-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #d9cdb8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.project-admin-row p,
.managed-project p {
  margin: 4px 0 0;
  color: var(--muted);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: #17201b;
  background: #ede3d0;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-check-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: start;
}

.managed-project {
  padding: 12px;
  border: 1px solid #d6c8af;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.managed-project > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.managed-url-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 46px;
}

.managed-url-row a {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  color: #fff;
  font-weight: 700;
}

.alert.success {
  background: linear-gradient(135deg, #15803d, #22c55e);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pill.large {
  min-width: 120px;
  padding: 12px 18px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

.empty {
  color: var(--muted);
  text-align: center;
}

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

.align-start {
  align-items: start;
}

.result-list {
  display: grid;
  gap: 14px;
}

.result-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.result-item.wide {
  grid-template-columns: 1fr auto;
}

.result-item p {
  margin: 4px 0;
  color: var(--muted);
}

.config-summary {
  margin-bottom: 18px;
}

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

.sub-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.34);
}

.section-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--ok);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.step-badge.advanced {
  background: #17201b;
}

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

label,
fieldset {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.row-help {
  margin-top: -2px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  font: inherit;
}

select {
  min-height: 46px;
}

textarea {
  min-height: 100px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
}

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

.checkbox-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
}

.checkbox-grid input {
  width: auto;
}

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

.help-item {
  padding: 10px;
  border: 1px solid #d9cdb8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.50);
}

.help-item code {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  color: #17201b;
  background: #ede3d0;
  font-size: 0.82rem;
}

.help-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.project-grid {
  display: grid;
  gap: 18px;
}

.project-tile {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 252, 244, 0.94);
  box-shadow: var(--shadow);
}

.project-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--unknown);
}

.project-tile.ok::before {
  background: var(--ok);
}

.project-tile.warning::before {
  background: var(--warning);
}

.project-tile.critical::before {
  background: var(--critical);
}

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

.project-heading.slim {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.project-heading.slim p {
  margin: 4px 0 0;
}

.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.status-strip span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.status-strip strong {
  display: block;
  color: var(--ink);
  font-size: 1.5rem;
}

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

.url-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--unknown);
}

.url-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.url-main a {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.check-chips span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #17201b;
  background: #ede3d0;
  font-size: 0.78rem;
}

.check-chips span.ok {
  color: #fff;
  background: var(--ok);
}

.check-chips span.warning {
  color: #fff;
  background: var(--warning);
}

.check-chips span.critical {
  color: #fff;
  background: var(--critical);
}

.project-list-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.32);
}

.nested-list {
  gap: 10px;
}

code {
  display: inline-block;
  max-width: 100%;
  color: #334155;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 980px) {
  .hero,
  .grid-two {
    grid-template-columns: 1fr;
    display: grid;
  }

  .actions {
    justify-content: flex-start;
  }

  .project-heading {
    display: grid;
    justify-content: stretch;
  }

  .project-metrics {
    justify-content: flex-start;
  }

  .status-strip,
  .url-row {
    grid-template-columns: 1fr;
  }

  .status-dot {
    display: none;
  }

  .check-chips {
    justify-content: flex-start;
  }

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

  .admin-overview,
  .admin-check-grid,
  .project-admin-row,
  .managed-url-row {
    grid-template-columns: 1fr;
  }

  .project-panel {
    position: static;
  }

  .managed-project > header {
    display: grid;
  }

  .form-row,
  .checkbox-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 18px;
  }

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

  .status-panel,
  .card {
    border-radius: 18px;
  }
}

/* Backend console v2 */
.backend-body {
  background:
    linear-gradient(90deg, rgba(23, 32, 27, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 32, 27, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(21, 128, 61, 0.16), transparent 30rem),
    #f4efe4;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

.backend-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.backend-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 24px;
  color: #f8f3ea;
  background: #17201b;
}

.brand-mark {
  display: grid;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.brand-mark span {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: #17201b;
  background: #d9f99d;
  font-weight: 900;
}

.brand-mark strong {
  font-size: 1.1rem;
}

.backend-nav {
  display: grid;
  gap: 8px;
}

.backend-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(248, 243, 234, 0.82);
  text-decoration: none;
}

.backend-nav a:hover {
  color: #17201b;
  background: #d9f99d;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.sidebar-actions form,
.sidebar-action {
  margin: 0;
}

.sidebar-actions a,
.sidebar-actions button,
.sidebar-action button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  color: #17201b;
  background: #d9f99d;
  font-family: inherit;
  font-size: inherit;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-actions a:hover,
.sidebar-actions button:hover,
.sidebar-action button:hover {
  background: #bef264;
}

.sidebar-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.sidebar-timebox {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(248, 243, 234, 0.16);
  border-radius: 14px;
  color: rgba(248, 243, 234, 0.78);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-timebox span {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.sidebar-timebox span:first-child {
  margin-top: 0;
}

.sidebar-timebox strong {
  color: #f8f3ea;
  font-size: 0.86rem;
  line-height: 1.3;
}

.sidebar-project-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: rgba(248, 243, 234, 0.82);
  font-size: 0.86rem;
  line-height: 1.3;
  text-decoration: none;
}

.sidebar-project-link:hover,
.sidebar-project-link.active {
  color: #17201b;
  background: #d9f99d;
}

.backend-main {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.backend-topbar,
.backend-section {
  border: 1px solid #d6c8af;
  border-radius: 22px;
  background: rgba(255, 252, 244, 0.88);
  box-shadow: 0 18px 48px rgba(61, 48, 28, 0.10);
}

.backend-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px;
}

.backend-topbar h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.backend-topbar p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.backend-section {
  padding: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d6c8af;
}

.section-title p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.project-console-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
}

.console-card,
.builder-card,
.project-console-card,
.inventory-project {
  border: 1px solid #d9cdb8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.console-card,
.builder-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.create-project-card {
  align-self: start;
}

.project-stack,
.inventory-grid,
.inventory-url-list {
  display: grid;
  gap: 10px;
}

.project-console-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.project-console-card p,
.inventory-project p {
  margin: 4px 0 0;
  color: var(--muted);
}

.ghost-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dc2626;
  border-radius: 10px;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.ghost-danger-button:hover {
  color: #fff;
  background: #dc2626;
}

.url-builder {
  display: grid;
  gap: 12px;
}

.identity-card {
  background: rgba(217, 249, 157, 0.20);
}

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

.toggle-card {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d9cdb8;
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
}

.toggle-card input {
  width: auto;
}

.builder-submit {
  display: flex;
  justify-content: flex-end;
}

.notification-cockpit {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.notification-sidepanel,
.notification-studio {
  display: grid;
  gap: 16px;
}

.notification-rack,
.notification-create-panel,
.notification-studio {
  padding: 18px;
  border: 1px solid #d9cdb8;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 36px rgba(29, 24, 16, 0.05);
}

.notification-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.notification-panel-head h3,
.notification-routing-head h4 {
  margin: 0;
}

.notification-panel-head p,
.notification-routing-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.notification-channel-stack,
.notification-recipient-stack,
.notification-project-grid {
  display: grid;
  gap: 12px;
}

.notification-channel-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #ddd1bd;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.95), rgba(248, 244, 233, 0.72));
}

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

.notification-channel-top input {
  width: auto;
}

.notification-channel-copy {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.notification-create-form,
.notification-recipient-form,
.notification-routing-block {
  display: grid;
  gap: 14px;
}

.notification-create-assignments {
  display: grid;
  gap: 10px;
}

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

.notification-create-full {
  grid-column: 1 / -1;
}

.notification-project-picker {
  display: grid;
  gap: 10px;
}

.notification-project-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #e1d6c4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.notification-project-choice input {
  width: auto;
  margin-top: 4px;
}

.notification-project-choice span {
  display: grid;
  gap: 4px;
}

.notification-project-choice small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.notification-recipient-card {
  border: 1px solid #d9cdb8;
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.84);
  overflow: hidden;
}

.notification-recipient-card summary {
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.notification-recipient-card summary::-webkit-details-marker {
  display: none;
}

.notification-recipient-card[open] summary {
  border-bottom: 1px solid #dfd2bd;
  background: rgba(246, 240, 226, 0.78);
}

.notification-recipient-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.notification-recipient-identity p {
  margin: 4px 0 0;
  color: var(--muted);
}

.notification-recipient-status {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.notification-channel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-channel-chips .count-badge {
  opacity: 0.4;
}

.notification-channel-chips .count-badge.is-on {
  opacity: 1;
  color: #fff;
  background: var(--ok);
}

.notification-project-count {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.notification-recipient-form {
  padding: 18px;
}

.notification-routing-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1.5fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid #e1d6c4;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.notification-routing-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.notification-mini-toggle {
  display: grid;
  gap: 8px;
}

.notification-mini-toggle > span:first-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-mini-toggle .toggle-card,
.notification-mini-toggle .notification-unavailable {
  min-height: 46px;
}

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

.notification-contact-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.notification-contact-actions form {
  margin: 0;
}

.notification-empty-state {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px dashed #d9cdb8;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 252, 244, 0.58);
}

.notification-empty-state p {
  margin: 0;
}

.notification-assignment-table {
  display: grid;
  gap: 8px;
}

.notification-assignment-table-head,
.notification-assignment-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(110px, 0.7fr));
  gap: 8px;
  align-items: stretch;
}

.notification-assignment-table-head {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-assignment-row {
  padding: 10px;
  border: 1px solid #d9cdb8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.notification-assignment-row.compact {
  padding: 8px;
}

.notification-assignment-person {
  display: grid;
  gap: 4px;
  align-content: center;
}

.notification-assignment-person span {
  color: var(--muted);
  font-size: 0.86rem;
}

.notification-assignment-cell {
  display: grid;
  align-items: center;
}

.notification-assignment-cell .toggle-card {
  justify-content: center;
  min-height: 46px;
}

.notification-unavailable {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 0 10px;
  border: 1px dashed #d6c8af;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 252, 244, 0.48);
  font-size: 0.82rem;
}

.inventory-project {
  padding: 14px;
}

.inventory-project > header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d6c8af;
}

.inventory-url {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e1d6c4;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.inventory-url a {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.rule-reference-grid > div {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d9cdb8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.rule-reference-grid code {
  color: #17201b;
  font-size: 0.82rem;
  font-weight: 800;
}

.rule-reference-grid span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.backend-shell .primary-button,
.backend-shell .secondary-button,
.backend-shell .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1;
}

.backend-shell a.link-button,
.backend-shell a.link-button:visited {
  color: #fff;
}

/* Detail view */
.detail-topbar {
  align-items: flex-start;
}

.detail-topbar .actions {
  align-items: flex-start;
}

.detail-topbar h1 {
  font-size: clamp(1.9rem, 3.8vw, 3.2rem);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.detail-grid.two-col {
  margin-top: 4px;
}

.detail-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid #d6c8af;
  border-radius: 20px;
  background: rgba(255, 252, 244, 0.88);
  box-shadow: 0 18px 48px rgba(61, 48, 28, 0.10);
}

.detail-card.accent {
  background:
    radial-gradient(circle at top right, rgba(217, 249, 157, 0.22), transparent 16rem),
    rgba(255, 252, 244, 0.92);
}

.detail-card h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.detail-card strong {
  color: var(--ink);
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #17201b;
  background: #ede3d0;
  font-size: 0.78rem;
  font-weight: 800;
}

.detail-chip.muted-chip {
  color: var(--muted);
  font-weight: 700;
}

.detail-card .result-list {
  gap: 10px;
}

.detail-card .result-item {
  padding: 12px;
}

.detail-card .table-wrap {
  margin-top: 4px;
}

.detail-card .empty {
  padding: 18px 0;
}

.detail-section-head {
  display: grid;
  gap: 6px;
}

.incident-timeline {
  display: grid;
  gap: 12px;
}

.incident-card {
  display: grid;
  gap: 14px;
  border: 1px solid #d6c8af;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  overflow: hidden;
}

.incident-card.is-open {
  border-color: rgba(185, 28, 28, 0.22);
  background: rgba(254, 242, 242, 0.72);
}

.incident-summary {
    display: block;
    position: relative;
    gap: 14px;
    padding: 14px;
    cursor: pointer;
    list-style: none;
    appearance: none;
  }

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

.incident-summary::marker {
    content: "";
  }

.incident-card[open] .incident-summary {
    border-bottom: 1px solid #eadfce;
  }

.incident-details {
  display: grid;
  gap: 12px;
  padding: 14px;
  padding-top: 12px;
}

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

.incident-duration {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.incident-meta-block {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e1d6c4;
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.86);
}

.incident-meta-block span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

.incident-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    justify-self: end;
    width: fit-content;
    margin-left: auto;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #d8ccb8;
    border-radius: 999px;
    background: rgba(255, 252, 244, 0.92);
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 700;
  }

.incident-toggle::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(13, 64, 89, 0.1);
    font-size: 1rem;
    line-height: 1;
    color: var(--ink);
    transition: transform 0.18s ease, background 0.18s ease;
  }

.incident-card[open] .incident-toggle::after {
    content: "−";
    background: rgba(185, 28, 28, 0.12);
  }

.incident-issues {
  display: grid;
  gap: 8px;
}

.incident-issues.secondary {
  padding-top: 2px;
  border-top: 1px solid #eadfce;
}

.incident-issues ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.incident-issues li {
  line-height: 1.45;
}

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

  .backend-sidebar {
    position: static;
    height: auto;
  }

  .backend-nav,
  .sidebar-note {
    display: flex;
    flex-wrap: wrap;
  }

  .detail-grid,
  .project-console-grid,
  .toggle-grid,
  .rule-reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .backend-main {
    padding: 14px;
  }

  .backend-topbar,
  .detail-topbar,
  .section-title,
  .inventory-project > header {
    display: grid;
    align-items: start;
  }

  .detail-grid,
  .project-console-grid,
  .notification-create-grid,
  .notification-recipient-grid,
  .notification-routing-toggles,
  .project-console-card,
  .toggle-grid,
  .inventory-url,
  .rule-reference-grid {
    grid-template-columns: 1fr;
  }

  .notification-cockpit,
  .notification-panel-head,
  .notification-recipient-summary,
  .notification-recipient-actions,
  .notification-routing-card {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .notification-recipient-status {
    justify-items: start;
  }

  .incident-grid,
  .incident-card-top {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .notification-assignment-table-head {
    display: none;
  }

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

  .notification-assignment-cell {
    gap: 6px;
  }

  .notification-assignment-cell::before {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .notification-assignment-row > .notification-assignment-cell:nth-child(2)::before {
    content: "E-Mail";
  }

  .notification-assignment-row > .notification-assignment-cell:nth-child(3)::before {
    content: "Teams";
  }

  .notification-assignment-row > .notification-assignment-cell:nth-child(4)::before {
    content: "Slack";
  }

  .notification-assignment-row > .notification-assignment-cell:nth-child(5)::before {
    content: "Webhook";
  }
}

/* Pulse console */
.pulse-topbar {
  background:
    radial-gradient(circle at top right, rgba(217, 249, 157, 0.30), transparent 22rem),
    rgba(255, 252, 244, 0.88);
  padding: 14px 18px;
  border-radius: 18px;
}

.pulse-topbar h1 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.pulse-topbar p {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.35;
}

.pulse-body .backend-main {
  align-content: start;
  grid-auto-rows: max-content;
}

.pulse-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 112px;
  gap: 12px;
}

.pulse-status-card,
.pulse-metric {
  border: 1px solid #d6c8af;
  border-radius: 22px;
  background: rgba(255, 252, 244, 0.88);
  box-shadow: 0 18px 48px rgba(61, 48, 28, 0.10);
}

.pulse-status-card {
  display: grid;
  align-content: end;
  height: 112px;
  min-height: 0;
  padding: 16px;
  color: #fff;
  background: var(--unknown);
}

.pulse-status-card.ok {
  background: linear-gradient(135deg, #15803d, #16a34a);
}

.pulse-status-card.warning {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}

.pulse-status-card.critical {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.pulse-status-card.unknown {
  background: linear-gradient(135deg, #475569, #64748b);
}

.pulse-status-card span,
.pulse-metric span {
  color: inherit;
  opacity: 0.78;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pulse-status-card strong {
  color: #fff;
  font-size: clamp(1.8rem, 3.2vw, 3.2rem);
  font-weight: 900;
  line-height: 0.92;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}

.pulse-metric {
  display: grid;
  gap: 8px;
  align-content: center;
  height: 112px;
  min-height: 0;
  padding: 14px;
}

.pulse-metric span {
  color: var(--muted);
}

.pulse-metric strong {
  overflow-wrap: anywhere;
  font-size: 2rem;
}

.pulse-metric.wide {
  grid-column: span 2;
  min-height: 92px;
}

.pulse-metric.wide strong {
  font-size: 0.95rem;
}

.pulse-project-grid {
  display: grid;
  gap: 14px;
}

.pulse-project-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid #d6c8af;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.50);
}

.pulse-project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--unknown);
}

.pulse-project-card.ok::before {
  background: var(--ok);
}

.pulse-project-card.warning::before {
  background: var(--warning);
}

.pulse-project-card.critical::before {
  background: var(--critical);
}

.pulse-project-card > header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.pulse-project-card h3 {
  font-size: 1.35rem;
}

.pulse-project-card header span:not(.pill) {
  color: var(--muted);
}

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

.pulse-strip span {
  padding: 10px;
  border: 1px solid #e1d6c4;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 252, 244, 0.72);
}

.pulse-strip strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

.pulse-url-list {
  display: grid;
  gap: 8px;
}

.pulse-url-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(280px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e1d6c4;
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.64);
}

.pulse-url-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pulse-url-main a {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.pulse-summary {
  display: grid;
  gap: 8px;
}

.pulse-issues {
  display: grid;
  gap: 6px;
}

.issue-row {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #e1d6c4;
  background: rgba(255, 252, 244, 0.82);
}

.issue-row span {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.issue-row strong {
  font-size: 0.92rem;
}

.issue-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.issue-row.critical {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(254, 226, 226, 0.80);
}

.issue-row.critical span {
  color: var(--critical);
}

.issue-row.warning {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(254, 243, 199, 0.78);
}

.issue-row.warning span {
  color: var(--warning);
}

.issue-row.ok {
  border-color: rgba(21, 128, 61, 0.18);
  background: rgba(220, 252, 231, 0.68);
}

.issue-row.ok span {
  color: var(--ok);
}

.pulse-checks span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #17201b;
  background: #ede3d0;
  font-size: 0.76rem;
  font-weight: 800;
}

.pulse-checks span.ok {
  color: #fff;
  background: var(--ok);
}

.pulse-checks span.warning {
  color: #fff;
  background: var(--warning);
}

.pulse-checks span.critical {
  color: #fff;
  background: var(--critical);
}

@media (max-width: 1180px) {
  .pulse-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pulse-status-card {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .pulse-status-grid,
  .pulse-strip,
  .pulse-url-item {
    grid-template-columns: 1fr;
  }

  .pulse-status-card,
  .pulse-metric.wide {
    grid-column: auto;
  }

  .pulse-project-card > header {
    display: grid;
  }

  .pulse-checks {
    justify-content: flex-start;
  }

  .pulse-url-item {
    grid-template-columns: 1fr;
  }
}
