:root {
  --bg: #05070d;
  --bg-soft: #0a101c;
  --panel: #101827;
  --panel-2: #121d2f;
  --panel-3: #172337;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8edf7;
  --muted: #9aa8bd;
  --muted-2: #6e7d94;

  /* Yaxxa brand colours */
  --yaxxa-pink: #c21b83;
  --yaxxa-green: #72bf44;
  --yaxxa-blue: #009bdf;

  /* UI usage */
  --brand: var(--yaxxa-pink);
  --brand-2: var(--yaxxa-blue);
  --good: var(--yaxxa-green);
  --warn: #ffc857;
  --danger: #ff5f6d;
  --status-info: var(--yaxxa-blue);
  --status-warning: var(--warn);
  --status-critical: var(--danger);

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --sidebar-width: 270px;
}
* {
  box-sizing: border-box;
}
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 1000; padding: 10px 14px; border-radius: 8px; background: var(--yaxxa-pink); color: white; font-weight: 800; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--yaxxa-blue); outline-offset: 3px; }
.mode-chip { display: inline-flex; align-items: center; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.mode-live { color: #b9f59c; border-color: rgba(114,191,68,.45); background: rgba(114,191,68,.08); }
.mode-dry { color: #9bddfa; border-color: rgba(0,155,223,.45); background: rgba(0,155,223,.08); }
.nav-section-label { margin: 18px 12px 6px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-section-label:first-child { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(37, 208, 195, 0.14), transparent 36%),
    radial-gradient(circle at top right, rgba(55, 168, 255, 0.13), transparent 32%),
    linear-gradient(135deg, #060914 0%, #0a1020 48%, #05070d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 26px 18px;
  background: rgba(8, 13, 23, 0.78);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 8px 26px 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  color: #061015;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 30px rgba(37, 208, 195, 0.22);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
}

.nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  gap: 7px;
}

.nav a {
  padding: 12px 14px;
  color: var(--muted);
  border-radius: 14px;
  transition: 0.15s ease;
  border: 1px solid transparent;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav a.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(37, 208, 195, 0.18), rgba(55, 168, 255, 0.12));
  border-color: rgba(37, 208, 195, 0.20);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 10px 4px;
  color: var(--muted);
}

.main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  padding: 30px;
}

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

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

h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1px;
}

h2 {
  font-size: 18px;
  letter-spacing: -0.2px;
}

.page-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #061015;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(37, 208, 195, 0.14);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

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

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(16, 24, 39, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  overflow: hidden;
}

.metric {
  min-height: 138px;
  position: relative;
}

.metric:after {
  content: "";
  position: absolute;
  right: -32px;
  top: -32px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(37, 208, 195, 0.08);
}

.metric.good:after {
  background: rgba(53, 208, 127, 0.12);
}

.metric.warn:after {
  background: rgba(255, 200, 87, 0.12);
}

