:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0a1728;
  --surface: rgba(14, 29, 48, 0.86);
  --surface-solid: #0e1d30;
  --surface-raised: #13263d;
  --line: rgba(164, 193, 220, 0.14);
  --line-strong: rgba(164, 193, 220, 0.24);
  --text: #f2f7fb;
  --muted: #91a8bc;
  --accent: #48d6ba;
  --accent-strong: #22b99c;
  --accent-soft: rgba(72, 214, 186, 0.12);
  --blue: #71a8ff;
  --warning: #f5bf64;
  --danger: #ff7c88;
  --success: #63ddb2;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --radius-small: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -20%, rgba(44, 116, 153, 0.24), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(113, 168, 255, 0.7);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link {
  background: var(--accent);
  color: #04120f;
  left: 1rem;
  padding: 0.65rem 1rem;
  position: fixed;
  top: -4rem;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  margin-bottom: 0;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin-bottom: 0.45rem;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.brand {
  align-items: center;
  display: flex;
  gap: 0.8rem;
}

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

.brand strong {
  font-size: 1.03rem;
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.05rem;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(145deg, rgba(72, 214, 186, 0.2), rgba(113, 168, 255, 0.12));
  border: 1px solid rgba(72, 214, 186, 0.28);
  border-radius: 12px;
  display: inline-flex;
  height: 50px;
  justify-content: center;
  width: 50px;
}

