:root {
  color: #17233b;
  background: #f4f6fb;
  --ink: #17233b;
  --muted: #69768b;
  --line: #e2e7f0;
  --surface: #ffffff;
  --primary: #6258ee;
  --primary-dark: #473bd4;
  --primary-soft: #efefff;
  --warning: #bd6d1e;
  --warning-soft: #fff2e3;
  --danger: #c8495a;
  --danger-soft: #fdecef;
  --ai: #16b9b1;
  --ai-soft: #e9faf7;
  --navy: #121a30;
  --navy-soft: #1a2440;
  --shadow: 0 14px 42px rgb(32 42 73 / 7%);
  --shadow-hover: 0 20px 55px rgb(42 51 82 / 11%);
}

body {
  background:
    radial-gradient(circle at 92% -5%, rgb(101 87 232 / 10%), transparent 32rem),
    radial-gradient(circle at 52% 8%, rgb(19 170 163 / 7%), transparent 26rem), #f4f6fb;
}

.login-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 17% 18%, rgb(101 87 232 / 23%), transparent 28rem),
    radial-gradient(circle at 83% 82%, rgb(19 170 163 / 20%), transparent 30rem), #eef1f8;
}

.login-screen::before,
.login-screen::after {
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid rgb(101 87 232 / 14%);
  border-radius: 50%;
  content: '';
}

.login-screen::before {
  top: -120px;
  right: 10%;
}
.login-screen::after {
  bottom: -150px;
  left: 8%;
  width: 360px;
  height: 360px;
}

.login-card {
  position: relative;
  z-index: 1;
  border-color: rgb(255 255 255 / 88%);
  border-radius: 28px;
  box-shadow: 0 34px 100px rgb(29 39 73 / 18%);
}

.login-brand,
.brand-mark {
  position: relative;
  overflow: visible;
  color: white;
  background: linear-gradient(145deg, #7769f2, #5145ce 58%, #13aaa3);
  box-shadow: 0 10px 25px rgb(101 87 232 / 28%);
}

.login-brand span,
.brand-mark span {
  position: relative;
  z-index: 1;
}

.login-brand i,
.brand-mark i {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 13px;
  height: 13px;
  background: #7df2dc;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 14px rgb(125 242 220 / 80%);
}

.app-shell {
  grid-template-columns: 274px minmax(0, 1fr);
}

.sidebar {
  z-index: 10;
  padding: 26px 20px 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 5% 2%, rgb(105 91 233 / 27%), transparent 18rem),
    linear-gradient(180deg, #151e36, #10172a 75%);
  box-shadow: 14px 0 40px rgb(18 26 48 / 8%);
}

.brand-block {
  padding: 0 5px;
}
.brand-block span,
.sidebar-note {
  color: #929eb7;
}
.brand-mark {
  width: 44px;
  height: 44px;
  color: white;
}
.mock-banner {
  margin-top: 24px;
  color: #cbd5ed;
  background: rgb(255 255 255 / 6%);
  border-color: rgb(255 255 255 / 9%);
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.status-dot {
  background: #56dfc7;
  box-shadow: 0 0 0 4px rgb(86 223 199 / 12%);
}

.section-nav {
  min-height: 0;
  margin: 14px -6px 10px 0;
  padding-right: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 15%) transparent;
}

.nav-label {
  margin: 17px 12px 6px;
  color: #697694;
}

.section-nav a {
  position: relative;
  display: flex;
  min-height: 42px;
  padding: 8px 11px;
  align-items: center;
  gap: 10px;
  color: #b8c3da;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  transition: 160ms ease;
}

.section-nav a::before {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  color: #98a5c2;
  background: rgb(255 255 255 / 5%);
  border-radius: 8px;
  content: attr(data-icon);
  font-size: 10px;
  font-weight: 800;
  place-items: center;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  color: white;
  background: rgb(255 255 255 / 6%);
}

.section-nav a.active {
  color: white;
  background: linear-gradient(110deg, rgb(101 87 232 / 30%), rgb(19 170 163 / 12%));
  border-color: rgb(132 119 246 / 26%);
}

.section-nav a.active::before {
  color: white;
  background: linear-gradient(145deg, #7769f2, #6557e8);
  box-shadow: 0 5px 14px rgb(101 87 232 / 28%);
}

.sidebar-note {
  margin: 8px 4px 0;
  padding: 11px;
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 11px;
  font-size: 11px;
}

.workspace {
  width: 100%;
  min-width: 0;
  padding: 34px clamp(22px, 3.5vw, 54px) 72px;
}
.topbar {
  align-items: flex-start;
}
.topbar h1 {
  color: #141f36;
}
.topbar-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.eyebrow {
  color: var(--primary);
}

.current-identity {
  border-color: #e1e5ef;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgb(35 45 78 / 7%);
}

.identity-avatar {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.environment-panel {
  position: sticky;
  z-index: 8;
  top: 12px;
  margin-top: 24px;
  padding: 13px 15px;
  background: rgb(255 255 255 / 88%);
  border-color: rgb(219 225 237 / 90%);
  border-radius: 16px;
  box-shadow: 0 12px 35px rgb(42 51 82 / 8%);
  backdrop-filter: blur(18px);
}

input,
select {
  border-color: #d7deea;
  border-radius: 10px;
  transition: 140ms ease;
}
input:hover,
select:hover {
  border-color: #bfc6db;
}
input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(101 87 232 / 11%);
  outline: 0;
}

.panel {
  margin-top: 20px;
  border-color: #e1e6ef;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.panel:target {
  border-color: rgb(101 87 232 / 28%);
  box-shadow: 0 18px 58px rgb(57 52 111 / 11%);
}
.section-heading {
  align-items: flex-start;
}
.section-heading h2 {
  color: #17233b;
}
.section-heading p:not(.eyebrow) {
  max-width: 760px;
  color: #6d788b;
}

.button {
  min-height: 41px;
  border-radius: 10px;
  transition: 150ms ease;
}
.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), #7d62ec);
  box-shadow: 0 7px 18px rgb(101 87 232 / 20%);
}
.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), #6b50df);
  transform: translateY(-1px);
}
.button.secondary {
  border-color: #dce2ec;
}
.button.secondary:hover:not(:disabled) {
  color: var(--primary-dark);
  background: #f8f7ff;
  border-color: #cfc9fa;
}