.metric.danger:after {
  background: rgba(255, 95, 109, 0.12);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-value {
  margin-top: 14px;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1.5px;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 13px;
}

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

.section-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.link {
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(37, 208, 195, 0.09);
  border: 1px solid rgba(37, 208, 195, 0.18);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

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

th,
td {
  padding: 12px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #121d2f;
  color: #b9c5d8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

td {
  color: #dce4f2;
  font-size: 13px;
  max-width: 360px;
  word-break: break-word;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.compact-table table {
  min-width: 680px;
}

.compact-table th,
.compact-table td {
  padding: 10px 11px;
  font-size: 12px;
}

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  padding: 26px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.kv {
  display: grid;
  gap: 12px;
}

.kv div {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

.kv span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.kv strong {
  color: var(--text);
  font-weight: 700;
  word-break: break-word;
}

.filters {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}

.small-field {
  flex: 0 0 140px;
  min-width: 140px;
}

.button-field {
  flex: 0 0 auto;
  min-width: auto;
}

label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  background: rgba(5, 9, 16, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 12px 13px;
  outline: none;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 220px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 208, 195, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 208, 195, 0.08);
}

.number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.number-list span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(37, 208, 195, 0.09);
  border: 1px solid rgba(37, 208, 195, 0.16);
  color: #c7fff9;
  font-weight: 700;
  font-size: 12px;
}

.number-list.muted-list span {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border);
  color: var(--muted);
}

.log-viewer {
  margin: 0;
  padding: 18px;
  max-height: 720px;
  overflow: auto;
  border-radius: 16px;
  background: #03060b;
  border: 1px solid var(--border);
  color: #d6f7ef;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.flash-wrap {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.flash.success {
  border-color: rgba(53, 208, 127, 0.35);
  background: rgba(53, 208, 127, 0.1);
}

.flash.warning {
  border-color: rgba(255, 200, 87, 0.35);
  background: rgba(255, 200, 87, 0.1);
}

.flash.info {
  border-color: rgba(55, 168, 255, 0.35);
  background: rgba(55, 168, 255, 0.1);
}

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

.small {
  font-size: 12px;
}

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

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

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .app-shell {
    display: block;
  }

  .main {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }

  .topbar {
    flex-direction: column;
  }

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

  .filters {
    display: grid;
  }

  .small-field,
  .button-field {
    flex: 1;
    min-width: 100%;
  }
}

/* Yaxxa colour refinement */
body {
  background:
    radial-gradient(circle at top left, rgba(194, 27, 131, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(0, 155, 223, 0.15), transparent 32%),
    radial-gradient(circle at 62% 6%, rgba(114, 191, 68, 0.08), transparent 28%),
    linear-gradient(135deg, #05070d 0%, #0a1020 52%, #04060b 100%);
}

.brand-mark {
  background: linear-gradient(135deg, var(--yaxxa-pink), var(--yaxxa-blue));
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(194, 27, 131, 0.24);
}

.brand-title {
  color: #ffffff;
}

.brand-subtitle {
  color: var(--yaxxa-green);
}

.nav a.active {
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(194, 27, 131, 0.22),
    rgba(0, 155, 223, 0.14)
  );
  border-color: rgba(194, 27, 131, 0.38);
}

.nav a:hover {
  border-color: rgba(0, 155, 223, 0.22);
}

.button {
  background: linear-gradient(135deg, var(--yaxxa-pink), var(--yaxxa-blue));
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(194, 27, 131, 0.20);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(0, 155, 223, 0.24);
}

.metric:after {
  background: rgba(194, 27, 131, 0.10);
}

.metric.good:after {
  background: rgba(114, 191, 68, 0.14);
}

.metric.warn:after {
  background: rgba(255, 200, 87, 0.13);
}

.metric.danger:after {
  background: rgba(194, 27, 131, 0.18);
}

.metric.good .metric-value {
  color: var(--yaxxa-green);
}

.metric.warn .metric-value {
  color: var(--warn);
}

.metric.danger .metric-value {
  color: var(--yaxxa-pink);
}

.link {
  color: var(--yaxxa-blue);
}

.pill {
  color: #dff7ff;
  background: rgba(0, 155, 223, 0.12);
  border-color: rgba(0, 155, 223, 0.30);
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    linear-gradient(135deg, rgba(194, 27, 131, 0.035), rgba(0, 155, 223, 0.025)),
    rgba(16, 24, 39, 0.90);
}

th {
  background: #121d2f;
  color: #d8e1ef;
  border-bottom: 1px solid rgba(0, 155, 223, 0.18);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 155, 223, 0.70);
  box-shadow: 0 0 0 4px rgba(0, 155, 223, 0.10);
}

.number-list span {
  background: rgba(114, 191, 68, 0.11);
  border-color: rgba(114, 191, 68, 0.26);
  color: #dfffd2;
}

.flash.success {
  border-color: rgba(114, 191, 68, 0.42);
  background: rgba(114, 191, 68, 0.11);
}

.flash.info {
  border-color: rgba(0, 155, 223, 0.42);
  background: rgba(0, 155, 223, 0.11);
}

.log-viewer {
  color: #dff7ff;
  border-color: rgba(0, 155, 223, 0.18);
}

/* Yaxxa logo */
.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  box-shadow: 0 12px 30px rgba(194, 27, 131, 0.18);
}

