/* EIS Connector Admin Dashboard */

:root {
  --color-primary: #1FB894;
  --color-primary-hover: #17A085;
  --color-bg-accent: #CDEDE3;
  --color-text: #1A2238;
  --color-text-muted: #5A6472;
  --color-surface: #ffffff;
  --color-warm-accent: #F5841F;
  --color-sidebar: #1A2238;
  --color-success: #1FB894;
  --color-warning: #F5A623;
  --color-critical: #E5484D;
  --color-neutral: #9AA5B1;
  --color-border: rgba(26, 34, 56, 0.08);
  --color-border-strong: #e4e9ef;
  --color-canvas: #eef1f5;
  --color-canvas-soft: #f6f8fa;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;

  --page-pad-x: clamp(1rem, 2.4vw, 2rem);
  --page-pad-y: clamp(1.15rem, 2vw, 1.85rem);
  --content-max: 1240px;
  --sidebar-width: 256px;
  --topbar-height: 68px;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(26, 34, 56, 0.05), 0 8px 24px rgba(26, 34, 56, 0.05);
  --shadow-card-hover: 0 8px 22px rgba(26, 34, 56, 0.09);
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
}

img,
svg {
  max-width: 100%;
}

/* App shell -------------------------------------------------------------- */

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

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 8% 0%, rgba(58, 202, 167, 0.16), transparent 15rem),
    linear-gradient(180deg, #202b47 0%, #18223a 45%, #121a2d 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 8px 0 28px rgba(12, 20, 37, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar-brand {
  padding: 1.15rem 1.1rem 1rem;
  background: rgba(8, 15, 30, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.sidebar .brand:hover {
  color: #fff;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.2;
}

.brand-text {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #17c9a0 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 18px rgba(8, 203, 158, 0.22), inset 0 1px rgba(255, 255, 255, 0.2);
}

.brand-mark-lg {
  width: 48px;
  height: 48px;
  font-size: 0.85rem;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 0.85rem 1.25rem;
}

.sidebar-section {
  margin-top: 1.15rem;
}

.sidebar-section:first-of-type {
  margin-top: 0.85rem;
}

.sidebar-section-title,
.sidebar-nav-label,
.sidebar-footer-label {
  display: block;
  padding: 0 0.7rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(216, 229, 242, 0.42);
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 40px;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: rgba(235, 241, 248, 0.74);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(31, 184, 148, 0.24), rgba(31, 184, 148, 0.1));
  border-color: rgba(100, 223, 194, 0.16);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.sidebar-link.active .nav-icon {
  color: #7ce0c9;
  opacity: 1;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.nav-icon--home {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1v-10.5Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1v-10.5Z'/%3E%3C/svg%3E");
}

.nav-icon--receipt {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M7 3h10v18l-2-1-2 1-2-1-2 1-2-1V3Z'/%3E%3Cpath d='M9 7h6M9 11h6M9 15h4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M7 3h10v18l-2-1-2 1-2-1-2 1-2-1V3Z'/%3E%3Cpath d='M9 7h6M9 11h6M9 15h4'/%3E%3C/svg%3E");
}

.nav-icon--alert {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3 2 20h20L12 3Z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3 2 20h20L12 3Z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E");
}

.nav-icon--sync {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 12a9 9 0 0 0-9-9 9 9 0 0 0-6.36 2.64M3 12a9 9 0 0 0 9 9 9 9 0 0 0 6.36-2.64'/%3E%3Cpath d='M3 3v6h6M21 21v-6h-6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 12a9 9 0 0 0-9-9 9 9 0 0 0-6.36 2.64M3 12a9 9 0 0 0 9 9 9 9 0 0 0 6.36-2.64'/%3E%3Cpath d='M3 3v6h6M21 21v-6h-6'/%3E%3C/svg%3E");
}

.nav-icon--terminal {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='14' rx='2'/%3E%3Cpath d='M7 16h10M8 12l2 2 4-4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='14' rx='2'/%3E%3Cpath d='M7 16h10M8 12l2 2 4-4'/%3E%3C/svg%3E");
}

.nav-icon--key {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='4'/%3E%3Cpath d='M11 11 21 21M16 11h5M19 8v6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='4'/%3E%3Cpath d='M11 11 21 21M16 11h5M19 8v6'/%3E%3C/svg%3E");
}

.nav-icon--config {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
}

.nav-icon--timeline {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h10M4 18h14'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h10M4 18h14'/%3E%3C/svg%3E");
}

.nav-icon--audit {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3 4 7v6c0 5 3.5 8 8 8s8-3 8-8V7l-8-4Z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3 4 7v6c0 5 3.5 8 8 8s8-3 8-8V7l-8-4Z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
}

.nav-icon--dot {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3C/svg%3E");
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 0.95rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 15, 30, 0.18);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(31, 184, 148, 0.28);
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sidebar .user-name {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.connector-status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.connector-status-pill--live {
  background: rgba(31, 184, 148, 0.12);
  border-color: rgba(31, 184, 148, 0.25);
  color: rgba(255, 255, 255, 0.88);
}

.main-nav,
.user-menu {
  display: none;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 72% -18%, rgba(31, 184, 148, 0.1), transparent 28rem),
    linear-gradient(180deg, #f7f9fb 0, #eef1f5 12rem);
}

/* Topbar ----------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  min-height: var(--topbar-height);
  padding: 0.7rem var(--page-pad-x);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(26, 34, 56, 0.03), 0 6px 18px rgba(26, 34, 56, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 0 1 220px;
}

.topbar-heading {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding-left: 0.8rem;
}

.topbar-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(var(--color-primary), #7ce0c9);
}

.topbar-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #798495;
}

.topbar-title {
  margin: 0;
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-text);
}

.bridge-panel {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.bridge-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: min(100%, 540px);
  min-height: 48px;
  padding: 0.45rem 0.85rem;
  background: rgba(249, 251, 252, 0.95);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(26, 34, 56, 0.04);
}

.bridge-widget--live {
  background: linear-gradient(90deg, #f9fffd, #f3fbf8);
  border-color: rgba(31, 184, 148, 0.28);
}

.bridge-widget--attention {
  border-color: rgba(245, 166, 35, 0.35);
}

.bridge-widget--paused {
  opacity: 0.82;
}

.bridge-summary {
  display: none;
}

.bridge-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 72px;
}

.bridge-node-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.bridge-node-label::before {
  content: "";
  width: 13px;
  height: 13px;
  display: inline-block;
  background: currentColor;
  opacity: 0.78;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.bridge-node--erp .bridge-node-label::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16v5H4zm0 7h16v9H4zm3 2v5h3v-5zm5 0v5h5v-5z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16v5H4zm0 7h16v9H4zm3 2v5h3v-5zm5 0v5h5v-5z'/%3E%3C/svg%3E");
}

.bridge-node--eis .bridge-node-label::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm3 3v2h10V8zm0 4v2h10v-2zm0 4v2h6v-2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm3 3v2h10V8zm0 4v2h10v-2zm0 4v2h6v-2z'/%3E%3C/svg%3E");
}

.bridge-node--mra .bridge-node-label::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 6v6c0 5.5 3.8 8.7 9 10 5.2-1.3 9-4.5 9-10V6zm0 3.2 5 2.2v4.5c0 3.6-2.2 5.9-5 6.9-2.8-1-5-3.3-5-6.9V7.4z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 6v6c0 5.5 3.8 8.7 9 10 5.2-1.3 9-4.5 9-10V6zm0 3.2 5 2.2v4.5c0 3.6-2.2 5.9-5 6.9-2.8-1-5-3.3-5-6.9V7.4z'/%3E%3C/svg%3E");
}

.bridge-node-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-neutral);
}

.status-pulse--live {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(31, 184, 148, 0.25);
  animation: pulse 2s infinite;
}

.status-pulse--error { background: var(--color-critical); }
.status-pulse--warn { background: var(--color-warning); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.bridge-connector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  min-width: 54px;
}

.bridge-line {
  position: relative;
  flex: 1;
  height: 2px;
  min-width: 24px;
  overflow: hidden;
  background: var(--color-neutral);
  border-radius: 1px;
}

.bridge-connector--live .bridge-line {
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
}

.bridge-connector--paused .bridge-line {
  background: repeating-linear-gradient(90deg, var(--color-neutral) 0 4px, transparent 4px 8px);
}

.bridge-widget--live .bridge-line::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -30%;
  width: 28%;
  height: 4px;
  border-radius: 999px;
  background: #77ddc4;
  box-shadow: 0 0 8px rgba(31, 184, 148, 0.7);
  animation: bridge-flow 1.9s linear infinite;
}

.bridge-widget--live .bridge-connector:nth-of-type(4) .bridge-line::after {
  animation-delay: 0.95s;
}

@keyframes bridge-flow {
  from { left: -30%; }
  to { left: 105%; }
}

.bridge-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: #eef2f4;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.bridge-badge--live {
  background: rgba(31, 184, 148, 0.15);
  color: #12866d;
}

.bridge-badge--paused {
  background: rgba(154, 165, 177, 0.2);
  color: #5f6b78;
}

.bridge-badge--warn {
  background: rgba(245, 166, 35, 0.15);
  color: #b87a12;
}

.bridge-sync-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 0 0 auto;
  padding-left: 0.85rem;
  border-left: 1px solid #e5eaef;
}

.sync-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  min-width: 88px;
}

.sync-meta-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.sync-meta-value {
  font-size: 0.78rem;
  color: var(--color-text);
  font-weight: 500;
}

.connector-toggle-form,
.logout-form {
  margin: 0;
}

/* Page content ----------------------------------------------------------- */

.page-content {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x) 2.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-content--auth {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(31, 184, 148, 0.1), transparent 28rem),
    var(--color-canvas);
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.page-header--toolbar,
.page-header--hero {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header--toolbar > form {
  margin: 0;
}

.page-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-lead {
  margin: 0.4rem 0 0;
  max-width: 62ch;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.text-muted { color: var(--color-text-muted); }
.text-warning { color: var(--color-warning); font-weight: 600; }
.text-critical { color: var(--color-critical); }
.status-success,
.status-ok { color: var(--color-success); }
.status-warning,
.status-warn { color: var(--color-warning); }
.status-critical,
.status-error { color: var(--color-critical); }

/* Cards / buttons / forms ------------------------------------------------ */

.card {
  --card-pad-x: 1.4rem;
  --card-pad-y: 1.25rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--card-pad-y) var(--card-pad-x);
  border: 1px solid var(--color-border);
}

.card > p:first-child {
  margin-top: 0;
}

.card > .table-responsive {
  margin-left: calc(-1 * var(--card-pad-x));
  margin-right: calc(-1 * var(--card-pad-x));
}

.card > .table-responsive:last-child {
  margin-bottom: calc(-1 * var(--card-pad-y));
}

.card-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card-failed {
  border-left: 4px solid var(--color-critical);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.5rem 1rem;
  border-radius: 9px;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, #22c9a0 0%, var(--color-primary) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 184, 148, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #1ec99a 0%, var(--color-primary-hover) 100%);
  color: #fff;
}

.btn-secondary {
  background: #eef2f4;
  color: var(--color-text);
}

.btn-secondary:hover { background: #e2e8ec; }

.btn-sm {
  min-height: 32px;
  padding: 0.32rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block { width: 100%; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

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

.btn-danger:hover {
  background: #c93a3f;
  color: #fff;
}

.btn-danger-text { color: var(--color-critical); }

.btn-danger-text:hover {
  background: rgba(229, 72, 77, 0.1);
  color: var(--color-critical);
}

.btn-disconnect {
  background: transparent;
  color: var(--color-critical);
  border: 1px solid rgba(229, 72, 77, 0.4);
}

.btn-disconnect:hover { background: rgba(229, 72, 77, 0.08); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-group--checkbox {
  justify-content: center;
}

input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--color-primary);
}

.form-group--grow {
  flex: 1;
  min-width: 200px;
}

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

.form-grid .form-group:has(.json-field),
.form-grid .form-group:has(textarea) {
  grid-column: 1 / -1;
}

.form-grid > .form-group:has(> .btn) {
  justify-content: flex-end;
  padding-top: 1.45rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid #eef2f4;
}

.crud-form { max-width: 920px; }
.field-help { font-size: 0.8rem; color: var(--color-text-muted); }
.field-error { font-size: 0.82rem; color: var(--color-critical); }
.required { color: var(--color-critical); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.json-field {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  width: 100%;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="email"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border: 1px solid #d5dde5;
  border-radius: 9px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder { color: #a0aab4; }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 184, 148, 0.15);
}

.filter-bar { padding: 1rem 1.15rem; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1rem;
  align-items: flex-end;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
}

.inline-form { display: inline; margin: 0; }

/* Metrics / health / quick links ---------------------------------------- */

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

.summary-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4rem;
  min-height: 118px;
  padding: 1.15rem 1.2rem;
}

.summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-neutral);
}

.summary-card--success::before { background: var(--color-success); }
.summary-card--warning::before { background: var(--color-warning); }
.summary-card--critical::before { background: var(--color-critical); }
.summary-card--default::before { background: var(--color-primary); }

.summary-icon {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(31, 184, 148, 0.12);
  color: #12866d;
}

.summary-icon::after,
.quick-link-icon::after,
.health-icon {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.summary-card--warning .summary-icon { background: rgba(245, 166, 35, 0.14); color: #b87a12; }
.summary-card--critical .summary-icon { background: rgba(229, 72, 77, 0.12); color: #b52e32; }
.summary-icon--transactions { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m2 4v2h10V7zm0 4v2h10v-2zm0 4v2h6v-2z'/%3E%3C/svg%3E"); }
.summary-icon--pending { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m1 5v5.2l3.5 2.1-1 1.7L11 13V7z'/%3E%3C/svg%3E"); }
.summary-icon--synced { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m9.2 16.2-3.7-3.7L4.1 14l5.1 5.1L20 8.3l-1.4-1.4z'/%3E%3C/svg%3E"); }
.summary-icon--failed { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 1 21h22zm1 15h-2v-2h2zm0-4h-2v-4h2z'/%3E%3C/svg%3E"); }
.summary-icon--offline { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16v12H4zm2 2v8h12V6zm5 10h2v2h3v2H8v-2h3z'/%3E%3C/svg%3E"); }
.summary-icon--terminal { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 4h18v13H3zm2 2v9h14V6zm4 11h6v2h3v2H6v-2h3z'/%3E%3C/svg%3E"); }
.summary-icon--alerts { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2.5 2.5 0 0 0 2.4-2h-4.8A2.5 2.5 0 0 0 12 22m7-5v-1l-2-2V9a5 5 0 0 0-4-4.9V3h-2v1.1A5 5 0 0 0 7 9v5l-2 2v1z'/%3E%3C/svg%3E"); }

.summary-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

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

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

.health-item--card {
  background: var(--color-canvas-soft);
  border: 1px solid #eef2f4;
  border-radius: var(--radius-sm);
  padding: 1rem 1.05rem;
}

.health-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.health-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.health-icon {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
}

.health-icon--erp { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 4h18v5H3zm0 7h18v9H3zm3 2v5h3v-5zm5 0v5h7v-5z'/%3E%3C/svg%3E"); }
.health-icon--mra { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 6v6c0 5.5 3.8 8.7 9 10 5.2-1.3 9-4.5 9-10V6zm0 3.2 5 2.2v4.5c0 3.6-2.2 5.9-5 6.9-2.8-1-5-3.3-5-6.9V7.4z'/%3E%3C/svg%3E"); }
.health-icon--database { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3C7 3 4 4.8 4 6v12c0 1.2 3 3 8 3s8-1.8 8-3V6c0-1.2-3-3-8-3m0 2c3.5 0 5.5 1 6 1.5-.5.5-2.5 1.5-6 1.5S6.5 7 6 6.5C6.5 6 8.5 5 12 5m6 13c-.5.5-2.5 1.5-6 1.5S6.5 18.5 6 18v-2c1.5.8 3.7 1.2 6 1.2s4.5-.4 6-1.2zm0-5c-.5.5-2.5 1.5-6 1.5S6.5 13.5 6 13v-2c1.5.8 3.7 1.2 6 1.2s4.5-.4 6-1.2z'/%3E%3C/svg%3E"); }
.health-icon--time { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm1 5h-2v6l5 3 1-1.7-4-2.3z'/%3E%3C/svg%3E"); }
.health-icon--reconciliation { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.5 6.5A8 8 0 0 0 4 9h2a6 6 0 0 1 10.9-1.3L14 10.5h7V3.5zM6 13.5h-7v7l2.8-2.8A8 8 0 0 0 20 15h-2A6 6 0 0 1 7.1 16.3z'/%3E%3C/svg%3E"); }

.health-status {
  font-size: 1.05rem;
  font-weight: 700;
}

.health-status[data-status="reachable"],
.health-status[data-status="ok"] { color: var(--color-success); }

.health-status[data-status="unreachable"],
.health-status[data-status="error"] { color: var(--color-critical); }

.health-detail,
.health-timestamp {
  font-size: 0.84rem;
  color: var(--color-text-muted);
}

.health-timestamp { margin: 1rem 0 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-accent {
  background: rgba(245, 132, 31, 0.12);
  color: var(--color-warm-accent);
}

.badge-live {
  background: rgba(31, 184, 148, 0.1);
  color: #12866d;
  padding: 0.32rem 0.65rem;
}

.badge-warning {
  background: rgba(245, 166, 35, 0.15);
  color: #b87a12;
}

.badge-success {
  background: rgba(31, 184, 148, 0.15);
  color: #12866d;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.quick-link-card {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.quick-link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  color: inherit;
  border-color: rgba(31, 184, 148, 0.2);
}

.quick-link-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.quick-link-card:hover .quick-link-arrow { color: var(--color-primary); }

.quick-link-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--color-primary);
}

.quick-link-icon::after { width: 18px; height: 18px; }
.quick-link-icon--primary { background: rgba(31, 184, 148, 0.15); }
.quick-link-icon--warning { background: rgba(245, 166, 35, 0.15); color: #b87a12; }
.quick-link-icon--critical { background: rgba(229, 72, 77, 0.15); color: #b52e32; }
.quick-link-icon--failed { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 1 21h22zm1 15h-2v-2h2zm0-4h-2v-4h2z'/%3E%3C/svg%3E"); }
.quick-link-icon--alert { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 22a2.5 2.5 0 0 0 2.4-2h-4.8A2.5 2.5 0 0 0 12 22m7-5v-1l-2-2V9a5 5 0 0 0-4-4.9V3h-2v1.1A5 5 0 0 0 7 9v5l-2 2v1z'/%3E%3C/svg%3E"); }
.quick-link-icon--terminal { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 4h18v13H3zm2 2v9h14V6zm4 11h6v2h3v2H6v-2h3z'/%3E%3C/svg%3E"); }

.quick-link-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.quick-link-card p {
  margin: 0;
  font-size: 0.86rem;
}

/* Tables ----------------------------------------------------------------- */

.table-card {
  --card-pad-x: 0;
  --card-pad-y: 0;
  padding: 0;
  overflow: hidden;
}

.table-card > .card-header {
  margin: 0;
  padding: 1.1rem 1.25rem 0.9rem;
}

.table-card > .filter-bar,
.table-card > .text-critical {
  margin: 0;
  padding: 0 1.2rem 1rem;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid #eef2f4;
  background: #fafbfc;
}

.table-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.table-filter-hint {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 500;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.9rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid #eef2f4;
  vertical-align: middle;
}

.data-table th {
  background: #f8fafb;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 700;
}

.data-table tbody tr:nth-child(even) { background: rgba(248, 250, 251, 0.7); }
.data-table tbody tr:hover { background: rgba(205, 237, 227, 0.22); }

.col-actions { width: 1%; white-space: nowrap; }

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.cell-subtext {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.18rem;
}

.row-failed { background: rgba(229, 72, 77, 0.06); }
.row-failed:hover { background: rgba(229, 72, 77, 0.1) !important; }

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

.empty-state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-state-icon { font-size: 2rem; opacity: 0.5; }
.empty-state-content p { margin: 0; }

.status-pill {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pending,
.status-submitting { background: rgba(245, 166, 35, 0.15); color: #b87a12; }
.status-synced { background: rgba(31, 184, 148, 0.15); color: #12866d; }
.status-offline_queued { background: rgba(245, 166, 35, 0.15); color: #b87a12; }
.status-failed_validation,
.status-failed_permanent { background: rgba(229, 72, 77, 0.15); color: #b52e32; }
.status-terminal-active { background: rgba(31, 184, 148, 0.15); color: #12866d; }
.status-terminal-blocked { background: rgba(229, 72, 77, 0.15); color: #b52e32; }
.status-terminal-pending_activation,
.status-terminal-deactivated { background: rgba(154, 165, 177, 0.2); color: #5f6b78; }
.severity-warning { background: rgba(245, 166, 35, 0.15); color: #b87a12; }
.severity-critical { background: rgba(229, 72, 77, 0.15); color: #b52e32; }

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

.status-dot-active { background: var(--color-success); box-shadow: 0 0 0 3px rgba(31, 184, 148, 0.25); }
.status-dot-blocked { background: var(--color-critical); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.25); }
.status-dot-inactive { background: var(--color-neutral); }

/* Detail / timeline / pagination / messages ------------------------------ */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.25rem;
  align-items: start;
}

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

.detail-list > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem;
}

.detail-list--compact > div {
  grid-template-columns: minmax(112px, 0.7fr) minmax(0, 1.4fr);
}

.detail-list dt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.detail-list dd {
  margin: 0;
  word-break: break-word;
}

code {
  font-size: 0.82rem;
  background: #f4f6f8;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.15rem;
  position: relative;
}

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

.timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.timeline-content { flex: 1; min-width: 0; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.timeline-header time {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.timeline-detail {
  margin: 0;
  padding: 0.75rem;
  background: #f8fafb;
  border-radius: 8px;
  font-size: 0.78rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid #eef2f4;
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.message {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.message--dismissed {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.message-body { flex: 1; }

.message-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  padding: 0;
}

.message-success {
  background: rgba(31, 184, 148, 0.1);
  color: #0f6b57;
  border-color: rgba(31, 184, 148, 0.2);
}

.message-error {
  background: rgba(229, 72, 77, 0.08);
  color: #9b2c30;
  border-color: rgba(229, 72, 77, 0.2);
}

.message-info,
.message-debug {
  background: rgba(154, 165, 177, 0.12);
  color: var(--color-text-muted);
  border-color: rgba(154, 165, 177, 0.2);
}

/* Login ------------------------------------------------------------------ */

.login-shell {
  width: min(100%, 420px);
}

.login-form-panel { display: block; padding: 0; }

.login-card {
  width: 100%;
  padding: 1.75rem 1.7rem 1.85rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 14px 36px rgba(26, 34, 56, 0.1);
}

.login-header { margin-bottom: 1.5rem; }
.login-header .brand-mark { margin-bottom: 1rem; }

.login-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-form .btn {
  min-height: 42px;
  margin-top: 0.25rem;
}

.card .form-actions:first-of-type {
  margin-top: 1rem;
}

.card > form > .field-help {
  display: block;
  margin: 0.85rem 0 0;
}

.login-brand-panel { display: none; }

/* Activation / checklist / invoices ------------------------------------- */

.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(26, 34, 56, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 9999;
}

.global-loader[hidden] { display: none !important; }

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

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

.activation-banner {
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(90deg, rgba(31, 184, 148, 0.04) 0%, #fff 40%);
}

.activation-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.activation-banner-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 184, 148, 0.12);
  border-radius: 10px;
  flex-shrink: 0;
  font-size: 1.35rem;
}

.activation-banner h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.activation-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.activation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: #f8fafb;
  border-radius: var(--radius-sm);
  border: 1px solid #eef2f4;
  flex-wrap: wrap;
}

.activation-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.activation-item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.activation-import-card {
  margin-top: 0.25rem;
  border-left: 4px solid var(--color-warm-accent);
}

.activation-import-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activation-response-card { margin-top: 0.25rem; }

.activation-response-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
}

.checklist-progress {
  height: 6px;
  background: #eef2f4;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.15rem;
}

.checklist-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: 999px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  background: #fafbfc;
  border: 1px solid #eef2f4;
}

.checklist-item--done {
  background: rgba(31, 184, 148, 0.06);
  border-color: rgba(31, 184, 148, 0.15);
}

.checklist-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: #eef2f4;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.checklist-item--done .checklist-icon {
  background: var(--color-primary);
  color: #fff;
}

.checklist-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.checklist-label { font-weight: 600; font-size: 0.9rem; }
.checklist-hint { font-size: 0.8rem; color: var(--color-text-muted); }

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

.transaction-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.75rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.transaction-stat span,
.transaction-stat small {
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.transaction-stat strong {
  grid-row: span 2;
  align-self: center;
  font-size: 1.35rem;
  line-height: 1;
}

.transaction-stat--success { border-color: rgba(31, 184, 148, 0.2); }
.transaction-stat--success strong { color: #12866d; }
.transaction-stat--warning { border-color: rgba(245, 166, 35, 0.22); }
.transaction-stat--warning strong { color: #b87a12; }

.invoice-name {
  display: block;
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.invoice-name:hover { color: var(--color-primary-hover); }
.table-date { display: block; font-size: 0.84rem; font-weight: 600; }

.title-with-status {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.source-invoice-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.source-invoice-summary > div {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.8rem 0.85rem;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fafbfc;
}

.source-invoice-summary span {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.source-invoice-summary strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-invoice-data {
  border: 1px solid #e7ebef;
  border-radius: 8px;
  overflow: hidden;
}

.source-invoice-data summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
}

.source-invoice-json {
  max-height: 36rem;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  background: #101827;
  color: #e4edf4;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
}

.source-invoice-unavailable {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem;
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 8px;
  background: #fffaf0;
  color: #8a641b;
  font-size: 0.84rem;
}

.mapped-line-items {
  margin: 0.25rem 0 1rem;
}

.mapped-summary {
  margin-bottom: 1rem;
}

.receipt-qr {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  color: #657085;
  font-size: 0.78rem;
  text-align: center;
}

.receipt-qr img {
  border: 1px solid #dfe4ec;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.4rem;
}

.nav-toggle,
.sidebar-backdrop { display: none; }

.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;
}

.sidebar-link:focus-visible,
.nav-toggle:focus-visible,
.topbar .btn:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(124, 224, 201, 0.48);
  outline-offset: 2px;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1200px) {
  .quick-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .topbar-left { flex: 1 1 auto; }
  .bridge-panel {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .bridge-widget {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .topbar-actions {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }
  .dashboard-panels,
  .health-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .summary-grid,
  .transaction-summary,
  .source-invoice-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  body.nav-open { overflow: hidden; }

  .app-shell { display: block; }

  .sidebar {
    width: min(86vw, 320px);
    height: 100dvh;
    position: fixed;
    z-index: 200;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 10px 0 30px rgba(26, 34, 56, 0.2);
  }

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

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    border: 0;
    background: rgba(26, 34, 56, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-backdrop--visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    background: #fff;
    color: var(--color-text);
    cursor: pointer;
  }

  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
  }

  .nav-toggle-icon { position: relative; }
  .nav-toggle-icon::before,
  .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-icon::before { top: -6px; }
  .nav-toggle-icon::after { top: 6px; }

  .topbar { min-height: 0; padding: 0.7rem 1rem; }
  .page-content { padding: 1.15rem 1rem 2rem; gap: 1rem; }
  .page-header h1 { font-size: 1.4rem; }
  .card {
    --card-pad-x: 1.1rem;
    --card-pad-y: 1.05rem;
    padding: var(--card-pad-y) var(--card-pad-x);
  }
  .data-table { min-width: 680px; }
  .data-table th,
  .data-table td { padding: 0.75rem 0.85rem; }
  .filter-row .form-group,
  .form-group--grow { width: 100%; min-width: 0; }
  .filter-actions { width: 100%; }
  .filter-actions .btn { flex: 1; }
  .detail-list > div,
  .detail-list--compact > div { grid-template-columns: 1fr; gap: 0.2rem; }
  .activation-response-list { grid-template-columns: 1fr; }
  .timeline-header { flex-direction: column; gap: 0.2rem; }
  .quick-links { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar-eyebrow { display: none; }
  .topbar-title { max-width: 16ch; font-size: 0.95rem; }
  .sync-meta { display: none; }
  .bridge-widget { min-width: 420px; }
  .summary-grid,
  .transaction-summary,
  .source-invoice-summary { grid-template-columns: 1fr; }
  .page-header--toolbar > .btn,
  .page-header--toolbar > a.btn { width: 100%; }
  .transaction-detail-header .action-buttons { width: 100%; }
  .transaction-detail-header .action-buttons .btn { flex: 1; }
  .activation-item-actions { width: 100%; }
  .activation-item-actions .btn,
  .activation-item-actions .inline-form { flex: 1; }
  .activation-item-actions .inline-form .btn { width: 100%; }
  .page-content--auth { padding: 1rem; }
  .login-card { padding: 1.4rem 1.25rem; }
}

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

.sync-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.sync-settings-panel h2,
.sync-actions-panel h2 { margin: 0; }
.sync-settings-panel p,
.sync-action span,
.sync-control-row span { display: block; color: var(--color-text-muted); font-size: .82rem; }
.sync-control-row,
.sync-action { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 1rem 0; border-bottom: 1px solid var(--color-border); }
.sync-control-row select { width: 10rem; }
.mode-toggle { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.mode-toggle label { cursor: pointer; }
.mode-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mode-toggle span { display: block; padding: .45rem .7rem; color: var(--color-text-muted); font-size: .8rem; }
.mode-toggle input:checked + span { background: var(--color-primary); color: #fff; }
.field-label { display: block; margin: 1rem 0 .35rem; font-weight: 600; font-size: .82rem; }
.sync-settings-panel input,
.sync-settings-panel select { width: 100%; min-height: 2.6rem; padding: .55rem .7rem; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--color-text); }
.sync-settings-panel .sync-control-row select { width: 10rem; }
.panel-actions { display: flex; justify-content: flex-end; margin-top: 1.2rem; }
.panel-copy { margin-top: .4rem; }
.sync-error { color: var(--color-critical) !important; }
.catalog-sync-table select { min-width: 12rem; }
.sync-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.sync-action { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 1rem; }
.sync-action form { flex-shrink: 0; }
.status-badge--success { color: var(--color-success); }
.status-badge--failed { color: var(--color-critical); }

@media (max-width: 720px) {
  .sync-settings-grid,
  .sync-action-grid { grid-template-columns: 1fr; }
  .sync-control-row { align-items: flex-start; flex-direction: column; }
  .sync-settings-panel .sync-control-row select { width: 100%; }
}

/* Density and loading polish ------------------------------------------------
   Shared final overrides keep every page compact and consistent. */
:root {
  --page-pad-x: clamp(0.9rem, 1.8vw, 1.45rem);
  --page-pad-y: clamp(1rem, 1.6vw, 1.35rem);
  --content-max: 1180px;
  --topbar-height: 60px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(26, 34, 56, .04), 0 5px 16px rgba(26, 34, 56, .045);
}

body { font-size: .9rem; line-height: 1.48; }
.sidebar-brand { padding: .9rem 1rem .8rem; }
.sidebar-nav { gap: .1rem; padding: .7rem .75rem .9rem; }
.sidebar-section, .sidebar-section:first-of-type { margin-top: .65rem; }
.sidebar-section-title, .sidebar-nav-label, .sidebar-footer-label { padding-bottom: .3rem; }
.sidebar-link { min-height: 44px; padding: .45rem .7rem; font-size: .88rem; }
.sidebar-footer { gap: .5rem; padding: .75rem .85rem; }

.topbar { gap: .6rem .85rem; padding-top: .5rem; padding-bottom: .5rem; }
.topbar-left { flex-basis: 180px; }
.topbar-heading { padding-left: .65rem; }
.topbar-title { font-size: 1rem; }
.bridge-panel { flex: 1 1 440px; }
.bridge-widget { min-height: 46px; padding: .35rem .6rem; gap: .45rem; }
.bridge-node-label, .sync-meta-label { font-size: .65rem; }
.bridge-node-status { font-size: .78rem; }
.bridge-badge { padding: .22rem .45rem; font-size: .65rem; }
.topbar-actions { gap: .65rem; padding-left: .65rem; }

.page-content { gap: 1rem; }
.page-header { margin-bottom: .1rem; padding-bottom: .85rem; }
.page-header--hero { padding-top: .25rem; }
.page-eyebrow { margin-bottom: .25rem; font-size: .7rem; }
.page-header h1 { font-size: clamp(1.55rem, 2.3vw, 2rem); margin-bottom: .35rem; }
.page-lead { max-width: 48rem; font-size: 1rem; }
.card { padding: 1rem 1.1rem; border-radius: var(--radius); }
.card-header { margin-bottom: .85rem; }
.card-header h2 { font-size: 1.05rem; }
.card-subtitle { font-size: .84rem; }

.summary-grid { gap: .7rem; }
.summary-card { min-height: 112px; padding: .85rem 1rem; }
.summary-label { font-size: .72rem; }
.summary-value { font-size: 2rem; }
.summary-icon { width: 34px; height: 34px; }
.dashboard-panels { gap: .85rem; }
.health-grid { gap: .65rem; }
.health-item--card { padding: .8rem; min-height: 112px; }
.health-label { font-size: .72rem; }
.health-status { font-size: 1rem; }
.health-detail { font-size: .78rem; }
.quick-links { gap: .7rem; }
.quick-link-card { padding: .85rem .95rem; }

.table-card { padding: 0; }
.data-table th, .data-table td { padding: .68rem .85rem; }
.data-table th { font-size: .66rem; }
.filter-row { gap: .65rem; }
.form-group label, .field-label { font-size: .78rem; }
.detail-grid { gap: .85rem; }

/* Shared in-flight treatment for health, bridge checks, tables and actions. */
.button-spinner { display: inline-block; width: .9rem; height: .9rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; opacity: .78; cursor: wait; }
.health-item.is-loading { position: relative; overflow: hidden; color: transparent; pointer-events: none; }
.health-item.is-loading > * { visibility: hidden; }
.health-item.is-loading::after { content: ""; position: absolute; inset: .8rem; border-radius: 6px; background: linear-gradient(100deg, #edf1f4 20%, #f8fafb 38%, #edf1f4 56%); background-size: 200% 100%; animation: skeleton-shimmer 1.1s linear infinite; }
.health-item--error { border-color: rgba(229, 72, 77, .3); background: rgba(229, 72, 77, .035); }
.health-retry { margin-left: .35rem; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.bridge-panel[aria-busy="true"] .bridge-node-status { color: var(--color-text-muted); }
.bridge-panel[aria-busy="true"] .status-pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes skeleton-shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .bridge-panel { flex-basis: 100%; }
  .bridge-widget { justify-content: space-between; }
}

@media (max-width: 640px) {
  .topbar { align-items: center; }
  .topbar-left { flex: 1 1 auto; }
  .bridge-panel { order: 3; width: 100%; min-width: 0; }
  .bridge-widget { min-width: 0; width: 100%; gap: .25rem; overflow: hidden; }
  .bridge-node { min-width: 0; flex: 1 1 0; }
  .bridge-node-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bridge-connector { display: none; }
  .bridge-node--eis { display: none; }
  .topbar-actions { margin-left: auto; padding-left: 0; border-left: 0; }
  .summary-card { min-height: 102px; }
  .summary-value { font-size: 1.8rem; }
  .card { padding: .9rem; }
  .data-table { min-width: 620px; }
}

/* ERP sync settings ------------------------------------------------------- */
.sync-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); }
.sync-page-status { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border: 1px solid rgba(31, 184, 148, .18); border-radius: 999px; background: rgba(31, 184, 148, .08); color: #117d67; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.sync-control-card, .sync-history-card { margin-bottom: var(--space-4); }
.sync-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-5); }
.sync-card-heading h2 { margin: .1rem 0 .3rem; font-size: 1.1rem; }
.sync-card-heading p { max-width: 42rem; margin: 0; color: var(--color-text-muted); font-size: .84rem; }
.section-kicker { margin: 0; color: var(--color-primary) !important; font-size: .68rem !important; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sync-interval-control { min-width: 145px; }
.sync-interval-control > label { display: block; margin-bottom: .3rem; color: var(--color-text-muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.interval-input { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: #fff; }
.interval-input input { width: 58px; min-height: 2.35rem; padding: .4rem .5rem; border: 0; font: inherit; font-weight: 700; color: var(--color-text); }
.interval-input span { padding-right: .65rem; color: var(--color-text-muted); font-size: .78rem; }
.sync-service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.sync-service-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .75rem; padding: .9rem; border: 1px solid var(--color-border-strong); border-radius: var(--radius); background: #fafcfc; transition: border-color .16s ease, background .16s ease; }
.sync-service-card--active { border-color: rgba(31, 184, 148, .35); background: linear-gradient(135deg, rgba(31, 184, 148, .09), #fff 72%); }
.sync-service-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; font-size: 1rem; font-weight: 800; flex-shrink: 0; }
.sync-service-icon--tax { background: #e7f7f2; color: #11866d; }
.sync-service-icon--catalogue { background: #fff1dd; color: #ba7110; }
.sync-service-icon--warehouse { background: #eaf0ff; color: #536fc2; }
.sync-service-copy h3 { margin: .1rem 0 .2rem; font-size: .92rem; }
.sync-service-copy p, .sync-last-run { display: block; margin: 0; color: var(--color-text-muted); font-size: .77rem; line-height: 1.45; }
.sync-last-run { margin-top: .45rem; font-weight: 600; }
.switch-control { display: inline-flex; cursor: pointer; padding: .15rem; }
.switch-control input { position: absolute; opacity: 0; }
.switch-track { display: flex; align-items: center; width: 40px; height: 23px; padding: 3px; border-radius: 999px; background: #c8d0d9; transition: background .16s ease; }
.switch-thumb { width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(26, 34, 56, .25); transition: transform .16s ease; }
.switch-control input:checked + .switch-track { background: var(--color-primary); }
.switch-control input:checked + .switch-track .switch-thumb { transform: translateX(17px); }
.switch-control input:focus-visible + .switch-track { outline: 3px solid rgba(31, 184, 148, .35); outline-offset: 2px; }
.sync-card-footer, .warehouse-card-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--color-border); }
.sync-card-footer p { margin: 0; color: var(--color-text-muted); font-size: .78rem; }
.sync-settings-grid { margin-bottom: var(--space-4); }
.warehouse-card .field-label { margin-top: 1rem; }
.warehouse-card select { width: 100%; }
.sync-run-actions { display: grid; gap: .55rem; margin-top: 1rem; }
.sync-run-button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; width: 100%; gap: .7rem; padding: .7rem; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--color-text); text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.sync-run-button:hover { border-color: rgba(31, 184, 148, .4); background: rgba(31, 184, 148, .045); }
.sync-run-button strong, .sync-run-button small { display: block; }
.sync-run-button strong { font-size: .84rem; }
.sync-run-button small { margin-top: .1rem; color: var(--color-text-muted); font-size: .74rem; }
.sync-history-card .sync-card-heading { margin-bottom: .9rem; }

@media (max-width: 720px) {
  .sync-page-header, .sync-card-heading, .sync-card-footer { align-items: flex-start; flex-direction: column; }
  .sync-page-status { margin-top: -.25rem; }
  .sync-interval-control { width: 100%; }
  .interval-input { width: 100%; }
  .interval-input input { flex: 1; }
  .sync-service-grid { grid-template-columns: 1fr; }
  .warehouse-card-actions .btn, .sync-card-footer .btn { width: 100%; }
}