.brand-mark img {
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.login-view {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 2rem;
  position: relative;
}

.login-atmosphere {
  background:
    linear-gradient(rgba(72, 214, 186, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 214, 186, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  inset: 0;
  mask-image: radial-gradient(circle at center, black 0, transparent 72%);
  opacity: 0.4;
  position: absolute;
}

.login-view::before,
.login-view::after {
  border-radius: 50%;
  content: "";
  filter: blur(4px);
  position: absolute;
}

.login-view::before {
  background: rgba(72, 214, 186, 0.11);
  height: 26rem;
  left: -8rem;
  top: -9rem;
  width: 26rem;
}

.login-view::after {
  background: rgba(63, 113, 182, 0.16);
  bottom: -13rem;
  height: 34rem;
  right: -12rem;
  width: 34rem;
}

.login-card {
  backdrop-filter: blur(22px);
  background: linear-gradient(145deg, rgba(17, 35, 57, 0.94), rgba(8, 20, 35, 0.92));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-width: 430px;
  padding: clamp(1.6rem, 5vw, 2.5rem);
  position: relative;
  width: 100%;
  z-index: 1;
}

.brand-login {
  flex-direction: column;
  gap: 0.7rem;
  justify-content: center;
  margin-bottom: 1.7rem;
  text-align: center;
}

.brand-login .brand-mark {
  border-radius: 22px;
  height: 104px;
  width: 104px;
}

.brand-login .brand-mark img {
  height: 90px;
  width: 90px;
}

.brand-login strong {
  font-size: 1.55rem;
}

.login-copy p:not(.eyebrow) {
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.login-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  margin: 1.6rem 0 0;
  padding-top: 1.1rem;
}

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

.workspace-alert {
  align-items: flex-start;
  background: rgba(255, 124, 136, 0.1);
  border: 1px solid rgba(255, 124, 136, 0.42);
  border-radius: var(--radius-small);
  color: var(--text);
  display: grid;
  gap: 0.75rem 1.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 1fr);
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
}

.workspace-alert p,
.workspace-alert ul {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.2rem 0 0;
}

.workspace-alert ul {
  padding-left: 1.2rem;
}

.workspace-alert li + li {
  margin-top: 0.2rem;
}

.sidebar {
  background: rgba(7, 17, 31, 0.92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.5rem 1.1rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.sidebar > .brand {
  padding: 0 0.65rem 1.8rem;
}

.nav-list {
  display: grid;
  gap: 0.28rem;
}

.nav-item,
.profile-chip {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-small);
  color: var(--muted);
  display: flex;
  gap: 0.75rem;
  padding: 0.72rem 0.78rem;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
  width: 100%;
}

.nav-item:hover,
.profile-chip:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: #baf9ea;
}

.nav-icon {
  align-items: center;
  display: inline-flex;
  font-size: 1.1rem;
  height: 1.35rem;
  justify-content: center;
  width: 1.35rem;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: 0.85rem;
}

.profile-menu {
  position: relative;
}

.profile-chevron {
  margin-left: auto;
  transition: transform 140ms ease;
}

.profile-chip[aria-expanded="true"] .profile-chevron {
  transform: rotate(180deg);
}

.profile-menu-popover {
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  bottom: calc(100% + 0.55rem);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.25rem;
  left: 0;
  padding: 0.45rem;
  position: absolute;
  width: 100%;
  z-index: 35;
}

.profile-menu-popover button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  text-align: left;
  width: 100%;
}

.profile-menu-popover button:hover,
.profile-menu-popover button:focus-visible {
  background: var(--accent-soft);
}

.profile-chip strong,
.profile-chip small {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chip strong {
  color: var(--text);
  font-size: 0.84rem;
}

.profile-chip small {
  font-size: 0.7rem;
  text-transform: capitalize;
}

.avatar {
  align-items: center;
  background: linear-gradient(145deg, var(--accent), #5da2ed);
  border-radius: 50%;
  color: #07111f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  text-transform: uppercase;
  width: 34px;
}

.avatar.large {
  font-size: 1.5rem;
  height: 72px;
  width: 72px;
}

.workspace {
  min-width: 0;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(7, 17, 31, 0.74);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  min-height: 86px;
  padding: 1rem clamp(1rem, 4vw, 2.7rem);
  position: sticky;
  top: 0;
  z-index: 15;
}

.topbar > h1 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin: 0;
  text-align: center;
}

.topbar-actions {
  align-items: center;
  display: flex;
  position: absolute;
  right: clamp(1rem, 4vw, 2.7rem);
}

.status-dot {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  gap: 0.45rem;
}

.status-dot::before {
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(99, 221, 178, 0.09);
  content: "";
  height: 7px;
  width: 7px;
}

.status-dot.success {
  color: var(--success);
}

.status-dot.error {
  color: var(--danger);
}

.content {
  margin: 0 auto;
  max-width: 1500px;
  padding: clamp(1rem, 3.5vw, 2.6rem);
}

.view {
  animation: reveal 180ms ease-out;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-panel {
  align-items: end;
  background:
    radial-gradient(circle at 90% 0, rgba(72, 214, 186, 0.15), transparent 24rem),
    linear-gradient(135deg, rgba(18, 45, 65, 0.94), rgba(11, 28, 47, 0.9));
  border: 1px solid rgba(72, 214, 186, 0.18);
  border-radius: var(--radius);
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  overflow: hidden;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  position: relative;
}

.hero-panel h2 {
  font-size: clamp(1.7rem, 4vw, 2.65rem);
  max-width: 720px;
}

.hero-panel p:not(.eyebrow) {
  color: #a9bdcc;
  margin-bottom: 0;
  max-width: 650px;
}

.configuration-status {
  align-items: center;
  background: linear-gradient(135deg, rgba(245, 191, 100, 0.09), rgba(72, 214, 186, 0.07));
  border: 1px solid rgba(245, 191, 100, 0.2);
  border-radius: var(--radius);
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 1.1rem 1.3rem;
}

.configuration-status h3,
.configuration-status p {
  margin-bottom: 0;
}

.configuration-status p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metric-card,
.panel,
.table-panel,
.resource-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card {
  padding: 1.2rem 1.3rem;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  display: block;
}

.metric-card span {
  font-size: 0.78rem;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin: 0.35rem 0 0.05rem;
}

.metric-card small {
  font-size: 0.7rem;
}

.metric-history .history-filter {
  align-items: stretch;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.metric-history .history-filter select {
  min-width: 0;
  width: 100%;
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.8fr);
}

.flow-panel {
  margin-bottom: 1rem;
}

.flow-head,
.flow-row {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1.5fr) minmax(180px, 0.8fr);
}

.flow-head {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  padding: 0.7rem 0.25rem 0.4rem;
  text-transform: uppercase;
}

.flow-map {
  display: grid;
  gap: 0.55rem;
}

.flow-row {
  align-items: stretch;
  border-left: 3px solid var(--success);
  border-radius: var(--radius-small);
  padding-left: 0.45rem;
}

.flow-row.problem {
  border-left-color: var(--danger);
}

.flow-row.disabled {
  border-left-color: var(--warning);
}

.flow-row.source-active {
  border-left-color: var(--success);
}

.flow-row.source-disabled {
  border-left-color: var(--warning);
}

.flow-row.source-error {
  border-left-color: var(--danger);
}

.flow-node.state-active,
.flow-route.state-active {
  border-color: rgba(99, 221, 178, 0.42);
}

.flow-node.state-disabled,
.flow-route.state-disabled {
  background: rgba(245, 191, 100, 0.09);
  border-color: rgba(245, 191, 100, 0.42);
}

.flow-node.state-error,
.flow-route.state-error {
  background: rgba(255, 124, 136, 0.09);
  border-color: rgba(255, 124, 136, 0.44);
}

.flow-row.disabled .flow-node,
.flow-row.disabled .flow-route {
  background: rgba(245, 191, 100, 0.09);
  border-color: rgba(245, 191, 100, 0.38);
}

.flow-row.disabled .flow-arrow {
  animation: none;
  color: var(--warning);
  opacity: 0.8;
}

.flow-row.problem .flow-node,
.flow-row.problem .flow-route {
  background: rgba(255, 124, 136, 0.09);
  border-color: rgba(255, 124, 136, 0.4);
}

.flow-row.problem .flow-arrow {
  animation: route-error 0.9s ease-in-out infinite;
  color: var(--danger);
}

.flow-node,
.flow-route {
  align-items: center;
  background: rgba(7, 17, 31, 0.52);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  display: flex;
  min-width: 0;
  padding: 0.72rem 0.85rem;
}

.flow-node {
  background: linear-gradient(135deg, rgba(72, 214, 186, 0.09), rgba(113, 168, 255, 0.05));
  flex-direction: column;
  justify-content: center;
}

.source-node {
  flex-direction: row;
  gap: 0.7rem;
  justify-content: flex-start;
}

.source-product-icon {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  display: block;
  flex: 0 0 auto;
  height: 34px;
  object-fit: contain;
  padding: 4px;
  width: 34px;
}

.source-identity {
  align-items: center;
  display: flex;
  gap: 0.7rem;
}

.source-identity strong,
.source-identity small {
  display: block;
}

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

.category-virtualization {
  border-color: rgba(113, 168, 255, 0.34);
}

.category-monitoring {
  border-color: rgba(245, 191, 100, 0.34);
}

.category-storage {
  border-color: rgba(72, 214, 186, 0.34);
}

.category-networking {
  border-color: rgba(82, 202, 255, 0.34);
}

.category-hardware {
  border-color: rgba(190, 132, 255, 0.34);
}

.category-automation {
  border-color: rgba(99, 221, 178, 0.34);
}

.category-containers {
  border-color: rgba(70, 156, 255, 0.34);
}

.category-security {
  border-color: rgba(255, 124, 136, 0.34);
}

.category-generic {
  border-color: var(--line-strong);
}

.destination-node {
  flex-direction: row;
  gap: 0.7rem;
  justify-content: flex-start;
}

.flow-node strong,
.flow-node small,
.flow-route strong,
.flow-route small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-node small,
.flow-route small {
  color: var(--muted);
  font-size: 0.7rem;
}

.flow-route {
  gap: 0.75rem;
  justify-content: space-between;
}

.flow-route > div {
  min-width: 0;
  text-align: center;
}

.flow-arrow {
  animation: route-flow 1.25s ease-in-out infinite;
  color: var(--accent);
  flex: 0 0 auto;
  font-size: 1.1rem;
}

.flow-arrow.delayed {
  animation-delay: 0.3s;
}

.flow-arrow.flow-active {
  color: var(--success);
}

.flow-arrow.flow-disabled {
  animation: none;
  color: var(--warning);
  opacity: 1;
}

.flow-arrow.flow-error {
  animation: none;
  color: var(--danger);
  opacity: 1;
}

@keyframes route-flow {
  0%, 100% { opacity: 0.35; transform: translateX(-3px); }
  50% { opacity: 1; transform: translateX(3px); }
}

@keyframes route-error {
  0%, 100% { opacity: 0.45; transform: translateY(-3px); }
  50% { opacity: 1; transform: translateY(3px); }
}

.flow-row.unrouted {
  opacity: 0.7;
}

.history-filter {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.history-filter span {
  color: var(--muted);
  font-size: 0.72rem;
}

.history-filter select {
  min-width: 130px;
}

.notice-console {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.notice-form {
  align-items: end;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.35fr) auto;
}

.notice-form .wide {
  grid-column: 1 / 3;
}

.notice-list {
  display: grid;
  gap: 0.6rem;
}

.notice-item {
  align-items: start;
  background: rgba(113, 168, 255, 0.06);
  border: 1px solid rgba(113, 168, 255, 0.16);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.notice-item.warning {
  background: rgba(245, 191, 100, 0.06);
  border-left-color: var(--warning);
}

.notice-item.danger {
  background: rgba(255, 124, 136, 0.06);
  border-left-color: var(--danger);
}

.notice-item p {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.35rem 0;
}

.notice-actions {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.notice-item small {
  color: var(--muted);
  white-space: nowrap;
}

.notice-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.notice-close {
  flex: 0 0 auto;
}

.dashboard-deliveries-panel {
  margin-top: 1rem;
}

.settings-card {
  box-sizing: border-box;
  max-width: none;
  width: 100%;
}

.settings-card + .settings-card {
  margin-top: 1.25rem;
}

.panel {
  padding: 1.35rem;
}

.panel-heading,
.section-toolbar,
.modal-heading {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.panel-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
  padding-bottom: 1rem;
}

.centered-heading {
  justify-content: center;
  text-align: center;
}

.centered-heading h2,
.panel-heading > h2 {
  font-size: 1.45rem;
  margin: 0;
}

.panel-heading p,
.section-toolbar p,
.account-grid p {
  color: var(--muted);
  margin-bottom: 0;
}

.activity-list {
  display: grid;
}

.activity-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.9rem 0.15rem;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item strong,
.activity-item small {
  display: block;
}

.activity-item small {
  color: var(--muted);
  font-size: 0.72rem;
}

.event-indicator {
  background: var(--accent-soft);
  border-radius: 10px;
  color: var(--accent);
  display: grid;
  height: 34px;
  place-items: center;
  width: 34px;
}

.setup-list {
  display: grid;
  gap: 0.8rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.setup-list li {
  align-items: start;
  display: flex;
  gap: 0.8rem;
}

.setup-list li > span {
  align-items: center;
  background: rgba(113, 168, 255, 0.1);
  border: 1px solid rgba(113, 168, 255, 0.18);
  border-radius: 50%;
  color: var(--blue);
  display: flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.setup-list li.complete > span {
  background: var(--accent-soft);
  border-color: rgba(72, 214, 186, 0.2);
  color: var(--accent);
}

.setup-list li.complete > span::after {
  content: "✓";
}

.setup-list li.complete > span {
  font-size: 0;
}

.setup-list strong,
.setup-list small {
  display: block;
}

.setup-list small {
  color: var(--muted);
  font-size: 0.73rem;
  margin-top: 0.15rem;
}

.section-toolbar {
  align-items: end;
  margin-bottom: 1.25rem;
}

.resource-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.resource-card {
  min-width: 0;
  padding: 1.15rem;
  transition: border-color 140ms ease, transform 140ms ease;
}

.resource-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.resource-heading {
  align-items: start;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.resource-identity {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-width: 0;
}

.resource-icon {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(72, 214, 186, 0.16);
  border-radius: 12px;
  color: var(--accent);
  display: flex;
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  text-transform: uppercase;
  width: 42px;
}

.output-icon-image,
.output-icon-fallback {
  display: block;
  height: 25px;
  object-fit: contain;
  width: 25px;
}

.output-icon-fallback {
  align-items: center;
  background: rgba(113, 168, 255, 0.16);
  border-radius: 7px;
  color: var(--text);
  display: flex;
  font-size: 0.8rem;
  justify-content: center;
}

.output-icon-fallback.teams {
  background: #6264a7;
}

.output-icon-fallback.slack {
  background: #4a154b;
}

.resource-identity strong,
.resource-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-identity small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: capitalize;
}

.resource-meta {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
  padding: 0.85rem 0;
}

.resource-actions,
.row-actions,
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resource-actions .button {
  flex: 1 1 auto;
}

.yaml-resource {
  border-style: dashed;
}

.resource-note {
  color: var(--muted);
  font-size: 0.74rem;
  margin-bottom: 0;
}

.yaml-row {
  background: rgba(245, 191, 100, 0.025);
}

.badge {
  align-items: center;
  background: rgba(145, 168, 188, 0.1);
  border: 1px solid rgba(145, 168, 188, 0.12);
  border-radius: 999px;
  color: #b4c7d6;
  display: inline-flex;
  font-size: 0.66rem;
  font-weight: 750;
  gap: 0.35rem;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.48rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.success {
  background: rgba(99, 221, 178, 0.1);
  border-color: rgba(99, 221, 178, 0.15);
  color: var(--success);
}

.badge.warning {
  background: rgba(245, 191, 100, 0.1);
  border-color: rgba(245, 191, 100, 0.16);
  color: var(--warning);
}

.badge.danger {
  background: rgba(255, 124, 136, 0.1);
  border-color: rgba(255, 124, 136, 0.16);
  color: var(--danger);
}

.status-button,
.route-name-button {
  cursor: pointer;
}

.status-button:disabled {
  cursor: default;
}

.route-name-button {
  background: transparent;
  border: 0;
  color: var(--text);
  font-weight: 750;
  padding: 0;
  text-align: left;
}

.route-name-button:hover {
  color: var(--accent);
}

.order-actions {
  flex-wrap: nowrap;
}

.table-panel {
  overflow: hidden;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #c8d7e2;
  font-size: 0.8rem;
}

td strong,
td small {
  display: block;
}

td strong {
  color: var(--text);
}

td small {
  color: var(--muted);
  margin-top: 0.08rem;
}

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

.timeline {
  display: grid;
  gap: 0.75rem;
}

.timeline-item {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 1rem;
}

.timeline-item p {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.timeline-item.danger {
  border-left: 4px solid var(--danger);
}

.timeline-item.success {
  border-left: 4px solid var(--success);
}

.timeline-item.information {
  border-left: 4px solid var(--blue);
}

.timeline-item.information .event-indicator {
  background: rgba(113, 168, 255, 0.12);
  color: var(--blue);
}

.delivery-context {
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
}

.timeline-item .event-description {
  background: rgba(4, 14, 26, 0.5);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #c8d7e2;
  line-height: 1.55;
  margin-top: 0.65rem;
  padding: 0.7rem 0.8rem;
}

.toolbar-fields {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.toolbar-fields label > span {
  color: var(--muted);
  display: block;
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}

.audit-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.audit-footer label {
  min-width: 130px;
}

.audit-footer label > span {
  color: var(--muted);
  display: block;
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}

.timeline-meta {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
  white-space: nowrap;
}

.user-cell {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

#audit-table td:first-child,
#user-table td:nth-child(3) {
  white-space: nowrap;
}

.button,
.icon-button,
.text-button {
  align-items: center;
  border: 0;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  transition: background 140ms ease, border-color 140ms ease, opacity 140ms ease,
    transform 140ms ease;
}

.button {
  border-radius: 10px;
  min-height: 38px;
  padding: 0.56rem 0.9rem;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button.primary {
  background: var(--accent);
  color: #041510;
}

.button.primary:hover:not(:disabled) {
  background: #63e6ca;
}

.button.secondary {
  background: rgba(145, 168, 188, 0.1);
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.button.danger {
  background: rgba(255, 124, 136, 0.12);
  border: 1px solid rgba(255, 124, 136, 0.2);
  color: #ffadb5;
}

.button.small {
  font-size: 0.72rem;
  min-height: 30px;
  padding: 0.35rem 0.6rem;
}

.button.full {
  width: 100%;
}

.icon-button {
  background: rgba(145, 168, 188, 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  height: 38px;
  width: 38px;
}

.text-button {
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  padding: 0.3rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stack.compact {
  gap: 0.8rem;
}

label > span,
fieldset legend {
  color: #c5d5e0;
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.36rem;
}

label small {
  color: var(--muted);
  display: block;
  font-size: 0.67rem;
  margin-top: 0.3rem;
}

input,
select,
textarea {
  background: rgba(4, 14, 26, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  min-height: 42px;
  padding: 0.58rem 0.7rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  width: 100%;
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(164, 193, 220, 0.38);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(72, 214, 186, 0.65);
  box-shadow: 0 0 0 3px rgba(72, 214, 186, 0.08);
}

.search-field {
  min-width: min(320px, 100%);
}

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

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

.switch-field {
  align-items: center;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  gap: 0.6rem;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
}

.switch-field input {
  accent-color: var(--accent);
  min-height: auto;
  width: auto;
}

.switch-field span {
  margin: 0;
}

.form-error {
  background: rgba(255, 124, 136, 0.09);
  border: 1px solid rgba(255, 124, 136, 0.18);
  border-radius: 8px;
  color: #ffb5bc;
  font-size: 0.76rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
}

.field-help {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.8rem;
}

.empty-state {
  color: var(--muted);
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.account-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(240px, 0.7fr) minmax(320px, 1.3fr);
}

.data-tools-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-tool-card {
  align-content: space-between;
  display: grid;
  gap: 1rem;
}

.data-tool-card h3 {
  margin: 0.15rem 0 0.35rem;
}

.data-tool-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
  margin: 0;
}

.configuration-card {
  grid-column: 1 / -1;
}

.configuration-summary,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.configuration-inputs {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.configuration-input {
  align-items: center;
  background: rgba(4, 14, 26, 0.4);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  padding: 0.72rem 0.8rem;
}

.configuration-input strong,
.configuration-input small {
  display: block;
}

.configuration-input small {
  color: var(--muted);
  font-size: 0.68rem;
}

.backup-card {
  grid-column: 1 / -1;
}

.backup-targets-card {
  grid-column: 1 / -1;
}

.backup-schedule-card {
  grid-column: 1 / -1;
}

.backup-schedule-card .wide small {
  color: var(--muted);
  display: block;
  margin-top: 0.6rem;
}

.backup-list {
  display: grid;
  gap: 0.65rem;
}

.backup-list > .empty-state {
  padding: 1.5rem;
}

.backup-item {
  align-items: center;
  background: rgba(4, 14, 26, 0.48);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.8rem;
}

.backup-item strong,
.backup-item small,
.backup-item code {
  display: block;
}

.backup-item small,
.backup-item code {
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 0.18rem;
}

.identity-card {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.identity-card h3 {
  margin-bottom: 0.15rem;
}

.identity-card small {
  color: var(--muted);
}

.avatar-image {
  object-fit: cover;
}

.avatar-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.avatar-editor {
  display: grid;
  flex-basis: 100%;
  gap: 0.7rem;
  max-width: 280px;
}

.avatar-editor canvas {
  background: rgba(4, 14, 26, 0.75);
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: move;
  height: 256px;
  max-width: 100%;
  touch-action: none;
  width: 256px;
}

.avatar-editor label span,
.avatar-editor small {
  color: var(--muted);
  display: block;
  font-size: 0.7rem;
}

.health-panel {
  margin-bottom: 1rem;
}

.health-check-list {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.health-check {
  align-items: center;
  background: rgba(4, 14, 26, 0.4);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.7rem;
}

.health-check strong,
.health-check small {
  display: block;
}

.health-check small {
  color: var(--muted);
  font-size: 0.68rem;
}

.health-indicator {
  align-items: center;
  background: rgba(99, 221, 178, 0.12);
  border-radius: 50%;
  color: var(--success);
  display: flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.health-indicator.warning,
.health-indicator.error {
  background: rgba(245, 191, 100, 0.12);
  color: var(--warning);
}

.health-indicator.error {
  background: rgba(255, 124, 136, 0.12);
  color: var(--danger);
}

.danger-panel {
  align-items: center;
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
}

.restart-panel {
  margin-top: 1.5rem;
}

.update-panel {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.update-panel div {
  background: rgba(4, 14, 26, 0.45);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}

.update-panel strong,
.update-panel span {
  display: block;
}

.update-panel span {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 750;
  margin-top: 0.35rem;
}

.update-panel p {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
}

dialog {
  color: var(--text);
}

dialog::backdrop {
  backdrop-filter: blur(8px);
  background: rgba(1, 7, 14, 0.72);
}

.modal {
  background: linear-gradient(145deg, #10243a, #0a192a);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 2rem);
  max-width: 760px;
  overflow: auto;
  padding: 0;
  width: calc(100% - 2rem);
}

.modal > form,
.modal > div,
.modal > p,
.modal > .secret-value {
  margin-left: 1.4rem;
  margin-right: 1.4rem;
}

.modal > form {
  margin-bottom: 1.4rem;
  margin-top: 1.4rem;
}

.modal-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
}

.modal-heading h2 {
  font-size: 1.35rem;
  margin: 0;
}

.modal fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.2rem 0 0;
  padding: 1.1rem 0 0;
}

.modal-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
  padding-top: 1rem;
}

.small-modal {
  max-width: 520px;
}

.preview-modal {
  max-width: 820px;
}

.preview-actions {
  margin-top: 1rem;
}

.code-result,
.secret-value {
  background: rgba(2, 10, 19, 0.8);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.code-result {
  color: #bde9da;
  font: 0.74rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  max-height: 310px;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.secret-value {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
}

.secret-value code {
  color: #bde9da;
  flex: 1;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.toast-region {
  bottom: 1.2rem;
  display: grid;
  gap: 0.6rem;
  max-width: 360px;
  position: fixed;
  right: 1.2rem;
  z-index: 100;
}

.toast {
  animation: toast-in 180ms ease-out;
  background: #152a40;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  font-size: 0.76rem;
  padding: 0.75rem 0.9rem;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-only {
  display: none;
}

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

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

@media (max-width: 780px) {
  .workspace-alert {
    grid-template-columns: 1fr;
  }

  .flow-head {
    display: none;
  }

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

  .flow-route {
    min-height: 68px;
  }
  .app-shell {
    display: block;
  }

  .sidebar {
    box-shadow: var(--shadow);
    left: 0;
    max-width: 290px;
    position: fixed;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    width: 86vw;
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-flex;
  }

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

  .topbar-actions {
    margin-left: auto;
    position: static;
  }

  .hero-panel,
  .configuration-status,
  .section-toolbar,
  .danger-panel {
    align-items: stretch;
    flex-direction: column;
  }

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

  .data-tools-grid {
    grid-template-columns: 1fr;
  }

  .backup-card {
    grid-column: auto;
  }

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

  .notice-form .wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .login-view {
    padding: 1rem;
  }

  .content {
    padding: 1rem;
  }

  .topbar {
    min-height: 74px;
    padding: 0.8rem 1rem;
  }

  .status-dot {
    display: none;
  }

  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

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

  .timeline-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .backup-item {
    align-items: stretch;
    flex-direction: column;
  }

  .timeline-meta {
    grid-column: 2;
    text-align: left;
  }

  .modal-actions,
  .preview-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .button,
  .preview-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.destination-test-detail {
  color: var(--danger);
  display: block;
  margin: -0.2rem 0 0.1rem;
  overflow-wrap: anywhere;
}