.brand {
  align-items: center;
}


/* Full Yaxxa wordmark logo layout */
.brand-image-only {
  display: block;
  padding: 0 4px 28px 4px;
}

.brand-logo-full {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.logo-subtitle {
  margin-top: 8px;
  padding-left: 2px;
  color: var(--yaxxa-green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.4px;
}

/* Disable old square logo styling if browser still matches it */
.brand-logo {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

/* Final Yaxxa logo display fix */
.brand-image-only {
  display: block;
  padding: 8px 4px 28px 4px;
}

.brand-logo-full {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
  max-height: 95px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.logo-subtitle {
  margin-top: 10px;
  color: var(--yaxxa-green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.5px;
}

/* Sidebar logo proportion refinement */
.brand-image-only {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 8px 24px 8px;
  min-height: 135px;
}

.brand-logo-full {
  display: block;
  width: 86px;
  height: 86px;
  max-width: 86px;
  max-height: 86px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.logo-subtitle {
  margin-top: 12px;
  padding-left: 0;
  color: var(--yaxxa-green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1;
}

/* Give the sidebar nav a cleaner start below the logo */
.nav {
  margin-top: 6px;
}


/* ANI + description display */
.ani-card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.ani-pill {
  display: inline-grid;
  grid-template-columns: auto;
  gap: 3px;
  padding: 9px 13px;
  border-radius: 16px;
  background: rgba(114, 191, 68, 0.11);
  border: 1px solid rgba(114, 191, 68, 0.28);
  min-width: 145px;
}

.ani-pill .ani-main {
  color: #eaffdf;
  font-weight: 900;
  font-size: 13px;
  line-height: 1.1;
}

.ani-pill .ani-desc {
  color: #a7b8d0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.ani-pill.used {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.10);
}

.ani-pill.used .ani-main {
  color: #d6deeb;
}

.ani-pill.used .ani-desc {
  color: #7f8fa8;
}

/* ANI Performance */
.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

.state-badge.good {
  color: #eaffdf;
  background: rgba(114, 191, 68, 0.16);
  border: 1px solid rgba(114, 191, 68, 0.34);
}

.state-badge.warn {
  color: #fff4ce;
  background: rgba(255, 200, 87, 0.15);
  border: 1px solid rgba(255, 200, 87, 0.32);
}

.state-badge.bad {
  color: #ffe4f3;
  background: rgba(194, 27, 131, 0.18);
  border: 1px solid rgba(194, 27, 131, 0.38);
}

.state-badge.unknown {
  color: #c7d2e5;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.rate-pill {
  display: inline-flex;
  min-width: 68px;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.rate-answer_rate_percent {
  color: #eaffdf;
  background: rgba(114, 191, 68, 0.12);
  border-color: rgba(114, 191, 68, 0.24);
}

.rate-rejection_rate_percent,
.rate-failure_rate_percent {
  color: #ffe4f3;
  background: rgba(194, 27, 131, 0.14);
  border-color: rgba(194, 27, 131, 0.28);
}

.rate-no_answer_rate_percent {
  color: #dff7ff;
  background: rgba(0, 155, 223, 0.12);
  border-color: rgba(0, 155, 223, 0.25);
}

/* Admin tenants */
.code-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.muted-small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

/* Login */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(0, 155, 223, 0.22), transparent 32%),
    radial-gradient(circle at bottom left, rgba(194, 27, 131, 0.18), transparent 34%),
    #060816;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-shell {
  width: min(440px, calc(100vw - 32px));
}

.login-card {
  background: rgba(20, 25, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
}

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

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  padding: 13px 14px;
  font-size: 15px;
}

.login-button {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

.login-error {
  background: rgba(194, 27, 131, 0.16);
  border: 1px solid rgba(194, 27, 131, 0.36);
  color: #ffe4f3;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 800;
}

.user-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: white;
  font-weight: 900;
  line-height: 1.1;
}

.user-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.subtle-button {
  background: rgba(255, 255, 255, 0.07) !important;
}

/* Admin forms */
.form-card {
  max-width: 760px;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.admin-form .field {
  display: grid;
  gap: 8px;
}

.admin-form label {
  font-weight: 900;
  color: var(--muted);
}

.admin-form input,
.admin-form select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  padding: 13px 14px;
  font-size: 15px;
}

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

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.checkbox-row input {
  width: auto;
}

.checkbox-row span {
  display: grid;
  gap: 2px;
}

.checkbox-row small {
  color: var(--muted);
}

.danger-button {
  background: rgba(194, 27, 131, 0.18) !important;
  border-color: rgba(194, 27, 131, 0.38) !important;
}

/* Tenant switcher */
.tenant-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.tenant-switcher label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tenant-switcher select {
  color: white;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 900;
}

.user-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: white;
  font-weight: 900;
  line-height: 1.1;
}

.user-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

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

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.check-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 14px;
}

.check-card input {
  margin-top: 4px;
}

.check-card strong {
  display: block;
}

.check-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.inline-form {
  display: inline;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.button.small {
  padding: 7px 10px;
  font-size: 12px;
}

.button.danger {
  background: rgba(255, 75, 92, 0.18);
  border-color: rgba(255, 75, 92, 0.35);
  color: #ff9aa5;
}

.pill.success {
  background: rgba(114, 191, 68, 0.16);
  color: #a8ef86;
}

.pill.warning {
  background: rgba(255, 193, 7, 0.14);
  color: #ffd978;
}

.pill.danger {
  background: rgba(255, 75, 92, 0.16);
  color: #ff9aa5;
}

.card.subtle {
  opacity: 0.86;
}

@media (max-width: 900px) {
  .form-grid.two,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .actions-cell {
    flex-direction: column;
    align-items: flex-start;
  }
}

.health-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-left: 5px solid var(--status-info);
}
.health-hero.status-pass { border-left-color: var(--good); }
.health-hero.status-warn { border-left-color: var(--warn); }
.health-hero.status-fail { border-left-color: var(--danger); }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.health-check { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); }
.health-check-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.health-check-title h3 { margin: 0; font-size: 15px; }
.health-check dl { margin: 14px 0 0; }
.health-check dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.health-check dt { color: var(--muted); }
.health-check dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.status-pass, .status-success { color: #b9f59c; }
.status-warn, .status-warning { color: #ffe09a; }
.status-fail, .status-critical { color: #ffb4bd; }
.status-info { color: #9bddfa; }
.empty-state { padding: 34px 20px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.empty-state h3 { margin-top: 0; }
.operating-hours-grid { display: grid; gap: 9px; }
.operating-hours-row { display: grid; grid-template-columns: minmax(210px,1fr) 145px auto 145px; align-items: center; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 720px) { .operating-hours-row { grid-template-columns: 1fr 1fr; } .operating-hours-row > span { display: none; } }
@media (max-width: 700px) { .health-hero { align-items: flex-start; flex-direction: column; } }

.api-test-result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

.api-test-result p {
  margin: 8px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}


/* ------------------------------------------------------------------
   Global dashboard and data-table layout improvements
   ------------------------------------------------------------------ */

.main {
  min-width: 0;
}

.grid,
.grid > *,
.card,
.section-header,
.filters {
  min-width: 0;
}

.card {
  width: 100%;
}

.table-wrap {
  position: relative;
  width: 100%;
  max-height: 68vh;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.table-wrap table {
  width: max-content;
  min-width: 100%;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--border);
}

.table-wrap td {
  min-width: 90px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.table-wrap td:hover {
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.table-wrap tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.012);
}

.table-wrap tbody tr:hover td {
  background: rgba(0, 155, 223, 0.055);
}

.section-header {
  align-items: center;
}

.filters {
  align-items: end;
}

.grid.cards {
  align-items: stretch;
}

.grid.cards > .card {
  height: 100%;
}

@media (max-width: 1400px) {
  .card {
    padding: 16px;
  }

  th,
  td {
    padding: 10px 11px;
  }

  .metric-value {
    font-size: 32px;
  }
}


/* ------------------------------------------------------------------
   Sidebar report navigation group
   ------------------------------------------------------------------ */

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-group > .nav-parent {
  position: relative;
  padding-right: 38px;
}

.nav-group > .nav-parent::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 4px 12px;
  padding-left: 10px;
  border-left: 1px solid rgba(0, 155, 223, 0.22);
}

.nav-group.open .nav-submenu {
  display: flex;
}

.nav .nav-submenu a {
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12px;
  color: var(--muted);
}

.nav .nav-submenu a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav .nav-submenu a.active {
  color: #ffffff;
  background: rgba(0, 155, 223, 0.12);
  border-color: rgba(0, 155, 223, 0.24);
}

/* Central Audit Log */
.audit-filters .field {
  min-width: 190px;
}

.audit-table {
  min-width: 1600px;
}

.audit-table-wrap {
  max-height: calc(100vh - 330px);
}

.audit-details summary {
  color: var(--yaxxa-blue);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.audit-detail-grid {
  display: grid;
  gap: 12px;
  width: min(760px, 75vw);
  margin-top: 12px;
}

.audit-detail-grid > div {
  min-width: 0;
}

.audit-detail-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.audit-detail-grid pre {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(5, 9, 16, 0.72);
  color: #dce4f2;
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-error {
  margin-top: 6px;
  color: #ffe4f3;
  font-size: 12px;
  font-weight: 700;
}

/* Dashboard and report CSV exports */
.export-toolbar {
  margin-bottom: 18px;
}

.export-actions,
.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-actions {
  justify-content: flex-end;
}

.export-actions .button,
.section-actions .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  text-decoration: none;
}

@media (max-width: 900px) {
  .section-actions {
    justify-content: flex-start;
  }
}

.report-export-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}


/* ------------------------------------------------------------------
   ANI Intelligence
   ------------------------------------------------------------------ */

.intelligence-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 26px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid rgba(0, 155, 223, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at top right,
      rgba(0, 155, 223, 0.13),
      transparent 42%
    ),
    rgba(10, 16, 27, 0.78);
}

.intelligence-hero h2 {
  margin: 6px 0 8px;
  font-size: 25px;
}

.intelligence-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.intelligence-kicker {
  color: var(--yaxxa-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.intelligence-mode {
  display: flex;
  min-width: 210px;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.intelligence-mode small {
  max-width: 260px;
  color: var(--muted);
  text-align: right;
  line-height: 1.4;
}

.intelligence-metrics {
  margin-bottom: 20px;
}

.intelligence-table-wrap {
  max-height: 520px;
}

.intelligence-list {
  display: flex;
  flex-direction: column;
}

.intelligence-list-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.intelligence-list-row:first-child {
  padding-top: 0;
}

.intelligence-list-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.intelligence-list-row strong {
  display: block;
  margin-bottom: 4px;
}

.intelligence-list-row span {
  color: var(--muted);
  font-size: 12px;
}

.intelligence-list-meta {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.intelligence-empty-state {
  padding: 42px 20px;
  border: 1px dashed rgba(0, 155, 223, 0.25);
  border-radius: 14px;
  background: rgba(0, 155, 223, 0.025);
  text-align: center;
}

.intelligence-empty-state strong {
  display: block;
  margin-bottom: 7px;
  font-size: 17px;
}

.intelligence-empty-state p {
  margin: 0;
  color: var(--muted);
}

.intelligence-danger-note {
  margin-top: 5px;
  color: #fb7185;
  font-size: 11px;
  font-weight: 800;
}

.state-badge.neutral {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.09);
}

@media (max-width: 900px) {
  .intelligence-hero {
    display: block;
  }

  .intelligence-mode {
    align-items: flex-start;
    margin-top: 18px;
  }

  .intelligence-mode small {
    text-align: left;
  }

  .intelligence-list-row {
    display: block;
  }

  .intelligence-list-meta {
    margin-top: 10px;
  }
}


/* ------------------------------------------------------------------
   ANI Intelligence Batch 2
   ------------------------------------------------------------------ */

.intelligence-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.intelligence-filters .field {
  min-width: 145px;
}

.intelligence-search-field {
  min-width: 260px !important;
  flex: 1;
}

.intelligence-filter-check {
  min-height: 42px;
  align-self: end;
}

.intelligence-record-link {
  color: var(--yaxxa-blue);
  font-weight: 800;
  text-decoration: none;
}

.intelligence-record-link:hover {
  text-decoration: underline;
}

.intelligence-large-link {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 17px;
}

.intelligence-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.intelligence-pagination span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.intelligence-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid rgba(0, 155, 223, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at top right,
      rgba(0, 155, 223, 0.12),
      transparent 44%
    ),
    rgba(10, 16, 27, 0.8);
}

.intelligence-detail-header h2 {
  margin: 12px 0 8px;
  font-size: 26px;
}

.intelligence-detail-header p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.intelligence-kv > div {
  min-width: 0;
}

.intelligence-evidence-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.intelligence-evidence-grid > div {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
}

.intelligence-evidence-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.intelligence-evidence-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.amd-canary-panel { border-left: 4px solid #6f63ff; }
.amd-canary-evidence { padding: 1rem 0; border-top: 1px solid var(--border-color); }
.amd-canary-evidence:first-of-type { border-top: 0; }
.amd-canary-metrics { display: flex; flex-wrap: wrap; gap: .65rem 1.5rem; margin-top: .75rem; }
.amd-canary-metrics span { color: var(--muted-text); }

.intelligence-error-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 12px;
  background: rgba(251, 113, 133, 0.08);
  color: #fecdd3;
  white-space: pre-wrap;
}

.intelligence-timeline {
  display: flex;
  flex-direction: column;
}

.intelligence-timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  padding-bottom: 20px;
}

.intelligence-timeline-row:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 13px;
  bottom: 0;
  width: 2px;
  background: rgba(0, 155, 223, 0.18);
}

.intelligence-timeline-marker {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 3px solid rgba(0, 155, 223, 0.32);
  border-radius: 50%;
  background: var(--yaxxa-blue);
}

.intelligence-timeline-row strong {
  display: block;
  margin-bottom: 4px;
}

.intelligence-timeline-row span {
  color: var(--muted);
  font-size: 12px;
}

.intelligence-timeline-row p {
  margin: 8px 0 0;
  color: var(--text);
}

.intelligence-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.intelligence-comparison .card {
  text-align: center;
}

.intelligence-comparison span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.intelligence-comparison strong {
  font-size: 28px;
}

.intelligence-comparison-arrow {
  color: var(--yaxxa-blue);
  font-size: 30px;
  font-weight: 900;
}

.intelligence-proposed-value {
  border-color: rgba(0, 155, 223, 0.35);
  background: rgba(0, 155, 223, 0.055);
}

.intelligence-json {
  max-height: 330px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(5, 9, 16, 0.75);
  color: #dce4f2;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .intelligence-detail-header {
    display: block;
  }

  .intelligence-detail-header .button {
    margin-top: 18px;
  }

  .intelligence-comparison {
    grid-template-columns: 1fr;
  }

  .intelligence-comparison-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
}


/* ------------------------------------------------------------------
   ANI Intelligence Batch 3 actions
   ------------------------------------------------------------------ */

.intelligence-action-grid {
  margin-bottom: 20px;
}

.intelligence-action-card textarea {
  width: 100%;
  resize: vertical;
}

.danger-zone {
  border-color: rgba(251, 113, 133, 0.22);
  background:
    linear-gradient(
      145deg,
      rgba(251, 113, 133, 0.035),
      transparent
    ),
    var(--card);
}

.button.danger {
  border-color: rgba(251, 113, 133, 0.36);
  background: rgba(190, 24, 93, 0.82);
  color: #ffffff;
}

.button.danger:hover {
  background: rgba(225, 29, 72, 0.92);
}

.intelligence-approved-panel {
  margin-bottom: 20px;
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.045);
}

.intelligence-three-way {
  grid-template-columns: repeat(3, 1fr);
}

.intelligence-reason-panel {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  line-height: 1.6;
}

.intelligence-warning-panel {
  margin: 16px 0;
  padding: 13px;
  border: 1px solid rgba(245, 158, 11, 0.27);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.07);
  color: #fde68a;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .intelligence-three-way {
    grid-template-columns: 1fr;
  }
}
/* Launch-complete navigation */
.sidebar-toggle { margin-left:auto; width:34px; height:34px; border:1px solid rgba(255,255,255,.18); border-radius:9px; background:transparent; color:inherit; cursor:pointer; }
.nav-section-label { width:100%; border:0; background:transparent; text-align:left; cursor:pointer; color:inherit; }
.nav-section-label::after { content:"⌄"; float:right; }
.nav-section-label[aria-expanded="false"]::after { content:"›"; }
.profile-menu { position:relative; }
.profile-menu-toggle { border:1px solid rgba(255,255,255,.14); cursor:pointer; }
.profile-menu-panel { position:absolute; z-index:30; right:0; top:calc(100% + 8px); min-width:230px; padding:8px; border:1px solid rgba(255,255,255,.14); border-radius:12px; background:#18202b; box-shadow:0 16px 40px rgba(0,0,0,.35); }
.profile-menu-panel a { display:block; padding:10px 12px; border-radius:8px; color:#fff; text-decoration:none; }
.profile-menu-panel a:hover,.profile-menu-panel a:focus { background:rgba(194,27,131,.2); }
body.sidebar-compact .sidebar { width:82px; }
body.sidebar-compact .main { margin-left:82px; width:calc(100% - 82px); }
body.sidebar-compact .brand-logo-full { max-width:48px; }
body.sidebar-compact .logo-subtitle,body.sidebar-compact .sidebar-footer,body.sidebar-compact .nav a,body.sidebar-compact .nav-group { display:none; }
body.sidebar-compact .nav-section-label { overflow:hidden; white-space:nowrap; text-indent:-9999px; min-height:28px; }
@media (max-width:900px) { body.sidebar-compact .sidebar,.sidebar { transform:translateX(-100%); width:270px; } body.sidebar-open .sidebar { transform:translateX(0); } body.sidebar-compact .main,.main { margin-left:0; width:100%; } }
.dashboard-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:18px 0}.chart-wide{grid-column:1/-1}.chart-host{min-height:190px}.chart-host svg{display:block;width:100%;max-height:260px;overflow:visible}.chart-summary{display:flex;flex-wrap:wrap;gap:10px 18px;color:var(--muted,#9ba8b7);font-size:.88rem}.chart-summary span strong{color:#fff}.chart-total{fill:#fff;font-size:24px;font-weight:800}.chart-label,.chart-empty{fill:#aab6c5;font-size:12px}.chart-grid{stroke:rgba(255,255,255,.1);stroke-width:1}.chart-line{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.chart-line.answer{stroke:#72bf44}.chart-line.negative{stroke:#e05757}@media(max-width:800px){.dashboard-chart-grid{grid-template-columns:1fr}.chart-wide{grid-column:auto}}
.error-state{text-align:center;padding:clamp(40px,8vw,90px) 24px}.error-state h2{font-size:clamp(1.6rem,3vw,2.4rem)}.stack-actions{display:flex;flex-wrap:wrap;gap:10px}.checklist p{padding:12px 14px;border:1px solid rgba(255,255,255,.1);border-radius:10px}

/* Cause-code governance */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.governance-heading,.governance-section .section-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}.governance-heading .muted,.governance-section .muted{margin-top:7px}.governance-section{margin-bottom:18px}.governance-metrics .metric strong{display:block;margin-top:10px;font-size:30px}.governance-metrics .metric small{color:var(--muted)}
.governance-filters{display:grid;grid-template-columns:2fr 1fr 1fr auto;align-items:end;gap:12px;margin-bottom:18px}.governance-filters .field{margin:0}.source-builtin{color:#9bddfa;background:rgba(0,155,223,.12)}.source-global{color:#dca5ca;background:rgba(194,27,131,.14)}.source-tenant{color:#b9f59c;background:rgba(114,191,68,.12)}.source-unknown{color:#ffe09a;background:rgba(255,200,87,.12)}
.governance-editor-layout{display:grid;gap:18px}.policy-comparison{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:16px}.policy-comparison article{padding:16px;border:1px solid var(--border);border-radius:var(--radius-sm);background:rgba(255,255,255,.025)}.policy-comparison h3{margin-top:0}.policy-comparison dl{margin-bottom:0}.policy-comparison dt{margin-top:10px;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase}.policy-comparison dd{margin:3px 0 0;overflow-wrap:anywhere}
.governance-warning{margin-top:16px;padding:14px;border-left:4px solid var(--warn);border-radius:var(--radius-sm);background:rgba(255,200,87,.08)}.governance-editor-layout textarea{min-height:96px}.impact-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.impact-grid div{padding:13px;border:1px solid var(--border);border-radius:var(--radius-sm)}.impact-grid dt{color:var(--muted);font-size:11px;text-transform:uppercase}.impact-grid dd{margin:5px 0 0;font-size:21px;font-weight:800}
.warning-list{padding-left:22px;color:#ffe09a}.warning-list li+li{margin-top:8px}.governance-action{margin-top:20px;padding-top:20px;border-top:1px solid var(--border)}.governance-secondary-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:18px}.governance-secondary-actions form{display:grid;gap:8px;padding:14px;border:1px solid var(--border);border-radius:var(--radius-sm)}.empty-state.error-state{border-color:rgba(255,95,109,.45)}
@media(max-width:1000px){.policy-comparison,.impact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.governance-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.governance-heading,.governance-section .section-heading{flex-direction:column}.policy-comparison,.impact-grid,.governance-filters,.governance-secondary-actions{grid-template-columns:1fr}}
.canary-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem;margin-bottom:1rem}.metric-card{display:flex;flex-direction:column;gap:.35rem}.metric-card>strong{font-size:2rem}.metric-card>small{color:var(--muted)}.canary-table progress{width:100%;min-width:110px}.canary-outcome-grid{display:grid;grid-template-columns:repeat(2,minmax(90px,1fr));gap:.35rem;margin:.5rem 0}.canary-outcome-grid div{display:flex;justify-content:space-between;gap:1rem;border-bottom:1px solid var(--border);padding:.25rem 0}.canary-outcome-grid dt,.canary-outcome-grid dd{margin:0}.needs-attention-row{box-shadow:inset 3px 0 0 var(--danger)}.canary-table details{min-width:180px}.canary-table summary{cursor:pointer;font-weight:600}

/* Manual DID swap */
.manual-swap-action{min-width:170px}.manual-swap-disabled{display:block;max-width:240px;margin-top:.4rem;color:var(--muted)}
.manual-swap-dialog{width:min(560px,calc(100% - 2rem));padding:1.4rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--card);color:inherit}
.manual-swap-dialog::backdrop{background:rgba(0,0,0,.7)}.manual-swap-dialog form{display:grid;gap:1rem}.manual-swap-dialog textarea{width:100%;resize:vertical}
.manual-swap-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin:0}.manual-swap-summary div{padding:.7rem;border:1px solid var(--border);border-radius:var(--radius-sm)}.manual-swap-summary dt{color:var(--muted);font-size:.75rem;text-transform:uppercase}.manual-swap-summary dd{margin:.25rem 0 0;font-weight:700}.manual-swap-warning{padding:.75rem;border-left:3px solid var(--warn);background:rgba(255,200,87,.08)}
@media(max-width:600px){.manual-swap-summary{grid-template-columns:1fr}}