.operations-panel {
  background: radial-gradient(circle at 100% 0%, rgb(19 170 163 / 10%), transparent 27rem), white;
}
.commercial-panel {
  background: radial-gradient(circle at 100% 0%, rgb(101 87 232 / 10%), transparent 30rem), white;
}
.operations-context {
  background: linear-gradient(112deg, #162444, #234769 62%, #176f70);
  box-shadow: 0 12px 28px rgb(27 54 83 / 16%);
}
.metric-card {
  background: #fafbfe;
  border-color: #e4e8f0;
}
.metric-card.featured {
  background: linear-gradient(145deg, #e8faf6, #f5fffc);
  border-color: #9cdfd2;
}
.metric-card strong {
  color: #152b4b;
}
.metric-card.featured strong {
  color: #087f76;
}
.operations-card,
.connection-card {
  background: #fbfcfe;
  border-color: #e3e7ef;
}
.card-kicker {
  color: var(--primary);
}
.mock-chip {
  color: #087a72;
  background: var(--ai-soft);
}
.manual-badge {
  color: #a05a13;
  background: var(--warning-soft);
}
.queue-count {
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.action-icon,
.ledger-row > span {
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.stage-measure span {
  background: linear-gradient(90deg, var(--ai), var(--primary));
}
.value-summary span {
  color: #08776e;
  background: var(--ai-soft);
}
.connection-route {
  color: var(--primary);
}
.connection-status {
  color: #08776e;
  background: var(--ai-soft);
}

.compact-button {
  width: 100%;
  margin-top: 12px;
}

.local-operations-card {
  margin-top: 18px;
}

.local-operation-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.local-operation-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(31, 108, 93, 0.12);
  border-radius: 14px;
  background: rgba(246, 252, 250, 0.82);
}

.local-operation-item > span,
.local-operation-item small,
.local-operation-empty {
  color: var(--muted);
  font-size: 12px;
}

.local-operation-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.local-operation-item b {
  color: var(--primary-dark);
  font-size: 12px;
}

.local-operation-empty {
  padding: 18px;
  border: 1px dashed rgba(44, 81, 72, 0.2);
  border-radius: 14px;
  text-align: center;
}

.table-action {
  min-width: 78px;
  padding: 7px 10px;
  border: 1px solid rgba(31, 108, 93, 0.22);
  border-radius: 10px;
  background: #fff;
  color: var(--primary-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.table-action:hover {
  background: rgba(231, 249, 243, 0.78);
}

.referral-item:has(.table-action) {
  grid-template-columns: minmax(180px, 1fr) auto minmax(150px, 0.7fr) auto;
}

@media (max-width: 600px) {
  .referral-item:has(.table-action) {
    grid-template-columns: minmax(0, 1fr);
  }

  .referral-item .table-action {
    width: 100%;
  }

  .local-operation-item {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .local-operation-item b {
    grid-column: 2;
  }
}
.model-card-grid strong,
.model-trust-grid strong {
  color: #182949;
}
.model-trust-grid strong {
  color: #087a72;
}

table {
  font-size: 13px;
}
th {
  color: #68758b;
  background: #f7f8fb;
  font-size: 11px;
  letter-spacing: 0.02em;
}
th,
td {
  border-color: #e7eaf1;
}
tbody tr {
  transition: background 120ms ease;
}
tbody tr:hover {
  background: #f8f7ff;
}
.table-wrap {
  border-color: #e2e6ee;
  border-radius: 14px;
}
.audit-snapshot pre {
  background: #111a30;
  color: #d8f7ef;
}

dialog {
  border-radius: 20px;
  box-shadow: 0 30px 90px rgb(19 26 48 / 28%);
}
.icon-button {
  background: #f2f4f8;
}

@media (prefers-reduced-motion: no-preference) {
  .login-brand i,
  .brand-mark i {
    animation: ai-pulse 2.4s ease-in-out infinite;
  }
  @keyframes ai-pulse {
    50% {
      transform: scale(0.78);
      opacity: 0.7;
    }
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .sidebar {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    padding: 16px;
    background: linear-gradient(120deg, #151e36, #11192e);
  }
  .brand-block {
    padding: 0;
  }
  .mock-banner {
    display: inline-flex;
    margin: 13px 0 0;
  }
  .section-nav {
    margin: 13px -16px 0;
    padding: 0 16px 3px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .section-nav .nav-label {
    display: none;
  }
  .section-nav a {
    min-height: 38px;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .section-nav a::before {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .workspace {
    padding: 22px 16px 48px;
  }
  .environment-panel {
    top: 8px;
  }
}

@media (max-width: 640px) {
  .topbar-subtitle {
    line-height: 1.55;
  }
  .environment-panel {
    position: static;
    padding: 13px;
  }
  .panel {
    padding: 18px;
    border-radius: 17px;
  }
  .section-heading h2 {
    font-size: 21px;
  }
  .metric-card {
    padding: 15px;
  }
}
